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

[PATCH v2] x86/iommu: adjust type in arch_iommu_hwdom_init()


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Wed, 24 May 2023 16:30:50 +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=evojdKPoO2vv7sqJFZpt7vipqjpyXG9GSYbmRyw6PoA=; b=CdehBN+XqJNfCtXa/5ny9GT6lRkl/W8qqWDyUhp5xn1QJWFLRDXbfrqnTjNFvtciDNIN0b3dpXE+qrWImcst07otmfxd9l/Vv4Jz7KLKKPa/PTw86Kkst5309q6uANUY354gLt24/OiQl93Dsa8DPsMqzyPNmBiXdhVX5uRgOOZr4RVeCjgel6IBp9czG6MChy9tFgNFh1Pu+QTSwyEyxwfBndVtR7Vjvr2kyfREFNEhouKOtS8Oy8Lw34R93xyjnERnaS5oKE7y6R3NpfGNhHSCmvK+TgXpA1E+bkWTLGRzjO/SDWAZf/gXtSuV3hu7fJv++47oqr0qUke7WltyjQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HYaPZRjsLMC6Vj+WMKxVqm2Psa+NTAInsCE278gsyCqswtGnCcEttnjjJmb9rEp85bGfwPE0Zi7KxW+7K5riLVNi2iRf5PcwWInCYyjjWtC5QVoaystvMvNwFpmqU0nq9g8Npq0TPO5x+FUun7M8/HhsomTTHhPA2CT8RAzwqw+/ESNtFbLFFUpmjliULrXFTcnu3whMgzYmhOycRFHd6diEJTV5AXxQsTXTSLPCZvhVFS8VFlXSB/s9URP+dqJ0l+FrfUjJnGrtgCyxh6nhyZ8EuL36y6yPY1uoPEUQ3q1dnBys+o4A8TypP7Av42uOi8NYhqC+DQ6yWxvxYkbuGQ==
  • 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: Wed, 24 May 2023 14:34:24 +0000
  • Ironport-data: A9a23:4NFo0qjiH0DJktbdWkGgk/U8X161QxEKZh0ujC45NGQN5FlHY01je htvXWHQaPePYGbyKd5xPY/l8xgHvpOGmtMxHlE9rSg0RSMb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsx+qyq0N8klgZmP6sT4QWCzyJ94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVBktubD12i+ tQlKjQAcACmjtuKnpGaabJvt5Q5Ksn0adZ3VnFIlVk1DN4AaLWaGuDhwoYd2z09wMdTAfzZe swVLyJ1awjNaAFOPVFRD48imOCvhT/0dDgwRFC9/PJrpTSMilEvluGybLI5efTTLSlRtlyfq W/cuXzwHzkRNcCFyCrD+XWp7gPKtXqiANxJS+XkqJaGhnW69EcSJT8ueWfn//iAsGiRQf1Vd Gwbr39GQa8asRbDosPGdw21pjuIswARX/JUEvYm80edx6zM+QGbC2MYCDlbZ7QOtsU7WDgr3 V+hhM7yCHpkt7j9YWqU67O8vT60fy8PIgc/iTQsSAIE55zop9g1hxeWF9J7Svfq0pvyBC36x C2MoG4mnbIPgMUX1qK9u1fanzaroZuPRQkwjunKYl+YAspCTNbNT+SVBZLzt6sowFqxJrVZg EU5pg==
  • Ironport-hdrordr: A9a23:HYw6362GYtL4SSGh5oWOBwqjBIckLtp133Aq2lEZdPWaSL3gqy nIpoVh6faUskdoZJhEo7q90ca7MBbhHPJOkOss1PKZLWrbUQiTTb2Kj7GSpwEIcheWnoVgPO VbE5SWY+eAamSS4/yKhjVQ0OxN/DBEys2VbCvloEuFhDsFV51d
  • 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.

This is harmless currently, as the PDX compression skips the bottom
MAX_ORDER bits which cover the low 1MB, but still do the conversion
from PDX to PFN for type correctness.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
Changes since v1:
 - Soften the description as it's not an error.
---
 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®.