Thread (148 messages) 148 messages, 14 authors, 2024-04-26

Re: [PATCH v13 09/35] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2023-11-02 11:01:50
Also in: kvm, kvm-riscv, kvmarm, linux-arm-kernel, linux-fsdevel, linux-mips, linux-mm, linux-riscv, lkml

On 11/1/23 18:36, Sean Christopherson wrote:
A good example is KVM_RUN with -EINTR; if KVM were to return something other than
-EINTR on a pending signal or vcpu->run->immediate_exit, userspace would fall over.
And dually if KVM were to return KVM_EXIT_INTR together with something 
other than -EINTR.
And purging exit_reason super early is subtly tricky because KVM's 
(again, poorly documented) ABI is that *some* exit reasons are preserved 
across KVM_RUN with vcpu->run->immediate_exit (or with a pending 
signal). https://lore.kernel.org/all/ZFFbwOXZ5uI%2Fgdaf@google.com (local)
vcpu->run->immediate_exit preserves all exit reasons, but it's not a 
good idea that immediate_exit behaves different from a pending signal on 
entry to KVM_RUN (remember that immediate_exit was meant to be a better 
performing alternative to KVM_SET_SIGNAL_MASK).

In principle, vcpu->run->immediate_exit could return KVM_EXIT_INTR 
(perhaps even _should_, except that breaks selftests so at this point it 
is ABI).

Paolo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help