public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jody Belka <lists-lkml@pimb.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ian Campbell <ijc@hellion.org.uk>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Andi Kleen <andi@firstfloor.org>,
	Mika Penttila <mika.penttila@kolumbus.fi>
Subject: Re: 2.6.25-rc1 xen pvops regression
Date: Wed, 13 Feb 2008 22:59:33 +1100	[thread overview]
Message-ID: <47B2DBA5.6030001@goop.org> (raw)
In-Reply-To: <20080212235404.GY7980@pimb.org>

[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]

Jody Belka wrote:
> Hi all,
>
> I thought I'd try out 2.6.25-rc1 as a xen 32-bit pae domU the other day.
> Unfortunately, I didn't get very far very fast, as the domain just crashed
> immediately upon booting, without any direct feedback (I did have messages
> on the xen message buffer, which helped). This even with earlyprintk turned on.
>
> After a long, arduous journey, I managed to track this down to the following:
>
> ----------
> commit	551889a6e2a24a9c06fd453ea03b57b7746ffdc0
>
> x86: construct 32-bit boot time page tables in native format.
>
> Specifically the boot time page tables in a CONFIG_X86_PAE=y enabled
> kernel are in PAE format.
>
> early_ioremap is updated to use the standard page table accessors.
>
> Clear any mappings beyond max_low_pfn from the boot page tables in
> native_pagetable_setup_start because the initial mappings can extend
> beyond the range of physical memory and into the vmalloc area.
>
> Derived from patches by Eric Biederman and H. Peter Anvin.
>
> [ jeremy@goop.org: PAE swapper_pg_dir needs to be page-sized fix ]
> ----------
>
> However, to make life more interesting, just reverting this isn't quite
> enough to get us to the promised land. If we try, we find that although
> we do now start booting, we crash again a short way into the process.
>
> In a different manner though. Specifically, in early_ioremap_clear.
> Reverting the above commit /except/ for the changes to arch/x86/mm/ioremap.c
> gets everything working again.
>
> Well, except that we can't shutdown/reboot properly, but I've sent a patch
> for that in another email.
>
>
> I'm afraid i've no idea what needs to be done to get the change to work
> with xen, but i'm willing to try out any patches people come up with.
> Please cc me on any replies, as i'm not subscribed, thanks.

Hi,

Although I'm on vacation, I happened to download a recent copy of 
x86.git and found that it crashes early.  Here's a couple of patches to 
apply; I don't know if they apply to current git, but I hope it helps.

    J

[-- Attachment #2: x86-fix-early_ioremap.patch --]
[-- Type: text/x-patch, Size: 981 bytes --]

Subject: x86/early_ioremap: don't assume we're using swapper_pg_dir

At the early stages of boot, before the kernel pagetable has been
fully initialized, a Xen kernel will still be running off the
Xen-provided pagetables rather than swapper_pg_dir[].  Therefore,
readback cr3 to determine the base of the pagetable rather than
assuming swapper_pg_dir[].

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>

---
 arch/x86/mm/ioremap.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

===================================================================
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -265,7 +265,9 @@
 
 static inline pmd_t * __init early_ioremap_pmd(unsigned long addr)
 {
-	pgd_t *pgd = &swapper_pg_dir[pgd_index(addr)];
+	/* Don't assume we're using swapper_pg_dir at this point */
+	pgd_t *base = __va(read_cr3());
+	pgd_t *pgd = &base[pgd_index(addr)];
 	pud_t *pud = pud_offset(pgd, addr);
 	pmd_t *pmd = pmd_offset(pud, addr);
 

[-- Attachment #3: xen-unpin-init_pt.patch --]
[-- Type: text/x-patch, Size: 799 bytes --]

Subject: xen: unpin initial Xen pagetable once we're finished with it

Unpin the Xen-provided pagetable once we've finished with it, so it
doesn't cause stray references which cause later swapper_pg_dir
pagetable updates to fail.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>

---
 arch/x86/xen/enlighten.c |    4 ++++
 1 file changed, 4 insertions(+)

===================================================================
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -798,6 +798,10 @@
 	 * added to the table can be prepared properly for Xen.
 	 */
 	xen_write_cr3(__pa(base));
+
+	/* Unpin initial Xen pagetable */
+	pin_pagetable_pfn(MMUEXT_UNPIN_TABLE,
+			  PFN_DOWN(__pa(xen_start_info->pt_base)));
 }
 
 static __init void xen_pagetable_setup_done(pgd_t *base)

  reply	other threads:[~2008-02-13 12:01 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-12 23:54 2.6.25-rc1 xen pvops regression Jody Belka
2008-02-13 11:59 ` Jeremy Fitzhardinge [this message]
2008-02-13 12:13   ` Jody Belka
2008-02-13 12:23   ` Ingo Molnar
2008-02-14  2:27   ` Joel Becker
2008-02-14  7:50     ` Jeremy Fitzhardinge
2008-02-15 20:23       ` Joel Becker
2008-02-16  2:44         ` Jeremy Fitzhardinge
2008-02-16  8:54           ` Joel Becker
2008-02-16 11:46             ` Jeremy Fitzhardinge
2008-02-17  6:29               ` Joel Becker
2008-02-17 12:09                 ` Jeremy Fitzhardinge
2008-02-17  6:39               ` Joel Becker
2008-02-17 18:49         ` Ian Campbell
2008-02-18 10:40           ` Joel Becker
2008-02-19 21:50             ` Ian Campbell
2008-02-19 21:59             ` Ian Campbell
2008-02-20  7:43               ` H. Peter Anvin
2008-02-20  8:51                 ` Ian Campbell
2008-02-20 21:42                   ` Joel Becker
2008-02-20 22:30                     ` Ian Campbell
2008-02-20 21:58                   ` Jeremy Fitzhardinge
2008-02-20 22:29                     ` Ian Campbell
2008-02-21 21:16                       ` Jeremy Fitzhardinge
2008-02-21 21:21                         ` H. Peter Anvin
2008-02-21 21:37                           ` Jeremy Fitzhardinge
2008-02-21 21:44                             ` H. Peter Anvin
2008-02-21 22:12                             ` Ian Campbell
2008-02-21 22:23                               ` H. Peter Anvin
2008-02-21 22:49                                 ` Jeremy Fitzhardinge
2008-02-21 22:58                                   ` H. Peter Anvin
2008-02-22  7:25                                     ` Ian Campbell
2008-02-22  9:28                                       ` Alan Cox
2008-02-22  9:55                                         ` Andi Kleen
2008-02-22 10:00                                           ` Alan Cox
2008-02-22 10:15                                             ` Andi Kleen
2008-02-22 16:27                                               ` H. Peter Anvin
2008-02-22 19:25                                               ` Pavel Machek
2008-02-26 17:06                                       ` Mark McLoughlin
2008-02-26 20:05                                         ` Jeremy Fitzhardinge
2008-02-21 22:58                               ` Joel Becker
2008-02-21 22:04                           ` Eric W. Biederman
2008-02-21 23:14                             ` Jeremy Fitzhardinge
2008-02-21 23:26                               ` H. Peter Anvin
2008-02-21 23:46                                 ` Jeremy Fitzhardinge
2008-02-21 23:57                                   ` H. Peter Anvin

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=47B2DBA5.6030001@goop.org \
    --to=jeremy@goop.org \
    --cc=andi@firstfloor.org \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=ijc@hellion.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists-lkml@pimb.org \
    --cc=mika.penttila@kolumbus.fi \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /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