All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rishab Pradeep via qemu development <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, Palmer Dabbelt <palmer@dabbelt.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Weiwei Li <liwei1518@gmail.com>,
	Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,
	Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
	Chao Liu <chao.liu@processmission.com>,
	Tarun Patanjali <tarun.patanjali@utexas.edu>,
	Chris Elwood <christopher.elwood2024@gmail.com>,
	Rishab Pradeep <rishab@rispop.dev>
Subject: [PATCH 0/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK
Date: Thu, 29 Oct 2026 13:37:49 -0500	[thread overview]
Message-ID: <20261029183751.11143-1-rishab@rispop.dev> (raw)

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.

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.54.0 (Apple Git-157)



WARNING: multiple messages have this Message-ID (diff)
From: Rishab Pradeep via <qemu-riscv@nongnu.org>
To: qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, Palmer Dabbelt <palmer@dabbelt.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Weiwei Li <liwei1518@gmail.com>,
	Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>,
	Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
	Chao Liu <chao.liu@processmission.com>,
	Tarun Patanjali <tarun.patanjali@utexas.edu>,
	Chris Elwood <christopher.elwood2024@gmail.com>,
	Rishab Pradeep <rishab@rispop.dev>
Subject: [PATCH 0/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK
Date: Thu, 29 Oct 2026 13:37:49 -0500	[thread overview]
Message-ID: <20261029183751.11143-1-rishab@rispop.dev> (raw)

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.

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.54.0 (Apple Git-157)



             reply	other threads:[~2026-10-29 19:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 18:37 Rishab Pradeep via qemu development [this message]
2026-10-29 18:37 ` [PATCH 0/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK Rishab Pradeep via
2026-10-29 18:37 ` [PATCH 1/2] target/riscv: Factor out pointer-masking address adjustment Rishab Pradeep via qemu development
2026-10-29 18:37   ` Rishab Pradeep via
2026-10-29 18:37 ` [PATCH 2/2] target/riscv: Apply pointer masking to SSPUSH/SSPOPCHK addresses Rishab Pradeep via qemu development
2026-10-29 18:37   ` Rishab Pradeep via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261029183751.11143-1-rishab@rispop.dev \
    --to=qemu-devel@nongnu.org \
    --cc=alistair.francis@wdc.com \
    --cc=chao.liu@processmission.com \
    --cc=christopher.elwood2024@gmail.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=liwei1518@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-riscv@nongnu.org \
    --cc=rishab@rispop.dev \
    --cc=tarun.patanjali@utexas.edu \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.