x86/mm: move guest_get_eff_l1e to pv/mm.h

Make it static inline. It will be used by map_ldt_shadow_page and ro
page fault emulation code later.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Wei Liu committed 2017-09-22 16:31:50 +01:00
1 parent da80c8788f
commit 0f43e9cb6f
2 files changed
+22 -17

No files matched your search

+1 -17
View File
@@ -127,6 +127,7 @@
#include <asm/pv/grant_table.h>
#include "pv/emulate.h"
#include "pv/mm.h"
/* Override macros from asm/page.h to make them work with mfn_t */
#undef mfn_to_page
@@ -564,23 +565,6 @@ static l1_pgentry_t *map_guest_l1e(unsigned long linear, mfn_t *gl1mfn)
return (l1_pgentry_t *)map_domain_page(*gl1mfn) + l1_table_offset(linear);
}
/* Read a PV guest's l1e that maps this linear address. */
static l1_pgentry_t guest_get_eff_l1e(unsigned long linear)
{
l1_pgentry_t l1e;
ASSERT(!paging_mode_translate(current->domain));
ASSERT(!paging_mode_external(current->domain));
if ( unlikely(!__addr_ok(linear)) ||
__copy_from_user(&l1e,
&__linear_l1_table[l1_linear_offset(linear)],
sizeof(l1_pgentry_t)) )
l1e = l1e_empty();
return l1e;
}
/*
* Read the guest's l1e that maps this address, from the kernel-mode
* page tables.
+21
View File
@@ -0,0 +1,21 @@
#ifndef __PV_MM_H__
#define __PV_MM_H__
/* Read a PV guest's l1e that maps this linear address. */
static inline l1_pgentry_t guest_get_eff_l1e(unsigned long linear)
{
l1_pgentry_t l1e;
ASSERT(!paging_mode_translate(current->domain));
ASSERT(!paging_mode_external(current->domain));
if ( unlikely(!__addr_ok(linear)) ||
__copy_from_user(&l1e,
&__linear_l1_table[l1_linear_offset(linear)],
sizeof(l1_pgentry_t)) )
l1e = l1e_empty();
return l1e;
}
#endif /* __PV_MM_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.