Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation

2025-01-08 Thread Luca
Il 08/01/25 22:58, Diego Nieto Cid ha scritto: On Wed, Jan 08, 2025 at 10:25:41AM +0100, Luca wrote: Il 08/01/25 02:30, dnie...@gmail.com ha scritto: + +static char * features_edx[] = + { +"fpu", "vme", "de", "pse", "tsc", "msr",

Re: [RFC PATCH hurd] Add partial /proc/cpuinfo implementation

2025-01-08 Thread Luca
del_name + 10 * sizeof(unsigned int), (char *) &ecx, sizeof(unsigned int)); + memcpy(model_name + 11 * sizeof(unsigned int), (char *) &edx, sizeof(unsigned int)); +} + + fprintf(m, +"processor : 0\n" +"vendor_id : %s\n" +"cpu family : %d\n" +"model : %d\n" +"model name : %s\n" +"stepping: %d\n", +vendor, family, model, model_name, stepping); + + fprintf(m, "flags :"); + for (index = 0; index < 32; index++) +{ + if (features_edx[index] == NULL) +continue; + if (feature_edx & (1 << index)) +fprintf(m, " %s", features_edx[index]); +} + for (index = 0; index < 32; index++) +{ + if (features_ecx[index] == NULL) +continue; + if (feature_ecx & (1 << index)) +fprintf(m, " %s", features_ecx[index]); +} + + fprintf(m, "\n\n"); + +out: + fclose(m); + return err; +} maybe this can be already made arch-specific. Luca

[PATCH mig v2] header: add definitions for RPC presence and IDs

2025-01-06 Thread Luca Dariz
This allows to check at compilation time for some rpc (as done for example in glibc for thread_set/get_name() and host_page_size()). Also the IDs can be useful for testing purposes, or when assembling messages manually. --- header.c | 14 ++ mig_string.h | 1 + string.c | 11 +

[PATCH mig] header: add definitions for RPC presence and IDs

2025-01-05 Thread Luca Dariz
This allows to check at compilation time for some rpc (as done in glibc for thread_set/get_name() and host_page_size()). Also the IDs can be useful for testing purposes, or when assembling messages manually. --- header.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/header.c b/he

Re: [RFC] Implementing RLIMIT_AS

2024-12-20 Thread Luca
Il 20/12/24 02:54, Diego Nieto Cid ha scritto: On Thu, Dec 19, 2024 at 10:36:49PM +0100, Luca wrote: I see that some limits (e.g. RLIMIT_DATA) are managed in glibc instead of gnumach, maybe this could be a simpler way to add some minimal support? I guess that one might overcome these limits by

Re: [RFC] Implementing RLIMIT_AS

2024-12-20 Thread Luca
Il 19/12/24 23:54, Diego Nieto Cid ha scritto: On Thu, Dec 19, 2024 at 10:36:49PM +0100, Luca wrote: I tried a lower value, like 2GB, but some process is mapping 4GB at once during boot and it just hangs when the allocation fails. Which process is that? Its task name

Re: [RFC] Implementing RLIMIT_AS

2024-12-19 Thread Luca
quested size: %lu, hard limit: %lu\n", map->size, size, map->hard_limit); + return(KERN_NO_SPACE); + } + Beware of unsigned integer wrap, e.g. if size is very big (see [0] for example). Luca [0] https://wiki.sei.cmu.edu/confluence/display/c/INT30-C.+Ensure+that+unsigned+integer+operations+do+not+wrap

Re: [RFC PATCH Mach] Add a mach host operation which returns elapsed time since bootup

2024-12-18 Thread Luca
device that can be memory mapped, as done by the "time" device? Luca

Re: [PATCH gnumach v3 2/3] add tests for FLOAT/XFLOAT state

2024-11-04 Thread Luca Dariz
aster branch (as I'm doing currently)? Or are some debian patches needed for proper testing? Luca

Re: Unprivileged double fault with GDB and simple program written in assembly

2024-09-10 Thread Luca
Hi, Il 08/09/24 01:23, Samuel Thibault ha scritto: Hello, AIUI, the fix you submitted was meant to fix this? yes, at least to correctly decode the registers in the fault handler, I didn't look deeper yet. Luca

[PATCH gnumach v3 1/3] add xfloat thread state interface

2024-09-04 Thread Luca Dariz
* 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

[PATCH gnumach 3/3] x86_64: fix double fault handler

2024-09-04 Thread Luca Dariz
* 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

[PATCH gnumach v3 2/3] add tests for FLOAT/XFLOAT state

2024-09-04 Thread Luca Dariz
--- 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

Re: Unprivileged double fault with GDB and simple program written in assembly

2024-08-31 Thread Luca
h syscalls, but a double fault from some faulty program shouldn't trigger a panic without even root privileges. The kernel has no idea about unix users, AFAIK in userspace the difference is basically the access to some privileged mach ports, but this is implemented in glibc and the hurd servers. Luca

Re: [PATCH gnumach 2/3] add tests for FLOAT/XFLOAT state

2024-08-24 Thread Luca Dariz
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

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Luca Dariz
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

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Luca Dariz
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

Re: [PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-24 Thread Luca Dariz
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

[PATCH gnumach 3/3] add rpc interrupted test

2024-08-21 Thread Luca Dariz
* 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

[PATCH gnumach 2/3] add tests for FLOAT/XFLOAT state

2024-08-21 Thread Luca Dariz
--- 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

[PATCH v2 gnumach 1/3] add xfloat thread state interface

2024-08-21 Thread Luca Dariz
* 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

Re: [PATCH] add xfloat thread state interface

2024-08-17 Thread Luca Dariz
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

Re: [PATCH] add xfloat thread state interface

2024-08-05 Thread Luca Dariz
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

[PATCH] add xfloat thread state interface

2024-08-02 Thread Luca Dariz
* 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

[PATCH 2/2] tests/machmsg: check rx message size on different code paths

2024-06-11 Thread Luca Dariz
* 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 ++

[PATCH 1/2] x86_64: fix msg size forwarding in case it's not set by userspace

2024-06-11 Thread Luca Dariz
* 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

Re: [PATCH 1/2] RFC enhance tracing utilities

2024-03-09 Thread Luca Dariz
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

[PATCH 2/2] RFC: add kernel trace utilities

2024-03-09 Thread Luca Dariz
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

[PATCH 3/3] move x86 copy_user.[ch] to ipc/ and make it arch-indipendent

2024-03-09 Thread Luca Dariz
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

[PATCH 1/2] RFC enhance tracing utilities

2024-03-09 Thread Luca Dariz
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

[PATCH 1/3] x86_64: split SET_KERNEL_SEGMENTS() for NCPU > 1

2024-03-09 Thread Luca Dariz
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 @@ -

[PATCH 2/3] remove machine/machspl.h as it duplicates machine/spl.h

2024-03-09 Thread Luca Dariz
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

Re: Help with cross install

2024-01-12 Thread Luca
quot;noahci" to gnumach command line after "noide"; this should prevent gnumach from probing AHCI devices and then rumpdisk should be able to find them. Luca

[PATCH 02/11] add mach_host tests

2024-01-11 Thread Luca Dariz
--- 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 .

[PATCH 09/11] add raw mach_msg tests

2024-01-11 Thread Luca Dariz
--- 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

[PATCH 03/11] add gsync tests

2024-01-11 Thread Luca Dariz
--- 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 ---

[PATCH 06/11] add basic vm tests

2024-01-11 Thread Luca Dariz
--- 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 +

[PATCH 11/11] add basic thread tests

2024-01-11 Thread Luca Dariz
--- 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

[PATCH 05/11] adjust range when changing memory pageability

2024-01-11 Thread Luca Dariz
* 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

[PATCH 01/11] add basic user-space tests with qemu

2024-01-11 Thread Luca Dariz
* 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

[PATCH 10/11] add basic task tests

2024-01-11 Thread Luca Dariz
--- 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

[PATCH 07/11] add thread creation helper to tests

2024-01-11 Thread Luca Dariz
--- 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

[PATCH 08/11] add syscall tests

2024-01-11 Thread Luca Dariz
--- 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

[PATCH 04/11] add mach_port tests

2024-01-11 Thread Luca Dariz
--- 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

Re: [PATCH 03/14] add mach_host tests

2024-01-06 Thread Luca
Il 06/01/24 20:43, Sergey Bugaev ha scritto: On Sat, Jan 6, 2024 at 10:26 PM Luca wrote: Uhm, I still have an issue, although a bit different now: By the way, the exception is still the same (General Protection, which is usually forwarded to user space), but for a different reason, apparently

Re: [PATCH] news/2023-q4.mdwn: new qoth for q4 of 2023.

2024-01-06 Thread Luca
Il 06/01/24 21:20, Sergey Bugaev ha scritto: On Sat, Jan 6, 2024 at 10:47 PM jbra...@dismail.de wrote: +Luca Dariz worked on adding [[some simple GNUMach user-space tests I've never seen gnumach spelled like that (GNUMach), only GNU Mach or gnumach. Is that intentional? +Flavio

Re: [PATCH 03/14] add mach_host tests

2024-01-06 Thread Luca
Il 06/01/24 20:02, Sergey Bugaev ha scritto: On Sat, Jan 6, 2024 at 9:45 PM Samuel Thibault wrote: Luca, le sam. 06 janv. 2024 19:41:17 +0100, a ecrit: Il 29/12/23 15:14, Luca Dariz ha scritto: Il 29/12/23 14:44, Samuel Thibault ha scritto: Also, it would be useful to compile the tests

Re: [PATCH 03/14] add mach_host tests

2024-01-06 Thread Luca
Il 06/01/24 19:44, Samuel Thibault ha scritto: Luca, le sam. 06 janv. 2024 19:41:17 +0100, a ecrit: Il 29/12/23 15:14, Luca Dariz ha scritto: Il 29/12/23 14:44, Samuel Thibault ha scritto: Also, it would be useful to compile the tests with -ftrivial-auto-var-init=pattern so as to fill the

Re: [PATCH 03/14] add mach_host tests

2024-01-06 Thread Luca
Il 29/12/23 15:14, Luca Dariz ha scritto: Il 29/12/23 14:44, Samuel Thibault ha scritto: Also, it would be useful to compile the tests with -ftrivial-auto-var-init=pattern so as to fill the structures with random values before making the gnumach calls. with this option all tests fail on the

Re: [PATCH 11/14] add raw mach_msg tests

2024-01-06 Thread Luca Dariz
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

Re: [PATCH 08/14] add thread creation helper to tests

2024-01-06 Thread Luca Dariz
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

Re: [PATCH 07/14] add basic vm tests

2024-01-06 Thread Luca Dariz
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

Re: [PATCH 06/14] adjust range when changing memory pageabilityg

2024-01-06 Thread Luca Dariz
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

Re: [PATCH 05/14] add mach_port tests

2024-01-06 Thread Luca Dariz
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

Re: 64bit startup

2024-01-05 Thread Luca
userspace. I'm working on top of your gnumach patch for now. Luca

Re: 64bit startup

2024-01-05 Thread Luca
ead_fpregset (threads[i], ¬e.data.pr_fpreg); HTH Luca

Re: 64bit startup

2024-01-03 Thread Luca
e, but I've been building gdb and the hurd itself (for a fix for the crash server that I have in my queue). Luca

Re: aarch64-gnu (and Happy New Year!)

2024-01-01 Thread Luca
Il 01/01/24 14:51, Sergey Bugaev ha scritto: On Mon, Jan 1, 2024 at 4:02 PM Luca wrote: Hi Sergey, Hi Luca, Really great work! To work on gnumach we just need MIG and any armv8 compiler (also targeting GNU/Linux is fine), and it seems MIG works fine without adjustments? Maybe there could

Re: aarch64-gnu (and Happy New Year!)

2024-01-01 Thread Luca
ead states, context switch, irqs and userspace entry points (list by no means exhaustive). I actually have an armv8 server that would be handy for some development, so I might be able to help with something in the future. Luca

Re: [PATCH 04/14] add gsync tests

2023-12-29 Thread Luca Dariz
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

Re: [PATCH 03/14] add mach_host tests

2023-12-29 Thread Luca Dariz
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

Re: [PATCH 02/14] add basic user-space tests with qemu

2023-12-29 Thread Luca Dariz
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

Re: [PATCH 02/14] add basic user-space tests with qemu

2023-12-29 Thread Luca Dariz
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

[PATCH 14/14] add tests to make check

2023-12-28 Thread Luca Dariz
--- 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-

[PATCH 11/14] add raw mach_msg tests

2023-12-28 Thread Luca Dariz
--- 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 @@

[PATCH 12/14] add basic task tests

2023-12-28 Thread Luca Dariz
--- 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

[PATCH 13/14] add basic thread tests

2023-12-28 Thread Luca Dariz
--- 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 @@

[PATCH v2 00/14] add user tests to gnumach

2023-12-28 Thread Luca Dariz
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

[PATCH 03/14] add mach_host tests

2023-12-28 Thread Luca Dariz
--- 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

[PATCH 09/14] add syscall tests

2023-12-28 Thread Luca Dariz
--- 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.

[PATCH 07/14] add basic vm tests

2023-12-28 Thread Luca Dariz
--- 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

[PATCH 02/14] add basic user-space tests with qemu

2023-12-28 Thread Luca Dariz
* 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

[PATCH 06/14] adjust range when changing memory pageability

2023-12-28 Thread Luca Dariz
* 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

[PATCH 10/14] expose MACH_MSG_USER_ALIGNMENT for manually-built messages

2023-12-28 Thread Luca Dariz
--- 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_

[PATCH 08/14] add thread creation helper to tests

2023-12-28 Thread Luca Dariz
--- 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

[PATCH 04/14] add gsync tests

2023-12-28 Thread Luca Dariz
--- 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,

[PATCH 01/14] USER32: change default to disabled and make it a general option

2023-12-28 Thread Luca Dariz
* 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

[PATCH 05/14] add mach_port tests

2023-12-28 Thread Luca Dariz
--- 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

Re: [PATCH gnumach] x86_64: Support 8 byte inlined port rights to avoid message resizing.

2023-11-28 Thread Luca
, and would be also simpler than this change. Luca

Re: [RFC PATCH 1/2] add basic user-space tests with qemu

2023-10-28 Thread Luca Dariz
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

[RFC PATCH 2/2] add mach_host tests

2023-10-19 Thread Luca Dariz
--- 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/

[RFC PATCH 0/2] gnumach testing

2023-10-19 Thread Luca Dariz
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

[RFC PATCH 1/2] add basic user-space tests with qemu

2023-10-19 Thread Luca Dariz
* 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

Re: [PATCH] Updated the emacs open issues page.

2023-09-05 Thread Luca
='${exec-task}' -T typed '${root}' \ '$(fs-task=task-create)' module /boot/exec.static exec '$(exec-task=task-create)' boot } >8---- - once installed, you can configure a network interface and ssh into it as a 32-bit hurd virtual machine Probably there is a simpler way to use it, but I hope this helps :) I guess once the port is stabilized, it will be easier to have it running. Luca

Re: [RFC PATCH gnumach] percpu area using gs segment

2023-08-27 Thread Luca
r need it) supports using a specific segment base for a variable: https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/Named-Address-Spaces.html#x86-Named-Address-Spaces and https://kernel.org/doc/html/next/x86/x86_64/fsgs.html#compiler-support-for-fs-gs-based-addressing Luca

Re: [PATCH 1/3 gnumach] apic: Use cpuid to read the apic id for speed

2023-08-11 Thread Luca
than the others, and that might benefit from further optimizations? Luca

Re: 64bit startup

2023-08-10 Thread Luca
anyway for now with --allow-unauthenticated and --allow-insecure-repositories. Luca

Re: [PATCH 5/5] x86_64: remove unneeded segment selectors handling on full 64 bit

2023-08-09 Thread Luca Dariz
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 &=

gnumach kernel memory map (was: Re: 64bit startup)

2023-08-09 Thread Luca
e else. Any thoughts? I have probably overlooked some other issues, so please correct me if I'm wrong. Luca [0] https://gitlab.com/luckyd/gnumach/-/commit/f0564e8ed63b82b4e8b0342821c37f2461625438

Re: [PATCH gnumach] Update the 64bit RPC ABI to be simpler (v2)

2023-08-08 Thread luca
Il 09/08/23 03:09, Samuel Thibault ha scritto: Hello, So, is anybody against making this change? Hi, for me it's ok, I tried this patch together with the mig one and didn't see any issue so far. Luca

[PATCH v2] x86_64: install emergency handler for double fault

2023-07-29 Thread Luca Dariz
* 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_

[PATCH 3/5] x86_64: format pusha/popa macros for readability

2023-07-29 Thread Luca Dariz
--- 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

[PATCH 2/5] x86_64: disable V86 mode on full 64-bit configuration

2023-07-29 Thread Luca Dariz
* 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

[PATCH 4/5] x86_64: refactor segment register handling

2023-07-29 Thread Luca Dariz
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

[PATCH 5/5] x86_64: remove unneeded segment selectors handling on full 64 bit

2023-07-29 Thread Luca Dariz
* 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

[PATCH 1/5] x86_64: fix stack handling on recursive interrupts for USER32

2023-07-29 Thread Luca Dariz
* 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

Re: [RFC PATCH v4 1/2 hurd] libirqhelp: Add library

2023-07-07 Thread Luca
n error different from MACH_SEND_INVALID_DEST or MACH_RCV_TOO_LARGE, so the server loop will return with this error code. It's a bit hacky but I don't know if there is another way, since the demuxer return code seems ignored. Luca

Re: Recent patches break ACPI tables

2023-06-19 Thread Luca
hread_fn: assertion failed: (cpu->halted) Sending IPIs to APIC ID 1...Bail out! ERROR:../../accel/tcg/tcg-accel-ops-mttcg.c:110:mttcg_cpu_thread_fn: assertion failed: (cpu->halted) ===8<=== Luca

Re: Recent patches break ACPI tables

2023-06-19 Thread luca
this. I tried anticipating the call to machine_init() to be before vm_mem_bootstrap() (to have lapic initialized) but this triggers another assert. Any idea? Luca

Re: [PATCH 2/3] x86_64: install emergency handler for double fault

2023-06-19 Thread luca
hread (i.e. KTSS is loaded) when the next cpu is started. Luca

  1   2   3   >