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

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


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Rahul Singh <Rahul.Singh@xxxxxxx>
  • Date: Tue, 2 May 2023 14:58:40 +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=CoBq4X/ytiUZ+0l51aI3Y1BdDXoWW4utuLAfOzMoDMw=; b=LdACtd0pPu6GFRfjr4IlN8OKcYNZIsHIHVhFlzxhxZfUemFo67RfFDuNlsqtaKWD5jcW5ljAiozBh7flCU5alUTWuceme9B582qBSDtFW5kAU8Gvfr0vfchwv3AvBzBAgFVHzDyGvfI9ewG+nDldEaKQPo0rC722txa0xgwShy1mBwFM0ZqArS0HCVRPzXPTEZvreYmtvUe/aj6vKBzFypSLNioWwXci4Q1PL3XHWVxRTQldaA101H2edM+uVWiTzlIWlIKbysiDp9AXAQQgz82VbQ5VrrR2hVO/TYw4wPh2J+brYbYwy1CYJm2/s8GGuzecX0qRuqWr9CWPg9trsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RuUoe9q251JAtDGbWBbhaJBZwGnv944m4b9/uZVKpYsHav2Or71oZ/yofCAQAY/0fr2xj891FUraR+tJxpng3igcGyl/omy3Ec127mYpZI3na+5E4qAmVJvuBsoaklDjTzmsfbHFYxukVb3U4hNsS/puVgVOnBJl2dP1BPq25y/zlDwoSWKCGvBvGq4kEX3/soEsRucVcFusnJ2pFry5kUxlyPeeTGJ5DUg/PKGKNk1k5GZC/PGVYvVnCfEcRaP6KL/ySp8UoMMvkRzhLTtO1DKVOsLsJjdIatDOW+hjZ0+bpyrlHDaSvS1M6vLwiuMYeJUGt5mLU26FndO2BetdIA==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, 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, 02 May 2023 14:59:16 +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+E02fa4Z9QZ57Yq9At36AgAZiAgA=
  • Thread-topic: [PATCH] xen/evtchn: Introduce new IOCTL to bind static evtchn

 Hi Ayan,

On 28 Apr 2023, at 2:30 pm, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:

Hi Rahul,

On 28/04/2023 13:36, Rahul Singh wrote:
CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.


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>
---
 drivers/xen/events/events_base.c |  7 +++++--
 drivers/xen/evtchn.c             | 22 +++++++++++++++++-----
 include/uapi/xen/evtchn.h        |  9 +++++++++
 include/xen/events.h             |  2 +-
 4 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index c7715f8bd452..31f2d3634ad5 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -112,6 +112,7 @@ struct irq_info {
        unsigned int irq_epoch; /* If eoi_cpu valid: irq_epoch of event */
        u64 eoi_time;           /* Time in jiffies when to EOI. */
        raw_spinlock_t lock;
+       u8 is_static;           /* Is event channel static */

I think we should avoid u8/u16/u32 and instead use uint8_t/uint16_t/uint32_t.

However in this case, you can use bool.

Make sense. I will change to bool in next patch.

Regards,
Rahul


 


Rackspace

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