From: Ian Campbell <ijc@hellion.org.uk>
To: huang ying <huang.ying.caritas@gmail.com>
Cc: "Huang, Ying" <ying.huang@intel.com>,
akpm@linux-foundation.org, "H. Peter Anvin" <hpa@zytor.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Andi Kleen <ak@suse.de>,
linux-kernel@vger.kernel.org,
Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: [PATCH -mm 1/3] i386 boot: replace boot_ioremap with enhanced bt_ioremap - enhance bt_ioremap
Date: Fri, 18 Jan 2008 15:23:57 +0000 [thread overview]
Message-ID: <1200669837.9891.35.camel@localhost.localdomain> (raw)
In-Reply-To: <851fc09e0801180654u6957f966g47c7629db6d4b2b0@mail.gmail.com>
On Fri, 2008-01-18 at 22:54 +0800, huang ying wrote:
> On Jan 18, 2008 4:48 PM, Ian Campbell <ijc@hellion.org.uk> wrote:
> > On Tue, 2008-01-15 at 13:45 +0800, Huang, Ying wrote:
> > > +void __init bt_ioremap_init(void)
> > > +{
> > > [...]
> > > + *pgd = __pa(bm_pte) | _PAGE_TABLE;
> > > +}
> > > [...]
> > > +static void __init __bt_set_fixmap(enum fixed_addresses idx,
> > > + unsigned long phys, pgprot_t flags)
> > > +{
> > > [...]
> > > + if (pgprot_val(flags))
> > > + *pte = (phys & PAGE_MASK) | pgprot_val(flags);
> > > + else
> > > + *pte = 0;
> > [...]
> >
> > Shouldn't these, and the rest of the file, be using the PTE accessor
> > macros set_pte,clear_pte etc? The boot_ioremap it replaces seems to have
> > done. Otherwise these patches don't appear to be paravirt_ops clean. I
>
> If CONFIG_X86_PAE is defined, the set_pte, clear_pte etc will operate
> 3-level page tables, while on i386, the early page table is always
> 2-level, so set_pte, clear_pte etc functions can not be used here. The
> boot_ioremap use a trick to deal with this problem. The CONFIG_X86_PAE
> is undefined in arch/x86/mm/boot_ioremap_32.c unconditionally, so the
> 2-level page table handling function is always used.
Ah, when booting a Xen guest you get 3 level page tables right from the
start.
I'm hacking on a patch right now but I hadn't appreciated/noticed that
this was a two level page table even on a PAE kernel which would explain
why it isn't exactly working as planned...
> Is the method used by boot_ioremap better for Xen?
Well, it worked ;-) I haven't looked closely enough at the two ways of
doing things to comment further but I'm sure the new way can be made to
work for Xen too somehow.
> [snip]
> This crash has nothing to do with this patch. Because this patch is
> for i386 only, x86_64 has its own early_ioremap implementation.
It's a 64 bit hypervisor but the guest in question is a 32 bit (PAE)
guest.
Ian
--
Ian Campbell
Current Noise: Mistress - Cheyne Stoking
You can't kiss a girl unexpectedly -- only sooner than she thought you would.
prev parent reply other threads:[~2008-01-18 15:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-15 5:45 [PATCH -mm 1/3] i386 boot: replace boot_ioremap with enhanced bt_ioremap - enhance bt_ioremap Huang, Ying
2008-01-18 8:48 ` Ian Campbell
2008-01-18 12:50 ` Ingo Molnar
2008-01-18 14:54 ` huang ying
2008-01-18 14:54 ` H. Peter Anvin
2008-01-18 15:54 ` Ian Campbell
2008-01-18 16:22 ` Ingo Molnar
2008-01-18 17:27 ` Jeremy Fitzhardinge
2008-01-18 17:45 ` Ian Campbell
2008-01-18 15:23 ` Ian Campbell [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=1200669837.9891.35.camel@localhost.localdomain \
--to=ijc@hellion.org.uk \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=huang.ying.caritas@gmail.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=ying.huang@intel.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.