WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH]: Fix Xen domU boot with batched mprotect

To: Jan Beulich <jbeulich@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH]: Fix Xen domU boot with batched mprotect
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Fri, 17 Oct 2008 08:19:19 -0700
Cc: Ingo Molnar <mingo@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Chris Lalancette <clalance@xxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx
Delivery-date: Fri, 17 Oct 2008 08:19:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <48F85711.76E4.0078.0@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <48F5CE10.3060403@xxxxxxxxxx> <48F6274D.76E4.0078.0@xxxxxxxxxx> <48F61919.2050005@xxxxxxxx> <48F72C7A.76E4.0078.0@xxxxxxxxxx> <48F76773.2090700@xxxxxxxx> <48F85711.76E4.0078.0@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.17 (X11/20081009)
Jan Beulich wrote:
Jeremy Fitzhardinge <jeremy@xxxxxxxx> 16.10.08 18:10 >>>
The current x86-64 implementation is:

bool __virt_addr_valid(unsigned long x)
{
        if (x >= __START_KERNEL_map) {
                x -= __START_KERNEL_map;
                if (x >= KERNEL_IMAGE_SIZE)
                        return false;

This, imo, is still broken (i.e. the name of the function still isn't matched
by the implementation): KERNEL_IMAGE_SIZE is a constant and doesn't
account for the fact that only the real kernel image can be relied upon
to be mapped.

Perhaps, but I don't think it matters too much. Unless you have a tiny amount of physical memory, locations in the kernel mapping beyond the actual kernel will still resolve to proper locations in the linear map.

and 32-bit is similar (but simpler, since it doesn't need to worry about a 
separate kernel mapping).

This continues to be broken, but not as badly as it used to be - while it
now covers user space and the vmalloc area (I'm unclear why this is
excluded only after booting completed, though), hypervisor space
continues to not be considered here.

But as mentioned before - excluding the vmalloc area seems bogus wrt
the name of the function, but as I take it the confusion here is intended.

I think a strictly correct name for the function would be can_i_use___pa_on_this_address(vaddr). It isn't is_this_really_an_addressable_location(vaddr).

   J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel