[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 26/35] target/arm: Implement FEAT_NV2 redirection of sysregs
From: |
Richard Henderson |
Subject: |
Re: [PATCH 26/35] target/arm: Implement FEAT_NV2 redirection of sysregs to RAM |
Date: |
Thu, 28 Dec 2023 10:55:06 +1100 |
User-agent: |
Mozilla Thunderbird |
On 12/18/23 22:32, Peter Maydell wrote:
+ if (s->nv && s->nv2 && ri->nv2_redirect_offset) {
Again, s->nv test is redundant.
+ /*
+ * Some registers always redirect to memory; some only do so if
+ * HCR_EL2.NV1 is 0, and some only if NV1 is 1 (these come in
+ * pairs which share an offset; see the table in R_CSRPQ).
+ */
+ if (ri->nv2_redirect_offset & NV2_REDIR_NV1) {
+ nv2_mem_redirect = s->nv1;
+ } else if (ri->nv2_redirect_offset & NV2_REDIR_NO_NV1) {
+ nv2_mem_redirect = !s->nv1;
+ } else {
+ nv2_mem_redirect = true;
+ }
I wondered if it would be clearer with the "both" case having both bits set. While I see
that the first defined offset is 0x20, offset 0x00 is still reserved and *could* be used.
At which point ri->nv2_redirect_offset would need a non-zero value for a zero offset.
Maybe clearer as
nv2_mem_redirect = (ri->nv2_redirect_offset &
(s->nv1 ? NV2_REDIR_NV1_1 : NV2_REDIR_NV1_0));
?
This is more verbose for the (common?) case of redirect regardless of nv1, so
maybe not.
+ if (s->nv2_mem_be) {
+ mop |= MO_BE;
+ }
MO_BSWAP is host dependent -- needs
mop |= (s->nv2_mem_be ? MO_BE : MO_LE);
r~
- Re: [PATCH 22/35] target/arm: Handle HCR_EL2 accesses for FEAT_NV2 bits, (continued)
- [PATCH 24/35] target/arm: Handle FEAT_NV2 changes to when SPSR_EL1.M reports EL2, Peter Maydell, 2023/12/18
- [PATCH 25/35] target/arm: Handle FEAT_NV2 redirection of SPSR_EL2, ELR_EL2, ESR_EL2, FAR_EL2, Peter Maydell, 2023/12/18
- [PATCH 27/35] target/arm: Report VNCR_EL2 based faults correctly, Peter Maydell, 2023/12/18
- [PATCH 29/35] target/arm: Mark up VNCR offsets (offsets 0x100..0x160), Peter Maydell, 2023/12/18
- [PATCH 26/35] target/arm: Implement FEAT_NV2 redirection of sysregs to RAM, Peter Maydell, 2023/12/18
- Re: [PATCH 26/35] target/arm: Implement FEAT_NV2 redirection of sysregs to RAM,
Richard Henderson <=
- [PATCH 30/35] target/arm: Mark up VNCR offsets (offsets 0x168..0x1f8), Peter Maydell, 2023/12/18
- [PATCH 35/35] target/arm: Add FEAT_NV2 to max, neoverse-n2, neoverse-v1 CPUs, Peter Maydell, 2023/12/18
- [PATCH 33/35] target/arm: Report HCR_EL2.{NV,NV1,NV2} in cpu dumps, Peter Maydell, 2023/12/18
- [PATCH 31/35] target/arm: Mark up VNCR offsets (offsets >= 0x200, except GIC), Peter Maydell, 2023/12/18
- [PATCH 32/35] hw/intc/arm_gicv3_cpuif: Mark up VNCR offsets for GIC CPU registers, Peter Maydell, 2023/12/18