Re: [RFC/PATCH v2 03/22] s390/mm: add gmap PMD invalidation notification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22.01.2018 12:56, David Hildenbrand wrote:
> 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?
> 

It's in the GMAP segment entry, not in the process' segment entry.
That's why we throw away all software bits from the process entry when
linking into the gmap table.

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux