From: Keir Fraser <keir@xen.org>
To: Paolo Bonzini <pbonzini@redhat.com>, xen-devel@lists.xensource.com
Subject: Re: [PATCH] fix xenctx with 32-on-64 domains
Date: Thu, 03 Mar 2011 17:47:57 +0000 [thread overview]
Message-ID: <C99584CD.2B4CA%keir@xen.org> (raw)
In-Reply-To: <c639f0afaa74591d1053.1299171243@yakj.usersys.redhat.com>
On 03/03/2011 17:08, "Paolo Bonzini" <pbonzini@redhat.com> wrote:
> # HG changeset patch
> # User Paolo Bonzini <pbonzini@redhat.com>
> # Date 1299171180 -3600
> # Node ID c639f0afaa74591d1053677b0a6348503a14fd78
> # Parent c923816861a96328aaf3d5ba8939fd9b4c441cd0
> fix xenctx with 32-on-64 domains
>
> When compiled on 64-bit, xenctx was using the 64-bit version
> of xen_cr3_to_pfn even for 32-bit PV domains. This is wrong,
> and this patch fixes it.
I applied a better version (clearer, and also fixes 64-bit PV domU / 32-bit
PV dom0) as c/s 22966.
-- Keir
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>
> diff --git a/tools/libxc/xc_pagetab.c b/tools/libxc/xc_pagetab.c
> --- a/tools/libxc/xc_pagetab.c
> +++ b/tools/libxc/xc_pagetab.c
> @@ -64,8 +64,8 @@ unsigned long xc_translate_foreign_addre
> paddr = ctx.x64.ctrlreg[3] & ~0xfffull;
> } else {
> pt_levels = 3;
> - paddr = (((uint64_t) xen_cr3_to_pfn(ctx.x32.ctrlreg[3]))
> - << PAGE_SHIFT);
> + paddr = (((unsigned)ctx.x32.ctrlreg[3] >> 12) |
> + ((unsigned)ctx.x32.ctrlreg[3] << 20)) << PAGE_SHIFT;
> }
> }
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
prev parent reply other threads:[~2011-03-03 17:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-03 17:08 [PATCH] fix xenctx with 32-on-64 domains Paolo Bonzini
2011-03-03 17:47 ` Keir Fraser [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=C99584CD.2B4CA%keir@xen.org \
--to=keir@xen.org \
--cc=pbonzini@redhat.com \
--cc=xen-devel@lists.xensource.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 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).