Mailing List Archive

[PATCH] [PATCH] fix booting with SMP enabled
ChangeSet 1.1414, 2005/05/02 14:50:40+01:00, kmacy@netapp.com

[PATCH] [PATCH] fix booting with SMP enabled

Let me know if pine has messed up the patch the way gmail does.

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2005/04/30 16:07:55-07:00 kmacy@curly.lab.netapp.com
# Make FreeBSD work with SMP enabled again
# Kip Macy <kmacy@fsmware.com>
#
# BitKeeper/etc/logging_ok
# 2005/04/30 16:07:54-07:00 kmacy@curly.lab.netapp.com +1 -0
# Logging to logging@openlogging.org accepted
#
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c
# 2005/04/30 16:07:39-07:00 kmacy@curly.lab.netapp.com +22 -12
# Do shadow directory initialization before SMP page table setup
#
# freebsd-5.3-xen-sparse/i386-xen/i386-xen/local_apic.c
# 2005/04/30 16:07:39-07:00 kmacy@curly.lab.netapp.com +2 -1
# Don't try to probe apics
#



local_apic.c | 3 ++-
machdep.c | 34 ++++++++++++++++++++++------------
2 files changed, 24 insertions(+), 13 deletions(-)


diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/local_apic.c b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/local_apic.c
--- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/local_apic.c 2005-05-02 10:02:56 -04:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/local_apic.c 2005-05-02 10:02:56 -04:00
@@ -545,7 +545,6 @@
static void
apic_init(void *dummy __unused)
{
- struct apic_enumerator *enumerator;
uint64_t apic_base;
int retval, best;

@@ -560,6 +559,7 @@
/* First, probe all the enumerators to find the best match. */
best_enum = NULL;
best = 0;
+#ifndef XEN
SLIST_FOREACH(enumerator, &enumerators, apic_next) {
retval = enumerator->apic_probe();
if (retval > 0)
@@ -569,6 +569,7 @@
best = retval;
}
}
+#endif
if (best_enum == NULL) {
if (bootverbose)
printf("APIC: Could not find any APICs.\n");
diff -Nru a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c
--- a/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c 2005-05-02 10:02:56 -04:00
+++ b/freebsd-5.3-xen-sparse/i386-xen/i386-xen/machdep.c 2005-05-02 10:02:56 -04:00
@@ -1386,6 +1386,7 @@
{
int i;
vm_paddr_t pdir_shadow_ma, KPTphys;
+ vm_offset_t *pdir_shadow;
#ifdef WRITABLE_PAGETABLES
printk("using writable pagetables\n");
HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_writable_pagetables);
@@ -1424,6 +1425,27 @@
/* allocate page for ldt */
ldt = (union descriptor *)(KERNBASE + (tmpindex << PAGE_SHIFT));
tmpindex++;
+
+ /* initialize page directory shadow page */
+ pdir_shadow = (vm_offset_t *)(KERNBASE + (tmpindex << PAGE_SHIFT));
+ i686_pagezero(pdir_shadow);
+ pdir_shadow_ma = xpmap_ptom(tmpindex << PAGE_SHIFT);
+ PT_SET_MA(pdir_shadow, pdir_shadow_ma | PG_V | PG_A);
+ tmpindex++;
+
+ /* setup shadow mapping first so vtomach will work */
+ xen_pt_pin((vm_paddr_t)pdir_shadow_ma);
+ xen_queue_pt_update((vm_paddr_t)(IdlePTD + PTDPTDI),
+ pdir_shadow_ma | PG_V | PG_A | PG_RW | PG_M);
+ xen_queue_pt_update(pdir_shadow_ma + PTDPTDI*sizeof(vm_paddr_t),
+ ((vm_paddr_t)IdlePTD) | PG_V | PG_A);
+ xen_queue_pt_update(pdir_shadow_ma + KPTDI*sizeof(vm_paddr_t),
+ KPTphys | PG_V | PG_A);
+
+ xen_flush_queue();
+ /* allocate remainder of NKPT pages */
+
+
#ifdef SMP
/* allocate cpu0 private page */
cpu0prvpage = (KERNBASE + (tmpindex << PAGE_SHIFT));
@@ -1458,18 +1480,6 @@
xen_queue_pt_update(KPTphys + i*sizeof(vm_paddr_t), 0);
xen_flush_queue();

- pdir_shadow_ma = xpmap_ptom(tmpindex << PAGE_SHIFT);
- tmpindex++;
-
- /* setup shadow mapping first so vtomach will work */
- xen_pt_pin((vm_paddr_t)pdir_shadow_ma);
- xen_queue_pt_update((vm_paddr_t)(IdlePTD + PTDPTDI),
- pdir_shadow_ma | PG_V | PG_A | PG_RW | PG_M);
- xen_queue_pt_update(pdir_shadow_ma + PTDPTDI*sizeof(vm_paddr_t),
- ((vm_paddr_t)IdlePTD) | PG_V | PG_A);
- xen_queue_pt_update(pdir_shadow_ma + KPTDI*sizeof(vm_paddr_t),
- KPTphys | PG_V | PG_A);
-
/* allocate remainder of NKPT pages */
for (i = 0; i < NKPT-1; i++, tmpindex++) {
xen_queue_pt_update((vm_paddr_t)(IdlePTD + KPTDI + i + 1),

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog