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

[PATCH] x86/iommu: fix wrong iterator type in arch_iommu_hwdom_init()


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Tue, 9 May 2023 13:03:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=EEVdwpNoDpCMI+qjQBMvK79jWyy35hxraOfYHbD9/PY=; b=O9+8EH3RpAZ0E5HHTlmp1MC3Du80FxScR3EmY7iA1PjdVCCkQEmIjue6xOxQOpky5gzffzr0IBop4lC2Mob5jCvAvf+k9FUQSoaoqy7e883YZVJhpmsCS2no7vnsfzh3pL/9FGz5RhtkLQ5iySZDKm8V9dtKSKb+ZU1hkD5PaWAUQBm8CQtq04By0JwHyfLwd41tY+tShKNNCWf3kQrgSK76Q+h2XK/iogWX8DEsiFDhZUjamO8YYJOQGFs+XUYEWdKgIjRySKyQaq79CQ+TXePmZ7PA1Ev5a5P4JGSwPe6AU058SRjG8CTDxLg0djdxAZRfOP9X2R0s6O1B3eKbCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K6399ZA2Lw2MTkbtY75Ek8PEkSQjCkgWKIo3OUkvDWAyZBiJywN+wRXidEdeY3EHarQBNLZkrPQrNvbXHxRWe366iLyTIXvmpyzu8N5KUJYQv8W7/75vkLbsDOZkb/KR966ocs+M+rbjTKY7C9+ez1M4q6Ql07+t8ZnEvYfmrU36/uGITR+f2rgrvqALOCli+K8x638eRjyr9u9LhbcT+DEEk3uNrPc18TNqX1Qlx/63vkOXb02QCs6KgvFCYnUdDgXhQUE/vr1kOuq56TFfCjmfgOKaCMsbaTc4rPrm+4fTVB2Uks48uCxGRzPdYKkRsRvLZQ6mGZajuZ7LKpoCKg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • Delivery-date: Tue, 09 May 2023 11:04:24 +0000
  • Ironport-data: A9a23:utWWbK0v67ioTzkJufbD5fNwkn2cJEfYwER7XKvMYLTBsI5bp2BRn GIcCm7VbvjYYjOmftAjaYS08BsBvZ6AnNVjSFE/pC1hF35El5HIVI+TRqvS04F+DeWYFR46s J9OAjXkBJppJpMJjk71atANlVEliefTAOK6ULWeUsxIbVcMYD87jh5+kPIOjIdtgNyoayuAo tq3qMDEULOf82cc3lk8tuTS+XuDgNyo4GlD5gFmNKgS1LPjvyJ94Kw3dPnZw0TQGuG4LsbiL 87fwbew+H/u/htFIrtJRZ6iLyXm6paLVeS/oiI+t5qK23CulQRrukoPD9IOaF8/ttm8t4sZJ OOhF3CHYVxB0qXkwIzxWvTDes10FfUuFLTveRBTvSEPpqFvnrSFL/hGVSkL0YMkFulfIEtsq dM/Gm00SAm6q9qGxOmWCe92mZF2RCXrFNt3VnBI6xj8VKxja7aTBqLA6JlfwSs6gd1IEbDGf c0FZDFzbRPGJRpSJlMQD5F4l+Ct7pX9W2QA9BTJ+uxqvi6Kk1UZPLvFabI5fvSQQspYhACAr 3/u9GXlGBAKcteYzFJp91r13r+Qwn2mCN16+LuQxvlgsFar2XApEQQvCkn4sPaWlxGOYocKQ 6AT0m90xUQoz2S7Q9+4UxCmrXqsuh8HR8EWA+A88BuKyKff/0CeHGdsZjxLZcEitcQ2bSc3z VLPlNTsbRR3uaCRYWKQ8PGTtzzaBMQOBWoLZCtBRw1V5dDm+ds3lkiWEY8lF7OphNroHz222 yqNsCU1m7QUi4gMyrm/+lfExTmro/AlUzII2+keZUr9hisRWWJvT9bABYTzhRqYELukcw==
  • Ironport-hdrordr: A9a23:Y/BNhKnc99t3ZEFori5IRw/2tULpDfL13DAbv31ZSRFFG/Fw9v re4cjzsCWetN9/YhAdcK+7Sc+9qB/nmaKdorNhRItKJTOWw1dAdbsSl7cKoAeQZxEWlNQ86U 4IScEXYuEYa2IUsS+Q2mSF+rgbruVujciT9J/jJqNWPGNXg90J1XYfNu/iKDwUeOCwP+tcKH M03Lsjmwad
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The 'i' iterator index stores a pdx, not a pfn, and hence the initial
assignation of start (which stores a pfn) needs a conversion from pfn
to pdx.

Fixes: 6b4f6a31ace1 ('x86/PVH: de-duplicate mappings for first Mb of Dom0 
memory')
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/drivers/passthrough/x86/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/x86/iommu.c 
b/xen/drivers/passthrough/x86/iommu.c
index cb0788960a08..6bc79e7ec843 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -406,7 +406,7 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d)
      */
     start = paging_mode_translate(d) ? PFN_DOWN(MB(1)) : 0;
 
-    for ( i = start, count = 0; i < top; )
+    for ( i = pfn_to_pdx(start), count = 0; i < top; )
     {
         unsigned long pfn = pdx_to_pfn(i);
         unsigned int perms = hwdom_iommu_map(d, pfn, max_pfn);
-- 
2.40.0




 


Rackspace

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