s390/mm: Add gmap shadowing for large pmds
Janosch Frank
maintainerRFC 11/14 s390/mm: Add gmap shadowing for large pmds
Up to now we could only shadow large pmds when the parent's mapping was done with normal sized pmds. This is done by introducing fake page tables and effectively running the level 3 guest with a standard memory backing instead of the large one.
With this patch we add shadowing when the host is large page backed. This allows us to run normal and large backed VMs inside a large backed host.
Signed-off-by Janosch Frank <[email protected]>
--- arch/s390/include/asm/gmap.h | 9 +- arch/s390/kvm/gaccess.c | 52 +++++-- arch/s390/mm/gmap.c | 327 +++++++++++++++++++++++++++++++++++-------- 3 files changed, 316 insertions(+), 72 deletions(-)
arch/s390/include/asm/gmap.h +6 -3
@@ -16,11 +16,12 @@/* Status bits only for huge segment entries */ #define _SEGMENT_ENTRY_GMAP_IN 0x8000/* invalidation notify bit */ #define _SEGMENT_ENTRY_GMAP_UC 0x4000/* dirty (migration) */ +#define _SEGMENT_ENTRY_GMAP_VSIE 0x2000/* vsie bit */ /* Status bits in the gmap segment entry. */ #define _SEGMENT_ENTRY_GMAP_SPLIT 0x0001/* split huge pmd */ #define GMAP_SEGMENT_STATUS_BITS (_SEGMENT_ENTRY_GMAP_UC | _SEGMENT_ENTRY_GMAP_SPLIT) -#define GMAP_SEGMENT_NOTIFY_BITS _SEGMENT_ENTRY_GMAP_IN +#define GMAP_SEGMENT_NOTIFY_BITS (_SEGMENT_ENTRY_GMAP_IN | _SEGMENT_ENTRY_GMAP_VSIE)/** * struct gmap_struct - guest address space
@@ -146,9 +147,11 @@ int gmap_shadow_sgt(struct gmap *sg, unsigned long saddr, unsigned long sgt, int fake);int gmap_shadow_pgt (struct gmap *sg,unsigned long saddr,unsigned long pgt,int fake); -int gmap_shadow_pgt_lookup (struct gmap *sg,unsigned long saddr, -unsigned long *pgt,int *dat_protection,int *fake); +int gmap_shadow_sgt_lookup (struct gmap *sg,unsigned long saddr, +unsigned long *pgt,int *dat_protection, +int *fake,int *lvl);int gmap_shadow_page (struct gmap *sg,unsigned long saddr,pte_t pte); +int gmap_shadow_segment (struct gmap *sg,unsigned long saddr,pmd_t pmd);void gmap_register_pte_notifier (struct gmap_notifier *);void gmap_unregister_pte_notifier (struct gmap_notifier *);
arch/s390/kvm/gaccess.c +44 -8
91 lines not on this page · raw message
arch/s390/mm/gmap.c +266 -61
415 lines not on this page · raw message
Signature · 1 line
2.14.3