[PATCH] Move user_intr handling to mach side

2020-08-02 Thread Junling Ma
1. make deliver_intr a linux irq handler, and do not let it touch the main_intr_queue. the queue handling is solely in intr_thread (removing dead entries) and insert_intr_entry (insertion). 2. remove user_intr from struct linux_action and its handling on linux side. --- device/intr.c

[PATCH] user_intr: a lock to protect main_intr_queue

2020-08-02 Thread Junling Ma
1. The queue manipulated by two threads, the registration server and the intr_thread, so we need a lock to protect it. 2. To initialize the lock, we introduce a irq_init function in i386/i386/irq.[ch] and call it in device/device_init.c --- device/device_init.c | 3 ++- device/intr.c|

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Junling Ma
Ok. Will do. Junling > On Aug 2, 2020, at 4:52 PM, Samuel Thibault wrote: > > Junling Ma, le dim. 02 août 2020 16:45:22 -0700, a ecrit: >> I guess you misunderstood what I mean. I mean that there seems to be no >> interest in the discussion on IRC yesterday that we introduce a new scheme. > >

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Samuel Thibault
Junling Ma, le dim. 02 août 2020 16:45:22 -0700, a ecrit: > I guess you misunderstood what I mean. I mean that there seems to be no > interest in the discussion on IRC yesterday that we introduce a new scheme. That's because you asked on IRC at a random time. That's what IRC is not good at: coll

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Junling Ma
I guess you misunderstood what I mean. I mean that there seems to be no interest in the discussion on IRC yesterday that we introduce a new scheme. If so, I will not work on that part. For part I, ie., moving the irq management to mach side, it people think it is useful, I will prepare a series

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Samuel Thibault
Samuel Thibault, le lun. 03 août 2020 01:33:53 +0200, a ecrit: > Junling Ma, le dim. 02 août 2020 16:19:39 -0700, a ecrit: > > You may have missed the part where I say let user side [/dev/irq*] > > translator > > do the multiplexing. > > I didn't but that looks like extra complexity, and makes th

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Samuel Thibault
Junling Ma, le dim. 02 août 2020 16:19:39 -0700, a ecrit: > I was distracted by using a counter at all in the original code, > because an irq cannot be fired more than once before it is acked. Right, normally that doesn't happen. > What we really need is a boolean_t type per notification, And th

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Junling Ma
> On Aug 2, 2020, at 3:44 PM, Samuel Thibault wrote: > > Junling Ma, le dim. 02 août 2020 15:32:01 -0700, a ecrit: 1. Change devicer_user_intr to be a linux interrupt handler. >>> >>> Right, this makes sense, but did you actually try it? Check the existing >>> code twice to realize why it'

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Samuel Thibault
Junling Ma, le dim. 02 août 2020 15:32:01 -0700, a ecrit: > >> 1. Change devicer_user_intr to be a linux interrupt handler. > > > > Right, this makes sense, but did you actually try it? Check the existing > > code twice to realize why it's done that way. Here linux_intr is looking > > through the

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Junling Ma
Hi Samual, Thanks for reviewing. > Junling Ma, le sam. 01 août 2020 18:59:58 -0700, a ecrit: >> PATCH 1 is included in this email: it prepares the stage by > > Please provide separate patches for each over these. Otherwise this is > all conflated and way more difficult to review. Ok. >> 1. Ch

Re: [PATCH v2] libmachdev: Introduce startup notification for clean rumpdisk shutdown

2020-08-02 Thread Samuel Thibault
I applied, thanks! Just one thing: I moved the functions so as to get the code in the execution order: fsys_startup, then fsys_init, then arrange_shutdown_notification, and S_startup_dosync before trivfs_goaway. Samuel

Re: [PATCH v2] libmachdev: Introduce startup notification for clean rumpdisk shutdown

2020-08-02 Thread Samuel Thibault
Damien Zammit, le sam. 01 août 2020 15:05:38 +1000, a ecrit: > +static void > +device_shutdown (void) > +{ > + struct block_data *bd = block_head; > + > + while (bd) > +{ > + device_close((void *)bd); > + bd = bd->next; > +} > + rump_sys_reboot (0, NULL); > +} Did you check th

Re: [PATCH v2] libmachdev: Introduce startup notification for clean rumpdisk shutdown

2020-08-02 Thread Samuel Thibault
Samuel Thibault, le dim. 02 août 2020 23:16:22 +0200, a ecrit: > Damien Zammit, le sam. 01 août 2020 15:09:57 +1000, a ecrit: > > I figured out why it was hanging on reboot: > > netdde was frozen because pci-arbiter was not working > > with my setup that used x86 method of pci access for rumpdisk.

Re: [PATCH v2] libmachdev: Introduce startup notification for clean rumpdisk shutdown

2020-08-02 Thread Samuel Thibault
Hello, Damien Zammit, le sam. 01 août 2020 15:09:57 +1000, a ecrit: > I figured out why it was hanging on reboot: > netdde was frozen because pci-arbiter was not working > with my setup that used x86 method of pci access for rumpdisk. > > When I removed the translators from /dev/netdde and /serve

Re: [PATCH-2] A new irq device interface -- resend in plain text

2020-08-02 Thread Samuel Thibault
Could you also send a patch that fixes libddekit? Otherwise, again, I can't apply your patches. Until I would happen to magically find the time to fix libddekit myself of course. Samuel

Re: [PATCH-3] A new irq device interface

2020-08-02 Thread Samuel Thibault
Junling Ma, le sam. 01 août 2020 19:06:02 -0700, a ecrit: > In this patch, the old interface of device_intr_register and device_intr_ack > is removed. We don't want to remove it yet, we need to keep it for smooth upgrade. Please everybody always remember to test smooth upgrades. Otherwise I end

Re: [PATCH-2] A new irq device interface -- resend in plain text

2020-08-02 Thread Samuel Thibault
Junling Ma, le sam. 01 août 2020 19:04:05 -0700, a ecrit: > In this patch, the new interface of irq device is implemented. Please see the > first patch for a description. Not only, it also brings other changes, making the patch unreviewable. Samuel

Re: [PATCH-1] A new irq device interface

2020-08-02 Thread Samuel Thibault
Hello, Junling Ma, le sam. 01 août 2020 18:59:58 -0700, a ecrit: > PATCH 1 is included in this email: it prepares the stage by Please provide separate patches for each over these. Otherwise this is all conflated and way more difficult to review. > 1. Change devicer_user_intr to be a linux interr