[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/6] xen/riscv: make Zihintpause no longer a required extension





On 9/22/26 2:27 PM, Jan Beulich wrote:
On 10.09.2026 11:34, Baptiste Le Duc wrote:
required_extensions[] panics at boot if Zihintpause is missing, but Xen
never actually depends on it: cpu_relax() only emits the "pause" hint when
the extension is implemented, otherwise it emits `0x0100000F`, a legally
valid FENCE instruction (`FENCE W, 0`) rather than a native NOP.

Just that PAUSE's encoding is 0x0100000F. I.e. what is emitted is always
the same, and hence discussing the encoding aspect here doesn't help
justify the change. NOP or not also doesn't really matter here. The
specific hint encoding looks to fall into what prior to Zihintpause would
have been covered by "Designated for future standard use", and hence ...

FENCE is
guaranteed by the RISC-V base ISA, so it never raises an illegal
instruction fault. With an empty successor set, it enforces no
memory-ordering constraints and thus architecturally behaves as a NOP.

... there indeed should be no concern for any platform playing by the
rules.

Drop it from required_extensions so hardware without Zihintpause
still boots.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
---
Changes since v1:
- rewrite commit message.

I fear another round of re-writing is going to be necessary, sorry.

Would it be better:

required_extensions[] panics at boot if Zihintpause is missing, but Xen does not strictly require hardware support for it.

The PAUSE hint (Zihintpause extension) is encoded as FENCE W, 0 (0x0100000F). In accordance with the RISC-V Unprivileged ISA, HINTs are encoded in the space of valid standard instructions. On platforms without Zihintpause support, executing 0x0100000F is treated as a standard FENCE with an empty successor set, which acts as a NOP and never generates an illegal instruction trap.

Therefore, Zihintpause is purely an optimization hint. Drop it from required_extensions[] so systems without explicit Zihintpause support can boot Xen successfully.

?

~ Oleksii



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.