[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 04/34] target/arm: Install ASIDs for short-form f
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH v3 04/34] target/arm: Install ASIDs for short-form from EL1 |
Date: |
Sat, 3 Aug 2019 11:47:30 -0700 |
This is less complex than the LPAE case, but still we now avoid the
flush in case it is only the PROCID field that is changing.
Reviewed-by: Alex Bennée <address@hidden>
Signed-off-by: Richard Henderson <address@hidden>
---
target/arm/helper.c | 34 ++++++++++++++++++++++++----------
1 file changed, 24 insertions(+), 10 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 2a65f4127e..c0dc76ed41 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -551,17 +551,31 @@ static void fcse_write(CPUARMState *env, const
ARMCPRegInfo *ri, uint64_t value)
static void contextidr_write(CPUARMState *env, const ARMCPRegInfo *ri,
uint64_t value)
{
- ARMCPU *cpu = env_archcpu(env);
-
- if (raw_read(env, ri) != value && !arm_feature(env, ARM_FEATURE_PMSA)
- && !extended_addresses_enabled(env)) {
- /* For VMSA (when not using the LPAE long descriptor page table
- * format) this register includes the ASID, so do a TLB flush.
- * For PMSA it is purely a process ID and no action is needed.
- */
- tlb_flush(CPU(cpu));
- }
raw_write(env, ri, value);
+
+ /*
+ * For VMSA (when not using the LPAE long descriptor page table format)
+ * this register includes the ASID. For PMSA it is purely a process ID
+ * and no action is needed.
+ */
+ if (!arm_feature(env, ARM_FEATURE_PMSA) &&
+ !extended_addresses_enabled(env)) {
+ CPUState *cs = env_cpu(env);
+ int asid = extract32(value, 0, 8);
+ int idxmask;
+
+ switch (ri->secure) {
+ case ARM_CP_SECSTATE_S:
+ idxmask = ARMMMUIdxBit_S1SE1 | ARMMMUIdxBit_S1SE0;
+ break;
+ case ARM_CP_SECSTATE_NS:
+ idxmask = ARMMMUIdxBit_S12NSE1 | ARMMMUIdxBit_S12NSE0;
+ break;
+ default:
+ g_assert_not_reached();
+ }
+ tlb_set_asid_for_mmuidx(cs, asid, idxmask, 0);
+ }
}
/* IS variants of TLB operations must affect all cores */
--
2.17.1
- [Qemu-devel] [PATCH v3 00/34] target/arm: Implement ARMv8.1-VHE, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 01/34] cputlb: Add tlb_set_asid_for_mmuidx, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 02/34] cputlb: Add tlb_flush_asid_by_mmuidx and friends, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 05/34] target/arm: Install ASIDs for EL2, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 03/34] target/arm: Install ASIDs for long-form from EL1, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 04/34] target/arm: Install ASIDs for short-form from EL1,
Richard Henderson <=
- [Qemu-devel] [PATCH v3 06/34] target/arm: Define isar_feature_aa64_vh, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 07/34] target/arm: Enable HCR_E2H for VHE, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 08/34] target/arm: Add CONTEXTIDR_EL2, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 11/34] target/arm: Add the hypervisor virtual counter, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 12/34] target/arm: Add VHE system register redirection and aliasing, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 14/34] target/arm: Simplify tlb_force_broadcast alternatives, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 10/34] target/arm: Update CNTVCT_EL0 for VHE, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 09/34] target/arm: Add TTBR1_EL2, Richard Henderson, 2019/08/03
- [Qemu-devel] [PATCH v3 13/34] target/arm: Split out vae1_tlbmask, vmalle1_tlbmask, Richard Henderson, 2019/08/03