From nobody Thu Nov 6 16:12:02 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.intel.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1542175736945829.8557726933637; Tue, 13 Nov 2018 22:08:56 -0800 (PST) Received: from localhost ([::1]:58428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMoM3-0005BN-6E for importer@patchew.org; Wed, 14 Nov 2018 01:08:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gMoKN-0003x9-TH for qemu-devel@nongnu.org; Wed, 14 Nov 2018 01:07:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gMoKN-0007dA-0P for qemu-devel@nongnu.org; Wed, 14 Nov 2018 01:07:03 -0500 Received: from mga07.intel.com ([134.134.136.100]:25615) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gMoKM-0007bU-P2 for qemu-devel@nongnu.org; Wed, 14 Nov 2018 01:07:02 -0500 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 22:07:02 -0800 Received: from zhangyu-optiplex-9020.bj.intel.com ([10.238.135.159]) by fmsmga005.fm.intel.com with ESMTP; 13 Nov 2018 22:07:00 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,231,1539673200"; d="scan'208";a="279668576" From: Yu Zhang To: qemu-devel@nongnu.org Date: Wed, 14 Nov 2018 14:04:44 +0800 Message-Id: <1542175484-2742-4-git-send-email-yu.c.zhang@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542175484-2742-1-git-send-email-yu.c.zhang@linux.intel.com> References: <1542175484-2742-1-git-send-email-yu.c.zhang@linux.intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.100 Subject: [Qemu-devel] [PATCH v2 3/3] intel-iommu: extend iotlb search logic to cover 57-bit IOVA. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , Peter Xu , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The 64-bit key used by vtd_lookup_iotlb() to search the cached mappings is formed by combining the GFN, source id and the page level. To cover 57-bit IOVA, the shift of source id and of page level need to be enlarged by 9 - the stride of one paging structure level. Signed-off-by: Yu Zhang Reviewed-by: Peter Xu --- Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Cc: Paolo Bonzini =20 Cc: Richard Henderson =20 Cc: Eduardo Habkost Cc: Peter Xu --- hw/i386/intel_iommu_internal.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index a7ef24b..2b29b6f 100644 --- a/hw/i386/intel_iommu_internal.h +++ b/hw/i386/intel_iommu_internal.h @@ -114,8 +114,8 @@ VTD_INTERRUPT_ADDR_FIRST + 1) =20 /* The shift of source_id in the key of IOTLB hash table */ -#define VTD_IOTLB_SID_SHIFT 36 -#define VTD_IOTLB_LVL_SHIFT 52 +#define VTD_IOTLB_SID_SHIFT 45 +#define VTD_IOTLB_LVL_SHIFT 61 #define VTD_IOTLB_MAX_SIZE 1024 /* Max size of the hash table = */ =20 /* IOTLB_REG */ --=20 1.9.1