diff options
author | cvs2svn <cvs2svn@FreeBSD.org> | 2008-05-31 23:01:15 +0000 |
---|---|---|
committer | cvs2svn <cvs2svn@FreeBSD.org> | 2008-05-31 23:01:15 +0000 |
commit | a54fe1ca9c33931d7c4381a84ee11454f9831c08 (patch) | |
tree | 16cc7f849128603b27ba13f7bdb8ae11e1eadd30 /emulators/kqemu-kmod-devel/files | |
parent | - Update to 1.11.3 (diff) |
This commit was manufactured by cvs2svn to create tag 'RELEASE_5_EOL'.5-eol
Diffstat (limited to 'emulators/kqemu-kmod-devel/files')
-rw-r--r-- | emulators/kqemu-kmod-devel/files/kqemu.in | 53 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd | 10 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-common-Makefile | 22 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-fpucontext | 78 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c | 49 | ||||
-rw-r--r-- | emulators/kqemu-kmod-devel/files/patch-tssworkaround | 111 |
6 files changed, 0 insertions, 323 deletions
diff --git a/emulators/kqemu-kmod-devel/files/kqemu.in b/emulators/kqemu-kmod-devel/files/kqemu.in deleted file mode 100644 index 7662ca3cccd1..000000000000 --- a/emulators/kqemu-kmod-devel/files/kqemu.in +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# $FreeBSD$ -# -# PROVIDE: kqemu -# KEYWORD: nojail -# -# Add the following line to /etc/rc.conf[.local] to enable kqemu -# -# kqemu_enable="YES" -# - -. /etc/rc.subr - -name="kqemu" -rcvar=${name}_enable - -load_rc_config $name - -: ${kqemu_enable="NO"} - -start_cmd=kqemu_start -stop_cmd=kqemu_stop - -kqemu_start() -{ - # load aio if needed - if ! kldstat -qm aio; then - if kldload aio; then - info 'aio module loaded.' - else - warn 'aio module failed to load.' - return 1 - fi - fi - if ! kldstat -qm kqemu; then - if kldload kqemu; then - echo 'kqemu module loaded.' - else - warn 'kqemu module failed to load.' - return 1 - fi - fi - return 0 -} - -kqemu_stop() -{ - if kldstat -qm kqemu && kldunload kqemu; then - echo 'kqemu module unloaded.' - fi -} - -run_rc_command "$1" diff --git a/emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd b/emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd deleted file mode 100644 index b75420fa0cc7..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-Makefile.freebsd +++ /dev/null @@ -1,10 +0,0 @@ ---- Makefile.freebsd.orig Fri Jul 29 06:37:06 2005 -+++ Makefile.freebsd Tue Oct 25 21:08:43 2005 -@@ -5,6 +5,7 @@ - .elif ${MACHINE_ARCH} == "amd64" - OBJS= kqemu-mod-x86_64.o - .endif -+CC= cc - WERROR= - - .include <bsd.kmod.mk> diff --git a/emulators/kqemu-kmod-devel/files/patch-common-Makefile b/emulators/kqemu-kmod-devel/files/patch-common-Makefile deleted file mode 100644 index a74cec5a4e1e..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-common-Makefile +++ /dev/null @@ -1,22 +0,0 @@ -Index: common/Makefile -@@ -47,9 +47,9 @@ - ifeq ($(ARCH), x86_64) - COMMON_CFLAGS+=-mno-red-zone - endif --CFLAGS=$(COMMON_CFLAGS) -+CFLAGS=$(COMMON_CFLAGS) ${DEBUG_FLAGS} - MON_CFLAGS=$(COMMON_CFLAGS) --KERNEL_CFLAGS=$(COMMON_CFLAGS) -+KERNEL_CFLAGS=$(COMMON_CFLAGS) ${DEBUG_FLAGS} - - # Disable SSP if GCC supports it - MON_CFLAGS+=$(call cc-option,$(MON_CC),-fno-stack-protector,) -@@ -119,7 +119,7 @@ - $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -c -o $@ $< - - %.o: %.S -- $(CC) $(DEFINES) $(INCLUDES) -D__ASSEMBLY__ -c -o $@ $< -+ $(CC) ${DEBUG_FLAGS} $(DEFINES) $(INCLUDES) -D__ASSEMBLY__ -c -o $@ $< - - clean: - rm -f *.o *~ monitor-image.h genoffsets genmon monitor_def.h \ diff --git a/emulators/kqemu-kmod-devel/files/patch-fpucontext b/emulators/kqemu-kmod-devel/files/patch-fpucontext deleted file mode 100644 index 186d131da2b2..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-fpucontext +++ /dev/null @@ -1,78 +0,0 @@ -Index: common/kernel.c -@@ -1240,6 +1240,11 @@ - case MON_REQ_EXCEPTION: - exec_exception(s->arg0); - break; -+#ifdef __FreeBSD__ -+ case MON_REQ_LOADFPUCONTEXT: -+ kqemu_loadfpucontext(s->arg0); -+ break; -+#endif - default: - kqemu_log("invalid mon request: %d\n", s->mon_req); - break; -Index: common/kqemu_int.h -@@ -523,6 +523,7 @@ - MON_REQ_LOCK_USER_PAGE, - MON_REQ_UNLOCK_USER_PAGE, - MON_REQ_EXCEPTION, -+ MON_REQ_LOADFPUCONTEXT, - } MonitorRequest; - - #define INTERRUPT_ENTRY_SIZE 16 -Index: common/monitor.c -@@ -1995,8 +1995,13 @@ - raise_exception_err(s, EXCP07_PREX, 0); - } else { - /* the host needs to restore the FPU state for us */ -+#ifndef __FreeBSD__ - s->mon_req = MON_REQ_EXCEPTION; - s->arg0 = 0x07; -+#else -+ s->mon_req = MON_REQ_LOADFPUCONTEXT; -+ s->arg0 = (unsigned long)s->cpu_state.cpl; -+#endif - monitor2kernel1(s); - } - } -Index: kqemu-freebsd.c -@@ -33,6 +33,11 @@ - - #include <machine/vmparam.h> - #include <machine/stdarg.h> -+#ifdef __x86_64__ -+#include <machine/fpu.h> -+#else -+#include <machine/npx.h> -+#endif - - #include "kqemu-kernel.h" - -@@ -172,6 +177,15 @@ - { - } - -+void CDECL kqemu_loadfpucontext(unsigned long cpl) -+{ -+#ifdef __x86_64__ -+ fpudna(); -+#else -+ npxdna(); -+#endif -+} -+ - #if __FreeBSD_version < 500000 - static int - curpriority_cmp(struct proc *p) -Index: kqemu-kernel.h -@@ -40,6 +40,10 @@ - void * CDECL kqemu_io_map(unsigned long page_index, unsigned int size); - void CDECL kqemu_io_unmap(void *ptr, unsigned int size); - -+#ifdef __FreeBSD__ -+void CDECL kqemu_loadfpucontext(unsigned long cpl); -+#endif -+ - int CDECL kqemu_schedule(void); - - void CDECL kqemu_log(const char *fmt, ...); diff --git a/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c b/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c deleted file mode 100644 index ac811e16d7fe..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-kqemu-freebsd.c +++ /dev/null @@ -1,49 +0,0 @@ -Index: kqemu-freebsd.c -@@ -208,9 +208,17 @@ - int CDECL kqemu_schedule(void) - { - /* kqemu_log("kqemu_schedule\n"); */ -+#if __FreeBSD_version < 700044 - mtx_lock_spin(&sched_lock); - mi_switch(SW_VOL, NULL); - mtx_unlock_spin(&sched_lock); -+#else -+ /* -current no longer uses sched_lock */ -+ struct thread *td = curthread; -+ thread_lock(td); -+ mi_switch(SW_VOL, NULL); -+ thread_unlock(td); -+#endif - return SIGPENDING(curthread); - } - #endif -@@ -320,8 +328,15 @@ - #if __FreeBSD_version >= 500000 - dev->si_drv1 = NULL; - TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent); -+#if __FreeBSD_version >= 700051 -+ destroy_dev_sched(dev); -+#else -+#if __FreeBSD_version >= 700024 -+ dev_relthread(dev); -+#endif - destroy_dev(dev); - #endif -+#endif - free(ks, M_KQEMU); - --kqemu_ref_count; - } -@@ -500,7 +515,13 @@ - while ((ks = TAILQ_FIRST(&kqemuhead)) != NULL) { - kqemu_destroy(ks); - } -+#if __FreeBSD_version >= 700051 -+ drain_dev_clone_events(); -+#endif - clone_cleanup(&kqemuclones); -+#if __FreeBSD_version >= 700051 -+ destroy_dev_drain(&kqemu_cdevsw); -+#endif - #endif - kqemu_global_delete(kqemu_gs); - kqemu_gs = NULL; diff --git a/emulators/kqemu-kmod-devel/files/patch-tssworkaround b/emulators/kqemu-kmod-devel/files/patch-tssworkaround deleted file mode 100644 index e735deb5f1de..000000000000 --- a/emulators/kqemu-kmod-devel/files/patch-tssworkaround +++ /dev/null @@ -1,111 +0,0 @@ -Index: kqemu-freebsd.c -@@ -38,6 +38,14 @@ - #else - #include <machine/npx.h> - #endif -+#ifdef __x86_64__ -+#include <sys/smp.h> -+#include <sys/pcpu.h> -+#include <machine/pcb.h> -+#include <machine/specialreg.h> -+#include <machine/segments.h> -+#include <machine/tss.h> -+#endif - - #include "kqemu-kernel.h" - -@@ -248,6 +256,57 @@ - va_end(ap); - } - -+#ifdef __x86_64__ -+int kqemu_cpu0gdtfixed; -+int kqemu_gdts_used; -+struct user_segment_descriptor *kqemu_gdts; -+struct region_descriptor kqemu_r_newgdt; -+extern struct pcpu __pcpu[]; -+ -+/* called with interrupts disabled */ -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase) -+{ -+ int gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); -+ unsigned cpuid = PCPU_GET(cpuid); -+ struct user_segment_descriptor *newgdt = gdt; -+ -+ if (mp_ncpus <= 1 || kerngdtbase != (unsigned long)gdt) -+ /* UP host or gdt already moved, nothing to do */ -+ return; -+ if (cpuid) { -+ /* move gdts of all but first cpu */ -+ if (!kqemu_gdts) -+ /* -+ * XXX gdt is allocated as -+ * struct user_segment_descriptor gdt[NGDT * MAXCPU]; -+ * so it has room for the moved copies; need to allocate at -+ * kldload (and only free if kqemu_gdts_used is zero) should this -+ * change in the future -+ */ -+ kqemu_gdts = &gdt[NGDT]; -+ ++kqemu_gdts_used; -+ newgdt = &kqemu_gdts[NGDT * (cpuid - 1)]; -+ bcopy(gdt, newgdt, NGDT * sizeof(gdt[0])); -+ kqemu_r_newgdt.rd_limit = NGDT * sizeof(gdt[0]) - 1; -+ kqemu_r_newgdt.rd_base = (long) newgdt; -+ } else { -+ if (kqemu_cpu0gdtfixed) -+ return; -+ ++kqemu_cpu0gdtfixed; -+ } -+ gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpuid]; -+ ssdtosyssd(&gdt_segs[GPROC0_SEL], -+ (struct system_segment_descriptor *)&newgdt[GPROC0_SEL]); -+ if (cpuid) { -+ lgdt(&kqemu_r_newgdt); -+ wrmsr(MSR_GSBASE, (u_int64_t)&__pcpu[cpuid]); -+ wrmsr(MSR_KGSBASE, curthread->td_pcb->pcb_gsbase); -+ wrmsr(MSR_FSBASE, curthread->td_pcb->pcb_fsbase); -+ } -+ ltr(gsel_tss); -+} -+#endif -+ - struct kqemu_instance { - #if __FreeBSD_version >= 500000 - TAILQ_ENTRY(kqemu_instance) kqemu_ent; -Index: common/kernel.c -@@ -1025,6 +1025,9 @@ - #ifdef __x86_64__ - uint16_t saved_ds, saved_es; - unsigned long fs_base, gs_base; -+#ifdef __FreeBSD__ -+ struct kqemu_global_state *g = s->global_state; -+#endif - #endif - - #ifdef PROFILE -@@ -1188,6 +1191,13 @@ - apic_restore_nmi(s, apic_nmi_mask); - } - profile_record(s); -+#ifdef __FreeBSD__ -+#ifdef __x86_64__ -+ spin_lock(&g->lock); -+ kqemu_tss_fixup(s->kernel_gdt.base); -+ spin_unlock(&g->lock); -+#endif -+#endif - - if (s->mon_req == MON_REQ_IRQ) { - struct kqemu_exception_regs *r; -Index: kqemu-kernel.h -@@ -48,4 +48,10 @@ - - void CDECL kqemu_log(const char *fmt, ...); - -+#ifdef __FreeBSD__ -+#ifdef __x86_64__ -+void CDECL kqemu_tss_fixup(unsigned long kerngdtbase); -+#endif -+#endif -+ - #endif /* KQEMU_KERNEL_H */ |