From: Marc Zyngier <maz@kernel.org>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/5] KVM: arm64: Define KVM_PHYS_SHIFT_MIN
Date: Tue, 10 Aug 2021 16:32:00 +0100 [thread overview]
Message-ID: <f6293361a98a6a9413643adeeb352f60@kernel.org> (raw)
In-Reply-To: <43c5ffa3-b3c5-9154-72b5-811eeb9ece8f@arm.com>
On 2021-08-10 16:19, Anshuman Khandual wrote:
> On 8/10/21 6:59 PM, Marc Zyngier wrote:
>> On 2021-08-10 08:02, Anshuman Khandual wrote:
>>> Drop the hard coded value for the minimum IPA range i.e 32 bit.
>>> Instead
>>> define a macro KVM_PHYS_SHIFT_MIN which improves the code
>>> readability.
>>>
>>> Cc: Marc Zyngier <maz@kernel.org>
>>> Cc: James Morse <james.morse@arm.com>
>>> Cc: Alexandru Elisei <alexandru.elisei@arm.com>
>>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
>>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>>> Cc: Will Deacon <will@kernel.org>
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: kvmarm@lists.cs.columbia.edu
>>> Cc: linux-kernel@vger.kernel.org
>>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>>> ---
>>> arch/arm64/include/asm/kvm_mmu.h | 3 ++-
>>> arch/arm64/kvm/reset.c | 2 +-
>>> 2 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm64/include/asm/kvm_mmu.h
>>> b/arch/arm64/include/asm/kvm_mmu.h
>>> index b52c5c4b9a3d..716f999818d9 100644
>>> --- a/arch/arm64/include/asm/kvm_mmu.h
>>> +++ b/arch/arm64/include/asm/kvm_mmu.h
>>> @@ -141,7 +141,8 @@ static __always_inline unsigned long
>>> __kern_hyp_va(unsigned long v)
>>> * We currently support using a VM-specified IPA size. For backward
>>> * compatibility, the default IPA size is fixed to 40bits.
>>> */
>>> -#define KVM_PHYS_SHIFT (40)
>>> +#define KVM_PHYS_SHIFT (40)
>>> +#define KVM_PHYS_SHIFT_MIN (32)
>>>
>>> #define kvm_phys_shift(kvm) VTCR_EL2_IPA(kvm->arch.vtcr)
>>> #define kvm_phys_size(kvm) (_AC(1, ULL) <<
>>> kvm_phys_shift(kvm))
>>> diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c
>>> index cba7872d69a8..8dc8b4b9de37 100644
>>> --- a/arch/arm64/kvm/reset.c
>>> +++ b/arch/arm64/kvm/reset.c
>>> @@ -369,7 +369,7 @@ int kvm_arm_setup_stage2(struct kvm *kvm,
>>> unsigned
>>> long type)
>>> phys_shift = KVM_VM_TYPE_ARM_IPA_SIZE(type);
>>> if (phys_shift) {
>>> if (phys_shift > kvm_ipa_limit ||
>>> - phys_shift < 32)
>>> + phys_shift < KVM_PHYS_SHIFT_MIN)
>>> return -EINVAL;
>>> } else {
>>> phys_shift = KVM_PHYS_SHIFT;
>>
>> This is not a KVM property, but an architectural one. If you
>
> Architectural property which suggest the minimum physical address shift
> supported on a platform, as indicated via ID_AA64MMFR0.PARANGE = 0x0 ?
That's the one.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2021-08-10 15:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 7:02 [PATCH 0/5] KVM: arm64: General cleanups Anshuman Khandual
2021-08-10 7:02 ` [PATCH 1/5] KVM: arm64: Drop direct PAGE_[SHIFT|SIZE] usage as page size Anshuman Khandual
2021-08-10 13:20 ` Will Deacon
2021-08-11 5:32 ` Anshuman Khandual
2021-08-10 13:33 ` Marc Zyngier
2021-08-11 5:34 ` Anshuman Khandual
2021-08-11 8:11 ` Marc Zyngier
2021-08-11 9:37 ` Anshuman Khandual
2021-08-11 10:13 ` Marc Zyngier
2021-08-10 7:02 ` [PATCH 2/5] KVM: arm64: Drop init_common_resources() Anshuman Khandual
2021-08-10 13:21 ` Will Deacon
2021-08-10 15:11 ` Anshuman Khandual
2021-08-10 7:02 ` [PATCH 3/5] KVM: arm64: Drop check_kvm_target_cpu() based percpu probe Anshuman Khandual
2021-08-10 13:28 ` Will Deacon
2021-08-11 5:54 ` Anshuman Khandual
2021-08-10 7:02 ` [PATCH 4/5] KVM: arm64: Drop unused REQUIRES_VIRT Anshuman Khandual
2021-08-10 7:02 ` [PATCH 5/5] KVM: arm64: Define KVM_PHYS_SHIFT_MIN Anshuman Khandual
2021-08-10 13:29 ` Marc Zyngier
2021-08-10 15:19 ` Anshuman Khandual
2021-08-10 15:32 ` Marc Zyngier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f6293361a98a6a9413643adeeb352f60@kernel.org \
--to=maz@kernel.org \
--cc=alexandru.elisei@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).