Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch Remove all references to KVM86.



details:   https://anonhg.NetBSD.org/src/rev/984cf19fa900
branches:  trunk
changeset: 781838:984cf19fa900
user:      dsl <dsl%NetBSD.org@localhost>
date:      Wed Oct 03 18:58:30 2012 +0000

description:
Remove all references to KVM86.
It was only ever used by APMBIOS - and then only if an option was selected.
Probably didn't work well at all!

diffstat:

 sys/arch/i386/conf/ALL           |    5 +-
 sys/arch/i386/conf/Makefile.i386 |    4 +-
 sys/arch/i386/conf/files.i386    |    7 +-
 sys/arch/i386/i386/autoconf.c    |   13 +-
 sys/arch/i386/i386/kvm86.c       |  355 ---------------------------------------
 sys/arch/i386/i386/kvm86call.S   |  157 -----------------
 sys/arch/i386/i386/machdep.c     |    6 +-
 sys/arch/i386/i386/trap.c        |   23 +--
 sys/arch/i386/include/kvm86.h    |   14 -
 sys/arch/xen/conf/files.compat   |    4 +-
 sys/arch/xen/conf/files.xen      |    6 +-
 sys/arch/xen/x86/autoconf.c      |   13 +-
 12 files changed, 17 insertions(+), 590 deletions(-)

diffs (truncated from 835 to 300 lines):

diff -r aedd76f79518 -r 984cf19fa900 sys/arch/i386/conf/ALL
--- a/sys/arch/i386/conf/ALL    Wed Oct 03 17:43:22 2012 +0000
+++ b/sys/arch/i386/conf/ALL    Wed Oct 03 18:58:30 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.345 2012/09/30 21:36:18 dsl Exp $
+# $NetBSD: ALL,v 1.346 2012/10/03 18:58:30 dsl Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "ALL-$Revision: 1.345 $"
+#ident                 "ALL-$Revision: 1.346 $"
 
 maxusers       64              # estimated number of users
 
@@ -2140,7 +2140,6 @@
 options KSTACK_DEBUG
 options KSYMS_DEBUG
 options KUE_DEBUG
-options KVM86DEBUG
 options LANA_DEBUG
 options LCD_DEBUG
 options LDT_DEBUG
diff -r aedd76f79518 -r 984cf19fa900 sys/arch/i386/conf/Makefile.i386
--- a/sys/arch/i386/conf/Makefile.i386  Wed Oct 03 17:43:22 2012 +0000
+++ b/sys/arch/i386/conf/Makefile.i386  Wed Oct 03 18:58:30 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.i386,v 1.177 2012/10/01 17:35:57 dsl Exp $
+#      $NetBSD: Makefile.i386,v 1.178 2012/10/03 18:58:31 dsl Exp $
 
 # Makefile for NetBSD
 #
@@ -89,7 +89,7 @@
 linux_sigcode.o lock_stubs.o svr4_sigcode.o mach_sigcode.o: assym.h
 cpufunc.o cpu_in_cksum.o pnpbioscall.o bioscall.o: assym.h
 mptramp.o: assym.h
-acpi_wakeup_low.o busfunc.o kvm86call.o: assym.h
+acpi_wakeup_low.o busfunc.o: assym.h
 
 ##
 ## (7) misc settings
diff -r aedd76f79518 -r 984cf19fa900 sys/arch/i386/conf/files.i386
--- a/sys/arch/i386/conf/files.i386     Wed Oct 03 17:43:22 2012 +0000
+++ b/sys/arch/i386/conf/files.i386     Wed Oct 03 18:58:30 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i386,v 1.366 2012/09/30 20:19:51 dsl Exp $
+#      $NetBSD: files.i386,v 1.367 2012/10/03 18:58:31 dsl Exp $
 #
 # new style config file for i386 architecture
 #
@@ -20,7 +20,6 @@
 
 # VM86 emulation
 defflag                        VM86
-defflag                        KVM86
 
 # User-settable LDT (used by WINE)
 defflag                        USER_LDT
@@ -329,10 +328,6 @@
 # VM86 mode
 file   arch/i386/i386/vm86.c                   vm86
 
-# VM86 in kernel
-file   arch/i386/i386/kvm86.c                  kvm86
-file   arch/i386/i386/kvm86call.S              kvm86
-
 # Binary compatibility with previous NetBSD releases (COMPAT_XX)
 file   arch/i386/i386/compat_13_machdep.c      compat_13
 file   arch/i386/i386/compat_16_machdep.c      compat_16 | compat_ibcs2
diff -r aedd76f79518 -r 984cf19fa900 sys/arch/i386/i386/autoconf.c
--- a/sys/arch/i386/i386/autoconf.c     Wed Oct 03 17:43:22 2012 +0000
+++ b/sys/arch/i386/i386/autoconf.c     Wed Oct 03 18:58:30 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.97 2011/02/22 06:37:24 dholland Exp $   */
+/*     $NetBSD: autoconf.c,v 1.98 2012/10/03 18:58:31 dsl Exp $        */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.97 2011/02/22 06:37:24 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.98 2012/10/03 18:58:31 dsl Exp $");
 
 #include "opt_compat_oldboot.h"
 #include "opt_intrdebug.h"
@@ -90,11 +90,6 @@
 #include <i386/pci/pcibios.h>
 #endif
 
-#include "opt_kvm86.h"
-#ifdef KVM86
-#include <machine/kvm86.h>
-#endif
-
 /*
  * Determine i/o configuration for a machine.
  */
@@ -113,10 +108,6 @@
        pcibios_init();
 #endif
 
-#ifdef KVM86
-       kvm86_init();
-#endif
-
        if (config_rootfound("mainbus", NULL) == NULL)
                panic("configure: mainbus not configured");
 
diff -r aedd76f79518 -r 984cf19fa900 sys/arch/i386/i386/kvm86.c
--- a/sys/arch/i386/i386/kvm86.c        Wed Oct 03 17:43:22 2012 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/* $NetBSD: kvm86.c,v 1.21 2009/11/21 03:11:00 rmind Exp $ */
-
-/*
- * Copyright (c) 2002
- *     Matthias Drochner.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions, and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kvm86.c,v 1.21 2009/11/21 03:11:00 rmind Exp $");
-
-#include "opt_multiprocessor.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/mutex.h>
-#include <sys/cpu.h>
-
-#include <uvm/uvm.h>
-
-#include <machine/tss.h>
-#include <machine/gdt.h>
-#include <machine/pte.h>
-#include <machine/pmap.h>
-#include <machine/kvm86.h>
-
-/* assembler functions in kvm86call.s */
-extern int kvm86_call(struct trapframe *);
-extern void kvm86_ret(struct trapframe *, int);
-
-struct kvm86_data {
-#define PGTABLE_SIZE   ((1024 + 64) * 1024 / PAGE_SIZE)
-       pt_entry_t pgtbl[PGTABLE_SIZE]; /* must be aliged */
-
-       struct segment_descriptor sd;
-
-       struct i386tss tss;
-       u_long iomap[0x10000/32]; /* full size io permission map */
-};
-
-static void kvm86_map(struct kvm86_data *, paddr_t, uint32_t);
-static void kvm86_mapbios(struct kvm86_data *);
-
-/*
- * global VM for BIOS calls
- */
-struct kvm86_data *bioscallvmd;
-/* page for trampoline and stack */
-void *bioscallscratchpage;
-/* where this page is mapped in the vm86 */
-#define BIOSCALLSCRATCHPAGE_VMVA 0x1000
-/* a virtual page to map in vm86 memory temporarily */
-vaddr_t bioscalltmpva;
-
-int kvm86_tss_sel;
-
-kmutex_t kvm86_mp_lock;
-
-#define KVM86_IOPL3 /* not strictly necessary, saves a lot of traps */
-
-void
-kvm86_init(void)
-{
-       size_t vmdsize;
-       char *buf;
-       struct kvm86_data *vmd;
-       struct i386tss *tss;
-       int i;
-       int slot;
-
-       vmdsize = round_page(sizeof(struct kvm86_data)) + PAGE_SIZE;
-
-       buf = malloc(vmdsize, M_DEVBUF, M_NOWAIT | M_ZERO);
-       if ((u_long)buf & (PAGE_SIZE - 1)) {
-               printf("struct kvm86_data unaligned\n");
-               return;
-       }
-       /* first page is stack */
-       vmd = (struct kvm86_data *)(buf + PAGE_SIZE);
-       tss = &vmd->tss;
-
-       /*
-        * we want to access all IO ports, so we need a full-size
-        *  permission bitmap
-        */
-       memcpy(tss, &curcpu()->ci_tss, sizeof(*tss));
-       tss->tss_esp0 = (int)vmd;
-       tss->tss_ss0 = GSEL(GDATA_SEL, SEL_KPL);
-       for (i = 0; i < sizeof(vmd->iomap) / 4; i++)
-               vmd->iomap[i] = 0;
-       tss->tss_iobase = ((char *)vmd->iomap - (char *)tss) << 16;
-
-       /* setup TSS descriptor (including our iomap) */
-       mutex_enter(&cpu_lock);
-       slot = gdt_get_slot();
-       kvm86_tss_sel = GSEL(slot, SEL_KPL);
-       setgdt(slot, tss, sizeof(*tss) + sizeof(vmd->iomap) - 1,
-           SDT_SYS386TSS, SEL_KPL, 0, 0);
-       mutex_exit(&cpu_lock);
-
-       /* prepare VM for BIOS calls */
-       kvm86_mapbios(vmd);
-       bioscallscratchpage = malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT);
-       kvm86_map(vmd, vtophys((vaddr_t)bioscallscratchpage),
-                 BIOSCALLSCRATCHPAGE_VMVA);
-       bioscallvmd = vmd;
-       bioscalltmpva = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_VAONLY);
-       mutex_init(&kvm86_mp_lock, MUTEX_DEFAULT, IPL_NONE);
-}
-
-/*
- * XXX pass some stuff to the assembler code
- * XXX this should be done cleanly (in call argument to kvm86_call())
- */
-static void kvm86_prepare(struct kvm86_data *);
-static void
-kvm86_prepare(struct kvm86_data *vmd)
-{
-       extern paddr_t vm86newptd;
-       extern struct trapframe *vm86frame;
-       extern pt_entry_t *vm86pgtableva;
-
-       vm86newptd = vtophys((vaddr_t)vmd) | PG_V | PG_RW | PG_U | PG_u;
-       vm86pgtableva = vmd->pgtbl;
-       vm86frame = (struct trapframe *)vmd - 1;
-}
-
-static void
-kvm86_map(struct kvm86_data *vmd, paddr_t pa, uint32_t vmva)
-{
-
-       vmd->pgtbl[vmva >> 12] = pa | PG_V | PG_RW | PG_U | PG_u;
-}
-
-static void
-kvm86_mapbios(struct kvm86_data *vmd)
-{
-       paddr_t pa;
-
-       /* map first physical page (vector table, BIOS data) */
-       kvm86_map(vmd, 0, 0);
-
-       /* map ISA hole */
-       for (pa = 0xa0000; pa < 0x100000; pa += PAGE_SIZE)
-               kvm86_map(vmd, pa, pa);
-}
-
-void *
-kvm86_bios_addpage(uint32_t vmva)
-{
-       void *mem;
-
-       if (bioscallvmd->pgtbl[vmva >> 12]) /* allocated? */
-               return (0);
-
-       mem = malloc(PAGE_SIZE, M_DEVBUF, M_NOWAIT);
-       if ((u_long)mem & (PAGE_SIZE - 1)) {
-               printf("kvm86_bios_addpage: unaligned");
-               return (0);
-       }
-       kvm86_map(bioscallvmd, vtophys((vaddr_t)mem), vmva);



Home | Main Index | Thread Index | Old Index