qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Rémi Denis-Courmont" <remi@remlab.net>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] tcg: assert last byte is in guest space
Date: Fri, 8 Feb 2019 12:27:04 -0800	[thread overview]
Message-ID: <85b56507-bc4b-a4fc-18a3-d45569f19968@linaro.org> (raw)
In-Reply-To: <2034657.8N3RCfXzMK@basile.remlab.net>

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 <remi@remlab.net>
>>> ---
>>>
>>>  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~

      reply	other threads:[~2019-02-08 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 16:37 [Qemu-devel] [PATCH] tcg: assert last byte is in guest space Rémi Denis-Courmont
2019-02-08 18:12 ` Richard Henderson
2019-02-08 18:32   ` Rémi Denis-Courmont
2019-02-08 20:27     ` Richard Henderson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85b56507-bc4b-a4fc-18a3-d45569f19968@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=remi@remlab.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).