The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: [PATCH v2] riscv: misaligned: Make enabling delegation depend on NONPORTABLE
       [not found] <20260401-riscv-misaligned-dont-delegate-v2-1-5014a288c097@iscas.ac.cn>
@ 2026-05-14  4:30 ` Paul Walmsley
  0 siblings, 0 replies; only message in thread
From: Paul Walmsley @ 2026-05-14  4:30 UTC (permalink / raw)
  To: Vivian Wang
  Cc: Clément Léger, Paul Walmsley, Palmer Dabbelt,
	Alexandre Ghiti, Andrew Jones, Conor Dooley, linux-riscv,
	linux-kernel, stable, Songsong Zhang

On Wed, 1 Apr 2026, Vivian Wang wrote:

> The unaligned access emulation code in Linux has various deficiencies.
> For example, it doesn't emulate vector instructions [1] [2], and doesn't
> emulate KVM guest accesses. Therefore, requesting misaligned exception
> delegation with SBI FWFT actually regresses vector instructions' and KVM
> guests' behavior.
> 
> Until Linux can handle it properly, guard these sbi_fwft_set() calls
> behind RISCV_SBI_FWFT_DELEGATE_MISALIGNED, which in turn depends on
> NONPORTABLE. Those who are sure that this wouldn't be a problem can
> enable this option, perhaps getting better performance.
> 
> The rest of the existing code proceeds as before, except as if
> SBI_FWFT_MISALIGNED_EXC_DELEG is not available, to handle any remaining
> address misaligned exceptions on a best-effort basis. The KVM SBI FWFT
> implementation is also not touched, but it is disabled if the firmware
> emulates unaligned accesses.
> 
> Cc: stable@vger.kernel.org
> Fixes: cf5a8abc6560 ("riscv: misaligned: request misaligned exception from SBI")
> Reported-by: Songsong Zhang <U2FsdGVkX1@gmail.com> # KVM
> Link: https://lore.kernel.org/linux-riscv/38ce44c1-08cf-4e3f-8ade-20da224f529c@iscas.ac.cn/ [1]
> Link: https://lore.kernel.org/linux-riscv/b3cfcdac-0337-4db0-a611-258f2868855f@iscas.ac.cn/ [2]
> Signed-off-by: Vivian Wang <wangruikang@iscas.ac.cn>

Thanks, queued for v7.1-rc.


- Paul

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-14  4:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260401-riscv-misaligned-dont-delegate-v2-1-5014a288c097@iscas.ac.cn>
2026-05-14  4:30 ` [PATCH v2] riscv: misaligned: Make enabling delegation depend on NONPORTABLE Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox