All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Liang <liang.li@windriver.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: virtualization@lists.osdl.org, lguest@ozlabs.org,
	Matias Zabaljauregui <zabaljauregui@gmail.com>
Subject: Re: [Lguest] [PATCH 3/5] lguest: use PGDIR_SHIFT for PAE code to allow different PAGE_OFFSET
Date: Thu, 24 Sep 2009 09:34:19 +0800	[thread overview]
Message-ID: <20090924013419.GA4122@localhost> (raw)
In-Reply-To: <20090921072352.10E17B7C82@ozlabs.org>

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@rustcorp.com.au>
> Cc: Matias Zabaljauregui <zabaljauregui@gmail.com>
> ---
>  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@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/lguest

           reply	other threads:[~2009-09-24  1:34 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20090921072352.10E17B7C82@ozlabs.org>]

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=20090924013419.GA4122@localhost \
    --to=liang.li@windriver.com \
    --cc=lguest@ozlabs.org \
    --cc=rusty@rustcorp.com.au \
    --cc=virtualization@lists.osdl.org \
    --cc=zabaljauregui@gmail.com \
    /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.