From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: Re: [RFC/PATCH v2 03/22] s390/mm: add gmap PMD invalidation notification Date: Mon, 22 Jan 2018 12:56:07 +0100 Message-ID: <5a4805ea-7b97-60ca-a4a6-e456fe7475c6@redhat.com> References: <1513169613-13509-1-git-send-email-frankja@linux.vnet.ibm.com> <1513169613-13509-4-git-send-email-frankja@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: schwidefsky@de.ibm.com, borntraeger@de.ibm.com, dominik.dingel@gmail.com, linux-s390@vger.kernel.org To: Janosch Frank , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:50382 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751028AbeAVL4J (ORCPT ); Mon, 22 Jan 2018 06:56:09 -0500 In-Reply-To: <1513169613-13509-4-git-send-email-frankja@linux.vnet.ibm.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: 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 > --- > 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