[PATCH v2] pfinet: Add SIOCADDRT and SIOCDELRT equivalent iioctls

2022-08-27 Thread Damien Zammit
Adds ability to add and remove network routes for pfinet. Using the following replacement for , this patch still accesses network and cleans up options.c. #ifndef NET_ROUTE_H_ #define NET_ROUTE_H_ #include #include #include #define _IOT_srtentry _IOT (_IOTS(int), 3, _IOTS(short int), 2, 0, 0

[PATCH v3] pfinet: Add SIOCADDRT and SIOCDELRT equivalent iioctls

2022-08-29 Thread Damien Zammit
Using a new client side I was able to clean up the existing options.c in pfinet and add two new ioctls for adding/deleting network routes. #ifndef NET_ROUTE_H_ #define NET_ROUTE_H_ #include #include #include #define _IOT_ifrtreq _IOT (_IOTS(char), IFNAMSIZ, _IOTS(int), 10, 0, 0) /* move to

[PATCH hurd] defs: Fix typing of iioctl

2022-08-31 Thread Damien Zammit
After much digging this fixes the new routing ioctls --- hurd/iioctl.defs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hurd/iioctl.defs b/hurd/iioctl.defs index 6701d8ec7..c1007b2a6 100644 --- a/hurd/iioctl.defs +++ b/hurd/iioctl.defs @@ -41,7 +41,7 @@ type ifname_t = array

Network routing table for pfinet

2022-08-31 Thread Damien Zammit
This patchset exposes a new /proc/route file containing the live routing table for pfinet on the procfs server. It does this by using a new RPC from pfinet to get the table. It also causes pfinet to dump its initial routing table at start up for debugging purposes.

[PATCH 1/3] pfinet: Dump initial routing table at start up

2022-08-31 Thread Damien Zammit
--- pfinet/iioctl-ops.c | 21 + pfinet/linux-src/net/ipv4/fib_hash.c | 6 -- pfinet/linux-src/net/ipv4/fib_semantics.c | 4 pfinet/options.c | 8 pfinet/pfinet.h | 4 +--- 5 file

[PATCH 2/3] pfinet: New RPC S_pfinet_getroutes to get routing table

2022-08-31 Thread Damien Zammit
--- hurd/pfinet.defs| 10 pfinet/pfinet-ops.c | 56 + 2 files changed, 66 insertions(+) diff --git a/hurd/pfinet.defs b/hurd/pfinet.defs index ec0b03e34..a6000142e 100644 --- a/hurd/pfinet.defs +++ b/hurd/pfinet.defs @@ -37,3 +37,13 @@ rout

[PATCH 3/3] procfs: Populate /proc/route with network routes

2022-08-31 Thread Damien Zammit
--- procfs/Makefile | 2 +- procfs/rootdir.c | 43 +++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/procfs/Makefile b/procfs/Makefile index 13ee026c4..d32328d28 100644 --- a/procfs/Makefile +++ b/procfs/Makefile @@ -21,7 +21,7 @@ makemode

Re: [PATCH 1/3] pfinet: Dump initial routing table at start up

2022-08-31 Thread Damien Zammit
Hi, > Damien Zammit, le mer. 31 août 2022 14:37:23 +, a ecrit: >> --- >> pfinet/iioctl-ops.c | 21 + >> pfinet/linux-src/net/ipv4/fib_hash.c | 6 -- >> pfinet/linux-src/net/ipv4/fib_semantics.c |

Re: [PATCH 2/3] pfinet: New RPC S_pfinet_getroutes to get routing table

2022-08-31 Thread Damien Zammit
Hi, On 1/9/22 5:45 am, Samuel Thibault wrote: > Ah, you are just dumping the routing table in ascii format? I don't > think we want that, and rather get a series of route structures. procfs > can then do the ascii rendering. OK, I didn't think of that. But my code works and is proof of concept.

[PATCH v2 1/2] Add new RPC for pfinet network routes

2022-09-02 Thread Damien Zammit
I had to add some code to linux-src (otherwise reimplement tons of structs). --- hurd/pfinet.defs | 9 +++ pfinet/iioctl-ops.c | 1 + pfinet/linux-src/include/net/ip_fib.h | 2 + pfinet/linux-src/net/ipv4/fib_hash.c | 84 +++ pfin

[PATCH v2 2/2] procfs: Populate /proc/route with network routes

2022-09-02 Thread Damien Zammit
This exposes network routing table on /proc/route --- procfs/Makefile | 2 +- procfs/rootdir.c | 74 2 files changed, 75 insertions(+), 1 deletion(-) diff --git a/procfs/Makefile b/procfs/Makefile index 13ee026c4..d32328d28 100644 --- a/procfs/M

[PATCH 1/2] acpi: Link translator to libacpica and provide RPCs

2022-09-02 Thread Damien Zammit
Provides two new acpi RPCs to sleep the machine and to get the irq of any pci device. ACPI mode is enabled by default when the translator is started. NB: Merging this commit means libacpica is a build dep. --- acpi/Makefile | 19 +++-- acpi/acpi-ops.c | 83 +

[PATCH 2/2] shutdown: Use new acpi RPC to halt machine, clean up

2022-09-02 Thread Damien Zammit
This allows clean shutdown of all modern x86 machines (not just qemu) by using the acpi translator to call into libacpica code. --- shutdown/Makefile| 2 +- shutdown/acpi_shutdown.c | 66 shutdown/acpi_shutdown.h | 18 --- shutdown/shutdown

Re: Freeze booting from upstream gnumach

2022-09-02 Thread Damien Zammit
On 3/9/22 1:26 am, Almudena Garcia wrote: > Hi: > > I've just compiled gnumach from upstream sources, and I noticed that there > are a freeze in the booting, just in the pci-arbitrer starting. > > I attach a screenshot with the problem. > > Could you check this? > Thanks in advance I saw this f

Introduction of libacpica to get pci irqs and shutdown

2022-09-03 Thread Damien Zammit
Hi! This patch series has been tested to boot a rumpdisk and fetch the PCI IRQs of disk controllers from acpi.static translator via bootstrapping acpi -> pci -> rumpdisk -> ext2fs -> exec. It also cleanly shuts down the machine by sending an RPC to acpi to call the new shutdown method inside li

[PATCH 2/5] shutdown: Use new acpi RPC to halt machine, clean up

2022-09-03 Thread Damien Zammit
This allows clean shutdown of all modern x86 machines (not just qemu) by using the acpi translator to call into libacpica code. --- shutdown/Makefile| 2 +- shutdown/acpi_shutdown.c | 66 shutdown/acpi_shutdown.h | 18 --- shutdown/shutdown

[PATCH 1/5] acpi: Link translator to libacpica and provide RPCs

2022-09-03 Thread Damien Zammit
Provides two new acpi RPCs to sleep the machine and to get the irq of any pci device. ACPI mode is enabled by default when the translator is started. NB: Merging this commit means libacpica is a build dep. --- acpi/Makefile | 19 +++-- acpi/acpi-ops.c | 83 +

[PATCH 4/5] acpi: Remove references to /dev/mem

2022-09-03 Thread Damien Zammit
--- acpi/acpi.c | 109 1 file changed, 34 insertions(+), 75 deletions(-) diff --git a/acpi/acpi.c b/acpi/acpi.c index 9827232a..dd32d60f 100644 --- a/acpi/acpi.c +++ b/acpi/acpi.c @@ -30,37 +30,13 @@ #include "myacpi.h" -int -mmap_phys_acpi_

[PATCH 3/5] acpi: Convert translator to an emulated mach device

2022-09-03 Thread Damien Zammit
--- acpi/Makefile | 12 +-- acpi/acpifs.c | 34 +--- acpi/acpifs.h | 6 +- acpi/main.c| 206 +++-- acpi/options.c | 20 + acpi/options.h | 8 ++ 6 files changed, 243 insertions(+), 43 deletions(-) diff --git a/acpi/Makefile b/acpi/

[PATCH 5/5 rumpkernel] pci-userspace: Add acpi lookup of irqs

2022-09-03 Thread Damien Zammit
This depends on having installed. It will now fail to run if acpi translator is not running as it needs the actual pci irq. --- debian/patches/acpi.diff | 74 debian/patches/series| 1 + 2 files changed, 75 insertions(+) create mode 100644 debian/p

Re: Introduction of libacpica to get pci irqs and shutdown

2022-09-03 Thread Damien Zammit
Hi On 4/9/22 1:47 pm, Damien Zammit wrote:> This patch series has been tested to boot a rumpdisk > and fetch the PCI IRQs of disk controllers from acpi.static translator > via bootstrapping acpi -> pci -> rumpdisk -> ext2fs -> exec. On native hardware, acpi translator fail

Re: [PATCH 1/5] acpi: Link translator to libacpica and provide RPCs

2022-09-07 Thread Damien Zammit
Hi Samuel, On 6/9/22 8:47 am, Samuel Thibault wrote: >> >> -#include "acpi.h" >> +#include "myacpi.h" > > Aren't the libacpi headers in acpi/acpi.h and thus no conflict? Yes, but -I../.. seems to take precedence over /usr/include therefore the compiler discovers ../../acpi/acpi.h instead of /us

Re: [PATCH 3/5] acpi: Convert translator to an emulated mach device

2022-09-07 Thread Damien Zammit
Hi Samuel, On 6/9/22 9:05 am, Samuel Thibault wrote: > machdev_trivfs_server can probably be split into two functions, so that > one can run the initialization part sequentially in the main thread, > then initialize the rest, and then only start the libmachdev demuxer in > another thread. I can f

Re: [PATCH 3/5] acpi: Convert translator to an emulated mach device

2022-09-07 Thread Damien Zammit
On 8/9/22 4:11 pm, Samuel Thibault wrote: > Damien Zammit, le jeu. 08 sept. 2022 05:42:43 +, a ecrit: >> On 6/9/22 9:05 am, Samuel Thibault wrote: >>> machdev_trivfs_server can probably be split into two functions, so that >>> one can run the initialization part sequ

[PATCH] pci-arbiter: Fix type of printf param

2022-09-08 Thread Damien Zammit
--- pci-arbiter/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pci-arbiter/options.c b/pci-arbiter/options.c index 73f74ca3..e0455f41 100644 --- a/pci-arbiter/options.c +++ b/pci-arbiter/options.c @@ -382,7 +382,7 @@ netfs_append_args (char **argz, size_t * argz_len)

[PATCH] machdev, pci-arbiter, rumpdisk: Fix race condition in bootstrap

2022-09-08 Thread Damien Zammit
This fixes a known race condition in bootstrapping by separating the fsys_startup call from the server demuxer loop into two separate functions that the caller can decide when to call. --- libmachdev/machdev.h | 3 ++- libmachdev/trivfs_server.c | 18 -- pci-arbiter/main.c

[PATCH v3 1/2] Add new RPC for pfinet network routes

2022-09-09 Thread Damien Zammit
--- hurd/pfinet.defs | 9 +++ pfinet/iioctl-ops.c | 1 + pfinet/linux-src/include/net/ip_fib.h | 2 + pfinet/linux-src/net/ipv4/fib_hash.c | 80 pfinet/pfinet-ops.c | 88 ++- pfinet/pfinet

[PATCH v3 2/2] procfs: Populate /proc/route with network routes

2022-09-09 Thread Damien Zammit
This requires the new client side to be installed. --- procfs/Makefile | 2 +- procfs/rootdir.c | 78 2 files changed, 79 insertions(+), 1 deletion(-) diff --git a/procfs/Makefile b/procfs/Makefile index 13ee026c..d32328d2 100644 --- a/procfs/M

Incoming patches to follow

2022-09-09 Thread Damien Zammit
Hi Samuel, Thank you for reviewing my patches. I want to let you know what I have ready for review next, as I have 4 patch sets in the pipeline: The network routing is completed, (see [PATCH v3 1+2]). (I did not use inet_ntop because inet_ntoa is also thread safe) Machdev race condition in boot

Re: Debian GNU/Hurd takes forever to shut down

2022-09-09 Thread Damien Zammit
Hi, On 9/9/22 1:08 am, Saniya Maheshwari wrote: > INIT: Switching to runlevel: 1 > INIT: No inittab.d directory found > INIT: Sending processes configured via /etc/inittab the TERM signal > Using makefile-style concurrent boot in runlevel 1. > Stopping enhanced syslogd: rsyslogd. > Asking all rema

[PATCH v2 0/4] ACPI as a bootstrap translator

2022-09-12 Thread Damien Zammit
Hi, This patchset addresses all the issues raised the first time around. I tested it to boot a rump disk and shut down cleanly in qemu. I had to patch rumpkernel as before, but the rumpkernel patches can be separate to this, as we don't have to hard switch to using ACPI for irqs. I have another p

[PATCH v2 2/4] shutdown: Use new acpi RPC to halt machine, clean up

2022-09-12 Thread Damien Zammit
This allows clean shutdown of all modern x86 machines (not just qemu) by using the acpi translator to call into libacpica code. --- shutdown/Makefile| 2 +- shutdown/acpi_shutdown.c | 66 shutdown/acpi_shutdown.h | 18 --- shutdown/shutdown

[PATCH v2 3/4] acpi: Convert translator to an emulated mach device

2022-09-12 Thread Damien Zammit
This makes acpi usable as a bootstrap translator. --- acpi/Makefile | 6 +- acpi/acpifs.c | 37 +++ acpi/acpifs.h | 6 +- acpi/main.c| 172 ++--- acpi/options.c | 20 ++ acpi/options.h | 8 +++ 6 files changed, 225 insertions(+

[PATCH v2 4/4] acpi: Remove references to /dev/mem

2022-09-12 Thread Damien Zammit
--- acpi/acpi.c | 109 1 file changed, 34 insertions(+), 75 deletions(-) diff --git a/acpi/acpi.c b/acpi/acpi.c index 9827232a..dd32d60f 100644 --- a/acpi/acpi.c +++ b/acpi/acpi.c @@ -30,37 +30,13 @@ #include "myacpi.h" -int -mmap_phys_acpi_

[PATCH v2 1/4] acpi: Link translator to libacpica and provide RPCs

2022-09-12 Thread Damien Zammit
Provides two new acpi RPCs to sleep the machine and to get the irq of any pci device. ACPI mode is enabled by default when the translator is started. NB: Merging this commit means libacpica is a build dep. --- Makefile | 5 ++- acpi/Makefile | 13 -- acpi/acpi-o

[PATCH v3 1/1] acpi: Convert translator to an emulated mach device

2022-09-19 Thread Damien Zammit
This makes acpi usable as a bootstrap translator. --- acpi/Makefile | 6 +- acpi/acpifs.c | 37 acpi/acpifs.h | 6 +- acpi/main.c| 155 + acpi/options.c | 20 +++ acpi/options.h | 8 +++ 6 files changed, 207 insertions

[PATCH v4 1/1] procfs: Populate /proc/route with network routes

2022-09-19 Thread Damien Zammit
--- procfs/Makefile | 2 +- procfs/rootdir.c | 77 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/procfs/Makefile b/procfs/Makefile index 13ee026c..d32328d2 100644 --- a/procfs/Makefile +++ b/procfs/Makefile @@ -21,7 +21,7 @@ makem

[PATCH] libirqhelp: user interrupt handler helper library

2022-09-19 Thread Damien Zammit
This provides a new helper lib for registering interrupt handlers in userspace. ( -1, bus, dev, fun, ...): will look up gsi from ACPI (gsi, -1, -1, -1, ...): will use gsi and ignore pci commands I haven't been able to test this yet, but hope to introduce it into rumpkernel(pci-userspace) and l

Re: [PATCH v3] pfinet: Add SIOCADDRT and SIOCDELRT equivalent iioctls

2022-09-20 Thread Damien Zammit
> Applied, thanks! > > Damien Zammit, le lun. 29 août 2022 10:30:04 +, a ecrit: >> Using a new client side >> I was able to clean up the existing options.c in pfinet >> and add two new ioctls for adding/deleting network routes. >> >> #ifndef NET_ROUTE_H_ &g

[PATCH] lwip: Add missing stub

2022-09-21 Thread Damien Zammit
--- lwip/pfinet-ops.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/lwip/pfinet-ops.c b/lwip/pfinet-ops.c index 1af2a3fe..5be85879 100644 --- a/lwip/pfinet-ops.c +++ b/lwip/pfinet-ops.c @@ -113,3 +113,13 @@ lwip_S_pfinet_siocgifconf (io_t port, return 0; } + +error_t +lwip_S

[PATCH] rioctl: Use r not i group ioctl for SIOCADDRT/SIOCDELRT

2022-09-21 Thread Damien Zammit
--- hurd/iioctl.defs| 12 ++ hurd/rioctl.defs| 56 + lwip/Makefile | 3 ++- lwip/iioctl-ops.c | 5 ++-- lwip/main.c | 2 ++ lwip/mig-mutate.h | 1 + pfinet/Makefile | 3 ++- pfinet/iioctl-ops.c | 4 ++-- pfinet

[PATCH v2 1/2] libirqhelp: user interrupt handler helper library

2022-09-21 Thread Damien Zammit
This provides a new helper lib for registering interrupt handlers in userspace. ( -1, bus, dev, fun, ...): will look up gsi from ACPI (gsi, -1, -1, -1, ...): will use gsi and ignore pci commands --- Makefile | 4 + libirqhelp/Makefile | 28 libirqhelp/irqhelp.c | 376

[PATCH v2 2/2] ddekit: Use libirqhelp

2022-09-21 Thread Damien Zammit
This makes ddekit depend on irqhelp and cleans up the irq registration. TESTED: using this change and recompiling netdde, I was able to remotely access the vm over ssh. --- libddekit/Makefile| 2 +- libddekit/interrupt.c | 231 -- 2 files changed, 19

[PATCH v3 1/2] libirqhelp: user interrupt handler helper library

2022-09-24 Thread Damien Zammit
This provides a new helper lib for registering interrupt handlers in userspace, libirqhelp. libirqhelp does not depend on libpciaccess. ( -1, bus, dev, fun, ...): will look up gsi from ACPI (gsi, -1, -1, -1, ...): will use given gsi --- Makefile | 1 + libirqhelp/Makefile | 2

[PATCH v3 0/2]: libirqhelp + libddekit

2022-09-24 Thread Damien Zammit
Hi, RE: libirqhelp Since the internal irq demuxer for the mach_msg_server has no opaque pointer passed in, there is no way to expose the demuxer function in a sane way. Thus, I have embedded it in a wrapper with a struct irqhelp* passed in, and provided hooks for the caller to override if it ne

[PATCH v3 2/2] ddekit: Use libirqhelp for interrupt registration

2022-09-24 Thread Damien Zammit
Using libirqhelp and recompiling netdde with new libddekit, I was able to boot and transfer a 2470MB file at an average of 2.3MB/s over scp with no visible warnings on console with matching md5sums on each end. --- libddekit/Makefile| 2 +- libddekit/interrupt.c | 231 --

[PATCH grub] hurdhelper: Add helper to load GNU/Hurd multiboot modules

2022-09-30 Thread Damien Zammit
commands. Signed-off-by: Damien Zammit --- grub-core/Makefile.core.def | 8 ++ grub-core/loader/hurdhelper.c | 190 ++ grub-core/loader/multiboot.c | 6 ++ include/grub/multiboot.h | 1 + include/grub/multiboot2.h | 1 + 5 files changed, 206

[PATCH 01/12] kdb: Fix TODO for multiprocessor

2022-10-25 Thread Damien Zammit
--- ddb/db_mp.h | 1 + i386/i386/db_interface.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ddb/db_mp.h b/ddb/db_mp.h index b0d221ea..e32371d4 100644 --- a/ddb/db_mp.h +++ b/ddb/db_mp.h @@ -22,6 +22,7 @@ void remote_db(void); void lock_db(void); void

[PATCH 04/12] acpi: Add lapic_addr

2022-10-25 Thread Damien Zammit
--- i386/i386at/acpi_parse_apic.c | 2 ++ i386/i386at/acpi_parse_apic.h | 1 + 2 files changed, 3 insertions(+) diff --git a/i386/i386at/acpi_parse_apic.c b/i386/i386at/acpi_parse_apic.c index 3cf6f042..712de689 100644 --- a/i386/i386at/acpi_parse_apic.c +++ b/i386/i386at/acpi_parse_apic.c @@ -33

[PATCH 07/12] i386/pit: Tune delays

2022-10-25 Thread Damien Zammit
- Add half a clock tick for more accuracy - Start the pit countdown during pit_sleep - Add pit_mdelay and pit_udelay functions --- i386/i386/pit.c | 24 i386/i386/pit.h | 2 ++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/i386/i386/pit.c b/i386/i386/pit

[PATCH 10/12] Add cpu_number and cpuboot

2022-10-25 Thread Damien Zammit
--- i386/i386/cpu_number.c | 37 ++ i386/i386/cpuboot.S| 157 + 2 files changed, 194 insertions(+) create mode 100644 i386/i386/cpu_number.c create mode 100644 i386/i386/cpuboot.S diff --git a/i386/i386/cpu_number.c b/i386/i386/cpu_number.c n

[PATCH 06/12] linux drivers: Don't depend on curr_pic_mask for APIC

2022-10-25 Thread Damien Zammit
--- linux/dev/arch/i386/kernel/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index 656c1470..67feea84 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux/dev/arch/i386/kernel/irq.c @@ -363,7 +

[PATCH 11/12] i386: Fix race in multiprocessor ktss

2022-10-25 Thread Damien Zammit
--- i386/i386/io_perm.c | 5 --- i386/i386/pcb.c | 79 - 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/i386/i386/io_perm.c b/i386/i386/io_perm.c index 6db60f73..d9c646fe 100644 --- a/i386/i386/io_perm.c +++ b/i386/i386/io_perm.c @

[PATCH 12/12] i386: Refactor int stacks to be per cpu for SMP

2022-10-25 Thread Damien Zammit
--- i386/Makefrag.am | 6 + i386/i386/cpu_number.h | 31 ++- i386/i386/cswitch.S | 4 +- i386/i386/locore.S | 48 ++-- i386/i386/mp_desc.c | 366 +-- i386/i386/mp_desc.h | 9 +- i386/

[PATCH 08/12] i386: Add AP variants of descriptor tables

2022-10-25 Thread Damien Zammit
--- i386/i386/gdt.c | 63 ++--- i386/i386/gdt.h | 1 + i386/i386/idt-gen.h | 4 +++ i386/i386/idt.c | 40 -- i386/i386/ktss.c| 36 +++ i386/i386/ktss.h| 1 + i386/i386/ldt

[PATCH 0/12 - gnumach] SMP almost working!

2022-10-25 Thread Damien Zammit
This patch series is based on Almu's work on SMP, with additional work by me and refactored for upstream. My goal is to have --enable-ncpus=X and --{enable/disable}-apic working with X >= 1. That means PIC should still work with SMP on i386. With --enable-ncpus=1 and --disable-apic it still work

[PATCH 05/12] linux: Reduce worst case wait to 10 seconds for disks

2022-10-25 Thread Damien Zammit
--- linux/src/drivers/block/ide.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/src/drivers/block/ide.h b/linux/src/drivers/block/ide.h index 28e371bf..7630be2c 100644 --- a/linux/src/drivers/block/ide.h +++ b/linux/src/drivers/block/ide.h @@ -160,7 +160,7 @@ typedef un

[PATCH 02/12] kern/startup: Disable interrupts before starting APs

2022-10-25 Thread Damien Zammit
--- kern/startup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kern/startup.c b/kern/startup.c index 1f873192..499ef0f1 100644 --- a/kern/startup.c +++ b/kern/startup.c @@ -242,6 +242,7 @@ void start_kernel_threads(void) /* * Allow other CPUs to run. */ +

[PATCH 09/12] i386: Fix lapic and ioapic for smp

2022-10-25 Thread Damien Zammit
--- i386/i386/apic.c | 91 +++ i386/i386/apic.h | 110 +-- i386/i386/smp.c | 88 +- i386/i386/smp.h | 7 +++ i386/i386at/ioapic.c | 103

[PATCH 03/12] bios32: Use phystokv() on low bios addresses

2022-10-25 Thread Damien Zammit
--- linux/src/arch/i386/kernel/bios32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/src/arch/i386/kernel/bios32.c b/linux/src/arch/i386/kernel/bios32.c index c10cc0c0..71cc3f98 100644 --- a/linux/src/arch/i386/kernel/bios32.c +++ b/linux/src/arch/i386/kernel/bios

Re: [PATCH 0/12 - gnumach] SMP almost working!

2022-10-25 Thread Damien Zammit
Hi Almu! On 25/10/22 10:14 pm, Almudena Garcia wrote: > Are you already implemented startup IPI cicle? I was stucked raising it, > because the AP keep freezed after load GDT in gdt_init() Yes, I implemented new functions for setting gdt for APs (patch 8) and see patch 9 for startup IPI sequence

Re: [PATCH 09/12] i386: Fix lapic and ioapic for smp

2022-10-25 Thread Damien Zammit
Hi, On 26/10/22 10:05 am, Samuel Thibault wrote: > Damien Zammit, le mar. 25 oct. 2022 10:56:20 +, a ecrit: >> +/* Grateful to trasterlabs for this snippet */ > > What is the copyright of this code? Almu, do you have this info? > Are these delays specified by Intel or s

Re: [PATCH 05/12] linux: Reduce worst case wait to 10 seconds for disks

2022-10-25 Thread Damien Zammit
On 26/10/22 9:03 am, Samuel Thibault wrote: > Why? > > If something is becoming so bad that it ends up waiting for that long, > there's something to fix, not to paper over it. Well, qemu has a cdrom drive by default and you cant remove it apparently. So my vm keeps probing the cdrom and failing in

[PATCH v2 0/4 - gnumach] SMP almost working!

2022-11-11 Thread Damien Zammit
Hi, This patchset applies to master and has been tested not to break --{enable,disable}-kdb --disable-pae --disable-apic while getting closer to a working SMP version. I did not test all patches in isolation, only the combination of 4. In particular, it adds separate interrupt stacks per cpu, de

[PATCH 1/4] i386: Add AP variants of descriptor tables

2022-11-11 Thread Damien Zammit
--- i386/i386/apic.c| 6 ++ i386/i386/gdt.c | 47 ++--- i386/i386/gdt.h | 1 + i386/i386/i386asm.sym | 1 + i386/i386/idt-gen.h | 4 ++-- i386/i386/idt.c | 25 -- i386/i386/ktss.c| 30

[PATCH 2/4] i386: Fix lapic and ioapic for smp

2022-11-11 Thread Damien Zammit
--- i386/i386/apic.c | 85 + i386/i386/apic.h | 110 +-- i386/i386/smp.c | 89 +- i386/i386/smp.h | 7 +++ i386/i386at/ioapic.c | 103 --

[PATCH 4/4] i386: Refactor int stacks to be per cpu for SMP

2022-11-11 Thread Damien Zammit
--- i386/Makefrag.am | 6 + i386/i386/cpu_number.h | 31 +++- i386/i386/cswitch.S | 6 +- i386/i386/locore.S | 31 ++-- i386/i386/mp_desc.c | 281 ++- i386/i386/mp_desc.h | 9 +- i386

[PATCH 3/4] Add cpu_number and cpuboot

2022-11-11 Thread Damien Zammit
--- i386/i386/cpu_number.c | 37 ++ i386/i386/cpuboot.S| 164 + i386/i386at/boothdr.S | 2 +- 3 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 i386/i386/cpu_number.c create mode 100644 i386/i386/cpuboot.S diff --git a/i

[PATCH rumpkernel] pci-userspace: Add acpi lookup of irqs with fallback

2023-01-14 Thread Damien Zammit
This adds support for looking up IRQ numbers via hurd's acpi translator. It falls back to the existing IRQ number if acpi cannot provide it. --- debian/patches/acpi.diff | 76 debian/patches/series| 1 + 2 files changed, 77 insertions(+) create mode

[PATCH v2 rumpkernel] pci-userspace: Add acpi lookup of irqs with fallback

2023-01-17 Thread Damien Zammit
--- debian/patches/acpi.diff | 78 debian/patches/series| 1 + 2 files changed, 79 insertions(+) create mode 100644 debian/patches/acpi.diff diff --git a/debian/patches/acpi.diff b/debian/patches/acpi.diff new file mode 100644 index 0..3ee6d2

[PATCH 1/4] i386/apic: Add ifdefs for APIC for mask/unmask irqs

2023-01-21 Thread Damien Zammit
This prepares for --enable-ncpus=2 with --disable-apic option --- i386/i386/apic.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i386/i386/apic.h b/i386/i386/apic.h index 10c83c01..0bb1bd73 100644 --- a/i386/i386/apic.h +++ b/i386/i386/apic.h @@ -207,6 +207,7 @@ extern volatile ApicLocalU

[PATCH 2/4] i386: Add AP variants of descriptor tables

2023-01-21 Thread Damien Zammit
--- i386/i386/apic.c| 6 ++ i386/i386/gdt.c | 47 ++--- i386/i386/gdt.h | 1 + i386/i386/i386asm.sym | 1 + i386/i386/idt-gen.h | 4 ++-- i386/i386/idt.c | 25 -- i386/i386/ktss.c| 30

[PATCH 0/4] gnumach smp preparation

2023-01-21 Thread Damien Zammit
This patch series has been tested on each commit to not break PIC version without SMP, but refactors some of the SMP code to prepare for another patch series that will add SMP support. Damien

[PATCH 4/4] Add cpu_number and cpuboot

2023-01-21 Thread Damien Zammit
--- i386/i386/cpu_number.c | 37 ++ i386/i386/cpuboot.S| 164 + 2 files changed, 201 insertions(+) create mode 100644 i386/i386/cpu_number.c create mode 100644 i386/i386/cpuboot.S diff --git a/i386/i386/cpu_number.c b/i386/i386/cpu_number.c n

[PATCH 3/4] i386: Fix lapic and ioapic for smp

2023-01-21 Thread Damien Zammit
--- i386/i386/apic.c | 87 ++ i386/i386/apic.h | 110 +-- i386/i386/smp.c | 89 +- i386/i386/smp.h | 7 +++ i386/i386at/ioapic.c | 103 -

[PATCH 00/12 gnumach] Progress on SMP with N cpus

2023-01-31 Thread Damien Zammit
This gets us closer to a working SMP kernel without breaking our non-SMP mode. What was tested? - kdb, apic, ncpus=8 with -smp 1 (boots slow) - kdb, apic, ncpus=8 with -smp 2 (hangs) - kdb, apic, ncpus=8 with -smp 4 (hangs) - kdb, apic, ncpus=8 with -smp 6 (hangs) - (no options) with -smp 1

[PATCH 01/12 gnumach] i386: Fix lapic and ioapic for smp

2023-01-31 Thread Damien Zammit
Also-by: Almudena Garcia --- i386/i386/apic.c | 87 ++--- i386/i386/apic.h | 114 --- i386/i386/smp.c | 89 - i386/i386/smp.h | 7 +++ i386/i386at/ioapic.c | 97 ++---

[PATCH 02/12 gnumach] Add cpu_number and cpuboot

2023-01-31 Thread Damien Zammit
I addressed most of the previous review. MSRs are easier to set in asm so I have left it in. --- i386/i386/cpu_number.c | 33 + i386/i386/cpuboot.S| 164 + 2 files changed, 197 insertions(+) create mode 100644 i386/i386/cpu_number.c create mo

[PATCH 03/12 gnumach] Print warning on bad cpu numbering and assume BSP

2023-01-31 Thread Damien Zammit
--- i386/i386/apic.c | 5 + i386/i386/cpu_number.c | 16 +--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/i386/i386/apic.c b/i386/i386/apic.c index e53d4749..891ce288 100644 --- a/i386/i386/apic.c +++ b/i386/i386/apic.c @@ -278,6 +278,11 @@ lapic_enable(v

[PATCH 04/12 gnumach] locore: Fix int stack check

2023-01-31 Thread Damien Zammit
TODO: Return kernel_id via lookup table, not apic_id --- i386/i386/cpu_number.h | 7 +++ i386/i386/locore.S | 15 +-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/i386/i386/cpu_number.h b/i386/i386/cpu_number.h index 9aef6370..a6dd47d6 100644 --- a/i386/i38

[PATCH 05/12 gnumach] interrupt: Send EOI before handling update interrupt

2023-01-31 Thread Damien Zammit
--- i386/i386at/interrupt.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/i386at/interrupt.S b/i386/i386at/interrupt.S index 9f1883ac..1103b1c8 100644 --- a/i386/i386at/interrupt.S +++ b/i386/i386at/interrupt.S @@ -122,8 +122,8 @@ _no_eoi: ret _call_single: +

[PATCH 06/12 gnumach] linux: Skip updating jiffies on AP timer

2023-01-31 Thread Damien Zammit
--- linux/dev/kernel/sched.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/dev/kernel/sched.c b/linux/dev/kernel/sched.c index 2a9eeb3f..f9c52d1e 100644 --- a/linux/dev/kernel/sched.c +++ b/linux/dev/kernel/sched.c @@ -616,6 +616,9 @@ int linux_timer_print = 0; void linux_timer_in

[PATCH 07/12 gnumach] Always use directed EOI and disable focus

2023-01-31 Thread Damien Zammit
--- i386/i386/apic.c | 4 +++- i386/i386at/ioapic.c | 9 - 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/i386/i386/apic.c b/i386/i386/apic.c index 891ce288..ff7ba3e2 100644 --- a/i386/i386/apic.c +++ b/i386/i386/apic.c @@ -304,7 +304,9 @@ lapic_enable(void) /* E

[PATCH 08/12 gnumach] smp: Deassert IPI 251 as part of sequence

2023-01-31 Thread Damien Zammit
--- i386/i386/smp.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i386/i386/smp.c b/i386/i386/smp.c index c351efaa..acf69d21 100644 --- a/i386/i386/smp.c +++ b/i386/i386/smp.c @@ -60,7 +60,11 @@ void smp_pmap_update(unsigned apic_id) pause_memory; } while(l

[PATCH 09/12 gnumach] i386: Refactor int stacks for SMP - shared temp pmap

2023-01-31 Thread Damien Zammit
Also-by: Almudena Garcia --- i386/i386/cpu_number.h | 15 +- i386/i386/cswitch.S | 6 +- i386/i386/i386asm.sym| 3 + i386/i386/locore.S | 4 +- i386/i386/mp_desc.c | 227 ++- i386/i386/mp_desc.h

[PATCH 10/12 gnumach] Fix makefrags

2023-01-31 Thread Damien Zammit
--- i386/Makefrag.am | 5 +++-- i386/Makefrag_x86.am | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/i386/Makefrag.am b/i386/Makefrag.am index 68460c49..5881f9f3 100644 --- a/i386/Makefrag.am +++ b/i386/Makefrag.am @@ -30,6 +30,8 @@ if HOST_ix86 # libkernel_a_SOURCES

[PATCH 11/12 gnumach] smp: Serialise AP bringup

2023-01-31 Thread Damien Zammit
--- i386/i386/mp_desc.c | 26 +++--- i386/i386at/ioapic.c| 1 - i386/i386at/model_dep.c | 1 - i386/intel/pmap.c | 1 + kern/startup.c | 5 - 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/i386/i386/mp_desc.c b/i386/i386/mp_desc.

[PATCH 12/12 gnumach] Debug printf when sending TLB IPI

2023-01-31 Thread Damien Zammit
--- i386/i386/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386/i386/smp.c b/i386/i386/smp.c index acf69d21..c6a62958 100644 --- a/i386/i386/smp.c +++ b/i386/i386/smp.c @@ -53,7 +53,7 @@ void smp_pmap_update(unsigned apic_id) cpu_intr_save(&flags); -printf("

[PATCH 4/5 gnumach] kdb: Fix ON_INT_STACK() macro to be cpu_number aware

2023-02-01 Thread Damien Zammit
--- i386/i386/db_trace.c| 3 ++- i386/i386at/model_dep.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/i386/i386/db_trace.c b/i386/i386/db_trace.c index 99cb8c48..04c868af 100644 --- a/i386/i386/db_trace.c +++ b/i386/i386/db_trace.c @@ -37,6 +37,7 @@ #include #inc

[PATCH 3/5 gnumach] linux: No need to init PIT timer twice

2023-02-01 Thread Damien Zammit
--- linux/dev/arch/i386/kernel/irq.c | 12 ++-- linux/dev/init/main.c| 2 ++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index 67feea84..5f221da1 100644 --- a/linux/dev/arch/i386/kernel/irq

[PATCH 0/5 gnumach] Progress with SMP revisited

2023-02-01 Thread Damien Zammit
This has been rebased onto master and reworked to address review. Same tests applied as last time, same results as last time. However, with ncpus>1 and apic enabled, there are warnings spewed at beginning of gnumach regarding cpu_number, but doesnt prevent continuing to start of boot process. Da

[PATCH 5/5 gnumach] linux: Skip probing IDE when 255 phys heads detected

2023-02-01 Thread Damien Zammit
This allows qemu -M q35 to boot without 30 second timeout failing on hd0, when disk is actually attached via ahci. I very much doubt a disk exists with 255 physical heads. --- linux/src/drivers/block/ide.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/src/drivers/block

[PATCH 1/5 gnumach] pmap: Debug printf when pmap_update_interrupt runs

2023-02-01 Thread Damien Zammit
--- i386/intel/pmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 84a4cef5..0505cfa2 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -2928,6 +2928,7 @@ void pmap_update_interrupt(void) int s; my_cpu = cpu_nu

[PATCH 2/5 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-01 Thread Damien Zammit
This is a rather large commit, but difficult to break it up. This also serialises the AP bringup, so paging can be enabled per cpu one by one. Also-by: Almudena Garcia --- i386/i386/cpu_number.h | 2 + i386/i386/mp_desc.c | 226 i386/i386/mp_desc.h

Re: [PATCH 0/5 gnumach] Progress with SMP revisited

2023-02-01 Thread Damien Zammit
le refactors) will be add the APs to > scheduler, using `slave_main()` function. > After this, the AP will be available to the scheduler, which can assign > process (or threads) to these. > > El mié, 1 feb 2023 a las 11:27, Damien Zammit () > escribió: > >> T

Re: [PATCH 0/5 gnumach] Progress with SMP revisited

2023-02-01 Thread Damien Zammit
Original Message On 1 Feb 2023, 10:35 pm, Almudena Garcia < liberamenso10...@gmail.com> wrote: Ok. Now I understand better. Maybe it's the same problem which I found in my first implementation: the AP was stuck, and the scheduler was sending all threads to the BSP. Try to debug

[PATCH v2 2/3 gnumach] linux: Keep existing timer interrupt handler for APIC

2023-02-03 Thread Damien Zammit
--- linux/dev/arch/i386/kernel/irq.c | 2 +- linux/dev/init/main.c| 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/linux/dev/arch/i386/kernel/irq.c b/linux/dev/arch/i386/kernel/irq.c index 67feea84..b48d1312 100644 --- a/linux/dev/arch/i386/kernel/irq.c +++ b/linux

[PATCH v2 3/3 gnumach] i386: Refactor int stacks to be per cpu for SMP

2023-02-03 Thread Damien Zammit
This also serialises the AP bringup, so paging can be enabled per cpu one by one. Also-by: Almudena Garcia --- i386/i386/mp_desc.c | 226 i386/i386/mp_desc.h | 7 +- i386/i386at/boothdr.S | 18 +++- i386/i386at/ioapic.c| 5 +- i386/i386

[PATCH v2 1/3 gnumach] pmap: Refactor temporary mapping functions

2023-02-03 Thread Damien Zammit
--- i386/i386at/model_dep.c | 73 +--- i386/intel/pmap.c | 93 + i386/intel/pmap.h | 6 +++ 3 files changed, 101 insertions(+), 71 deletions(-) diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c index fe1

[PATCH v3] i386: Refactor int stacks to be per cpu for SMP

2023-02-03 Thread Damien Zammit
This also serialises the AP bringup, so paging can be enabled per cpu one by one. Also-by: Almudena Garcia --- i386/i386/mp_desc.c | 230 i386/i386/mp_desc.h | 7 +- i386/i386at/boothdr.S | 18 +++- i386/i386at/ioapic.c| 5 +- i386/i386

<    1   2   3   4   5   6   7   >