Skip to contentSkip to conversation

target/arm: add support for FEAT_TLBIRANGE and FEAT_TLBIOS

PATCH Applied Rebecca Cran 4 participants 9 messages May 12, 2021 – May 25, 2021

lore
Share & tools
lore
#0 lore raw

v9 cover target/arm: add support for FEAT_TLBIRANGE and FEAT_TLBIOS

Testing: booted Linux 5.12. Ran "make test" and checkpatch.pl.

Changes from v8 to v9:

Dropped patch 1/4, because Richard's
'accel/tcg: Add tlb_flush interface for a range of pages' patch replaces it.

Fixed page_shift calculation.

Added do_rvae_write and vae2_tlbmask functions.

Moved RVAE*OS entries from the tlbios to tlbirange table.

Rebecca Cran (3):
target/arm: Add support for FEAT_TLBIRANGE target/arm: Add support for FEAT_TLBIOS
target/arm: set ID_AA64ISAR0.TLB to 2 for max AARCH64 CPU type

 target/arm/cpu.h    |  10 +
 target/arm/cpu64.c  |   1 +
 target/arm/helper.c | 324 ++++++++++++++++++++
 3 files changed, 335 insertions(+)
Signature · 1 line
2.26.2
#1 lore raw

PATCH v9 1/3 target/arm: Add support for FEAT_TLBIRANGE

ARMv8.4 adds the mandatory FEAT_TLBIRANGE. It provides TLBI maintenance instructions that apply to a range of input addresses.

---
 target/arm/cpu.h    |   5 +
 target/arm/helper.c | 281 ++++++++++++++++++++
 2 files changed, 286 insertions(+)
target/arm/cpu.h +5 -0
index 616b39325347..5802798c3069 100644
@@ -4071,6 +4071,11 @@ static inline bool isar_feature_aa64_pauth_arch(const ARMISARegisters *id)
     return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, APA) != 0;
 }
 
+static inline bool isar_feature_aa64_tlbirange(const ARMISARegisters *id)
+{
+    return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) == 2;
+}
+
 static inline bool isar_feature_aa64_sb(const ARMISARegisters *id)
 {
     return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, SB) != 0;
target/arm/helper.c +281 -0

299 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v9 1/3
#2 lore raw

Re: [PATCH v9 1/3] target/arm: Add support for FEAT_TLBIRANGE

Quoted 8 lines · Rebecca Cran

ARMv8.4 adds the mandatory FEAT_TLBIRANGE. It provides TLBI maintenance instructions that apply to a range of input addresses.

---
  target/arm/cpu.h    |   5 +
  target/arm/helper.c | 281 ++++++++++++++++++++
  2 files changed, 286 insertions(+)

r~

#3 lore raw

PATCH v9 2/3 target/arm: Add support for FEAT_TLBIOS

In reply to Rebecca Cran

ARMv8.4 adds the mandatory FEAT_TLBIOS. It provides TLBI maintenance instructions that extend to the Outer Shareable domain.

---
 target/arm/cpu.h    |  5 +++
 target/arm/helper.c | 43 ++++++++++++++++++++
 2 files changed, 48 insertions(+)
target/arm/cpu.h +5 -0
index 5802798c3069..7986a217acdd 100644
@@ -4076,6 +4076,11 @@ static inline bool isar_feature_aa64_tlbirange(const ARMISARegisters *id)
     return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) == 2;
 }
 
+static inline bool isar_feature_aa64_tlbios(const ARMISARegisters *id)
+{
+    return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) != 0;
+}
+
 static inline bool isar_feature_aa64_sb(const ARMISARegisters *id)
 {
     return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, SB) != 0;
target/arm/helper.c +43 -0

55 lines not on this page · raw message

Signature · 1 line
2.26.2
Reviewed-by on v9 2/3
#4 lore raw

Re: [PATCH v9 2/3] target/arm: Add support for FEAT_TLBIOS

Quoted 8 lines · Rebecca Cran

ARMv8.4 adds the mandatory FEAT_TLBIOS. It provides TLBI maintenance instructions that extend to the Outer Shareable domain.

---
  target/arm/cpu.h    |  5 +++
  target/arm/helper.c | 43 ++++++++++++++++++++
  2 files changed, 48 insertions(+)

r~

#5 lore raw

PATCH v9 3/3 target/arm: set ID_AA64ISAR0.TLB to 2 for max AARCH64 CPU type

In reply to Rebecca Cran

Indicate support for FEAT_TLBIOS and FEAT_TLBIRANGE by setting ID_AA64ISAR0.TLB to 2 for the max AARCH64 CPU type.

---
 target/arm/cpu64.c | 1 +
 1 file changed, 1 insertion(+)
target/arm/cpu64.c +1 -0
index f0a9e968c9c1..f42803ecaf1d 100644
@@ -651,6 +651,7 @@ static void aarch64_max_initfn(Object *obj)
         t = FIELD_DP64(t, ID_AA64ISAR0, DP, 1);
         t = FIELD_DP64(t, ID_AA64ISAR0, FHM, 1);
         t = FIELD_DP64(t, ID_AA64ISAR0, TS, 2); /* v8.5-CondM */
+        t = FIELD_DP64(t, ID_AA64ISAR0, TLB, 2); /* FEAT_TLBIRANGE */
         t = FIELD_DP64(t, ID_AA64ISAR0, RNDR, 1);
         cpu->isar.id_aa64isar0 = t;
 
Signature · 1 line
2.26.2
#6 lore raw
In reply to Rebecca Cran
Quoted 7 lines · Rebecca Cran

Testing: booted Linux 5.12. Ran "make test" and checkpatch.pl.

Changes from v8 to v9:

Dropped patch 1/4, because Richard's
'accel/tcg: Add tlb_flush interface for a range of pages' patch replaces it.

But it's needed right? It's perfectly fine to pull someone elses patch into your series if it's needed for the review. The alternative is to add a "Based-on" tag to your cover letter so it's easy to find the patch or series we need to apply before yours.

Signature · 1 line
Alex Bennée
#7 lore raw
Quoted 5 lines · Alex Bennée

But it's needed right? It's perfectly fine to pull someone elses patch into your series if it's needed for the review. The alternative is to add a "Based-on" tag to your cover letter so it's easy to find the patch or series we need to apply before yours.

Yes, it's needed. Sorry, I didn't realize there was an established process for this.

From previous patches, I see the line should be:

Based-on: [email protected]

Signature · 1 line
Rebecca Cran
#8 lore raw
In reply to Rebecca Cran
Quoted 9 lines · Rebecca Cran

Testing: booted Linux 5.12. Ran "make test" and checkpatch.pl.

Changes from v8 to v9:

Dropped patch 1/4, because Richard's
'accel/tcg: Add tlb_flush interface for a range of pages' patch replaces it.

Quoted 5 lines

Fixed page_shift calculation.

Added do_rvae_write and vae2_tlbmask functions.

Moved RVAE*OS entries from the tlbios to tlbirange table.

Applied to target-arm.next, thanks.

-- PMM