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

[xen master] x86/iommu: adjust type in arch_iommu_hwdom_init()



commit 053ffa783e6e8f402ba6bafd620666a3623c0fc8
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Thu May 25 14:57:14 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu May 25 14:57:14 2023 +0200

    x86/iommu: adjust type in arch_iommu_hwdom_init()
    
    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>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 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 9c868db63b..be71a4c464 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);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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