From nobody Fri Nov 22 13:11:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1716456024; cv=none; d=zohomail.com; s=zohoarc; b=UA5csJ/J3yBST6Z/8aarY6usiaVJru2/01ehe63TeIn/ps3OOdoTP/b0jii4/cgm0QZ0hXBSuC81zS8AB2NAs2KfyEQNOwBdVZKGv1gBOWHslCJvDtyWSoM0Hoty/KQFXPbd4SS9gntgrufNSP47K2G3glVYR3qdPMHU38Wmu3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716456024; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rb2g7/BafJk9f48N+Ig/DxIGBOHotYs1+I4pEEvyMaA=; b=liFHyg7eV+osDXXt3U7dBTf31tFOMTZ6I8sqiFl7kPHS+dyLf7z5hAzI3bP5nQcqqg4xfJ2N3xumfa2VhmUYLGjpUEkOgHbHLQdWKaTEI+owW57lAX9yMzboWThULPRyM+KHEI5NW+xPiHUNF17HRPjMniEds9KV5sZ1w7ea/hk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1716456024186274.99879789595605; Thu, 23 May 2024 02:20:24 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.728262.1133125 (Exim 4.92) (envelope-from ) id 1sA4cA-0006uS-1G; Thu, 23 May 2024 09:19:58 +0000 Received: by outflank-mailman (output) from mailman id 728262.1133125; Thu, 23 May 2024 09:19:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sA4c9-0006uL-TQ; Thu, 23 May 2024 09:19:57 +0000 Received: by outflank-mailman (input) for mailman id 728262; Thu, 23 May 2024 09:19:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sA4c8-0006uF-N1 for xen-devel@lists.xenproject.org; Thu, 23 May 2024 09:19:56 +0000 Received: from mail187-24.suw11.mandrillapp.com (mail187-24.suw11.mandrillapp.com [198.2.187.24]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9dc144ee-18e5-11ef-90a1-e314d9c70b13; Thu, 23 May 2024 11:19:55 +0200 (CEST) Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail187-24.suw11.mandrillapp.com (Mailchimp) with ESMTP id 4VlN1555QWzJKF3q8 for ; Thu, 23 May 2024 09:19:53 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 2fb4daa5dcaf486a8f71b549e7ac6e39; Thu, 23 May 2024 09:19:53 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9dc144ee-18e5-11ef-90a1-e314d9c70b13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1716455993; x=1716716493; bh=rb2g7/BafJk9f48N+Ig/DxIGBOHotYs1+I4pEEvyMaA=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=t3b3P7X85yze9/uayCXuewejxeoJ1jLwI2WHHbPHeik0tzKvgO4NrqGPLIYX/6fU8 kpz4lkN1F9zWxTYbayycAswMrSO12tqg9ynFxGXdQBxhpDhhJVw56w3qTdeOlhyYzN Vp5k4mfmNIt5hJPNPs3AXKcw+Xl+UKqt2M49f5UYDe+ckHWUFBKOC+Q5n0MOCa9qV6 vWwdHvwG9X1bArNKuRJt9LWqlt7ulmmQkB5DNIWOreAKUfXVdMi9KDRPThSRj0CegG CdX8WqGxPumzUZ61yzG6lzvYxrr7RRTI5BLnp6agNfTr1LZ2Wf0CupvauPczkmrNoj F8lrPr9XV/cgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1716455993; x=1716716493; i=teddy.astie@vates.tech; bh=rb2g7/BafJk9f48N+Ig/DxIGBOHotYs1+I4pEEvyMaA=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=aRCcRUksJ6hk/3evHqjybmx9cuR1lQTNwoN2qExfb9elL0WMgSWDdtsYRZNy7WfIu 4TTaExTdOFSchWKa3fZW25riCFRMb7sV1X3moYWNbx6JgKOJXFkOfr0JTKfRFaN0f8 xOyHtiXyashi+nK4UEW0h7ITEfQ+Zkm9zJUQA0IGqCxcViAI5koyPTbzVg304fxRIw 8puxTH0Zu9OaeNfbF3GOu1XsfPJnFuZvy5bUWh0zqsUUafCWhAwjSRJKeewxkJVlFu UuzN6WvKh8ycB/kYsM3o9JDx7ui3XFOkyJ1Fjl1GQfCb0ESyGVpwHVxCdglnr3YER6 yjLxUVTdSwU/A== From: Teddy Astie Subject: =?utf-8?Q?[XEN=20PATCH]=20x86/iommu:=20Conditionally=20compile=20platform-specific=20union=20entries?= X-Mailer: git-send-email 2.45.1 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1716455992462 To: xen-devel@lists.xenproject.org Cc: Teddy Astie , Jan Beulich , Andrew Cooper , =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= Message-Id: <2744240f42dadcb1edc69d0f921d5909fe0f63a2.1716455673.git.teddy.astie@vates.tech> X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.2fb4daa5dcaf486a8f71b549e7ac6e39?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20240523:md Date: Thu, 23 May 2024 09:19:53 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @mandrillapp.com) (identity teddy.astie@vates.tech) X-ZM-MESSAGEID: 1716456025198100001 Content-Type: text/plain; charset="utf-8" If some platform driver isn't compiled in, remove its related union entries as they are not used. Signed-off-by Teddy Astie --- xen/arch/x86/include/asm/iommu.h | 4 ++++ xen/arch/x86/include/asm/pci.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/xen/arch/x86/include/asm/iommu.h b/xen/arch/x86/include/asm/io= mmu.h index 8dc464fbd3..99180940c4 100644 --- a/xen/arch/x86/include/asm/iommu.h +++ b/xen/arch/x86/include/asm/iommu.h @@ -42,17 +42,21 @@ struct arch_iommu struct list_head identity_maps; =20 union { + #ifdef CONFIG_INTEL_IOMMU /* Intel VT-d */ struct { uint64_t pgd_maddr; /* io page directory machine address */ unsigned int agaw; /* adjusted guest address width, 0 is level= 2 30-bit */ unsigned long *iommu_bitmap; /* bitmap of iommu(s) that the do= main uses */ } vtd; + #endif + #ifdef CONFIG_AMD_IOMMU /* AMD IOMMU */ struct { unsigned int paging_mode; struct page_info *root_table; } amd; + #endif }; }; =20 diff --git a/xen/arch/x86/include/asm/pci.h b/xen/arch/x86/include/asm/pci.h index fd5480d67d..842710f0dc 100644 --- a/xen/arch/x86/include/asm/pci.h +++ b/xen/arch/x86/include/asm/pci.h @@ -22,12 +22,16 @@ struct arch_pci_dev { */ union { /* Subset of struct arch_iommu's fields, to be used in dom_io. */ + #ifdef CONFIG_INTEL_IOMMU struct { uint64_t pgd_maddr; } vtd; + #endif + #ifdef CONFIG_AMD_IOMMU struct { struct page_info *root_table; } amd; + #endif }; domid_t pseudo_domid; mfn_t leaf_mfn; --=20 2.45.1 Teddy Astie | Vates XCP-ng Intern XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech