From: David Hildenbrand Subject: Re: [RFC/PATCH v3 04/16] s390/mm: add gmap PMD invalidation notification Date: Wed, 14 Feb 2018 16:15:36 +0100 Message-ID: References: <1518168864-147803-1-git-send-email-frankja@linux.vnet.ibm.com> <1518168864-147803-5-git-send-email-frankja@linux.vnet.ibm.com> <38c32f80-9225-8e71-7a8a-aa759cdbbfc7@redhat.com> <5fb02c01-bbda-bdd7-eb54-8e8ee525093c@linux.vnet.ibm.com> <6e6d3053-1526-230c-0fb3-6d57168f47c7@linux.vnet.ibm.com> <7009cdd4-bbf1-2802-b9a8-03c238ec8ae2@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-Archive: List-Post: To: Janosch Frank , kvm@vger.kernel.org Cc: schwidefsky@de.ibm.com, borntraeger@de.ibm.com, dominik.dingel@gmail.com, linux-s390@vger.kernel.org List-ID: >> So what can happen is (please correct me if I'm wrong) >> >> a) PMD is split. SSKE writes storage key with _PAGE_CHANGED, ends up in >> PGSTE. The real storage key doesn't match the requested storage key. >> b) Split PMD is replaced, triggers a removal of the split PMD -> >> gmap_pmd_split_free(pmdp). The requested storage key is partially lost >> (pgste removed). >> c) PMD is mapped in again. If the guest reads the storage key now, the >> value is wrong. > > Yes, we loose GR and GC. > Is there a case when the VM is running, where this would happen? It should already happen when migrating storage keys. The fake PGSTE are not considered in get_guest_storage_key(). For the other parts, the original user space PMD would have to be changed. A simply mprotect() should achieve that. Or dirty tracking. But not sure how that applies to huge pages at all. -- Thanks, David / dhildenb