From: "Alex Bennée" <alex.bennee@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 6/6] target/arm: Implement FEAT_LPA2
Date: Tue, 14 Dec 2021 14:57:50 +0000 [thread overview]
Message-ID: <87y24ngn2s.fsf@linaro.org> (raw)
In-Reply-To: <20211208231154.392029-7-richard.henderson@linaro.org>
Richard Henderson <richard.henderson@linaro.org> writes:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> target/arm/cpu.h | 12 +++++++
> target/arm/internals.h | 2 ++
> target/arm/cpu64.c | 2 ++
> target/arm/helper.c | 80 +++++++++++++++++++++++++++++++++++-------
> 4 files changed, 83 insertions(+), 13 deletions(-)
>
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index 3149000004..379585352b 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -4283,6 +4283,18 @@ static inline bool isar_feature_aa64_i8mm(const ARMISARegisters *id)
> return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, I8MM) != 0;
> }
>
> +static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id)
> +{
> + return sextract64(id->id_aa64mmfr0,
> + R_ID_AA64MMFR0_TGRAN4_SHIFT,
> + R_ID_AA64MMFR0_TGRAN4_LENGTH) >= 1;
Is this correct - it shows:
0b1111 4KB granule not supported.
which I don't think implies FEAT_LPA2 because 1 indicates 4kb granule
supports 52 bit addressing. The other values are also reserved. Maybe it
would be safer just of == 1?
(a little more reading later)
The ID_AA64MMFR0_EL1.TGran4_2, ID_AA64MMFR0_EL1.TGran16_2 and
ID_AA64MMFR0_EL1.TGran64_2 fields that identify the memory translation stage 2 granule size, do not follow
the standard ID scheme. Software must treat these fields as follows:
• The value 0x0 indicates that support is identified by another field.
• If the field value is not 0x0, the value indicates the level of support provided.
This means that software should use a test of the form:
if (field !=0 and field > value) {
// do something that relies on the value of the feature
}
That's just confusing. It implies that you could see any of the TGran
fields set to zero but still support LPA2 if the other fields are set. I
think this at least warrants mentioning in an accompanying comments for
the function.
Otherwise:
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
next prev parent reply other threads:[~2021-12-14 16:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 23:11 [PATCH for-7.0 0/6] target/arm: Implement LVA, LPA, LPA2 features Richard Henderson
2021-12-08 23:11 ` [PATCH 1/6] target/arm: Fault on invalid TCR_ELx.TxSZ Richard Henderson
2021-12-14 14:34 ` Alex Bennée
2022-01-06 18:27 ` Peter Maydell
2022-01-11 16:00 ` Peter Maydell
2021-12-08 23:11 ` [PATCH 2/6] target/arm: Move arm_pamax out of line Richard Henderson
2021-12-09 7:28 ` Philippe Mathieu-Daudé
2021-12-14 14:36 ` Alex Bennée
2021-12-08 23:11 ` [PATCH 3/6] target/arm: Honor TCR_ELx.{I}PS Richard Henderson
2021-12-09 7:43 ` Philippe Mathieu-Daudé
2021-12-14 14:47 ` Alex Bennée
2022-01-06 20:08 ` Peter Maydell
2021-12-08 23:11 ` [PATCH 4/6] target/arm: Implement FEAT_LVA Richard Henderson
2021-12-14 14:53 ` Alex Bennée
2022-01-06 20:23 ` Peter Maydell
2022-02-10 0:17 ` Richard Henderson
2021-12-08 23:11 ` [PATCH 5/6] target/arm: Implement FEAT_LPA Richard Henderson
2022-01-07 10:53 ` Peter Maydell
2021-12-08 23:11 ` [PATCH 6/6] target/arm: Implement FEAT_LPA2 Richard Henderson
2021-12-14 14:57 ` Alex Bennée [this message]
2021-12-14 20:24 ` Richard Henderson
2022-01-07 14:39 ` Peter Maydell
2022-02-10 2:48 ` Richard Henderson
2021-12-14 16:37 ` [PATCH for-7.0 0/6] target/arm: Implement LVA, LPA, LPA2 features Alex Bennée
2021-12-14 17:46 ` Richard Henderson
2022-01-20 16:09 ` Peter Maydell
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=87y24ngn2s.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.