[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] tcg: assert last byte is in guest space
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] tcg: assert last byte is in guest space |
Date: |
Fri, 8 Feb 2019 12:27:04 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
On 2/8/19 10:32 AM, Rémi Denis-Courmont wrote:
> Le perjantaina 8. helmikuuta 2019, 20.12.13 EET Richard Henderson a écrit :
>> On 2/8/19 8:37 AM, Rémi Denis-Courmont wrote:
>>> Rather than assert that the first byte of a checked range is within the
>>> guest address space, assert that the last byte is. The assertion is
>>> moved past the overflow check to ensure that the last byte is actually
>>> the one with the highest address.
>>>
>>> Signed-off-by: Rémi Denis-Courmont <address@hidden>
>>> ---
>>>
>>> accel/tcg/translate-all.c | 14 +++++++-------
>>> 1 file changed, 7 insertions(+), 7 deletions(-)
>>
>> What are you trying to fix here?
>
> As far as I can tell, the following code assumes that the entire range of
> checked addresses falls within the guest address range. So it makes sense to
> fail the assertion if the any byte is out of range, rather than only the
> first
> one.
Sure. But that would call for adding a second assert, rather than removing one
from some paths. Which you say you "would not dare", which is confusing to me.
Is there a particular problem you are attempting to solve, or is this mere code
inspection?
r~