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

Re: [PATCH 02/15] xen/arm/gic: Enable interrupt assignment to running VM


  • To: Julien Grall <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <xin.wang2@xxxxxxx>
  • Date: Thu, 25 Apr 2024 15:06:39 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=5XE9TPjnivHbWUzUOYv7aZuYKCVTly+JQTCfnfs91HM=; b=PjTtPEEIz5sWuTGzloKuSBxLl/kZt1nroHzFL2Xn771/oW0HdWxGE5NkZTBLcS3nRtw1V1V1SPSFj0vB0CjliHhcoiKiY/QxTfhWtkZmSr3iginG2dto1PJN4kQ3bSeU6LZQlPN/1TI2l3CHAqhKlkD4MtrWwiCaOvXkxHX9doPAI7SCZfY62e8oirRqfsRg0/tFXCaWBZBdGej3Kf/bgFri3kG//6cWPCTh/5gNudrJaxkgluzjTLC5o30wOO0Js7rE3n9ONFFUGII0Tfd36ippgi5BJrToUGT+2skOt1Eah26X8zgSGXxhVfFxlfjEdfMn056LKPU1BCtZUP/fFA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AfuaHjNbvrtTOP57zK1RtKLim03X3/LbUpRmidEAZZFI9vefKa9y7CpgoP9swky+oT3TWTFeNsJhlBaddpBUpnbFGYYkkot3yAx2TJHDTGHGJpXZ6z4PDSJj0e19nE4VV8Z9pqxcDyKzHU4h8Bq4W+JEYm3YdYB1SqOgKJG61ckhDKNr+4IHYPi1C1QVsbzf6PQ00gIVrFU7RqBxs0g9FOvuo2r4XU50pOiiit7pHp13NsdkCifHtfzTRi/+GgtnIIV2hrRYj18FXPx6j/gamvZbX0Co1WF+druEmmSt+tAqd6+lOWqtMs5Csf6EOsvBtk5Ok6PMfghG5aHMrPAKCw==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 25 Apr 2024 07:06:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 4/24/2024 8:58 PM, Julien Grall wrote:
Hi Henry,

On 24/04/2024 04:34, Henry Wang wrote:
From: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>

Enable interrupt assign/remove for running VMs in CONFIG_OVERLAY_DTB.

Currently, irq_route and mapping is only allowed at the domain creation. Adding
exception for CONFIG_OVERLAY_DTB.

AFAICT, this is mostly reverting b8577547236f ("xen/arm: Restrict when a physical IRQ can be routed/removed from/to a domain").


Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Signed-off-by: Henry Wang <xin.wang2@xxxxxxx>
---
  xen/arch/arm/gic.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 44c40e86de..a775f886ed 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -140,8 +140,10 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int virq,
       * back to the physical IRQ. To prevent get unsync, restrict the
       * routing to when the Domain is been created.
       */

The above comment explains why the check was added. But the commit message doesn't explain why this can be disregarded for your use-case.

Looking at the history, I don't think you can simply remove the checks.

Regardless that...

+#ifndef CONFIG_OVERLAY_DTB

... I am against such #ifdef. A distros may want to have OVERLAY_DTB enabled, yet the user will not use it.

Instead, you want to remove the check once the code can properly handle routing an IRQ the domain is created or ...

      if ( d->creation_finished )
          return -EBUSY;
+#endif
        ret = vgic_connect_hw_irq(d, NULL, virq, desc, true);
      if ( ret )
@@ -171,8 +173,10 @@ int gic_remove_irq_from_guest(struct domain *d, unsigned int virq,
       * Removing an interrupt while the domain is running may have
       * undesirable effect on the vGIC emulation.
       */
+#ifndef CONFIG_OVERLAY_DTB
      if ( !d->is_dying )
          return -EBUSY;
+#endif

... removed before they domain is destroyed.

Thanks for your feeedback. After checking the b8577547236f commit message I think I now understand your point. Do you have any suggestion about how can I properly add the support to route/remove the IRQ to running domains? Thanks.

Kind regards,
Henry


desc->handler->shutdown(desc);

Cheers,





 


Rackspace

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