Skip to content

RISCV: Intrdouce SSTC support in Xen

Oleksii Kurochko xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 11 repliesIn review
  2. v14 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Address the comments from ML.
---

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xen/riscv: add exception table supportxen/arch/riscv/Kconfig xen/arch/riscv/Makefile xen/arch/riscv/extable.c +7 more+165 -53 replies
2/4xen/riscv: add csr_read_safe() helperxen/arch/riscv/include/asm/csr.h+35 -12 replies
3/4xen/riscv: allow Xen to use SSTC while hiding it from guestsxen/arch/riscv/cpufeature.c xen/arch/riscv/include/asm/cpufeature.h xen/arch/riscv/include/asm/riscv_encoding.h +2 more+62 -154 replies
4/4xen/riscv: init_csr_masks()-related improvementsxen/arch/riscv/domain.c+15 -142 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by.

PatchJan Beulich
1/4A-b
2/4R-b
3/4
4/4R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/4] RISCV: Intrdouce SSTC support in Xen

This patch series is created based on [1] and the aim is to make Xen properly works when SSTC extension is available.

It is needed to do in this way as OpenSBI doesn't pass that it supports SSTC by DTS to Xen and there is no easy way to turn off support of SSTC support.

Also, as a part of this patch series intrdouce suggested [2] by Jan B. improvements of init_csr_masks().

[1] https://lore.kernel.org/xen-devel/[email protected]/T/#mc14576ef43a83b344c5f31626005b995e2ccbeaa
[2] https://lore.kernel.org/xen-devel/[email protected]/T/#m9c18d2d7a98958befec16419f5deccc40f6c8c3e

CI tests: https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/2417456208

Also, I've manually ran QEMU with SSTC=on/off and built Xen with a newer RISC-V compileer (in comparison with the version used by CI's docker container) to verify CONFIG_CC_HAS_ASM_GOTO_OUTPUT branch inside csr_read_safe().

---
Changes in v2:
- Address the comments from ML.
---

Oleksii Kurochko (4):
xen/riscv: add exception table support
xen/riscv: add csr_allowed_read() helper xen/riscv: allow Xen to use SSTC while hiding it from guests xen/riscv: init_csr_masks()-related improvements

 xen/arch/riscv/Kconfig                      |  1 +
 xen/arch/riscv/Makefile                     |  1 +
 xen/arch/riscv/cpufeature.c                 | 33 ++++++++
 xen/arch/riscv/domain.c                     | 29 +++----
 xen/arch/riscv/extable.c                    | 85 +++++++++++++++++++++
 xen/arch/riscv/include/asm/bug.h            |  2 +
 xen/arch/riscv/include/asm/cpufeature.h     |  1 +
 xen/arch/riscv/include/asm/csr.h            | 36 ++++++++-
 xen/arch/riscv/include/asm/extable.h        | 58 ++++++++++++++
 xen/arch/riscv/include/asm/riscv_encoding.h |  2 +
 xen/arch/riscv/setup.c                      |  3 +
 xen/arch/riscv/time.c                       | 34 +++++----
 xen/arch/riscv/traps.c                      |  5 ++
 xen/arch/riscv/vtimer.c                     |  7 +-
 xen/arch/riscv/xen.lds.S                    |  3 +
 xen/arch/x86/xen.lds.S                      |  6 +-
 xen/include/xen/xen.lds.h                   |  6 ++
 17 files changed, 277 insertions(+), 35 deletions(-)
 create mode 100644 xen/arch/riscv/extable.c
 create mode 100644 xen/arch/riscv/include/asm/extable.h
Signature · 1 line
2.53.0