Re: [Lguest] [PATCH 3/5] lguest: use PGDIR_SHIFT for PAE code to allow different PAGE_OFFSET

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 21, 2009 at 04:52:21PM +0930, Rusty Russell wrote:
> 
> We still assume the Guest and Host have the same PAGE_OFFSET settings,
> but now we don't assume 0xC0000000.
> 
> Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
> Cc: Matias Zabaljauregui <zabaljauregui@xxxxxxxxx>
> ---
>  drivers/lguest/page_tables.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
> --- a/drivers/lguest/page_tables.c
> +++ b/drivers/lguest/page_tables.c
> @@ -996,11 +996,9 @@ static unsigned long setup_pagetables(st
>  	if (copy_to_user(&pgdir[0], &pgd, sizeof(pgd)) != 0)
>  		return -EFAULT;
>  	/*
> -	 * And the third PGD entry (ie. addresses 3G-4G).
> -	 *
> -	 * FIXME: This assumes that PAGE_OFFSET for the Guest is 0xC0000000.
> +	 * And the other PGD entry to make the linear mapping at PAGE_OFFSET
>  	 */
> -	if (copy_to_user(&pgdir[3], &pgd, sizeof(pgd)) != 0)
> +	if (copy_to_user(&pgdir[KERNEL_PGD_BOUNDARY], &pgd, sizeof(pgd)))

How about this:

+	if (!!copy_to_user(&pgdir[KERNEL_PGD_BOUNDARY], &pgd, sizeof(pgd)))

:)

Thanks,
-L

>  		return -EFAULT;
>  #else
>  	/*
> 
> _______________________________________________
> Lguest mailing list
> Lguest@xxxxxxxxxxxxxxxx
> https://lists.ozlabs.org/listinfo/lguest
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux