Source-Changes-HG archive

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

[src/trunk]: src/sys/arch The last GDT slots are reserved for Xen, so use FIR...



details:   https://anonhg.NetBSD.org/src/rev/7d5674d0c942
branches:  trunk
changeset: 826451:7d5674d0c942
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Sep 06 12:39:18 2017 +0000

description:
The last GDT slots are reserved for Xen, so use FIRST_RESERVED_GDT_BYTE
instead of MAXGDTSIZ for gdt_size.
Xen kernels should boot again.

diffstat:

 sys/arch/amd64/amd64/gdt.c |  8 ++++++--
 sys/arch/i386/i386/gdt.c   |  8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r 46a8f8574a90 -r 7d5674d0c942 sys/arch/amd64/amd64/gdt.c
--- a/sys/arch/amd64/amd64/gdt.c        Wed Sep 06 11:51:33 2017 +0000
+++ b/sys/arch/amd64/amd64/gdt.c        Wed Sep 06 12:39:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.c,v 1.41 2017/09/02 12:57:03 maxv Exp $    */
+/*     $NetBSD: gdt.c,v 1.42 2017/09/06 12:39:18 bouyer Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.41 2017/09/02 12:57:03 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.42 2017/09/06 12:39:18 bouyer Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -130,7 +130,11 @@
        struct cpu_info *ci = &cpu_info_primary;
 
        /* Initialize the global values */
+#ifdef XEN
+       gdt_size = FIRST_RESERVED_GDT_BYTE;
+#else
        gdt_size = MAXGDTSIZ;
+#endif
        memset(&gdt_bitmap.busy, 0, sizeof(gdt_bitmap.busy));
        gdt_bitmap.nslots = NSLOTS(gdt_size);
 
diff -r 46a8f8574a90 -r 7d5674d0c942 sys/arch/i386/i386/gdt.c
--- a/sys/arch/i386/i386/gdt.c  Wed Sep 06 11:51:33 2017 +0000
+++ b/sys/arch/i386/i386/gdt.c  Wed Sep 06 12:39:18 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.c,v 1.66 2017/09/02 12:57:03 maxv Exp $    */
+/*     $NetBSD: gdt.c,v 1.67 2017/09/06 12:39:18 bouyer Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.66 2017/09/02 12:57:03 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.67 2017/09/06 12:39:18 bouyer Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -119,7 +119,11 @@
        struct cpu_info *ci = &cpu_info_primary;
 
        /* Initialize the global values */
+#ifdef XEN
+       gdt_size = FIRST_RESERVED_GDT_BYTE;
+#else
        gdt_size = MAXGDTSIZ;
+#endif
        memset(&gdt_bitmap.busy, 0, sizeof(gdt_bitmap.busy));
        gdt_bitmap.nslots = NSLOTS(gdt_size);
 



Home | Main Index | Thread Index | Old Index