Skip to content

target/arm: Honor more HCR_EL2 traps

Richard Henderson qemu-arm qemu-devel 3 versions – Applied

Status from this message: Applied to target-arm.next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest12 patches 1 replyApplied
  2. v47 patches 10 repliesSuperseded
  3. v37 patches 9 repliesSuperseded

Changes in v5 from the cover letter

* Patch 1 was broken for aa32. Not just the masking vs the "other" 32-bit register that Peter noticed, but more explicitly in that "ri" was dereferenced as NULL -- hcr_write{high,low} did not pass along the structure. Oops.

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/12target/arm: Improve masking of HCR/HCR2 RES0 bitstarget/arm/helper.c+25 -130 replies
2/12target/arm: Add HCR_EL2 bit definitions from ARMv8.6target/arm/cpu.h+7 -00 replies
3/12target/arm: Disable has_el2 and has_el3 for user-onlytarget/arm/cpu.c+4 -20 replies
4/12target/arm: Remove EL2 and EL3 setup from user-onlytarget/arm/cpu.c+0 -60 replies
5/12target/arm: Improve masking in arm_hcr_el2_efftarget/arm/helper.c+27 -40 replies
6/12target/arm: Honor the HCR_EL2.{TVM,TRVM} bitstarget/arm/helper.c+55 -270 replies
7/12target/arm: Honor the HCR_EL2.TSW bittarget/arm/helper.c+16 -60 replies
8/12target/arm: Honor the HCR_EL2.TACR bittarget/arm/helper.c+14 -40 replies
9/12target/arm: Honor the HCR_EL2.TPCP bittarget/arm/helper.c+31 -80 replies
10/12target/arm: Honor the HCR_EL2.TPU bittarget/arm/helper.c+32 -210 replies
11/12target/arm: Honor the HCR_EL2.TTLB bittarget/arm/helper.c+55 -300 replies
12/12tests/tcg/aarch64: Add newline in pauth-1 printftests/tcg/aarch64/pauth-1.c+1 -10 replies

Reviews trailers per patch

6 of 12 patches have a Reviewed-by or Acked-by.

PatchPeter Maydell
1/12
2/12
3/12
4/12
5/12
6/12R-b
7/12R-b
8/12R-b
9/12R-b
10/12R-b
11/12R-b
12/12

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/12] target/arm: Honor more HCR_EL2 traps

Changes for v5:
* Patch 1 was broken for aa32. Not just the masking vs the "other" 32-bit register that Peter noticed, but more explicitly in that "ri" was dereferenced as NULL -- hcr_write{high,low} did not pass along the structure. Oops.

Break out a new helper that is passed a starting mask, which is used to preserve bits from the "other" 32-bit register.

Check the aa64 isar registers only if aarch64 is enabled.

* Add HCR bits from armv8.6.
* Remove EL2 & EL3 from user-only.

* Mask hcr_el2 bits that are res0 in aa32.
This didn't work at first because we weren't configuring SCR_RW for user-only, so aarch64-linux-user thought EL2 was aa32, which disabled pauth. Rather than find other corner cases like this, I think it makes more sense for user-only to only contend with EL1.

Patches 1-5, 12 require review.

r~

Richard Henderson (12):
target/arm: Improve masking of HCR/HCR2 RES0 bits target/arm: Add HCR_EL2 bit definitions from ARMv8.6 target/arm: Disable has_el2 and has_el3 for user-only target/arm: Remove EL2 and EL3 setup from user-only target/arm: Improve masking in arm_hcr_el2_eff target/arm: Honor the HCR_EL2.{TVM,TRVM} bits target/arm: Honor the HCR_EL2.TSW bit target/arm: Honor the HCR_EL2.TACR bit target/arm: Honor the HCR_EL2.TPCP bit target/arm: Honor the HCR_EL2.TPU bit target/arm: Honor the HCR_EL2.TTLB bit tests/tcg/aarch64: Add newline in pauth-1 printf

 target/arm/cpu.h            |   7 +
 target/arm/cpu.c            |  12 +-
 target/arm/helper.c         | 358 +++++++++++++++++++++++++-----------
 tests/tcg/aarch64/pauth-1.c |   2 +-
 4 files changed, 262 insertions(+), 117 deletions(-)
Signature · 1 line
2.20.1