[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7ac63cc6-d35a-d455-f629-abea2932d312@arm.com>
Date: Wed, 11 Aug 2021 11:02:05 +0530
From: Anshuman Khandual <anshuman.khandual@....com>
To: Will Deacon <will@...nel.org>
Cc: linux-arm-kernel@...ts.infradead.org,
Marc Zyngier <maz@...nel.org>,
James Morse <james.morse@....com>,
Alexandru Elisei <alexandru.elisei@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Catalin Marinas <catalin.marinas@....com>,
kvmarm@...ts.cs.columbia.edu, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] KVM: arm64: Drop direct PAGE_[SHIFT|SIZE] usage as
page size
On 8/10/21 6:50 PM, Will Deacon wrote:
> On Tue, Aug 10, 2021 at 12:32:37PM +0530, Anshuman Khandual wrote:
>> All instances here could just directly test against CONFIG_ARM64_XXK_PAGES
>> instead of evaluating via PAGE_SHIFT or PAGE_SIZE. With this change, there
>> will be no such usage left.
>>
>> Cc: Marc Zyngier <maz@...nel.org>
>> Cc: James Morse <james.morse@....com>
>> Cc: Alexandru Elisei <alexandru.elisei@....com>
>> Cc: Suzuki K Poulose <suzuki.poulose@....com>
>> Cc: Catalin Marinas <catalin.marinas@....com>
>> Cc: Will Deacon <will@...nel.org>
>> Cc: linux-arm-kernel@...ts.infradead.org
>> Cc: kvmarm@...ts.cs.columbia.edu
>> Cc: linux-kernel@...r.kernel.org
>> Signed-off-by: Anshuman Khandual <anshuman.khandual@....com>
>> ---
>> arch/arm64/kvm/hyp/pgtable.c | 6 +++---
>> arch/arm64/mm/mmu.c | 2 +-
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> Why is this better?
There are two improvements here.
1. Avoids using hard coded numerical shift values to determine the page size
e.g PAGE_SHIFT = 16 for 64K
2. There are already instances of IS_ENABLED() construct checking for the page
size. After this change there will be just a single method to test page size
, rather than checking for either config, PAGE_SHIFT or PAGE_SIZE etc through
out arm64. This change helps in that unification around IS_ENABLED().
There is another patch which drops remaining usage for PAGE_SIZE as well.
https://patchwork.kernel.org/project/linux-arm-kernel/patch/1628569782-30213-1-git-send-email-anshuman.khandual@arm.com/
Powered by blists - more mailing lists