Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Bump MAX_USERLDT_SIZE to the max size (wastes some ...



details:   https://anonhg.NetBSD.org/src/rev/7b3e330254e8
branches:  trunk
changeset: 378926:7b3e330254e8
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Apr 30 01:09:29 2021 +0000

description:
Bump MAX_USERLDT_SIZE to the max size (wastes some memory). wine needs more
than PAGE_SIZE and fails spuriously.
XXX: Note the duplicate definition hacks. Should really create <x86/gdt.h>,
put the just the constants there and unify them.
This would also avoid the hack in: src/tests/lib/libi386/t_user_ldt.c#46

diffstat:

 sys/arch/amd64/include/gdt.h |  6 +++---
 sys/arch/i386/include/gdt.h  |  6 +++---
 sys/arch/x86/include/pmap.h  |  6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diffs (59 lines):

diff -r bff3dd878b12 -r 7b3e330254e8 sys/arch/amd64/include/gdt.h
--- a/sys/arch/amd64/include/gdt.h      Thu Apr 29 20:17:20 2021 +0000
+++ b/sys/arch/amd64/include/gdt.h      Fri Apr 30 01:09:29 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.h,v 1.12 2020/04/25 15:26:16 bouyer Exp $  */
+/*     $NetBSD: gdt.h,v 1.13 2021/04/30 01:09:29 christos Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -45,6 +45,6 @@ int ldt_alloc(void *, size_t);
 void ldt_free(int);
 #endif
 
-#define MAXGDTSIZ              65536
-#define MAX_USERLDT_SIZE       PAGE_SIZE
+#define MAXGDTSIZ              65536   /* XXX: see <x86/pmap.h> */
+#define MAX_USERLDT_SIZE       65536   /* XXX: see <x86/pmap.h> */
 #define MAX_USERLDT_SLOTS      (int)(MAX_USERLDT_SIZE / sizeof(union descriptor))
diff -r bff3dd878b12 -r 7b3e330254e8 sys/arch/i386/include/gdt.h
--- a/sys/arch/i386/include/gdt.h       Thu Apr 29 20:17:20 2021 +0000
+++ b/sys/arch/i386/include/gdt.h       Fri Apr 30 01:09:29 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.h,v 1.18 2020/04/25 15:26:17 bouyer Exp $  */
+/*     $NetBSD: gdt.h,v 1.19 2021/04/30 01:09:29 christos Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -44,6 +44,6 @@ void ldt_free(int);
 
 #endif /* LOCORE */
 
-#define MAXGDTSIZ              65536
-#define MAX_USERLDT_SIZE       PAGE_SIZE
+#define MAXGDTSIZ              65536   /* XXX: see <x86/pmap.h> */
+#define MAX_USERLDT_SIZE       65536   /* XXX: see <x86/pmap.h> */
 #define MAX_USERLDT_SLOTS      (int)(MAX_USERLDT_SIZE / sizeof(union descriptor))
diff -r bff3dd878b12 -r 7b3e330254e8 sys/arch/x86/include/pmap.h
--- a/sys/arch/x86/include/pmap.h       Thu Apr 29 20:17:20 2021 +0000
+++ b/sys/arch/x86/include/pmap.h       Fri Apr 30 01:09:29 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.125 2020/07/19 07:35:08 maxv Exp $  */
+/*     $NetBSD: pmap.h,v 1.126 2021/04/30 01:09:29 christos Exp $      */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -188,11 +188,11 @@ struct slotspace {
 extern struct slotspace slotspace;
 
 #ifndef MAXGDTSIZ
-#define MAXGDTSIZ 65536 /* XXX */
+#define MAXGDTSIZ 65536 /* XXX: dup in <machine/gdt.h> */
 #endif
 
 #ifndef MAX_USERLDT_SIZE
-#define MAX_USERLDT_SIZE PAGE_SIZE /* XXX */
+#define MAX_USERLDT_SIZE 65536 /* XXX: dup in <machine/gdt.h> */
 #endif
 
 struct pcpu_entry {



Home | Main Index | Thread Index | Old Index