[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Make PAE work in QEMU on non-Xen
From: |
Thomas Schwinge |
Subject: |
[PATCH] Make PAE work in QEMU on non-Xen |
Date: |
Sun, 23 Nov 2008 13:04:03 +0100 |
User-agent: |
Mutt/1.5.11 |
Hello!
Index: i386/i386at/model_dep.c
===================================================================
RCS file: /cvsroot/hurd/gnumach/i386/i386at/Attic/model_dep.c,v
retrieving revision 1.9.2.19
diff -u -p -r1.9.2.19 model_dep.c
--- i386/i386at/model_dep.c 10 Nov 2008 15:18:47 -0000 1.9.2.19
+++ i386/i386at/model_dep.c 23 Nov 2008 11:58:02 -0000
@@ -247,6 +247,8 @@ mem_size_init(void)
void
i386at_init(void)
{
+ /* Assemble all flags to set in there and then set ONCE. */
+ unsigned int cr4_flags = 0;
/* XXX move to intel/pmap.h */
extern pt_entry_t *kernel_page_dir;
@@ -285,12 +287,13 @@ i386at_init(void)
set_cr3((unsigned)kernel_pmap->pdpbase);
if (!CPU_HAS_FEATURE(CPU_FEATURE_PAE))
panic("CPU doesn't have support for PAE.");
- set_cr4(get_cr4() | CR4_PAE);
+ cr4_flags |= CR4_PAE;
#else
set_cr3((unsigned)kernel_page_dir);
#endif /* PAE */
if (CPU_HAS_FEATURE(CPU_FEATURE_PGE))
- set_cr4(get_cr4() | CR4_PGE);
+ cr4_flags |= CR4_PGE;
+ set_cr4(get_cr4() | cr4_flags);
set_cr0(get_cr0() | CR0_PG | CR0_WP);
flush_instr_queue();
Samuel, is this fine?
I guess that the problem was the CPU_HAS_FEATURE memory reference, as
soon as cr4 has been changed once? (... but paging not yet being
enabled?)
Regards,
Thomas
signature.asc
Description: Digital signature
- [PATCH] Make PAE work in QEMU on non-Xen,
Thomas Schwinge <=