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

[Xen-changelog] [xen-unstable] cleanup get_gfn_from_base_reg() function.



# HG changeset patch
# User Wei Wang <wei.wang2@xxxxxxx>
# Date 1326728175 -3600
# Node ID 6f8d5e8fdf1f77915c8b8c3b740a9eeec6ce869d
# Parent  0d4a60bf37b95b58bbae7019e0c263c556999131
cleanup get_gfn_from_base_reg() function.

Signed-off-by: Wei Wang <wei.wang2@xxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Committed-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r 0d4a60bf37b9 -r 6f8d5e8fdf1f xen/drivers/passthrough/amd/iommu_guest.c
--- a/xen/drivers/passthrough/amd/iommu_guest.c Mon Jan 16 09:55:05 2012 +0100
+++ b/xen/drivers/passthrough/amd/iommu_guest.c Mon Jan 16 16:36:15 2012 +0100
@@ -121,16 +121,9 @@
 
 static unsigned long get_gfn_from_base_reg(uint64_t base_raw)
 {
-    struct mmio_reg reg;
-    uint64_t addr64;
-
-    reg.lo = iommu_get_addr_lo_from_reg(base_raw & DMA_32BIT_MASK);
-    reg.hi = iommu_get_addr_hi_from_reg(base_raw >> 32);
-    addr64 = reg_to_u64(reg);
-
-    ASSERT ( addr64 != 0 );
-
-    return addr64 >> PAGE_SHIFT;
+    base_raw &= PADDR_MASK;
+    ASSERT ( base_raw != 0 );
+    return base_raw >> PAGE_SHIFT;
 }
 
 static void guest_iommu_deliver_msi(struct domain *d)
diff -r 0d4a60bf37b9 -r 6f8d5e8fdf1f 
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h
--- a/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h     Mon Jan 16 09:55:05 
2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/amd-iommu-proto.h     Mon Jan 16 16:36:15 
2012 +0100
@@ -257,16 +257,4 @@
                          IOMMU_REG_BASE_ADDR_HIGH_SHIFT, reg);
 }
 
-static inline uint32_t iommu_get_addr_lo_from_reg(uint32_t reg)
-{
-    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_LOW_MASK,
-                                  IOMMU_REG_BASE_ADDR_LOW_SHIFT);
-}
-
-static inline uint32_t iommu_get_addr_hi_from_reg(uint32_t reg)
-{
-    return get_field_from_reg_u32(reg, IOMMU_REG_BASE_ADDR_HIGH_MASK,
-                                  IOMMU_REG_BASE_ADDR_HIGH_SHIFT);
-}
-
 #endif /* _ASM_X86_64_AMD_IOMMU_PROTO_H */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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