Date: Fri, 5 Aug 2016 18:59:38 +0200 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= <royger@freebsd.org> To: Akshay Jaggi <jaggi@freebsd.org> Cc: freebsd-xen@freebsd.org Subject: Re: Event Channel notification issue - Gntdev device Message-ID: <20160805165938.kg4af6ly5lywdp4r@mac> In-Reply-To: <CAAeUNV=NNtqWwOk6V%2BE2LCrGy6aGxTPfLvPESKz200DpMSG6_A@mail.gmail.com> References: <CAAeUNV=NNtqWwOk6V%2BE2LCrGy6aGxTPfLvPESKz200DpMSG6_A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 04, 2016 at 03:57:40PM +0530, Akshay Jaggi wrote: > Hi, > > I've been working on unmap notifications for the grant table user space > device (check progress: https://reviews.freebsd.org/D7293). > > I've added and tested unmap_clear_byte notification and unmap_send_event > notification is left. > > I was implementing the unmap_send_notify on event-channel, but I am stuck. > Basically, linux grabs a reference to the event-channel port, in case it is > deallocated, so that it can still send a notify. I could not find such a > reference-grabbing mechanism for event channel in FreeBSD. What should I do > now? > Should I add notify, adding the constraint that you cannot deallocate your > reference to that port till the notify is sent (ie, after an unmap). No, that would be quite bad because user-space applications could cause page faults in the kernel. You should look into adding reference counts to FreeBSD event channels. You probably want to add a refcount(9) to struct xenisrc that you increment/decrement in order to count references. A helper function to pick extra references to event channels should also be added to the interface exposed by xen_intr. Roger.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160805165938.kg4af6ly5lywdp4r>