All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK
@ 2026-11-08  6:46 Rishab Pradeep
  2026-11-08  6:46 ` [PATCH v2 1/2] target/riscv: Factor out pointer-masking address adjustment Rishab Pradeep
  2026-11-08  6:46 ` [PATCH v2 2/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK addresses Rishab Pradeep
  0 siblings, 2 replies; 8+ messages in thread
From: Rishab Pradeep @ 2026-11-08  6:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-riscv, Palmer Dabbelt, Alistair Francis, Weiwei Li,
	Daniel Henrique Barboza, Liu Zhiwei, Chao Liu, Tarun Patanjali,
	Chris Elwood, Rishab Pradeep

SSPUSH and SSPOPCHK form their effective address from ssp rather than
a GPR, so they bypass get_address() and never apply the pointer-masking
ignore transformation. With pointer masking enabled, a tagged ssp
raises a store/AMO page fault, whereas Spike, Sail and Whisper mask
the access.

Patch 1 factors the address adjustment out of get_address() and
get_address_indexed() into gen_pm_adjust_addr(), with no functional
change. Patch 2 applies it to the SSPUSH/SSPOPCHK address. ssp is still
written back unmasked, and the SSPOPCHK value comparison is unchanged.

Tested with the reproducer from the issue; all four cases now match
Spike.

v1 -> v2:
  - Patch 1: Collected Reviewed-by from Daniel Henrique Barboza.
  - Patch 2: Cite Privileged Architecture Specification, Section
    17.1.2.6 ("Memory Accesses Subject to Pointer Masking"), in the
    commit message, per Daniel's review.

v1: https://lore.kernel.org/qemu-devel/20261029183751.11143-1-rishab@rispop.dev/

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/4758

Rishab Pradeep (2):
  target/riscv: Factor out pointer-masking address adjustment
  target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK addresses

 .../tcg/insn_trans/trans_rvzicfiss.c.inc      |  8 +++++--
 target/riscv/tcg/translate.c                  | 21 ++++++++++---------
 2 files changed, 17 insertions(+), 12 deletions(-)

-- 
2.56.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-11-12  4:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-08  6:46 [PATCH v2 0/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK Rishab Pradeep
2026-11-08  6:46 ` [PATCH v2 1/2] target/riscv: Factor out pointer-masking address adjustment Rishab Pradeep
2026-11-12  4:37   ` Alistair Francis
2026-11-08  6:46 ` [PATCH v2 2/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK addresses Rishab Pradeep
2026-11-08 20:39   ` Daniel Henrique Barboza
2026-11-09  4:35   ` Rishab Pradeep
2026-11-12  4:45     ` Alistair Francis
2026-11-12  4:38   ` Alistair Francis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.