Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp206651yba; Wed, 3 Apr 2019 07:18:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD83j7YBjQHOb6Rn0enPUfF2uWPqYeYGIYJAn09hVL6tkqTYx179PuoryPVmCu92g0RFv/ X-Received: by 2002:a62:4351:: with SMTP id q78mr62121284pfa.86.1554301128359; Wed, 03 Apr 2019 07:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554301128; cv=none; d=google.com; s=arc-20160816; b=wtvMAOj+CpIO6EVzOFuk6Ra01VaxZHo1EZxPMw0EqqKUlxrHAgi63NLTOKUgifc0QT qPPXYAxNZm5Jy4pIFQsQ4cNMuMgzvKTOrAMib0dAOu7LnAOakQUfFoDUjJXBAd31STUr wjeqc83ZISIrMZlDmtItZe81YeZV1wUO4z3mP52AlKEznCFqOLdKirCguZEeK459YZ+Q eygc/PhMvzE9AFZcEsbvx5YpnTvJq97hySpx0ofAqUtLxJEWJyndUauc0NicqMX83wJ5 +tn7Yx6bGYFBJQIwIU2Hl7se32yobeMgS7TlmSKwzQIn1C8A32APta6KvpWyAFUQuIuF d2fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=SYRxLnl8XLiyLdkh6TtJG1FrMibEOdTkR6dxxuI72gg=; b=rG7bnCQP8ASXHSFCNATPRmvM7GyApB2NKRZXiv2sUCwlQ7VFvFozhQsmMX3pbi8DIX CsoRJZCTphltwAUbKj4jYW8ebItVlQ+LqG49LqCWI/pMGG4phav0TZmhzwxth3QGXOn0 ecHR9hnhWgt1mh/3yD+I0PPU3+ZBaUjTyRDZ9Is5YUtzmquZbInC/8WubtleBxV0lyKC 7SjmvhIohNeZ5O8o4H+HLj6MhFGdMjzCoy02MIuUe85Nk3XD5rSjrkml5vllTuLsIRaI BMLC86RMFellg3UZl2ee7ojoboggwhM6SwpqotK+JQRv2qX+26e7KS8xveAWs8SSViM1 R8GA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j16si13990035pgl.335.2019.04.03.07.18.32; Wed, 03 Apr 2019 07:18:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbfDCORd (ORCPT + 99 others); Wed, 3 Apr 2019 10:17:33 -0400 Received: from foss.arm.com ([217.140.101.70]:41530 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfDCORc (ORCPT ); Wed, 3 Apr 2019 10:17:32 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A197EBD; Wed, 3 Apr 2019 07:17:32 -0700 (PDT) Received: from e112269-lin.arm.com (e112269-lin.cambridge.arm.com [10.1.196.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F06A03F68F; Wed, 3 Apr 2019 07:17:27 -0700 (PDT) From: Steven Price To: linux-mm@kvack.org Cc: Steven Price , Andy Lutomirski , Ard Biesheuvel , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Dave Hansen , Ingo Molnar , James Morse , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Peter Zijlstra , Thomas Gleixner , Will Deacon , x86@kernel.org, "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland , "Liang, Kan" , Andrew Morton , Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras , kvm-ppc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v8 05/20] KVM: PPC: Book3S HV: Remove pmd_is_leaf() Date: Wed, 3 Apr 2019 15:16:12 +0100 Message-Id: <20190403141627.11664-6-steven.price@arm.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190403141627.11664-1-steven.price@arm.com> References: <20190403141627.11664-1-steven.price@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since pmd_large() is now always available, pmd_is_leaf() is redundant. Replace all uses with calls to pmd_large(). CC: Benjamin Herrenschmidt CC: Michael Ellerman CC: Paul Mackerras CC: kvm-ppc@vger.kernel.org CC: linuxppc-dev@lists.ozlabs.org Signed-off-by: Steven Price --- arch/powerpc/kvm/book3s_64_mmu_radix.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_radix.c b/arch/powerpc/kvm/book3s_64_mmu_radix.c index f55ef071883f..1b57b4e3f819 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_radix.c +++ b/arch/powerpc/kvm/book3s_64_mmu_radix.c @@ -363,12 +363,6 @@ static void kvmppc_pte_free(pte_t *ptep) kmem_cache_free(kvm_pte_cache, ptep); } -/* Like pmd_huge() and pmd_large(), but works regardless of config options */ -static inline int pmd_is_leaf(pmd_t pmd) -{ - return !!(pmd_val(pmd) & _PAGE_PTE); -} - static pmd_t *kvmppc_pmd_alloc(void) { return kmem_cache_alloc(kvm_pmd_cache, GFP_KERNEL); @@ -460,7 +454,7 @@ static void kvmppc_unmap_free_pmd(struct kvm *kvm, pmd_t *pmd, bool full, for (im = 0; im < PTRS_PER_PMD; ++im, ++p) { if (!pmd_present(*p)) continue; - if (pmd_is_leaf(*p)) { + if (pmd_large(*p)) { if (full) { pmd_clear(p); } else { @@ -593,7 +587,7 @@ int kvmppc_create_pte(struct kvm *kvm, pgd_t *pgtable, pte_t pte, else if (level <= 1) new_pmd = kvmppc_pmd_alloc(); - if (level == 0 && !(pmd && pmd_present(*pmd) && !pmd_is_leaf(*pmd))) + if (level == 0 && !(pmd && pmd_present(*pmd) && !pmd_large(*pmd))) new_ptep = kvmppc_pte_alloc(); /* Check if we might have been invalidated; let the guest retry if so */ @@ -662,7 +656,7 @@ int kvmppc_create_pte(struct kvm *kvm, pgd_t *pgtable, pte_t pte, new_pmd = NULL; } pmd = pmd_offset(pud, gpa); - if (pmd_is_leaf(*pmd)) { + if (pmd_large(*pmd)) { unsigned long lgpa = gpa & PMD_MASK; /* Check if we raced and someone else has set the same thing */ -- 2.20.1