From 0d0135df3ad617ad7136864ab627665ce026440b Mon Sep 17 00:00:00 2001 From: bouyer Date: Sat, 13 Jan 2018 14:12:57 +0000 Subject: [PATCH] Xen now needs cpu_init_tss() too. Makes XEN3PAE_DOMU boot again. --- sys/arch/i386/i386/machdep.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index f8a3b543d22e..23a9adfab190 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.802 2018/01/04 13:36:30 maxv Exp $ */ +/* $NetBSD: machdep.c,v 1.803 2018/01/13 14:12:57 bouyer Exp $ */ /* * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009, 2017 @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.802 2018/01/04 13:36:30 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.803 2018/01/13 14:12:57 bouyer Exp $"); #include "opt_beep.h" #include "opt_compat_freebsd.h" @@ -453,8 +453,8 @@ cpu_startup(void) gdt_init(); i386_proc0_pcb_ldt_init(); -#ifndef XEN cpu_init_tss(&cpu_info_primary); +#ifndef XEN ltr(cpu_info_primary.ci_tss_sel); #endif @@ -613,6 +613,7 @@ cpu_set_tss_gates(struct cpu_info *ci) GSEL(GIPITSS_SEL, SEL_KPL)); #endif } +#endif /* XEN */ /* * Set up TSS and I/O bitmap. @@ -626,14 +627,17 @@ cpu_init_tss(struct cpu_info *ci) sizeof(struct cpu_tss), 0, UVM_KMF_WIRED|UVM_KMF_ZERO); cputss->tss.tss_iobase = IOMAP_INVALOFF << 16; +#ifndef XEN cputss->tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); cputss->tss.tss_ldt = GSEL(GLDT_SEL, SEL_KPL); cputss->tss.tss_cr3 = rcr3(); +#endif ci->ci_tss = cputss; +#ifndef XEN ci->ci_tss_sel = tss_alloc(&cputss->tss); +#endif } -#endif /* XEN */ void * getframe(struct lwp *l, int sig, int *onstack)