[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/evtchn: Introduce new IOCTL to bind static evtchn


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Tue, 9 May 2023 15:34:24 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9gC+OZzMjd8ANa2cPCKvlFq3Lc0rxVf0XgXL5xZm6Vs=; b=fQihuQUUotQMZ5vLI2eOvVU8EO9RlGCNOYHRB3K7sWyUBXmOHOZWIWBN3NzS9tSCCRU+pn/N/nkJwJjyom/GfQ8E7MjHK4Dm4FIBcxRdRu4OHcQxzKa7tGfJELtSoIGQ55IUrLp8gdtTdRG7ohrMjRwZZ2VAI779vA+SyFmDw+3nwaj/koA5pPlOCS2wqrt6X6mYsxx3B7M5kesU1FiXxKok0+O9a1vcKUk/jT+uPzA2RQpBNSRksAXCsm/VZG/W0/VrnCSeshvZ7Jw43YdJbUg7OoIpo4eQoxpfVAKX7BrbeXRWhB3mNF39Sw6MpPey5r9jR1PiCwqUr6dQXmwFtw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MId7UH3mzThJG70nswdIikhXdXJjSeCVzxyT8djHy6atxVIxUU8fATla0GlszfblAizIvSp9BZd6XtFiUxfYcVM4M+mvc0sv25v6UsfNu6twR2yrTk1BxKy16I+7tOZ+4VzygIT/qOBjO5URLx7+M9b+XqHbIdU3+AGmzKbAPMeZy9u+PVOiCli/l4u6e3BdBV3km4lndkyPvyDhvRaFygIo/WnE25vFuZE3yHm5L4kJmkw1vmIdDaNYzOhXf3HTmIHjvwIJAlr7O4WyKMLmyfIRViTKwqkaSoY0Mo0izGmWRnUeMBT5sBBaXX6W9acOr6SNGkehmGJLk+jT8d8TYg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen developer discussion <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Samuel Holland <samuel@xxxxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Jane Malalane <jane.malalane@xxxxxxxxxx>, David Woodhouse <dwmw@xxxxxxxxxxxx>
  • Delivery-date: Tue, 09 May 2023 15:35:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZec44jeWWxzG+E02fa4Z9QZ57Yq9MdoEAgAWtTIA=
  • Thread-topic: [PATCH] xen/evtchn: Introduce new IOCTL to bind static evtchn

Hi Stefano,

Thanks for the review.

On 6 May 2023, at 1:52 am, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:

On Fri, 28 Apr 2023, Rahul Singh wrote:
Xen 4.17 supports the creation of static evtchns. To allow user space
application to bind static evtchns introduce new ioctl
"IOCTL_EVTCHN_BIND_STATIC". Existing IOCTL doing more than binding
that’s why we need to introduce the new IOCTL to only bind the static
event channels.

Also, static evtchns to be available for use during the lifetime of the
guest. When the application exits, __unbind_from_irq() end up
being called from release() fop because of that static evtchns are
getting closed. To avoid closing the static event channel, add the new
bool variable "is_static" in "struct irq_info" to mark the event channel
static when creating the event channel to avoid closing the static
evtchn.

Signed-off-by: Rahul Singh <rahul.singh@xxxxxxx>

I think the patch is OK but evtchn_bind_to_user on the error path calls
EVTCHNOP_close. Could that be a problem for static evtchns? I wonder if
we need to skip that EVTCHNOP_close call too.


err:
/* bind failed, should close the port now */
close.port = port;
if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
BUG();
del_evtchn(u, evtchn);

Yes, we need to avoid to close the static event channel in case of error path also. 
I will fix this in next version. 

Regards,
Rahul
 

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.