From nobody Tue Feb 10 00:23:11 2026 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; 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=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1671431750; cv=none; d=zohomail.com; s=zohoarc; b=GZgGt6cGUq9/YfwSruOBaCxyqVRJ6eBknUem8JtPZ9PqqdIs69huIOW5y0SZni8lCBOB4VFWXqVX+irWoMQPxaACx4JomMZCBt7QitZ5rwyBodEwK+srApDbkzO5vDGCapON3Oo5IzRIZM87QCNwgmVPUJ91O7rmXs9m1B/M+kw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671431750; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=80ZpLAZLQqNuZgUmUutfeY71usyNtY5k5j9A+SPx2to=; b=hOPtfcZoAPS3OfaS24bhn1rpLnR2+JH9ZugYpoUjV8a//QxTKahqCPLlIRw9hBE35ukbiiELxmcufLPGlx5k/AMTLt2tqBzS8dC+s+2WjO17TUlNKMhYFHlXn+IAvLNs9ezEzsfG64K1KrEgyEclWUfbvuMGJySIsJ34GaiwwtA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671431750403847.3635766886932; Sun, 18 Dec 2022 22:35:50 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.465757.724557 (Exim 4.92) (envelope-from ) id 1p79kF-0003dL-88; Mon, 19 Dec 2022 06:35:27 +0000 Received: by outflank-mailman (output) from mailman id 465757.724557; Mon, 19 Dec 2022 06:35:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p79kF-0003dE-4w; Mon, 19 Dec 2022 06:35:27 +0000 Received: by outflank-mailman (input) for mailman id 465757; Mon, 19 Dec 2022 06:35:24 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p79kC-000383-81 for xen-devel@lists.xenproject.org; Mon, 19 Dec 2022 06:35:24 +0000 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [2a00:1450:4864:20::633]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 50cf3775-7f67-11ed-8fd4-01056ac49cbb; Mon, 19 Dec 2022 07:35:23 +0100 (CET) Received: by mail-ej1-x633.google.com with SMTP id ud5so19149841ejc.4 for ; Sun, 18 Dec 2022 22:35:23 -0800 (PST) Received: from uni.router.wind (adsl-211.109.242.226.tellas.gr. [109.242.226.211]) by smtp.googlemail.com with ESMTPSA id q14-20020a17090676ce00b008302732f569sm77062ejn.78.2022.12.18.22.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Dec 2022 22:35:22 -0800 (PST) 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: 50cf3775-7f67-11ed-8fd4-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=80ZpLAZLQqNuZgUmUutfeY71usyNtY5k5j9A+SPx2to=; b=gVk9UDmfQbQncVBdtYx4cLWqd0Ht6rE7Z1HkpQymC4w74/GcSix53WlbG4nVBjzL9p Ldwq9/aoZdJb1MhMJmoNUJfZt9VmMc0axVhjeZXDyNmqhYJ+z/W19RimnqHghicR3sK0 sWuI6lZGiIQzHOT0rlo/sAq+/XS7uXgJ9bUvpsn2P2Ml7S6NNFX2LYFw/bM4gH8XCixG Mx0rV5Gve85/j4nzAeiJ1gwnvReLogaSsEBAqrg90RjMv6DdmiN2DAXX3X4uMql5u7oG WiojAQYJdoxytf19LwPzsfGsPPuF3ExR0kHljutGpBf+b4N20BCOsNFHMky1zgP5KSAs 9mxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=80ZpLAZLQqNuZgUmUutfeY71usyNtY5k5j9A+SPx2to=; b=DywuTsUj43h2qFlaVNPOplA0ZxxMYAUkRw0IN6CkdMlY3Miuq9pHuvp8O931JzWOfc aN9N54NvfJS6pbbSjDuQzcAsKW7eJpKkBFGxHb1uFNYoLZXSszQd6y0MkDXTODpXSeDv X3QN7H9fa+LO5VkuJ4/GWp9TnxVxb+O9H+m9+UjZj3+TuJJy72ZRZ8zadZxGaWIeS7n+ ewAbBvQ+73iC2RQ7bhLS9m1AjOIKRea5id8XfQQ3byWlLPfW4ww+tooZ/HYRvaEDuyyo yT2vY6Wd6mIJ+jKszxROKB2furtrhOur80KVqObN+RADvlS4vlry6ijjb/9bsJuhYEup moNg== X-Gm-Message-State: ANoB5pn4nq4oMAdpMLfvHeqWK1X+HG9HmrVubkZE2rXIJPrUt/fQ2awR hWdq5Lv9tR1A674jEYwfzS4dWOXwD9E= X-Google-Smtp-Source: AA0mqf5J1elLvocK/Jvfp9+6inR60vFTgMRDu7J1Mc4W50gcC0qsLz/dE1X2Xxw0QJBt8Eo/vQN45g== X-Received: by 2002:a17:907:970b:b0:7c1:9462:2dd3 with SMTP id jg11-20020a170907970b00b007c194622dd3mr23090216ejc.70.1671431722829; Sun, 18 Dec 2022 22:35:22 -0800 (PST) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Jan Beulich , Andrew Cooper , Paul Durrant , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [RFC 2/7] x86/iommu: amd_iommu_perdev_intremap is AMD-Vi specific Date: Mon, 19 Dec 2022 08:34:51 +0200 Message-Id: <20221219063456.2017996-3-burzalodowa@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221219063456.2017996-1-burzalodowa@gmail.com> References: <20221219063456.2017996-1-burzalodowa@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1671431752806100001 Content-Type: text/plain; charset="utf-8" Move its definition to the AMD-Vi driver and use CONFIG_AMD_IOMMU to guard its usage in common code. Take the opportunity to replace bool_t with bool and 1 with true. No functional change intended. Signed-off-by: Xenia Ragiadakou --- xen/drivers/passthrough/amd/iommu_init.c | 2 ++ xen/drivers/passthrough/iommu.c | 3 ++- xen/include/xen/iommu.h | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthr= ough/amd/iommu_init.c index 1f14aaf49e..c4a41630e5 100644 --- a/xen/drivers/passthrough/amd/iommu_init.c +++ b/xen/drivers/passthrough/amd/iommu_init.c @@ -36,6 +36,8 @@ static struct radix_tree_root ivrs_maps; LIST_HEAD_READ_MOSTLY(amd_iommu_head); bool_t iommuv2_enabled; =20 +bool __read_mostly amd_iommu_perdev_intremap =3D true; + static bool iommu_has_ht_flag(struct amd_iommu *iommu, u8 mask) { return iommu->ht_flags & mask; diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index 5e2a720d29..1a02fdc453 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -58,7 +58,6 @@ bool __read_mostly iommu_hap_pt_share =3D true; #endif =20 bool_t __read_mostly iommu_debug; -bool_t __read_mostly amd_iommu_perdev_intremap =3D 1; =20 DEFINE_PER_CPU(bool_t, iommu_dont_flush_iotlb); =20 @@ -115,8 +114,10 @@ static int __init cf_check parse_iommu_param(const cha= r *s) if ( val ) iommu_verbose =3D 1; } +#ifdef CONFIG_AMD_IOMMU else if ( (val =3D parse_boolean("amd-iommu-perdev-intremap", s, s= s)) >=3D 0 ) amd_iommu_perdev_intremap =3D val; +#endif else if ( (val =3D parse_boolean("dom0-passthrough", s, ss)) >=3D = 0 ) iommu_hwdom_passthrough =3D val; else if ( (val =3D parse_boolean("dom0-strict", s, ss)) >=3D 0 ) diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 4f22fc1bed..6b06732792 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -104,7 +104,9 @@ static inline void clear_iommu_hap_pt_share(void) } =20 extern bool_t iommu_debug; -extern bool_t amd_iommu_perdev_intremap; +#ifdef CONFIG_AMD_IOMMU +extern bool amd_iommu_perdev_intremap; +#endif =20 extern bool iommu_hwdom_strict, iommu_hwdom_passthrough, iommu_hwdom_inclu= sive; extern int8_t iommu_hwdom_reserved; --=20 2.37.2