diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-29 15:39:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-15 12:01:53 -0700 |
commit | fa56d361b07513cba87cc5c2b57f3f51248f89a8 (patch) | |
tree | b07a8b549d3c457637396b873534bc03e7180489 /drivers/staging/hv/Hv.c | |
parent | 4a66384567dfa68fb0bf6604842b1262e601d4a2 (diff) | |
download | op-kernel-dev-fa56d361b07513cba87cc5c2b57f3f51248f89a8.zip op-kernel-dev-fa56d361b07513cba87cc5c2b57f3f51248f89a8.tar.gz |
Staging: hv: osd: remove physical address wrapper functions
Use the real functions the kernel provides, so that people can see what
is actually going on in the code easier.
Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/hv/Hv.c')
-rw-r--r-- | drivers/staging/hv/Hv.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/staging/hv/Hv.c b/drivers/staging/hv/Hv.c index 4b9b3fb..87dc628 100644 --- a/drivers/staging/hv/Hv.c +++ b/drivers/staging/hv/Hv.c @@ -22,6 +22,7 @@ */ #include <linux/vmalloc.h> +#include <asm/io.h> #include "include/logging.h" #include "VmbusPrivate.h" @@ -166,8 +167,8 @@ HvDoHypercall ( { #ifdef CONFIG_X86_64 u64 hvStatus=0; - u64 inputAddress = (Input)? GetPhysicalAddress(Input) : 0; - u64 outputAddress = (Output)? GetPhysicalAddress(Output) : 0; + u64 inputAddress = (Input)? virt_to_phys(Input) : 0; + u64 outputAddress = (Output)? virt_to_phys(Output) : 0; volatile void* hypercallPage = gHvContext.HypercallPage; DPRINT_DBG(VMBUS, "Hypercall <control %llx input phys %llx virt %p output phys %llx virt %p hypercall %p>", @@ -191,10 +192,10 @@ HvDoHypercall ( u32 controlLo = Control & 0xFFFFFFFF; u32 hvStatusHi = 1; u32 hvStatusLo = 1; - u64 inputAddress = (Input) ? GetPhysicalAddress(Input) : 0; + u64 inputAddress = (Input) ? virt_to_phys(Input) : 0; u32 inputAddressHi = inputAddress >> 32; u32 inputAddressLo = inputAddress & 0xFFFFFFFF; - u64 outputAddress = (Output) ?GetPhysicalAddress(Output) : 0; + u64 outputAddress = (Output) ? virt_to_phys(Output) : 0; u32 outputAddressHi = outputAddress >> 32; u32 outputAddressLo = outputAddress & 0xFFFFFFFF; volatile void* hypercallPage = gHvContext.HypercallPage; @@ -276,8 +277,8 @@ HvInit ( } hypercallMsr.Enable = 1; - /* hypercallMsr.GuestPhysicalAddress = Logical2PhysicalAddr(virtAddr) >> PAGE_SHIFT; */ - hypercallMsr.GuestPhysicalAddress = Virtual2Physical(virtAddr) >> PAGE_SHIFT; + /* hypercallMsr.GuestPhysicalAddress = virt_to_phys(virtAddr) >> PAGE_SHIFT; */ + hypercallMsr.GuestPhysicalAddress = vmalloc_to_pfn(virtAddr); WriteMsr(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); /* Confirm that hypercall page did get setup. */ @@ -507,8 +508,8 @@ HvSynicInit ( if (guestID == HV_LINUX_GUEST_ID) { - gHvContext.synICMessagePage[0] = GetVirtualAddress(simp.BaseSimpGpa << PAGE_SHIFT); - gHvContext.synICEventPage[0] = GetVirtualAddress(siefp.BaseSiefpGpa << PAGE_SHIFT); + gHvContext.synICMessagePage[0] = phys_to_virt(simp.BaseSimpGpa << PAGE_SHIFT); + gHvContext.synICEventPage[0] = phys_to_virt(siefp.BaseSiefpGpa << PAGE_SHIFT); } else { @@ -536,7 +537,7 @@ HvSynicInit ( /* Setup the Synic's message page */ simp.AsUINT64 = ReadMsr(HV_X64_MSR_SIMP); simp.SimpEnabled = 1; - simp.BaseSimpGpa = GetPhysicalAddress(gHvContext.synICMessagePage[0]) >> PAGE_SHIFT; + simp.BaseSimpGpa = virt_to_phys(gHvContext.synICMessagePage[0]) >> PAGE_SHIFT; DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.AsUINT64); @@ -545,7 +546,7 @@ HvSynicInit ( /* Setup the Synic's event page */ siefp.AsUINT64 = ReadMsr(HV_X64_MSR_SIEFP); siefp.SiefpEnabled = 1; - siefp.BaseSiefpGpa = GetPhysicalAddress(gHvContext.synICEventPage[0]) >> PAGE_SHIFT; + siefp.BaseSiefpGpa = virt_to_phys(gHvContext.synICEventPage[0]) >> PAGE_SHIFT; DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.AsUINT64); |