Index: Makefile =================================================================== RCS file: /home/pcvs/ports/emulators/kqemu-kmod/Makefile,v retrieving revision 1.25 diff -u -p -r1.25 Makefile --- Makefile 12 May 2008 19:09:52 -0000 1.25 +++ Makefile 15 May 2008 17:07:33 -0000 @@ -7,7 +7,7 @@ PORTNAME= kqemu PORTVERSION= 1.3.0.p11 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= emulators kld MASTER_SITES= http://fabrice.bellard.free.fr/qemu/ \ http://qemu.org/ \ Index: files/patch-tssworkaround =================================================================== RCS file: /home/pcvs/ports/emulators/kqemu-kmod/files/patch-tssworkaround,v retrieving revision 1.3 diff -u -p -r1.3 patch-tssworkaround --- files/patch-tssworkaround 12 May 2008 19:09:52 -0000 1.3 +++ files/patch-tssworkaround 15 May 2008 17:04:38 -0000 @@ -14,7 +14,7 @@ Index: kqemu-freebsd.c #include "kqemu-kernel.h" -@@ -248,6 +256,57 @@ +@@ -248,6 +256,60 @@ va_end(ap); } @@ -26,7 +26,7 @@ Index: kqemu-freebsd.c +extern struct pcpu __pcpu[]; + +/* called with interrupts disabled */ -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase) ++void CDECL kqemu_tss_fixup(unsigned long kerngdtbase, uint16_t kernldtsel) +{ + int gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); + unsigned cpuid = PCPU_GET(cpuid); @@ -64,6 +64,9 @@ Index: kqemu-freebsd.c + wrmsr(MSR_GSBASE, (u_int64_t)&__pcpu[cpuid]); + wrmsr(MSR_KGSBASE, curthread->td_pcb->pcb_gsbase); + wrmsr(MSR_FSBASE, 0); ++ ssdtosyssd(&gdt_segs[GPROC0_SEL], ++ (struct system_segment_descriptor *)&newgdt[GPROC0_SEL]); ++ lldt(kernldtsel); + } + ltr(gsel_tss); +} @@ -90,7 +93,7 @@ Index: common/kernel.c +#ifdef __FreeBSD__ +#ifdef __x86_64__ + spin_lock(&g->lock); -+ kqemu_tss_fixup(s->kernel_gdt.base); ++ kqemu_tss_fixup(s->kernel_gdt.base, s->kernel_ldt_sel); + spin_unlock(&g->lock); +#endif +#endif @@ -104,7 +107,7 @@ Index: kqemu-kernel.h +#ifdef __FreeBSD__ +#ifdef __x86_64__ -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase); ++void CDECL kqemu_tss_fixup(unsigned long kerngdtbase, uint16_t kernldtsel); +#endif +#endif +