@@ -277,7 +277,7 @@ const char *__init dmi_get_table(paddr_t *base, u32 *len)
return "SMBIOS";
}
} else {
- char __iomem *p = maddr_to_virt(0xF0000), *q;
+ char __iomem *p = maddr_to_directmap_virt(0xF0000), *q;
union {
struct dmi_eps dmi;
struct smbios3_eps smbios3;
@@ -364,7 +364,7 @@ static int __init dmi_iterate(void (*decode)(const struct dmi_header *))
dmi.size = 0;
smbios3.length = 0;
- p = maddr_to_virt(0xF0000);
+ p = maddr_to_directmap_virt(0xF0000);
for (q = p; q < p + 0x10000; q += 16) {
if (!dmi.size) {
memcpy_fromio(&dmi, q, sizeof(dmi));
@@ -7,7 +7,7 @@
*/
static inline unsigned int get_bios_ebda(void)
{
- unsigned int address = *(unsigned short *)maddr_to_virt(0x40E);
+ unsigned int address = *(unsigned short *)maddr_to_directmap_virt(0x40E);
address <<= 4;
return address; /* 0 means none */
}
@@ -240,11 +240,11 @@ void copy_page_sse2(void *to, const void *from);
/* Convert between Xen-heap virtual addresses and machine addresses. */
#define __pa(x) (virt_to_maddr(x))
-#define __va(x) (maddr_to_virt(x))
+#define __va(x) (maddr_to_directmap_virt(x))
/* Convert between Xen-heap virtual addresses and machine frame numbers. */
#define __virt_to_mfn(va) (virt_to_maddr(va) >> PAGE_SHIFT)
-#define __mfn_to_virt(mfn) (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT))
+#define __mfn_to_virt(mfn) (maddr_to_directmap_virt((paddr_t)(mfn) << PAGE_SHIFT))
/* Convert between machine frame numbers and page-info structures. */
#define mfn_to_page(mfn) (frame_table + mfn_to_pdx(mfn))
@@ -270,7 +270,7 @@ void copy_page_sse2(void *to, const void *from);
#define virt_to_mfn(va) __virt_to_mfn(va)
#define mfn_to_directmap_virt(mfn) __mfn_to_virt(mfn)
#define virt_to_maddr(va) __virt_to_maddr((unsigned long)(va))
-#define maddr_to_virt(ma) __maddr_to_virt((unsigned long)(ma))
+#define maddr_to_directmap_virt(ma) __maddr_to_directmap_virt((unsigned long)(ma))
#define maddr_to_page(ma) __maddr_to_page(ma)
#define page_to_maddr(pg) __page_to_maddr(pg)
#define virt_to_page(va) __virt_to_page(va)
@@ -48,7 +48,7 @@ static inline unsigned long __virt_to_maddr(unsigned long va)
return xen_phys_start + va - XEN_VIRT_START;
}
-static inline void *__maddr_to_virt(unsigned long ma)
+static inline void *__maddr_to_directmap_virt(unsigned long ma)
{
/* Offset in the direct map, accounting for pdx compression */
unsigned long va_offset = maddr_to_directmapoff(ma);
@@ -664,7 +664,7 @@ void __init get_smp_config (void)
static int __init smp_scan_config (unsigned long base, unsigned long length)
{
- unsigned int *bp = maddr_to_virt(base);
+ unsigned int *bp = maddr_to_directmap_virt(base);
struct intel_mp_floating *mpf;
Dprintk("Scan SMP from %p for %ld bytes.\n", bp,length);
@@ -1764,7 +1764,7 @@ void __init efi_init_memory(void)
if ( map_pages_to_xen((unsigned long)mfn_to_directmap_virt(smfn),
_mfn(smfn), emfn - smfn, prot) == 0 )
desc->VirtualStart =
- (unsigned long)maddr_to_virt(desc->PhysicalStart);
+ (unsigned long)maddr_to_directmap_virt(desc->PhysicalStart);
else
printk(XENLOG_ERR "Could not map MFNs %#lx-%#lx\n",
smfn, emfn - 1);
Until directmap gets completely removed, we'd still need to keep some calls to mmaddr_to_virt() for xenheap pages or when the directmap is enabled. Rename the macro to maddr_to_directmap_virt() to flag them and prevent further use of maddr_to_virt(). Signed-off-by: Elias El Yandouzi <eliasely@amazon.com>