@@ -178,11 +178,6 @@ void *vmalloc(unsigned long size)
return mem;
}
-uint64_t virt_to_phys_cr3(void *mem)
-{
- return (*get_pte(phys_to_virt(read_cr3()), mem) & PT_ADDR_MASK) + ((ulong)mem & (PAGE_SIZE - 1));
-}
-
void vfree(void *mem)
{
unsigned long size = ((unsigned long *)mem)[-1];
@@ -12,7 +12,6 @@ void vfree(void *mem);
void *vmap(unsigned long long phys, unsigned long size);
void *alloc_vpage(void);
void *alloc_vpages(ulong nr);
-uint64_t virt_to_phys_cr3(void *mem);
unsigned long *get_pte(unsigned long *cr3, void *virt);
unsigned long *install_pte(unsigned long *cr3,
@@ -45,6 +45,11 @@ static inline uint32_t get_apf_reason(void)
return r;
}
+static uint64_t virt_to_phys_cr3(void *mem)
+{
+ return (*get_pte(phys_to_virt(read_cr3()), mem) & PT_ADDR_MASK) + ((ulong)mem & (PAGE_SIZE - 1));
+}
+
static void pf_isr(struct ex_regs *r)
{
void* virt = (void*)((ulong)(buf+i) & ~(PAGE_SIZE-1));
Public interface virt_to_phys_cr3() is only used in asyncpf test and does not make much sense for the rest of the code. This update turns it local to asyncpf only. Cc: Radim Krčmář <rkrcmar@redhat.com> Signed-off-by: Alexander Gordeev <agordeev@redhat.com> --- lib/x86/vm.c | 5 ----- lib/x86/vm.h | 1 - x86/asyncpf.c | 5 +++++ 3 files changed, 5 insertions(+), 6 deletions(-)