ia64/xen-unstable

annotate xen/include/asm-x86/grant_table.h @ 15812:86a154e1ef5d

[HVM] Shadow: don't shadow the p2m table.
For HVM vcpus with paging disabled, we used to shadow the p2m table,
and skip the p2m lookup to go from gfn to mfn. Instead, we now
provide a simple pagetable that gives a one-to-one mapping of 4GB, and
shadow that, making the translations from gfn to mfn via the p2m.
This removes the paging-disabled special-case code from the shadow
fault handler, and allows us to expand the p2m interface, since all HVM
translations now go through the same p2m lookups.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Fri Aug 31 11:06:22 2007 +0100 (2007-08-31)
parents 3d5f39c610ad
children 2e5d922b7ee3
rev   line source
kaf24@8001 1 /******************************************************************************
kaf24@8001 2 * include/asm-x86/grant_table.h
kaf24@8001 3 *
kaf24@8001 4 * Copyright (c) 2004-2005 K A Fraser
kaf24@8001 5 */
kaf24@8001 6
kaf24@8001 7 #ifndef __ASM_GRANT_TABLE_H__
kaf24@8001 8 #define __ASM_GRANT_TABLE_H__
kaf24@8001 9
kfraser@13970 10 #define INITIAL_NR_GRANT_FRAMES 4
kaf24@8001 11
kaf24@8001 12 /*
kaf24@8001 13 * Caller must own caller's BIGLOCK, is responsible for flushing the TLB, and
kaf24@8001 14 * must hold a reference to the page.
kaf24@8001 15 */
kaf24@8001 16 int create_grant_host_mapping(
kfraser@12227 17 uint64_t addr, unsigned long frame, unsigned int flags);
kfraser@15235 18 int replace_grant_host_mapping(
kfraser@15235 19 uint64_t addr, unsigned long frame, uint64_t new_addr, unsigned int flags);
kaf24@8001 20
kaf24@8726 21 #define gnttab_create_shared_page(d, t, i) \
kaf24@8001 22 do { \
kaf24@9200 23 share_xen_page_with_guest( \
kfraser@13970 24 virt_to_page((char *)(t)->shared[i]), \
kaf24@9200 25 (d), XENSHARE_writable); \
kaf24@8001 26 } while ( 0 )
kaf24@8001 27
kaf24@8001 28 #define gnttab_shared_mfn(d, t, i) \
kfraser@13970 29 ((virt_to_maddr((t)->shared[i]) >> PAGE_SHIFT))
kaf24@8001 30
kaf24@8726 31 #define gnttab_shared_gmfn(d, t, i) \
kaf24@8726 32 (mfn_to_gmfn(d, gnttab_shared_mfn(d, t, i)))
kaf24@8722 33
Tim@15310 34 #define gnttab_mark_dirty(d, f) paging_mark_dirty((d), (f))
kaf24@8001 35
kaf24@10614 36 static inline void gnttab_clear_flag(unsigned long nr, uint16_t *addr)
kaf24@10614 37 {
kfraser@11204 38 clear_bit(nr, addr);
kaf24@10614 39 }
kaf24@10614 40
kfraser@14418 41 #define gnttab_release_put_page(page) \
kfraser@14418 42 do { \
kfraser@14418 43 /* Done implicitly when page tables are destroyed. */ \
kfraser@14418 44 } while (0)
kfraser@14418 45
kfraser@14418 46 #define gnttab_release_put_page_and_type(page) \
kfraser@14418 47 do { \
kfraser@14418 48 /* Done implicitly when page tables are destroyed. */ \
kfraser@14418 49 } while (0)
kfraser@14418 50
kfraser@15235 51 static inline int replace_grant_supported(void)
kfraser@15235 52 {
kfraser@15235 53 return 1;
kfraser@15235 54 }
kfraser@15235 55
kaf24@8001 56 #endif /* __ASM_GRANT_TABLE_H__ */