From nobody Wed Apr 16 03:31:43 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1733993007; cv=none; d=zohomail.com; s=zohoarc; b=fIZMaCisC3yZ8ZCczMVOv8DTJvLwkYI8wkTnbFzmmCeLCILVc+ClcwhsG4FU8EwKl4oJnhuqmM8m6hCbX8T7KlkuWJ5RQOxn5q+DvjyTYUZMs/6Zu9cWGJcO/DPmytcxqKFn2+mPOiEASWd5eU8kJxo5ke9PqBvdpNb64kq10cY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1733993007; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fbUqOrS50GS1bY9Y8/3/uH7jQNWwzSsTyjPExdamKqs=; b=U/OS5y2CX7qx90zOq2ed730JLjvne7AgsB0E69dgZy98mOepeo1M8x31UjgkMxYUHC72gmNXj8KyZktbVF4mhlFvJW1MO4G2i/yH0bDB8QAXi4T2EXTezf7PSvdaow0VbmF0QpFUEcRQWsMdhQoJ4u/WSuT9aTkFlF4MEG1BYzU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1733993007850272.6018215788888; Thu, 12 Dec 2024 00:43:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLemH-0005T2-Af; Thu, 12 Dec 2024 03:42:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLemA-0005OR-F7 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 03:42:29 -0500 Received: from mgamail.intel.com ([198.175.65.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLem8-00084H-S2 for qemu-devel@nongnu.org; Thu, 12 Dec 2024 03:42:26 -0500 Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2024 00:42:24 -0800 Received: from spr-s2600bt.bj.intel.com ([10.240.192.127]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2024 00:42:20 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1733992945; x=1765528945; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=s0ggyZwu1G7bhjgQC3xPTDR13v1PzA5LRko9ioCPvfg=; b=A7Vjq1hY6wiAj7Ny2Z4CtxARjT3theLQgLzq78Sjeme73Zos5t64oqxp ZMqFgBZO7k00Cwhza9N6genadfcgtaCb9UTPB1tO8HZnFdnrYWP9qJMZl uK0puuOIDxnvfu69fxMKeqivLYY8NkYMHpOtf8hRhP97o5Uds+38CZzcy 01rEWxzAXR5FvivnjOebQPFTZgqOzPjbrA7ipBqdRa5GCZ2g97gakL9lF ofXNHDoXylJrBCTEQbzT6PphR8PcOOV3SCjMtYQfseIHCBA1C8BAoDt9Y ixBiR9reSSaVh60WxYDQprEl+fAr8hp+qfvjV6+LluSI8R73MZg5r9gb8 g==; X-CSE-ConnectionGUID: Ue3ls91ESX+cjVDHSpEuZA== X-CSE-MsgGUID: OlyM8ChqQn6D0WOlKzaGPw== X-IronPort-AV: E=McAfee;i="6700,10204,11283"; a="34125003" X-IronPort-AV: E=Sophos;i="6.12,228,1728975600"; d="scan'208";a="34125003" X-CSE-ConnectionGUID: UofLG1FyQV69+naFe+4uLA== X-CSE-MsgGUID: Up0+r+YLRASYdkpLbS58ag== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="119407186" From: Zhenzhong Duan To: qemu-devel@nongnu.org Cc: alex.williamson@redhat.com, clg@redhat.com, eric.auger@redhat.com, mst@redhat.com, peterx@redhat.com, jasowang@redhat.com, jgg@nvidia.com, nicolinc@nvidia.com, joao.m.martins@oracle.com, clement.mathieu--drif@eviden.com, kevin.tian@intel.com, yi.l.liu@intel.com, chao.p.peng@intel.com, Zhenzhong Duan , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v6 16/20] intel_iommu: Set default aw_bits to 48 starting from QEMU 9.2 Date: Thu, 12 Dec 2024 16:37:53 +0800 Message-Id: <20241212083757.605022-17-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241212083757.605022-1-zhenzhong.duan@intel.com> References: <20241212083757.605022-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.20; envelope-from=zhenzhong.duan@intel.com; helo=mgamail.intel.com X-Spam_score_int: -48 X-Spam_score: -4.9 X-Spam_bar: ---- X-Spam_report: (-4.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.472, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1733993009690116600 According to VTD spec, stage-1 page table could support 4-level and 5-level paging. However, 5-level paging translation emulation is unsupported yet. That means the only supported value for aw_bits is 48. So default aw_bits to 48 when stage-1 translation is turned on. For legacy and scalable modes, 48 is the default choice for modern OS when both 48 and 39 are supported. So it makes sense to set default to 48 for these two modes too starting from QEMU 9.2. Use pc_compat_9_1 to handle the compatibility for machines before 9.2. Suggested-by: Jason Wang Signed-off-by: Zhenzhong Duan Reviewed-by: Cl=C3=A9ment Mathieu--Drif Reviewed-by: Yi Liu Acked-by: Jason Wang --- include/hw/i386/intel_iommu.h | 2 +- hw/i386/pc.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h index a434c2489c..72428fefa4 100644 --- a/include/hw/i386/intel_iommu.h +++ b/include/hw/i386/intel_iommu.h @@ -45,7 +45,7 @@ OBJECT_DECLARE_SIMPLE_TYPE(IntelIOMMUState, INTEL_IOMMU_D= EVICE) #define DMAR_REG_SIZE 0x230 #define VTD_HOST_AW_39BIT 39 #define VTD_HOST_AW_48BIT 48 -#define VTD_HOST_ADDRESS_WIDTH VTD_HOST_AW_39BIT +#define VTD_HOST_ADDRESS_WIDTH VTD_HOST_AW_48BIT #define VTD_HAW_MASK(aw) ((1ULL << (aw)) - 1) =20 #define DMAR_REPORT_F_INTR (1) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 317aaca25a..5c1ceebe6a 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -83,6 +83,7 @@ GlobalProperty pc_compat_9_1[] =3D { { "ICH9-LPC", "x-smi-swsmi-timer", "off" }, { "ICH9-LPC", "x-smi-periodic-timer", "off" }, { TYPE_INTEL_IOMMU_DEVICE, "stale-tm", "on" }, + { TYPE_INTEL_IOMMU_DEVICE, "aw-bits", "39" }, }; const size_t pc_compat_9_1_len =3D G_N_ELEMENTS(pc_compat_9_1); =20 --=20 2.34.1