Index: sys/dev/vt/hw/ofwfb/ofwfb.c =================================================================== --- sys/dev/vt/hw/ofwfb/ofwfb.c +++ sys/dev/vt/hw/ofwfb/ofwfb.c @@ -90,10 +90,16 @@ static int ofwfb_probe(struct vt_device *vd) { + int disabled; phandle_t chosen, node; ihandle_t stdout; char buf[64]; + disabled = 0; + TUNABLE_INT_FETCH("hw.ofwfb.disable", &disabled); + if (disabled) + return (CN_DEAD); + chosen = OF_finddevice("/chosen"); if (chosen == -1) return (CN_DEAD); Index: sys/powerpc/ofw/ofw_real.c =================================================================== --- sys/powerpc/ofw/ofw_real.c +++ sys/powerpc/ofw/ofw_real.c @@ -168,7 +168,12 @@ static caddr_t of_bounce_virt; static off_t of_bounce_offset; static size_t of_bounce_size; + static struct mtx of_bounce_mtx; +static struct mtx of_spin_mtx; +static struct mtx *of_real_mtx; +static void (*of_mtx_lock)(void); +static void (*of_mtx_unlock)(void); extern int ofw_real_mode; @@ -181,17 +186,41 @@ SYSINIT(ofw_real_bounce_alloc, SI_SUB_KMEM, SI_ORDER_ANY, ofw_real_bounce_alloc, NULL); +static void +ofw_real_mtx_lock_spin(void) +{ + mtx_lock_spin(of_real_mtx); +} + +static void +ofw_real_mtx_lock(void) +{ + mtx_lock(of_real_mtx); +} + +static void +ofw_real_mtx_unlock_spin(void) +{ + mtx_unlock_spin(of_real_mtx); +} + +static void +ofw_real_mtx_unlock(void) +{ + mtx_lock(of_real_mtx); +} + static void ofw_real_start(void) { - mtx_lock(&of_bounce_mtx); + (*of_mtx_lock)(); of_bounce_offset = 0; } - + static void ofw_real_stop(void) { - mtx_unlock(&of_bounce_mtx); + (*of_mtx_unlock)(); } static void @@ -228,7 +257,7 @@ * we have a 32-bit virtual address to give OF. */ - if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0)) + if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0)) pmap_kenter(of_bounce_phys, of_bounce_phys); mtx_unlock(&of_bounce_mtx); @@ -240,7 +269,7 @@ static char emergency_buffer[255]; cell_t phys; - mtx_assert(&of_bounce_mtx, MA_OWNED); + mtx_assert(of_real_mtx, MA_OWNED); if (of_bounce_virt == NULL) { /* @@ -290,7 +319,7 @@ static void ofw_real_unmap(cell_t physaddr, void *buf, size_t len) { - mtx_assert(&of_bounce_mtx, MA_OWNED); + mtx_assert(of_real_mtx, MA_OWNED); if (of_bounce_virt == NULL) return; @@ -306,9 +335,24 @@ static int ofw_real_init(ofw_t ofw, void *openfirm) { - openfirmware = (int (*)(void *))openfirm; + int mtx_spin; + openfirmware = (int (*)(void *))openfirm; mtx_init(&of_bounce_mtx, "OF Bounce Page", NULL, MTX_DEF); + + mtx_spin = 0; + TUNABLE_INT_FETCH("hw.ofw.mtx_spin", &mtx_spin); + if (mtx_spin) { + mtx_init(&of_spin_mtx, "OF Real", NULL, MTX_SPIN); + of_real_mtx = &of_spin_mtx; + of_mtx_lock = ofw_real_mtx_lock_spin; + of_mtx_unlock = ofw_real_mtx_unlock_spin; + } else { + of_real_mtx = &of_bounce_mtx; + of_mtx_lock = ofw_real_mtx_lock; + of_mtx_unlock = ofw_real_mtx_unlock; + } + of_bounce_virt = NULL; return (0); } Index: sys/powerpc/pseries/platform_chrp.c =================================================================== --- sys/powerpc/pseries/platform_chrp.c +++ sys/powerpc/pseries/platform_chrp.c @@ -133,6 +133,7 @@ static int chrp_attach(platform_t plat) { + int quiesce; #ifdef __powerpc64__ int i; @@ -168,7 +169,10 @@ chrp_cpuref_init(); /* Some systems (e.g. QEMU) need Open Firmware to stand down */ - ofw_quiesce(); + quiesce = 1; + TUNABLE_INT_FETCH("hw.ofw.quiesce", &quiesce); + if (quiesce) + ofw_quiesce(); return (0); }