* i386/i386/fpu.c: extend current getter and setter to support the
extended state; move the struct casting here to reuse the locking
and allocation logic for the thread state; make sure the new state
is set as valid, otherwise it won't be applied; add
i386_get_xstate_size() to dynamically r
* x86_64/locore.S: adjust to the changes in the thread state
structure (segment registers), and add the missing opcode.
---
x86_64/locore.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 8f39a677..376f41c1 100644
--- a/x86_64/locore.S
---
tests/include/testlib.h | 1 +
tests/test-thread-state-fp.c | 240 +++
tests/testlib.c | 16 +++
tests/user-qemu.mk | 3 +-
4 files changed, 259 insertions(+), 1 deletion(-)
create mode 100644 tests/test-thread-state-fp.c
diff
Il 23/08/24 11:50, Sergey Bugaev ha scritto:
On Wed, Aug 21, 2024 at 7:37 PM Luca Dariz wrote:
+#include
+
+static void printx(struct i386_xfloat_state *state, int size)
+{
+ printf("xfloat init %d fp %d exc %d\n",
+ state->initialized, state->fpkind, state->exc
Il 22/08/24 23:26, Samuel Thibault ha scritto:
Hello,
Thanks for the improved version!
Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit:
@@ -495,10 +534,11 @@ ASSERT_IPL(SPL0);
* concurrent fpu_set_state or fpu_get_state.
*/
kern_return_t
-fpu_get_state(const thread_t thread
Il 22/08/24 23:51, Samuel Thibault ha scritto:
Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit:
+ } else if (flavor == i386_XFLOAT_STATE) {
+ int i;
+ struct i386_xfp_save *user_fp_state = (struct i386_xfp_save *)
&xfstate->hw_state[0
Il 22/08/24 23:44, Samuel Thibault ha scritto:
Luca Dariz, le mer. 21 août 2024 18:36:14 +0200, a ecrit:
diff --git a/i386/include/mach/i386/mach_i386.defs
b/i386/include/mach/i386/mach_i386.defs
index 965d5c3b..61fed222 100644
--- a/i386/include/mach/i386/mach_i386.defs
+++ b/i386/include
* tests/test-machmsg.c: add two use cases used by glibc during signal
handling
* tests/include/testlib.h
* tests/testlib.c: add new wait_thread_terminated() helper
---
tests/include/testlib.h | 1 +
tests/test-machmsg.c| 80 +
tests/testlib.c
---
tests/include/testlib.h | 1 +
tests/test-thread-state-fp.c | 232 +++
tests/testlib.c | 16 +++
tests/user-qemu.mk | 3 +-
4 files changed, 251 insertions(+), 1 deletion(-)
create mode 100644 tests/test-thread-state-fp.c
diff
* i386/i386/fpu.c: extend current getter and setter to support the
extended state; move the struct casting here to reuse the locking
and allocation logic for the thread state; make sure the new state
is set as valid, otherwise it won't be applied; add
i386_get_xstate_size() to dynamically r
Hi,
Il 05/08/24 20:28, Sergey Bugaev ha scritto:
On Mon, Aug 5, 2024 at 9:23 PM Samuel Thibault wrote:
Luca Dariz, le lun. 05 août 2024 14:52:24 +0200, a ecrit:
Il 05/08/24 00:32, Samuel Thibault ha scritto:
Luca Dariz, le ven. 02 août 2024 17:32:34 +0200, a ecrit:
+#define XFP_STATE_BYTES
Il 05/08/24 00:32, Samuel Thibault ha scritto:
Hello,
Luca Dariz, le ven. 02 août 2024 17:32:34 +0200, a ecrit:
+#define XFP_STATE_BYTES (sizeof (struct i386_xfp_save))
That is not sufficient: depending on the sse level and the saving style,
we have various amount of data to store. See
* i386/i386/fpu.c: extend current getter and setter to support the
extended state; move the struct casting here to reuse the locking
and allocation logic for the thread state.
* i386/i386/fpu.h: update prototypes to accept generic thread state
* i386/i386/pcb.c: forward raw thread state to gett
* tests/test-machmsg.c: add more combinations to existing cases:
- make tx and rx ports independent in the send/receive tests
- add two more variants for send/receive tests, using two separate
system calls, using different code paths in mach_msg().
---
tests/test-machmsg.c | 117 ++
* ipc/copy_user.c: recent MIG stubs should always fill the size
correctly in the msg header, but we shouldn't rely on that. Instead,
we use the size that was correctly copied-in, overwriting the value
in the header. This is already done by the 32-bit copyinmsg(), and
was missing in the 64-b
Il 09/03/24 16:24, Etienne Brateau ha scritto:
Le sam. 9 mars 2024 à 15:03, Luca Dariz diff --git a/i386/i386/debug.h b/i386/i386/debug.h
index 84397ba8..eff330c6 100644
--- a/i386/i386/debug.h
+++ b/i386/i386/debug.h
@@ -54,6 +54,7 @@ void debug_trace_dump(void
These are some utilities I used to decode and control the kernel
trace, compiled as part of gnumach just so it's easier to build
them. I'm not sure if they should be in their own package, for now
they complement the kernel tracing patch so it can be tested more
easily.
With ktrace we can collect t
From: LD
---
Makefrag.am| 2 ++
i386/Makefrag.am | 1 -
{x86_64 => ipc}/copy_user.c| 7 +--
{i386/i386 => ipc}/copy_user.h | 18 +-
ipc/ipc_kmsg.c | 2 +-
ipc/ipc_mqueue.c | 2 +-
ipc/mach_msg.c
This extends the previous debug utility to trace system calls with
more events and the ability to control the tracing from userspace,
collecting a trace of the whole systems.
This tool was quite useful in porting the rpc format to 64 bit and
handle the 32to64 translation, but also to debug user-sp
This allows 32on64 to work again. Also, it's a clearer indication of a
missing part.
---
x86_64/locore.S | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 806762bb..8f39a677 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -
From: LD
---
device/chario.c | 2 +-
device/ds_routines.c | 4 ++--
device/net_io.c | 4 ++--
i386/Makefrag_x86.am | 1 -
i386/i386/db_interface.c | 2 +-
i386/i386/db_trace.c | 2 +-
i386/i386/fpu.c
---
tests/test-mach_host.c | 81 ++
tests/user-qemu.mk | 3 +-
2 files changed, 83 insertions(+), 1 deletion(-)
create mode 100644 tests/test-mach_host.c
diff --git a/tests/test-mach_host.c b/tests/test-mach_host.c
new file mode 100644
index .
---
tests/test-machmsg.c | 405 +++
tests/user-qemu.mk | 3 +-
2 files changed, 407 insertions(+), 1 deletion(-)
create mode 100644 tests/test-machmsg.c
diff --git a/tests/test-machmsg.c b/tests/test-machmsg.c
new file mode 100644
index ..60f3f
---
tests/test-gsync.c | 122 +
tests/user-qemu.mk | 3 +-
2 files changed, 124 insertions(+), 1 deletion(-)
create mode 100644 tests/test-gsync.c
diff --git a/tests/test-gsync.c b/tests/test-gsync.c
new file mode 100644
index ..a5160651
---
---
tests/test-vm.c| 85 ++
tests/user-qemu.mk | 3 +-
2 files changed, 87 insertions(+), 1 deletion(-)
create mode 100644 tests/test-vm.c
diff --git a/tests/test-vm.c b/tests/test-vm.c
new file mode 100644
index ..4ece792e
--- /dev/null
+
---
tests/test-threads.c | 104 +++
tests/user-qemu.mk | 3 +-
2 files changed, 106 insertions(+), 1 deletion(-)
create mode 100644 tests/test-threads.c
diff --git a/tests/test-threads.c b/tests/test-threads.c
new file mode 100644
index ..06630
* vm/vm_map.c: use actual limits instead of min/max boundaries to
change pageability of the currently mapped memory.
This caused the initial vm_wire_all(host, task VM_WIRE_ALL) in glibc
startup to fail with KERN_NO_SPACE.
---
vm/vm_map.c | 31 ++-
1 file changed, 26
* configure.ac: move test fragment to have USER32
* tests/Makefrag.am: add user tests
* tests/README: add basic info on how to run and debug user tests
* tests/configfrag.ac: allow the test compiler/flags to be
autoconfigured or customized
* tests/grub.cfg.single.template: add minimal grub config
---
tests/test-task.c | 171 +
tests/user-qemu.mk | 3 +-
2 files changed, 173 insertions(+), 1 deletion(-)
create mode 100644 tests/test-task.c
diff --git a/tests/test-task.c b/tests/test-task.c
new file mode 100644
index ..cbc75e23
--- /de
---
tests/include/testlib.h | 1 +
tests/testlib_thread_start.c | 86
tests/user-qemu.mk | 1 +
3 files changed, 88 insertions(+)
create mode 100644 tests/testlib_thread_start.c
diff --git a/tests/include/testlib.h b/tests/include/testlib.h
i
---
tests/test-syscalls.c | 166 ++
tests/user-qemu.mk| 3 +-
2 files changed, 168 insertions(+), 1 deletion(-)
create mode 100644 tests/test-syscalls.c
diff --git a/tests/test-syscalls.c b/tests/test-syscalls.c
new file mode 100644
index ..b
---
tests/test-mach_port.c | 121 +
tests/user-qemu.mk | 3 +-
2 files changed, 123 insertions(+), 1 deletion(-)
create mode 100644 tests/test-mach_port.c
diff --git a/tests/test-mach_port.c b/tests/test-mach_port.c
new file mode 100644
index 000
Il 29/12/23 15:20, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:58 +0100, a ecrit:
+
+#define align_inline(val, n) { val = align(val, n); }
Rather name it ALIGN_INLINE, so people don't mistake this for a
function (that doesn't have side-effects on its paramet
Il 29/12/23 15:14, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:55 +0100, a ecrit:
diff --git a/tests/testlib.c b/tests/testlib.c
index 6abe8c4d..e6be46ee 100644
--- a/tests/testlib.c
+++ b/tests/testlib.c
@@ -95,3 +95,56 @@ void _start()
printf("%s: test %s exit
Il 29/12/23 15:09, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:54 +0100, a ecrit:
+ // this emulates maptime()
+ struct mapped_time_value *mtime;
+ mach_port_t device, memobj;
+ int err = device_open (device_priv(), 0, "time", &device);
+ ASSERT_RET(err
Il 29/12/23 15:06, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:53 +0100, a ecrit:
* vm/vm_map.c: if the start address is not in the map, try to find the
nearest entry instead of failing.
This caused the initial vm_wire_all(host, task VM_WIRE_ALL) in glibc
startup to
Il 29/12/23 15:01, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:52 +0100, a ecrit:
+ mach_port_t newname = 123;
Why initializing it?
the idea was to check that the value it's actually set, I'll fix it by
using a valid port name.
+ err = mach_por
Il 29/12/23 14:56, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:51 +0100, a ecrit:
+static void single_t2(void *arg)
+{
+ int err;
+ msleep(100);
+ err = gsync_wake(mach_task_self(), (vm_offset_t)&single_shared, 0, 0);
+ ASSERT_RET(err, "gsync_wake t2&qu
Il 29/12/23 14:44, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:50 +0100, a ecrit:
---
tests/test-mach_host.c | 54 ++
1 file changed, 54 insertions(+)
create mode 100644 tests/test-mach_host.c
diff --git a/tests/test
Il 29/12/23 14:57, Samuel Thibault ha scritto:
Luca Dariz, le ven. 29 déc. 2023 14:51:31 +0100, a ecrit:
Il 29/12/23 14:37, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:49 +0100, a ecrit:
new file mode 100644
index ..4cf25891
--- /dev/null
+++ b/tests/README
Hi,
Il 29/12/23 14:37, Samuel Thibault ha scritto:
Hello,
Thanks, this looks good!
Luca Dariz, le jeu. 28 déc. 2023 20:42:49 +0100, a ecrit:
new file mode 100644
index ..4cf25891
--- /dev/null
+++ b/tests/README
@@ -0,0 +1,37 @@
+
+There are some basic tests that can be run qith qemu
---
tests/user-qemu.mk | 10 +-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tests/user-qemu.mk b/tests/user-qemu.mk
index 50b04736..669eb77a 100644
--- a/tests/user-qemu.mk
+++ b/tests/user-qemu.mk
@@ -178,7 +178,15 @@ clean-test-%:
USER_TESTS := \
- tests/test-
---
tests/test-machmsg.c | 390 +++
1 file changed, 390 insertions(+)
create mode 100644 tests/test-machmsg.c
diff --git a/tests/test-machmsg.c b/tests/test-machmsg.c
new file mode 100644
index ..c262f5f4
--- /dev/null
+++ b/tests/test-machmsg.c
@@
---
tests/test-task.c | 149 ++
1 file changed, 149 insertions(+)
create mode 100644 tests/test-task.c
diff --git a/tests/test-task.c b/tests/test-task.c
new file mode 100644
index ..da9289ff
--- /dev/null
+++ b/tests/test-task.c
@@ -0,0 +1,149
---
tests/test-threads.c | 88
1 file changed, 88 insertions(+)
create mode 100644 tests/test-threads.c
diff --git a/tests/test-threads.c b/tests/test-threads.c
new file mode 100644
index ..659aaf3b
--- /dev/null
+++ b/tests/test-threads.c
@@
ll be definitely useful in case of new
architectures, if supported by qemu.
Currently I ran the tests only on GNU/Linux as qemu does not run yet
on the Hurd.
Luca Dariz (14):
USER32: change default to disabled and make it a general option
add basic user-space tests with qemu
add mach_host tests
---
tests/test-mach_host.c | 54 ++
1 file changed, 54 insertions(+)
create mode 100644 tests/test-mach_host.c
diff --git a/tests/test-mach_host.c b/tests/test-mach_host.c
new file mode 100644
index ..99fc4aca
--- /dev/null
+++ b/tests/test-mach_ho
---
tests/test-syscalls.c | 149 ++
1 file changed, 149 insertions(+)
create mode 100644 tests/test-syscalls.c
diff --git a/tests/test-syscalls.c b/tests/test-syscalls.c
new file mode 100644
index ..7e4234ac
--- /dev/null
+++ b/tests/test-syscalls.
---
tests/test-vm.c | 52 +
1 file changed, 52 insertions(+)
create mode 100644 tests/test-vm.c
diff --git a/tests/test-vm.c b/tests/test-vm.c
new file mode 100644
index ..ba52876b
--- /dev/null
+++ b/tests/test-vm.c
@@ -0,0 +1,52 @@
+
+#in
* configure.ac: move test fragment to have USER32
* tests/Makefrag.am: add user tests
* tests/README: add basic info on how to run and debug user tests
* tests/configfrag.ac: allow the test compiler/flags to be
autoconfigured or customized
* tests/grub.cfg.single.template: add minimal grub config
* vm/vm_map.c: if the start address is not in the map, try to find the
nearest entry instead of failing.
This caused the initial vm_wire_all(host, task VM_WIRE_ALL) in glibc
startup to fail with KERN_NO_SPACE.
---
vm/vm_map.c | 21 -
1 file changed, 16 insertions(+), 5 delet
---
include/mach/message.h | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/mach/message.h b/include/mach/message.h
index 0b8b34d4..9790ef98 100644
--- a/include/mach/message.h
+++ b/include/mach/message.h
@@ -401,6 +401,16 @@ typedef integer_t mach_
---
tests/include/testlib.h | 1 +
tests/testlib.c | 53 +
2 files changed, 54 insertions(+)
diff --git a/tests/include/testlib.h b/tests/include/testlib.h
index 2b7a67c0..52605047 100644
--- a/tests/include/testlib.h
+++ b/tests/include/testlib.h
---
tests/test-gsync.c | 87 ++
1 file changed, 87 insertions(+)
create mode 100644 tests/test-gsync.c
diff --git a/tests/test-gsync.c b/tests/test-gsync.c
new file mode 100644
index ..80701606
--- /dev/null
+++ b/tests/test-gsync.c
@@ -0,0 +1,
* configfrag.ac: add the global option USER32; although it makes sense
for 64-bit versions only, it can be used by future 64-bit
architectiures and not only x86_64.
Also, change the default setting to be disabled; now that we have a
working full 64-bit system, it makes sense to consider it
---
tests/test-mach_port.c | 80 ++
1 file changed, 80 insertions(+)
create mode 100644 tests/test-mach_port.c
diff --git a/tests/test-mach_port.c b/tests/test-mach_port.c
new file mode 100644
index ..4f095047
--- /dev/null
+++ b/tests/test-mach_po
Hi,
Il 22/10/23 17:19, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 19 oct. 2023 20:57:46 +0200, a ecrit:
* tests/configfrag.ac: add MIGUSER, required for user-space tests as
it might be different from the one used to ubild the kernel.
Can't we just automatically select the prope
---
tests/Makefrag.am | 4 +++-
tests/test-mach_host.c | 54 ++
2 files changed, 57 insertions(+), 1 deletion(-)
create mode 100644 tests/test-mach_host.c
diff --git a/tests/Makefrag.am b/tests/Makefrag.am
index c16326e8..cb946bc7 100644
--- a/tests/
sting
environment is settled I can adapt other tests I currently have.
Luca Dariz (2):
add basic user-space tests with qemu
add mach_host tests
tests/Makefrag.am| 127 +++
tests/README | 37 +
tests/configfr
* tests/Makefrag.am: add rules to build simple user-space test
modules, including generating mig stubs. The tests reuse some kernel
code (the printf(), mach_atoi(), mem*(), str*() functions) so we can
use the freestanding environment and not depend on glibc.
* tests/README: add basic info on
Il 04/08/23 23:50, Samuel Thibault ha scritto:
Luca Dariz, le sam. 29 juil. 2023 19:47:53 +0200, a ecrit:
@@ -803,10 +809,7 @@ kern_return_t thread_getstatus(
== 0)
saved_state->efl &=
* i386/i386/idt.c: add selector for the interrupt-specific stack
* i386/i386/ktss.c: configure ist1 to use a dedicated stack
* i386/i386/trap.c: add double fault handler, which just prints the
state and panics. There is not much else to do in this case but it's
useful for troubleshooting
* x86_
---
x86_64/locore.S | 37 +++--
1 file changed, 35 insertions(+), 2 deletions(-)
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 413d43c4..7127957b 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -39,8 +39,41 @@
#include
#include
-#define pusha pus
* i386/i386/pcb.c: simplify exception stack location and adapt thread
gettrs/setters
* i386/i386/thread.h: don't include V86 fields on full 64-bit
* x86_64/locore.S: don't include checks for V86 mode on full 64-bit
---
i386/i386/pcb.c| 35 ++-
i386/i386/thread
The actual values are not saved together with the rest of the thread
state, both because it would be quite espensive (reading MSR, unless
rdfsbase instructions are supported, but that's optional) and not
really needed. The only way the user has to change its value is with a
specific RPC, so we can
* i386/i386/db_interface.c: don't set unused segment selectors on full
64-bit
* i386/i386/db_trace.c: likewise.
* i386/i386/i386asm.sym: likewise.
* i386/i386/pcb.c:: likewise.
* i386/i386/thread.h: remove ES/DS/FS/GS from thread state on !USER32,
as they are unused in this configuration. Only
* x86_64/locore.S: ensure the thread state is filled completely even
on recursive interrups. The value of the segment selectors is not
very important in this case, but we still need to align the stack to
the bottom of i386_interrupt_state.
---
x86_64/locore.S | 16 +++-
1 file ch
Il 17/06/23 23:12, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 15 juin 2023 23:49:30 +0200, a ecrit:
diff --git a/i386/i386/ktss.c b/i386/i386/ktss.c
index 1d880167..52f3722c 100644
--- a/i386/i386/ktss.c
+++ b/i386/i386/ktss.c
@@ -61,6 +61,7 @@ ktss_fill(struct task_tss *myktss, struct
* x86_64/boothdr.S: there is no reason to not use it right away
---
x86_64/boothdr.S | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/x86_64/boothdr.S b/x86_64/boothdr.S
index d81f9a78..0ab9bd55 100644
--- a/x86_64/boothdr.S
+++ b/x86_64/boothdr.S
@@ -158,7 +158,7 @@ switch6
* i386/i386/idt.c: add selector for the interrupt-specific stack
* i386/i386/ktss.c: configure ist1
* i386/i386/trap.c: add double fault handler, which just prints the
state and panics. There is not much else to do in this case but it's
useful for troubleshooting
* x86_64/idt_inittab.S: allow t
When entering a syscall we're still using the user stack, so we can't
reliably handle exceptions or interrupts, otherwise a user thread can
easily crash the machine with an invalid stack. Instead, disable
interrupts and (hopefullly) avoid traps in the fragments where we need
to have the user stack
1 56 59 236k
12k
Luca Dariz (3):
pmap: only map lower BIOS memory 1:1 when using Linux drivers
x86_64: enable code for managing interrupts
x86_64: add 64-bit registers when dumping thread state
device/ds_routines.c | 12 ++--
i386/i386/debug_i386.c | 14
* i386/i386/debug_i386.c: when using a 64-bit userspace we need to use
RAX and so on, and we can ignore most segments except FS/GS, but
only the base address is useful.
---
i386/i386/debug_i386.c | 14 ++
1 file changed, 14 insertions(+)
diff --git a/i386/i386/debug_i386.c b/i386/
* device/ds_routines.c: enable interrupt registration and acknowledge
for x86_64. We can reuse the 32-bit mechanisms.
---
device/ds_routines.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/device/ds_routines.c b/device/ds_routines.c
index 1f0bacf4..ea880535 100
* i386/intel/pmap.c: add the check for LINUX_DEV; we could also check
for !__x86_64__, as this config would break ther kernel map by
removing the BIOS mem map, needed by the console and keyboard
drivers, but hopefully we won't need to enable Linux drivers on
x86_64.
---
i386/intel/pmap.c |
* i386/i386at/acpi_parse_apic.c: use vm_offset_t instead of uint32_t
for vm addresses
* x86_64/Makefrag.am: support --enable-apic
---
i386/i386at/acpi_parse_apic.c | 8
x86_64/Makefrag.am| 17 ++---
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a
* 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(-)
Il 21/05/23 21:17, Samuel Thibault ha scritto:
Luca Dariz, le dim. 21 mai 2023 10:57:57 +0200, a ecrit:
+#if defined(KERNEL) && defined(USER32)
+#define VM_MAX_ADDRESS (0xc000UL)
+#else /* defined(KERNEL) && defined(USER32) */
+#define VM_MAX_ADDRESS (0
* i386/i386/seg.h: use proper type for segment addresses. This is not
impacting any functionality on 64-bit, as segments limits are
ignored, but at least we silence a warning.
---
i386/i386/seg.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/i386/i386/seg.h b/i386/i386/
* i386/intel/pmap.c: switch to dynamic allocation of all the page tree
map levels for the user-space address range, using a separate kmem
cache for each level. This allows to extend the usable memory space
on x86_64 to use more than one L3 page for user space. The kernel
address map is left
* 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(-)
* x86_64/locore.S: fix PUSH_FSGS -> _ISR and always make room for
fsgsbase on a 64-bit kernel.
---
x86_64/locore.S | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/x86_64/locore.S b/x86_64/locore.S
index a782ec8a..d456b06b 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
Il 24/04/23 17:19, Sergey Bugaev ha scritto:
Resending without the attachment, because apparently the email did not
make it into the list archive so maybe it didn't get to you either;
and I'm too conscious about email just eating my letters without any
notice or indication since that one time. If
Hi Sergey,
Il 20/04/23 13:51, Sergey Bugaev ha scritto:
On Wed, Apr 19, 2023 at 11:52 PM Sergey Bugaev wrote:
We do reach the call to __thread_set_state (), but then it uses
__mig_memcpy (), which is just 'return memcpy (...)'. And (because of
the static build?), that memcpy () is the full real
Hi Flavio,
Il 20/04/23 04:04, Flávio Cruz ha scritto:
On Wed, Apr 19, 2023 at 3:47 PM Luca Dariz <mailto:l...@orpolo.org>> wrote:
* kern/exception.c: message fields need to be aligned to 8 bytes for a
64-bit userspace, so add the required padding if needed, as done by
While theoretically we could still use the same call gate as for
32-bit userspace, it doesn't seem very common, and gcc seems to not
encode properly the instruction. Instead we use syscall/sysret as
other kernels (e.g. XNU,Linux). This version still has some
limitations, but should be enough to sta
* x86_64/copy_user.c: use the correct user/kernel msg structure
---
x86_64/copy_user.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/x86_64/copy_user.c b/x86_64/copy_user.c
index b5084996..f76e44c9 100644
--- a/x86_64/copy_user.c
+++ b/x86_64/copy_user.c
@@ -430,7 +430,7
* kern/exception.c: message fields need to be aligned to 8 bytes for a
64-bit userspace, so add the required padding if needed, as done by
MIG.
---
kern/exception.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/kern/exception.c b/kern/exception.c
index 10435b5c..757f793e 100644
---
* i386/i386/i386asm.sym: add offsets for asm
* i386/i386/pcb.c: switch FSBASE/GSBASE on context switch and
implement accessors in thread setstatus/getstatus
* i386/i386/thread.h: add new state to thread saved state
* kern/thread.c: add i386_FSGS_BASE_STATE handler
* x86_64/locore.S: fix fs/gs han
* x86_64/locore.S: the faulty address is found in %rbp and not in
%rsi, so copy that in CR2
---
x86_64/locore.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86_64/locore.S b/x86_64/locore.S
index 47d9085c..ea5c71d6 100644
--- a/x86_64/locore.S
+++ b/x86_64/locore.S
@@ -12
While theoretically we could still use the same call gate as for
32-bit userspace, it doesn't seem very common, and gcc seems to not
encode properly the instruction. Instead we use syscall/sysret as
other kernels (e.g. XNU,Linux). This version still has some
limitations, but should be enough to sta
Il 02/03/23 14:14, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 02 mars 2023 09:20:15 +0100, a ecrit:
Il 02/03/23 09:00, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 02 mars 2023 08:55:38 +0100, a ecrit:
Il 01/03/23 21:18, Samuel Thibault ha scritto:
Luca Dariz, le mer. 01 mars 2023 18
Il 02/03/23 09:00, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 02 mars 2023 08:55:38 +0100, a ecrit:
Il 01/03/23 21:18, Samuel Thibault ha scritto:
Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
+asm volatile("wrmsr"
+ :
+ : "c
Il 01/03/23 21:18, Samuel Thibault ha scritto:
Luca Dariz, le mer. 01 mars 2023 18:40:37 +0100, a ecrit:
+asm volatile("wrmsr"
+ :
+ : "c" (regaddr), "a" (low), "d" (high)
+ : "memory" /* w
While theoretically we could still use the same call gate as for
32-bit userspace, it doesn't seem very common, and gcc seems to not
encode properly the instruction. Instead we use syscall/sysret as
other kernels (e.g. XNU,Linux). This version still has some
limitations, but should be enough to sta
Il 28/02/23 15:14, Sergey Bugaev ha scritto:
On Tue, Feb 28, 2023 at 4:26 PM Luca Dariz wrote:
+/* check if we need to place some arguments on the stack */
+_syscall64_args_stack:
+mov EXT(mach_trap_table)(%rax),%r10 /* get number of arguments */
+subq$6,%r10
Il 28/02/23 07:39, Sergey Bugaev ha scritto:
On Mon, Feb 27, 2023 at 11:46 PM Luca Dariz wrote:
+static inline void wrmsr(uint32_t regaddr, uint64_t value)
+{
+uint32_t low=(uint32_t)value, high=((uint32_t)(value >> 32));
I think it'd be more idiomatic in both GNU and Mach st
Il 27/02/23 23:02, Samuel Thibault ha scritto:
Luca Dariz, le lun. 27 févr. 2023 21:45:01 +0100, a ecrit:
diff --git a/i386/i386/ldt.h b/i386/i386/ldt.h
index b15f11a5..4490f99f 100644
--- a/i386/i386/ldt.h
+++ b/i386/i386/ldt.h
@@ -45,9 +45,14 @@
#define USER_SCALL 0x07
* i386/intel/pmap.c: remove #error and allow compilation, keeping a
reminder to fix the pmap module.
---
i386/intel/pmap.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index 302a60cb..40f672b5 100644
--- a/i386/intel/pmap.c
+++ b
* x86_64/copy_user.c: fix copyin/out, we already have a pointer to
user/kernel buffers
---
x86_64/copy_user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/x86_64/copy_user.c b/x86_64/copy_user.c
index dd9fe2d7..86d23525 100644
--- a/x86_64/copy_user.c
+++ b/x86_64/copy
1 - 100 of 193 matches
Mail list logo