From: ebiederm@xmission.com (Eric W. Biederman)
To: Andi Kleen <ak@suse.de>
Cc: linux-kernel@vger.kernel.org,
virtualization <virtualization@lists.linux-foundation.org>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 04/12] i386 voyager: Use modern techniques to setup and teardown low identiy mappings.
Date: Mon, 30 Apr 2007 09:57:40 -0600 [thread overview]
Message-ID: <m1vefd4zyj.fsf_-_@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <m1zm4p509a.fsf_-_@ebiederm.dsl.xmission.com> (Eric W. Biederman's message of "Mon, 30 Apr 2007 09:51:13 -0600")
This is a trivial and hopefully obviously correct patch to setup
and teardown the identity mappings the way the rest of arch/i386
does.
My new page table setup code will break some assumptions below so
this is my attempt to keep voyager working.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
arch/i386/mach-voyager/voyager_smp.c | 38 +++++----------------------------
1 files changed, 6 insertions(+), 32 deletions(-)
diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/i386/mach-voyager/voyager_smp.c
index b9ce33c..5e98ae7 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -536,15 +536,6 @@ do_boot_cpu(__u8 cpu)
& ~( voyager_extended_vic_processors
& voyager_allowed_boot_processors);
- /* For the 486, we can't use the 4Mb page table trick, so
- * must map a region of memory */
-#ifdef CONFIG_M486
- int i;
- unsigned long *page_table_copies = (unsigned long *)
- __get_free_page(GFP_KERNEL);
-#endif
- pgd_t orig_swapper_pg_dir0;
-
/* This is an area in head.S which was used to set up the
* initial kernel stack. We need to alter this to give the
* booting CPU a new stack (taken from its idle process) */
@@ -587,24 +578,11 @@ do_boot_cpu(__u8 cpu)
VDEBUG(("VOYAGER SMP: Booting CPU%d at 0x%lx[%x:%x], stack %p\n", cpu,
(unsigned long)hijack_source.val, hijack_source.idt.Segment,
hijack_source.idt.Offset, stack_start.esp));
- /* set the original swapper_pg_dir[0] to map 0 to 4Mb transparently
- * (so that the booting CPU can find start_32 */
- orig_swapper_pg_dir0 = swapper_pg_dir[0];
-#ifdef CONFIG_M486
- if(page_table_copies == NULL)
- panic("No free memory for 486 page tables\n");
- for(i = 0; i < PAGE_SIZE/sizeof(unsigned long); i++)
- page_table_copies[i] = (i * PAGE_SIZE)
- | _PAGE_RW | _PAGE_USER | _PAGE_PRESENT;
-
- ((unsigned long *)swapper_pg_dir)[0] =
- ((virt_to_phys(page_table_copies)) & PAGE_MASK)
- | _PAGE_RW | _PAGE_USER | _PAGE_PRESENT;
-#else
- ((unsigned long *)swapper_pg_dir)[0] =
- (virt_to_phys(pg0) & PAGE_MASK)
- | _PAGE_RW | _PAGE_USER | _PAGE_PRESENT;
-#endif
+
+ /* init lowmem identity mapping */
+ clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
+ min_t(unsigned long, KERNEL_PGD_PTRS, USER_PGD_PTRS));
+ flush_tlb_all();
if(quad_boot) {
printk("CPU %d: non extended Quad boot\n", cpu);
@@ -647,11 +625,7 @@ do_boot_cpu(__u8 cpu)
udelay(100);
}
/* reset the page table */
- swapper_pg_dir[0] = orig_swapper_pg_dir0;
- local_flush_tlb();
-#ifdef CONFIG_M486
- free_page((unsigned long)page_table_copies);
-#endif
+ zap_low_mappings();
if (cpu_booted_map) {
VDEBUG(("CPU%d: Booted successfully, back in CPU %d\n",
--
1.5.1.1.181.g2de0
next prev parent reply other threads:[~2007-04-30 15:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m1d51l6f1y.fsf@ebiederm.dsl.xmission.com>
2007-04-30 15:48 ` [PATCH 01/12] x86_64: Allow fixmaps to be used with the initial page table Eric W. Biederman
[not found] ` <m18xc96eyq.fsf@ebiederm.dsl.xmission.com>
2007-04-30 15:49 ` [PATCH 02/12] i386 head.S: Remove unnecessary use of %ebx as the boot cpu flag Eric W. Biederman
[not found] ` <m14pmx6ewk.fsf_-_@ebiederm.dsl.xmission.com>
2007-04-30 15:51 ` [PATCH 03/12] i386 head.S: Always run the full set of paging state Eric W. Biederman
[not found] ` <m1zm4p509a.fsf_-_@ebiederm.dsl.xmission.com>
2007-04-30 15:57 ` Eric W. Biederman [this message]
2007-04-30 16:03 ` [PATCH 05/12] i386: During page table initialization always set the leaf page table entries Eric W. Biederman
[not found] ` <m1r6q14zow.fsf_-_@ebiederm.dsl.xmission.com>
2007-04-30 16:09 ` [PATCH 06/12] i386: Minimum cpu detection cleanups Eric W. Biederman
2007-04-30 16:10 ` [PATCH 07/12] i386: Add missing !X86_PAE dependincy to the 2G/2G split Eric W. Biederman
2007-04-30 16:15 ` [PATCH 08/12] i386: Convert the boot time page tables to the kernels native format Eric W. Biederman
2007-04-30 16:26 ` Andi Kleen
2007-04-30 16:32 ` [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support Eric W. Biederman
2007-04-30 16:32 ` [PATCH 10/12] i386: Introduce head32.c Eric W. Biederman
2007-04-30 16:33 ` [PATCH 11/12] i386: Move setup_idt from head.S to head32.c Eric W. Biederman
2007-04-30 16:35 ` [PATCH 12/12] i386: remove cpuid checking in head.S Eric W. Biederman
2007-04-30 17:56 ` [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support Andi Kleen
[not found] ` <20070430175607.GD25929@bingen.suse.de>
2007-04-30 20:54 ` Eric W. Biederman
[not found] ` <200704301826.57920.ak@suse.de>
2007-04-30 16:42 ` [PATCH 08/12] i386: Convert the boot time page tables to the kernels native format Eric W. Biederman
2007-04-30 16:16 ` [PATCH 07/12] i386: Add missing !X86_PAE dependincy to the 2G/2G split H. Peter Anvin
2007-04-30 16:39 ` Eric W. Biederman
2007-04-30 16:13 ` [PATCH 06/12] i386: Minimum cpu detection cleanups H. Peter Anvin
2007-04-30 16:34 ` [PATCH 05/12] i386: During page table initialization always set the leaf page table entries Jeremy Fitzhardinge
2007-04-30 17:06 ` [PATCH 04/12] i386 voyager: Use modern techniques to setup and teardown low identiy mappings James Bottomley
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=m1vefd4zyj.fsf_-_@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
/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).