bug-hurd
[Top][All Lists]
Advanced

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

[PATCH 2/3] x86_64: push user's VM_MAX_ADDRESS


From: Luca Dariz
Subject: [PATCH 2/3] x86_64: push user's VM_MAX_ADDRESS
Date: Sun, 21 May 2023 10:57:57 +0200

* i386/include/mach/i386/vm_param.h: check for both KERNEL and USER32
  to differentiate between user/kernel on x86_64, and push the upper
  limit of user address space to 128 TB.
---
 i386/include/mach/i386/vm_param.h | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/i386/include/mach/i386/vm_param.h 
b/i386/include/mach/i386/vm_param.h
index f09049a5..d1a6c656 100644
--- a/i386/include/mach/i386/vm_param.h
+++ b/i386/include/mach/i386/vm_param.h
@@ -65,18 +65,26 @@
                                        ~(I386_PGBYTES-1))
 #define i386_trunc_page(x)     (((unsigned long)(x)) & ~(I386_PGBYTES-1))
 
-/* User address spaces are 3GB each,
-   starting at virtual and linear address 0.
+/* User address spaces are 3GB each on a 32-bit kernel, starting at
+   virtual and linear address 0.
+   On a 64-bit krenel we split the address space in half, with the
+   lower 128TB for the user address space and the upper 128TB for the
+   kernel address space.
 
-   VM_MAX_ADDRESS can be reduced to leave more space for the kernel, but must
-   not be increased to more than 3GB as glibc and hurd servers would not cope
-   with that.
+   On a 32-bit kernel VM_MAX_ADDRESS can be reduced to leave more
+   space for the kernel, but must not be increased to more than 3GB as
+   glibc and hurd servers would not cope with that.
    */
 #define VM_MIN_ADDRESS         (0ULL)
+
 #ifdef __x86_64__
-#define VM_MAX_ADDRESS         (0xc0000000ULL)
-#else
+#if defined(KERNEL) && defined(USER32)
+#define VM_MAX_ADDRESS         (0xc0000000UL)
+#else /* defined(KERNEL) && defined(USER32) */
+#define VM_MAX_ADDRESS         (0x7fffffffffffULL)
+#endif /* defined(KERNEL) && defined(USER32) */
+#else /* __x86_64__ */
 #define VM_MAX_ADDRESS         (0xc0000000UL)
-#endif
+#endif /* __x86_64__ */
 
 #endif /* _MACH_I386_VM_PARAM_H_ */
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]