All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/6] Fix last page errors in page_set_flags and page_check_range.
Date: Fri, 12 Feb 2010 12:16:37 -0800	[thread overview]
Message-ID: <4B75B725.1040305@twiddle.net> (raw)
In-Reply-To: <f43fc5581002121147o66816654p45424bcd101c0868@mail.gmail.com>

On 02/12/2010 11:47 AM, Blue Swirl wrote:
> Please make separate patches for unrelated changes. Now the essence of
> the patch is very hard to see. Also pure formatting changes are not
> very useful.

Is this just about page_get_flags, or was there some other pure 
formatting change to which you object?  For instance:

>> -    if (start + len < start)
>> -        /* we've wrapped around */
>> +    if (start + len - 1 < start) {
>> +        /* We've wrapped around.  */
>>         return -1;
>> +    }

Only the first line is required to fix an off-by-one error.  But if I 
don't add the braces, generally the patch will be bounced for that.

>> -        /* We may be called for host regions that are outside guest
>> -           address space.  */
>
> Why remove the comment, is it no longer true?

Yes, after the entire patch series is applied.  Indeed, I believe that 
many of the addresses rejected here were *not* in fact outside the guest 
address space, merely that page_find_alloc did not accurately know what 
the guest address space was.

I think it was a mistake to ever consider usage of this function with 
out-of-band addresses as valid -- it adds a great deal of confusion.

I could add an assertion here to make sure, if you like.

If this were C++, it might have been interesting to try to use the type 
system to keep the host and guest address spaces forcibly separate.  But 
since this is plain C, I think wrapping everything in structures and 
access macros would just be too ugly.


r~

  reply	other threads:[~2010-02-12 20:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  0:15 [Qemu-devel] [PATCH 0/6] Multi-level page tables and userland mapping fixes Richard Henderson
2010-02-11 22:20 ` [Qemu-devel] [PATCH 1/6] Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h Richard Henderson
2010-02-12 20:01   ` Blue Swirl
2010-02-12 20:25     ` Richard Henderson
2010-02-11 22:47 ` [Qemu-devel] [PATCH 2/6] Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid Richard Henderson
2010-02-11 22:57 ` [Qemu-devel] [PATCH 3/6] Fix last page errors in page_set_flags and page_check_range Richard Henderson
2010-02-12 19:47   ` Blue Swirl
2010-02-12 20:16     ` Richard Henderson [this message]
2010-02-12 20:37       ` Blue Swirl
2010-02-11 23:11 ` [Qemu-devel] [PATCH 5/6] linux-user: Use h2g_valid in qemu_vmalloc Richard Henderson
2010-02-11 23:29 ` [Qemu-devel] [PATCH 6/6] linux-user: Fix mmap_find_vma returning invalid addresses Richard Henderson
2010-02-11 23:51 ` [Qemu-devel] [PATCH 4/6] Implement multi-level page tables Richard Henderson
2010-02-15 20:59 ` [Qemu-devel] [PATCH 0/7] Multi-level page tables and userland mapping fixes, v2 Richard Henderson
2010-02-11 22:47   ` [Qemu-devel] [PATCH 2/7] Use TARGET_VIRT_ADDR_SPACE_BITS in h2g_valid Richard Henderson
2010-02-28 14:11     ` Paul Brook
2010-02-11 23:11   ` [Qemu-devel] [PATCH 5/7] linux-user: Use h2g_valid in qemu_vmalloc Richard Henderson
2010-02-11 23:29   ` [Qemu-devel] [PATCH 6/7] linux-user: Fix mmap_find_vma returning invalid addresses Richard Henderson
2010-02-11 23:51   ` [Qemu-devel] [PATCH 4/7] Implement multi-level page tables Richard Henderson
2010-02-12 21:38   ` [Qemu-devel] [PATCH 1/7] Move TARGET_PHYS_ADDR_SPACE_BITS to target-*/cpu.h Richard Henderson
2010-02-12 22:03   ` [Qemu-devel] [PATCH 3/7] Fix last page errors in page_set_flags and page_check_range Richard Henderson
2010-02-15 19:58   ` [Qemu-devel] [PATCH 7/7] Assert arguments in range for guest address space Richard Henderson
2010-02-28 23:23 ` [Qemu-devel] [PATCH 0/6] Multi-level page tables and userland mapping fixes Paul Brook

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=4B75B725.1040305@twiddle.net \
    --to=rth@twiddle.net \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.