| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: machdep.c,v 1.725 2012/03/04 15:56:09 bouyer Exp $ */ | | 1 | /* $NetBSD: machdep.c,v 1.726 2012/03/04 20:44:17 bouyer Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 | | 4 | * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 |
5 | * The NetBSD Foundation, Inc. | | 5 | * The NetBSD Foundation, Inc. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * This code is derived from software contributed to The NetBSD Foundation | | 8 | * This code is derived from software contributed to The NetBSD Foundation |
9 | * by Charles M. Hannum, by Jason R. Thorpe of the Numerical Aerospace | | 9 | * by Charles M. Hannum, by Jason R. Thorpe of the Numerical Aerospace |
10 | * Simulation Facility NASA Ames Research Center, by Julio M. Merino Vidal, | | 10 | * Simulation Facility NASA Ames Research Center, by Julio M. Merino Vidal, |
11 | * and by Andrew Doran. | | 11 | * and by Andrew Doran. |
12 | * | | 12 | * |
13 | * Redistribution and use in source and binary forms, with or without | | 13 | * Redistribution and use in source and binary forms, with or without |
14 | * modification, are permitted provided that the following conditions | | 14 | * modification, are permitted provided that the following conditions |
| @@ -57,27 +57,27 @@ | | | @@ -57,27 +57,27 @@ |
57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 57 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 58 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 59 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 60 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 61 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 62 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 63 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
64 | * SUCH DAMAGE. | | 64 | * SUCH DAMAGE. |
65 | * | | 65 | * |
66 | * @(#)machdep.c 7.4 (Berkeley) 6/3/91 | | 66 | * @(#)machdep.c 7.4 (Berkeley) 6/3/91 |
67 | */ | | 67 | */ |
68 | | | 68 | |
69 | #include <sys/cdefs.h> | | 69 | #include <sys/cdefs.h> |
70 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.725 2012/03/04 15:56:09 bouyer Exp $"); | | 70 | __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.726 2012/03/04 20:44:17 bouyer Exp $"); |
71 | | | 71 | |
72 | #include "opt_beep.h" | | 72 | #include "opt_beep.h" |
73 | #include "opt_compat_ibcs2.h" | | 73 | #include "opt_compat_ibcs2.h" |
74 | #include "opt_compat_freebsd.h" | | 74 | #include "opt_compat_freebsd.h" |
75 | #include "opt_compat_netbsd.h" | | 75 | #include "opt_compat_netbsd.h" |
76 | #include "opt_compat_svr4.h" | | 76 | #include "opt_compat_svr4.h" |
77 | #include "opt_cpureset_delay.h" | | 77 | #include "opt_cpureset_delay.h" |
78 | #include "opt_ddb.h" | | 78 | #include "opt_ddb.h" |
79 | #include "opt_ipkdb.h" | | 79 | #include "opt_ipkdb.h" |
80 | #include "opt_kgdb.h" | | 80 | #include "opt_kgdb.h" |
81 | #include "opt_mtrr.h" | | 81 | #include "opt_mtrr.h" |
82 | #include "opt_modular.h" | | 82 | #include "opt_modular.h" |
83 | #include "opt_multiboot.h" | | 83 | #include "opt_multiboot.h" |
| @@ -1430,30 +1430,26 @@ init386(paddr_t first_avail) | | | @@ -1430,30 +1430,26 @@ init386(paddr_t first_avail) |
1430 | /* Reclaim the boot gdt page - see locore.s */ | | 1430 | /* Reclaim the boot gdt page - see locore.s */ |
1431 | { | | 1431 | { |
1432 | pt_entry_t pte; | | 1432 | pt_entry_t pte; |
1433 | pt_entry_t pg_nx = (cpu_feature[2] & CPUID_NOX ? PG_NX : 0); | | 1433 | pt_entry_t pg_nx = (cpu_feature[2] & CPUID_NOX ? PG_NX : 0); |
1434 | | | 1434 | |
1435 | pte = pmap_pa2pte((vaddr_t)tmpgdt - KERNBASE); | | 1435 | pte = pmap_pa2pte((vaddr_t)tmpgdt - KERNBASE); |
1436 | pte |= PG_k | PG_RW | pg_nx | PG_V; | | 1436 | pte |= PG_k | PG_RW | pg_nx | PG_V; |
1437 | | | 1437 | |
1438 | if (HYPERVISOR_update_va_mapping((vaddr_t)tmpgdt, pte, UVMF_INVLPG) < 0) { | | 1438 | if (HYPERVISOR_update_va_mapping((vaddr_t)tmpgdt, pte, UVMF_INVLPG) < 0) { |
1439 | panic("tmpgdt page relaim RW update failed.\n"); | | 1439 | panic("tmpgdt page relaim RW update failed.\n"); |
1440 | } | | 1440 | } |
1441 | } | | 1441 | } |
1442 | | | 1442 | |
1443 | uvm_page_physload(atop((vaddr_t)tmpgdt), atop((vaddr_t)tmpgdt + PAGE_SIZE), | | | |
1444 | atop((vaddr_t)tmpgdt), atop((vaddr_t)tmpgdt + PAGE_SIZE), | | | |
1445 | VM_FREELIST_DEFAULT); | | | |
1446 | | | | |
1447 | #endif /* !XEN */ | | 1443 | #endif /* !XEN */ |
1448 | | | 1444 | |
1449 | init386_msgbuf(); | | 1445 | init386_msgbuf(); |
1450 | | | 1446 | |
1451 | #ifndef XEN | | 1447 | #ifndef XEN |
1452 | /* | | 1448 | /* |
1453 | * XXX Remove this | | 1449 | * XXX Remove this |
1454 | * | | 1450 | * |
1455 | * Setup a temporary Page Table Entry to allow identity mappings of | | 1451 | * Setup a temporary Page Table Entry to allow identity mappings of |
1456 | * the real mode address. This is required by: | | 1452 | * the real mode address. This is required by: |
1457 | * - bioscall | | 1453 | * - bioscall |
1458 | * - MP bootstrap | | 1454 | * - MP bootstrap |
1459 | * - ACPI wakecode | | 1455 | * - ACPI wakecode |