diff mbox

[Xen-devel,v5,05/17] xen/passthrough: x86: Use INVALID_GFN rather than INVALID_MFN

Message ID 1467130643-23868-6-git-send-email-julien.grall@arm.com
State Superseded
Headers show

Commit Message

Julien Grall June 28, 2016, 4:17 p.m. UTC
A variable containing a guest frame should be compared to INVALID_GFN
and not INVALID_GFN.

Signed-off-by: Julien Grall <julien.grall@arm.com>

---
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>

    Changes in v5:
        - Patch added
---
 xen/drivers/passthrough/amd/iommu_map.c | 2 +-
 xen/drivers/passthrough/x86/iommu.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Julien Grall June 28, 2016, 5:04 p.m. UTC | #1
On 28/06/16 17:47, Juergen Gross wrote:
> On 28/06/16 18:43, Andrew Cooper wrote:
>> On 28/06/16 17:17, Julien Grall wrote:
>>> A variable containing a guest frame should be compared to INVALID_GFN
>>> and not INVALID_GFN.
>
> I think the text should be changed? I'd expect one 'G' being replaced
> bay 'M'. :-)

Correct, the second should be replaced by a 'M'. Thank you for spotting it.

Cheers,

>>>
>>> Signed-off-by: Julien Grall <julien.grall@arm.com>
>>
>> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> I suspect these (mis)uses predate my movement of INVALID_GFN from x86
>> paging code to common code.
>>
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xen.org
>> http://lists.xen.org/xen-devel
>>
>
diff mbox

Patch

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 1b914ba..c758459 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -555,7 +555,7 @@  static int update_paging_mode(struct domain *d, unsigned long gfn)
     unsigned long old_root_mfn;
     struct domain_iommu *hd = dom_iommu(d);
 
-    if ( gfn == INVALID_MFN )
+    if ( gfn == INVALID_GFN )
         return -EADDRNOTAVAIL;
     ASSERT(!(gfn >> DEFAULT_DOMAIN_ADDRESS_WIDTH));
 
diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c
index a18a608..cd435d7 100644
--- a/xen/drivers/passthrough/x86/iommu.c
+++ b/xen/drivers/passthrough/x86/iommu.c
@@ -61,7 +61,7 @@  int arch_iommu_populate_page_table(struct domain *d)
             unsigned long mfn = page_to_mfn(page);
             unsigned long gfn = mfn_to_gmfn(d, mfn);
 
-            if ( gfn != INVALID_MFN )
+            if ( gfn != INVALID_GFN )
             {
                 ASSERT(!(gfn >> DEFAULT_DOMAIN_ADDRESS_WIDTH));
                 BUG_ON(SHARED_M2P(gfn));