[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-4.2 12/24] target/arm: Add VHE system regist
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH for-4.2 12/24] target/arm: Add VHE system register redirection and aliasing |
Date: |
Thu, 25 Jul 2019 07:24:11 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 7/25/19 7:01 AM, Alex Bennée wrote:
>> + union {
>> + /*
>> + * Offsets of the secure and non-secure fields in CPUARMState for
>> + * the register if it is banked. These fields are only used during
>> + * the static registration of a register. During hashing the bank
>> + * associated with a given security state is copied to fieldoffset
>> + * which is used from there on out.
>> + *
>> + * It is expected that register definitions use either fieldoffset
>> + * or bank_fieldoffsets in the definition but not both. It is also
>> + * expected that both bank offsets are set when defining a banked
>> + * register. This use indicates that a register is banked.
>> + */
>> + ptrdiff_t bank_fieldoffsets[2];
>
> It seems a bit off that we are compressing this structure into a union
> when we didn't bother with the above fieldoffset despite the statement
> that only one or the other is used.
...
> Is 2 pointers enough saving? Will we never see a re-directed register
> that was using the banked fieldoffsets? Can we protect against that?
It's because bank_fieldoffsets[] is only used before instantiation.
Before the structure is given to add_cpreg_to_hashtable, we have copied the
structure, copied bank_fieldoffsets into fieldoffset, and adjusted the secure
state flag.
After instantiation, those two pointers are unused, and I thought I could
reclaim it. However, you may have a point re total memory savings not making
the complication worthwhile.
r~
- Re: [Qemu-devel] [PATCH for-4.2 17/24] target/arm: Update arm_mmu_idx for VHE, (continued)
- [Qemu-devel] [PATCH for-4.2 13/24] target/arm: Split out vae1_tlbmask, vmalle1_tlbmask, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 10/24] target/arm: Update CNTVCT_EL0 for VHE, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 21/24] target/arm: Update arm_phys_excp_target_el for TGE, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 09/24] target/arm: Add TTBR1_EL2, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 12/24] target/arm: Add VHE system register redirection and aliasing, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 22/24] target/arm: Update regime_is_user for EL2&0, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 06/24] target/arm: Define isar_feature_aa64_vh, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 19/24] target/arm: Install asids for E2&0 translation regime, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 24/24] target/arm: Enable ARMv8.1-VHE in -cpu max, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 07/24] target/arm: Enable HCR_E2H for VHE, Richard Henderson, 2019/07/19
- [Qemu-devel] [PATCH for-4.2 16/24] target/arm: Add regime_has_2_ranges, Richard Henderson, 2019/07/19