[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/6] target/arm: Make cpregs 0, c0, c{3-15}, {0-7} correctly

From: Richard Henderson
Subject: Re: [PATCH 1/6] target/arm: Make cpregs 0, c0, c{3-15}, {0-7} correctly RAZ in v8
Date: Fri, 19 Aug 2022 19:37:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 8/19/22 04:00, Peter Maydell wrote:
In the AArch32 ID register scheme, coprocessor registers with
encoding cp15, 0, c0, c{0-7}, {0-7} are all in the space covered by
what in v6 and v7 was called the "CPUID scheme", and are supposed to
RAZ if they're not allocated to a specific ID register.  For our
pre-v8 CPUs we get this right, because the regdefs in
id_pre_v8_midr_cp_reginfo[] cover these RAZ requirements.  However
for v8 we failed to put in the necessary patterns to cover this, so
we end up UNDEFing on everything we didn't have an ID register for.
This is a problem because in Armv8 some encodings in 0, c0, c3, {0-7}
are now being used for new ID registers, and guests might thus start
trying to read them.  (We already have one of these: ID_PFR2.)

For v8 CPUs, we already have regdefs for 0, c0, c{0-2}, {0-7} (that
is, the space is completely allocated with no reserved spaces).  Add
entries to v8_idregs[] covering 0, c0, c3, {0-7}:
  * c3, {0-2} is the reserved AArch32 space corresponding to the
    AArch64 MVFR[012]_EL1
  * c3, {3,5,6,7} are reserved RAZ for both AArch32 and AArch64
    (in fact some of these are given defined meanings in Armv8.6,
    but we don't implement them yet)
  * c3, 4 is ID_PFR2 (already defined)

We then programmatically add RAZ patterns for AArch32 for
0, c0, c{4..15}, {0-7}:
  * c4-c7 are unused, and not shared with AArch64 (these
    are the encodings corresponding to where the AArch64
    specific ID registers live in the system register space)
  * c8-c15 weren't required to RAZ in v6/v7, but v8 extends
    the AArch32 reserved-should-RAZ space to cover these;
    the equivalent area of the AArch64 sysreg space is not
    defined as must-RAZ

Note that the architecture allows some registers in this space
to return an UNKNOWN value; we always return 0.

Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
  target/arm/helper.c | 65 +++++++++++++++++++++++++++++++++++++++++----
  1 file changed, 60 insertions(+), 5 deletions(-)

This is the thing at the top of H.a page G7-8990, yeah?

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]