[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v2 for-next v2 2/8] x86/mm: carve out create_grant_pv_mapping
We will later split out PV specific code to pv/mm.c. No functional change. Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- xen/arch/x86/mm.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index be4e308608..2137f2b6f8 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4269,15 +4269,12 @@ static int create_grant_p2m_mapping(uint64_t addr, unsigned long frame, return GNTST_okay; } -int create_grant_host_mapping(uint64_t addr, unsigned long frame, - unsigned int flags, unsigned int cache_flags) +static int create_grant_pv_mapping(uint64_t addr, unsigned long frame, + unsigned int flags, unsigned int cache_flags) { l1_pgentry_t pte; uint32_t grant_pte_flags; - if ( paging_mode_external(current->domain) ) - return create_grant_p2m_mapping(addr, frame, flags, cache_flags); - grant_pte_flags = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_GNTTAB; if ( cpu_has_nx ) @@ -4300,6 +4297,15 @@ int create_grant_host_mapping(uint64_t addr, unsigned long frame, return create_grant_va_mapping(addr, pte, current); } +int create_grant_host_mapping(uint64_t addr, unsigned long frame, + unsigned int flags, unsigned int cache_flags) +{ + if ( paging_mode_external(current->domain) ) + return create_grant_p2m_mapping(addr, frame, flags, cache_flags); + + return create_grant_pv_mapping(addr, frame, flags, cache_flags); +} + static int replace_grant_p2m_mapping( uint64_t addr, unsigned long frame, uint64_t new_addr, unsigned int flags) { -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |