Conversation

Jarkko Sakkinen

OK, so WFI on RISC-V is not detemistic! It can be same as HLT (x86) or WAIT (ARM) but could also be nop 🤷 Beyond me tbh. #riscv
2
1
1

@jarkko WFI on RISC-V is not that different from in ARMv8. In both cases, SW should treat it as a potentially-power-saving NOP. There are special cases around scenarios like CPU physical reset and power down. But, basically a NOP from an architectural point of view.

0
0
1

@jarkko looks like WFI allows for spurious wakeups, if the code handles WFI==NOP, then it'll also work correctly for spurious wake-ups. A hypervisor may also trap WFI and switch to another guest.

1
0
1
@edwintorok @sdbbp right thanks for to great answers! i mean mostly hlt and similar are used to conserve energy (e.g. in PM an similar), and e.g. locks just reschedule so i could imagine that in e.g. linux nop should not cause any actual collateral damage.

i'm just used to specs where opcode does one and only one thing :-)
0
0
0