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

Re: [PATCH v3 07/23] xen/arm: vIOMMU: Add cmdline boot option "viommu = <string>"


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Milan Djokic <milan_djokic@xxxxxxxx>
  • Date: Wed, 13 May 2026 11:41:00 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=9jFPrXpRbrfrR/muoX+iMH2iK5Y9JkVdH1twkdQ0HrY=; b=DcAEBFbfhk05he+Jm7+MQMjMosF6+VFIbxuDsgnOXEoBxqpQd6NIk3reNIafSOD1uzMPH0ps7mV7luVo9jny7SPXZCivMYvElFuCz69LodRamP0YPh8XXWa/mEJcbmJKtHnWQqZ7zf5xvW6VggJT5NyE0aDxyeaw4x3KVn/DnnlO3kOJR8jNNBXk3JfSSDHCEuvObXvbJdgaJRSpFLZTPW28t8btHQkJrPu0H+sLgkbdy6Q+R0U6vkU8sj1syVL1qAmxQDG0WxD60qw94VyvnYg32uxSkPlhbQDFrYKpVyBTE7UXQLTE2MedyxCkEKM1gMRSULnvl9MjAwB2f37hNQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CDbaWv79hCwMPQtNj4o4+iWSgf+Ef/Q8C2bExvuVDnO3KOD/mpBypoXXs4GorFqzMDsEZS7eRNWGIj+1Z8qdDIha5iepGz5azywyJumzyHBQo4WTbw7LriLdTbCoVupQKkKh4KdVpbGdmrj/mbxaCcogqzpw052gzeAFLg6jKtsBIfm06hXMtOk9mZ4eyG4JoMVJyhjnO7+bZP5YI/334wNIlumRlYVDFzkyFbwEaC8Ph8tbRTN+I2HlMaLMl3Rj6MstjoW3WYQYMkuwKB2QUjJt40UPUqRBwWeFV5XOY0+k1QNqySSQvgNm2iB0hB3Y6M1baXs91Qt4+agQQSjAOg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Rahul Singh <Rahul.Singh@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 13 May 2026 09:41:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Luca,

On 4/10/26 16:28, Luca Fancellu wrote:
HI Milan,


diff --git a/xen/arch/arm/include/asm/viommu.h 
b/xen/arch/arm/include/asm/viommu.h
index 2a6742de73..ed338fe0ec 100644
--- a/xen/arch/arm/include/asm/viommu.h
+++ b/xen/arch/arm/include/asm/viommu.h
@@ -10,6 +10,7 @@
#include <public/xen.h>

extern struct list_head host_iommu_list;
+extern char viommu[];

As far as I can see this one is used only in this header by ...


/* data structure for each hardware IOMMU */
struct host_iommu {
@@ -50,6 +51,12 @@ uint16_t viommu_get_type(void);
void add_to_host_iommu_list(paddr_t addr, paddr_t size,
                             const struct dt_device_node *node);

+static always_inline bool is_viommu_enabled(void)
+{
+    /* only smmuv3 emulation supported */
+    return !strcmp(viommu, "smmuv3");
+}

this function, it seems cleaner to me if viommu is static inside 
xen/xen/drivers/passthrough/arm/viommu.c
and this one can be defined there as well, so here we will have only the 
declaration.


I will remove this patch, including the additional boot option and is_viommu_enabled(). Relying on the existing vIOMMU config options should be sufficient for vIOMMU enable/disable control.

Cheers,
Luca


Best regards,
Milan




 


Rackspace

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