On 13.12.2017 13:53, Janosch Frank wrote: > For later migration of huge pages we want to write-protect guest > PMDs. While doing this, we have to make absolutely sure, that the > guest's lowcore is always accessible when the VCPU is running. With > PTEs, this is solved by marking the PGSTEs of the lowcore pages with > the invalidation notification bit and kicking the guest out of the SIE > via a notifier function if we need to invalidate such a page. > > With PMDs we do not have PGSTEs or some other bits we could use in the > host PMD. Instead we pick one of the free bits in the gmap PMD. Every > time a host pmd will be invalidated, we will check if the respective > gmap PMD has the bit set and in that case fire up the notifier. > > In the first step we only support setting the invalidation bit, but we > do not support restricting access of guest pmds. It will follow > shortly. > > Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxxxxxxx> > --- > arch/s390/include/asm/gmap.h | 3 ++ > arch/s390/include/asm/pgtable.h | 7 +++- > arch/s390/mm/gmap.c | 92 ++++++++++++++++++++++++++++++++++++----- > arch/s390/mm/pgtable.c | 4 ++ > 4 files changed, 94 insertions(+), 12 deletions(-) > > diff --git a/arch/s390/include/asm/gmap.h b/arch/s390/include/asm/gmap.h > index c1bc563..21bb658 100644 > --- a/arch/s390/include/asm/gmap.h > +++ b/arch/s390/include/asm/gmap.h > @@ -13,6 +13,9 @@ > #define GMAP_NOTIFY_SHADOW 0x2 > #define GMAP_NOTIFY_MPROT 0x1 > > +/* Status bits in the gmap segment entry. */ > +#define _SEGMENT_ENTRY_GMAP_IN 0x0001 /* invalidation notify bit */ > + _SEGMENT_ENTRY_READ -> 0x0001 Is it even okay to reuse that bit? -- Thanks, David / dhildenb -- To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html