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

Re: [PATCH for-4.21?] AMD/IOMMU: unshare IRQ .ack and .disable handlers


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 21 Oct 2025 10:48:57 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=9xUQveSAMaTSWthRxxUkVrjXbBu/B05arQkqbfcOES0=; b=ZKNFnobMhfmdrH4uLemTv4f5MJ+bXDQrrmURRT03eOOW4nsaIFTVhLhQzFwZxCPQvPTexFVV10dKawsmzp9GSo9uRn4DETwa39bHO/GAwNBNTv2T1P8VW31sbejp93nFhyMSXNxWqRjeV6a1prZWjEetSpmVLoP7h2KGRON3OTYyEzXNY9vgHm/WbipDsC6SXxrMTBcQb9I90e6LCXDqCKRGli0eABvDQ9xfPlPVVhg60855SA4i5Ai67KVnhhw3KKCwZPuVrGQOrN5WiXc2eRo4ddB7eLUg0IKrf9puM2erfn+Bdw3i7CKF3fcvolGzCDZzVd8MFvlULrMu7ntSpg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N/Damgjetl/t8AZC/wLeG38ndezdDgifa67Herwe0nFHdEZIoxuw/1SFmqI1vjywlw8Qb504ypcKOIRc/JLLdoBsacW38mvZaAftx+pDOKXFg6NHy3HeNwJWUI5TJx6xcBk6sublXmqBDp6HSj5Q9NeIBcJN7p09b2hoJcbPDHEzn4yn+UBCDgS+uXMpxG8HGmbxpT5Q2W8sgQo1FKHdCUHhIXLyzHDndzh88axemTUpq8jlfk+Gky3NcspQnAiC2EKcYWiH9wuVbwNVCuDvHGlpakIM2f6dKcEKpPSKDHc2L3S4LRmT192A2yVP0V6L0qDIWzlYxLIukLXiMe/J9A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Tue, 21 Oct 2025 09:49:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Oct 20, 2025 at 04:16:13PM +0200, Jan Beulich wrote:
> A .disable handler can't typically be re-used for .ack: The latter needs
> to deal with IRQ migration, while the former shouldn't. Furthermore
> invoking just irq_complete_move() isn't enough; one of
> move_{native,masked}_irq() also need invoking.
> 
> Fixes: 487a1cffd71a ("x86: Implement per-cpu vector for xen hypervisor")
> Fixes: f821102450a1 ("x86: IRQ Migration logic enhancement")
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> 
> --- a/xen/drivers/passthrough/amd/iommu_init.c
> +++ b/xen/drivers/passthrough/amd/iommu_init.c
> @@ -428,8 +428,6 @@ static void cf_check iommu_msi_mask(stru
>      unsigned long flags;
>      struct amd_iommu *iommu = desc->action->dev_id;
>  
> -    irq_complete_move(desc);
> -
>      spin_lock_irqsave(&iommu->lock, flags);
>      amd_iommu_msi_enable(iommu, IOMMU_CONTROL_DISABLED);
>      spin_unlock_irqrestore(&iommu->lock, flags);
> @@ -442,6 +440,13 @@ static unsigned int cf_check iommu_msi_s
>      return 0;
>  }
>  
> +static void cf_check iommu_msi_ack(struct irq_desc *desc)
> +{
> +    irq_complete_move(desc);
> +    iommu_msi_mask(desc);
> +    move_masked_irq(desc);

Not sure it matters much, as I don't expect IOMMU interrupts to move
around frequently, but do we really need to mask the source?  The
update of the interrupt would be done atomically, as we know IOMMU is
available.  Anyway this can be done later, so:

Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

Thanks, Roger.



 


Rackspace

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