From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751174AbdFAM7y (ORCPT ); Thu, 1 Jun 2017 08:59:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7725 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751083AbdFAM7w (ORCPT ); Thu, 1 Jun 2017 08:59:52 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3A30BC04B326 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=david@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3A30BC04B326 Subject: Re: [PATCH RFC 1/2] s390x: mm: allow mixed page table types (2k and 4k) To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Thomas Huth , Christian Borntraeger References: <20170529163202.13077-1-david@redhat.com> <20170529163202.13077-2-david@redhat.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <2bc699c3-f3ba-e8b1-1149-92b31a0bcb22@redhat.com> Date: Thu, 1 Jun 2017 14:59:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <20170529163202.13077-2-david@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Jun 2017 12:59:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c > index d4d409b..b22c2b6 100644 > --- a/arch/s390/mm/pgtable.c > +++ b/arch/s390/mm/pgtable.c > @@ -196,7 +196,7 @@ static inline pgste_t ptep_xchg_start(struct mm_struct *mm, > { > pgste_t pgste = __pgste(0); > > - if (mm_has_pgste(mm)) { > + if (pgtable_has_pgste(mm, __pa(ptep))) { > pgste = pgste_get_lock(ptep); > pgste = pgste_pte_notify(mm, addr, ptep, pgste); > } > @@ -207,7 +207,7 @@ static inline pte_t ptep_xchg_commit(struct mm_struct *mm, > unsigned long addr, pte_t *ptep, > pgste_t pgste, pte_t old, pte_t new) > { > - if (mm_has_pgste(mm)) { > + if (pgtable_has_pgste(mm, __pa(ptep))) { > if (pte_val(old) & _PAGE_INVALID) > pgste_set_key(ptep, pgste, new, mm); > if (pte_val(new) & _PAGE_INVALID) I think these two checks are wrong. We really have to test here the mapcount bit only (relying on mm_has_pgste(mm) is wrong in case global vm.allocate_pgste ist set). But before I continue working on this, I think it makes sense to clarify if something like that would be acceptable at all. -- Thanks, David