From: Mark Rutland <mark.rutland@arm.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
linux-kernel@vger.kernel.org, Marc Zyngier <maz@kernel.org>,
Will Deacon <will@kernel.org>,
kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64/cpufeature: Add ID_AA64MMFR0_PARANGE_MASK
Date: Tue, 12 May 2020 11:56:14 +0100 [thread overview]
Message-ID: <20200512105614.GC60359@C02TD0UTHF1T.local> (raw)
In-Reply-To: <20200512105343.GB60359@C02TD0UTHF1T.local>
On Tue, May 12, 2020 at 11:53:43AM +0100, Mark Rutland wrote:
> >
> > /* Clamp the IPA limit to the PA size supported by the kernel */
> > ipa_max = (pa_max > PHYS_MASK_SHIFT) ? PHYS_MASK_SHIFT : pa_max;
> > @@ -411,7 +411,8 @@ int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type)
> > phys_shift = KVM_PHYS_SHIFT;
> > }
> >
> > - parange = read_sanitised_ftr_reg(SYS_ID_AA64MMFR0_EL1) & 7;
> > + parange = id_aa64mmfr0_parange(read_sanitised_ftr_reg
> > + (SYS_ID_AA64MMFR0_EL1));
>
> Can't we add a system_ipa_range() helper, and avoid more boilerplate in
> each of these?
>
> e.g.
>
> int system_ipa_range(void)
> {
> u64 mmfr0;
> int parange;
>
> mmfr0 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR0_EL1);
> parange = cpuid_feature_extract_unsigned_field(mmfr0,
> ID_AA64MMFR0_PARANGE_SHIFT);
>
> return parange;
> }
As Per MarcZ's comments, that should be system_pa_range() rather than
system_ipa_range().
Mark.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
prev parent reply other threads:[~2020-05-12 10:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 2:13 [PATCH] arm64/cpufeature: Add ID_AA64MMFR0_PARANGE_MASK Anshuman Khandual
2020-05-12 10:39 ` Marc Zyngier
2020-05-12 10:53 ` Mark Rutland
2020-05-12 10:56 ` Mark Rutland [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=20200512105614.GC60359@C02TD0UTHF1T.local \
--to=mark.rutland@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--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).