[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 02/20] hurd: Stop relying on VM_MAX_ADDRESS
From: |
Sergey Bugaev |
Subject: |
[PATCH v2 02/20] hurd: Stop relying on VM_MAX_ADDRESS |
Date: |
Sat, 23 Mar 2024 20:32:43 +0300 |
We'd like to avoid committing to a specific size of virtual address
space (i.e. the value of VM_AARCH64_T0SZ) on AArch64. While the current
version of GNU Mach still exports VM_MAX_ADDRESS for compatibility, we
should try to avoid relying on it when we can. This piece of logic in
_hurdsig_getenv () doesn't actually care about the size of user-
accessible virtual address space, it just wants to preempt faults on any
addresses starting from the value of the P pointer and above. So, use
(unsigned long int) -1 instead of VM_MAX_ADDRESS.
While at it, change the casts to (unsigned long int) and not just
(long int), since the type of struct hurd_signal_preemptor.{first,last}
is unsigned long int.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
---
hurd/hurdsig.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 882a0347..8b1928d1 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1658,8 +1658,8 @@ _hurdsig_getenv (const char *variable)
while (*ep)
{
const char *p = *ep;
- _hurdsig_fault_preemptor.first = (long int) p;
- _hurdsig_fault_preemptor.last = VM_MAX_ADDRESS;
+ _hurdsig_fault_preemptor.first = (unsigned long int) p;
+ _hurdsig_fault_preemptor.last = (unsigned long int) -1;
if (! strncmp (p, variable, len) && p[len] == '=')
{
size_t valuelen;
@@ -1671,8 +1671,8 @@ _hurdsig_getenv (const char *variable)
memcpy (value, p, valuelen);
break;
}
- _hurdsig_fault_preemptor.first = (long int) ++ep;
- _hurdsig_fault_preemptor.last = (long int) (ep + 1);
+ _hurdsig_fault_preemptor.first = (unsigned long int) ++ep;
+ _hurdsig_fault_preemptor.last = (unsigned long int) (ep + 1);
}
_hurdsig_end_catch_fault ();
return value;
--
2.44.0
- [PATCH v2 00/20] aarch64-gnu port & GNU/Hurd on AArch64 progress, Sergey Bugaev, 2024/03/23
- [PATCH v2 01/20] hurd: Move internal functions to internal header, Sergey Bugaev, 2024/03/23
- [PATCH v2 05/20] hurd: Use the RETURN_ADDRESS macro, Sergey Bugaev, 2024/03/23
- [PATCH v2 04/20] hurd: Disable Prefer_MAP_32BIT_EXEC on non-x86_64 for now, Sergey Bugaev, 2024/03/23
- [PATCH v2 06/20] htl: Respect GL(dl_stack_flags) when allocating stacks, Sergey Bugaev, 2024/03/23
- [PATCH v2 08/20] aarch64: Add dl-procinfo, Sergey Bugaev, 2024/03/23
- [PATCH v2 11/20] mach: Add a basic AArch64 port, Sergey Bugaev, 2024/03/23
- [PATCH v2 13/20] hurd: Add a basic AArch64 port, Sergey Bugaev, 2024/03/23
- [PATCH v2 18/20] htl: Implement some support for TLS_DTV_AT_TP, Sergey Bugaev, 2024/03/23
- [PATCH v2 02/20] hurd: Stop relying on VM_MAX_ADDRESS,
Sergey Bugaev <=
- [PATCH v2 03/20] Allow glibc to be compiled without EXEC_PAGESIZE, Sergey Bugaev, 2024/03/23
- [PATCH v2 07/20] aarch64: Move pointer_guard.h out of sysdeps/unix/sysv/linux, Sergey Bugaev, 2024/03/23
- [PATCH v2 10/20] aarch64: Allow building without kernel support for BTI, Sergey Bugaev, 2024/03/23
- [PATCH v2 12/20] mach: Declare the new thread_set_self_state () trap, Sergey Bugaev, 2024/03/23
- [PATCH v2 15/20] hurd: Implement longjmp for AArch64, Sergey Bugaev, 2024/03/23
- [PATCH v2 17/20] hurd: Add an AArch64 signal implementation, Sergey Bugaev, 2024/03/23
- [PATCH v2 09/20] aarch64: Move saving user entry into _dl_start_user, Sergey Bugaev, 2024/03/23
- [PATCH v2 14/20] hurd: Implement TLS on AArch64, Sergey Bugaev, 2024/03/23
- [PATCH v2 16/20] Add FPE_FLTIDO, Sergey Bugaev, 2024/03/23
- [PATCH v2 19/20] htl: Add an AArch64 implementation, Sergey Bugaev, 2024/03/23