On 06/05/20 18:56, John Hauser wrote:
Paolo Bonzini wrote:But this would be a VS-mode application, not an ordinary user-modeOn 05/05/20 23:15, John Hauser wrote:I'm afraid this makes no sense to me. Ordinary user-mode applications- attempts to execute WFI, unless the instruction completes within anIt would be great to have this controlled by a bit in the hstatus CSR.
application. I'm not sure why U-mode matters. Anyway...
And if a guest OS itself executes WFI, I find it hard to believe it... I guess this is the misunderstanding. I'm not proposing to delegate
the WFI trap to the guest, but rather *the WFI instruction*: HS-mode
could optionally let WFI run in VS-mode, even if it wouldn't complete
within a bounded time. This is because, if you don't overcommit CPUs,
there's no advantage in getting out of VS-mode and doing the wait for
interrupts in HS-mode.
When an interrupt arrives, it would either be delivered to VS-mode or
cause an HS-mode trap, depending on the contents of hideleg.
Nested virtualization does not matter.
Is this clearer?