Re: [RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-29 Thread Paolo Bonzini
On 29/09/20 05:52, Sean Christopherson wrote: >> I think usage should be limited to dangerous cases, basically WARN_ON >> level. However I agree with Vitaly that KVM_GET_* should be allowed. > > On the topic of feedback from Vitaly, while dredging through my mailbox I > rediscovered his

Re: [RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-28 Thread Sean Christopherson
On Fri, Sep 25, 2020 at 11:06:10PM +0200, Paolo Bonzini wrote: > On 25/09/20 19:12, Sean Christopherson wrote: > >> Do we actually want to prevent *all* ioctls? E.g. when 'vm bugged' > >> condition is triggered userspace may want to extract some information to > >> assist debugging but even things

Re: [RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-25 Thread Paolo Bonzini
On 25/09/20 19:12, Sean Christopherson wrote: >> Do we actually want to prevent *all* ioctls? E.g. when 'vm bugged' >> condition is triggered userspace may want to extract some information to >> assist debugging but even things like KVM_GET_[S]REGS will just return >> -EIO. I'm not sure it is

Re: [RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-25 Thread Sean Christopherson
On Fri, Sep 25, 2020 at 11:50:38AM +0200, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > > On Thu, Sep 24, 2020 at 02:34:14PM +0200, Vitaly Kuznetsov wrote: > >> Sean Christopherson writes: > >> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c > >> > index

Re: [RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-25 Thread Vitaly Kuznetsov
Sean Christopherson writes: > On Thu, Sep 24, 2020 at 02:34:14PM +0200, Vitaly Kuznetsov wrote: >> Sean Christopherson writes: >> > diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c >> > index 6f9a0c6d5dc5..810d46ab0a47 100644 >> > --- a/arch/x86/kvm/vmx/vmx.c >> > +++

Re: [RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-24 Thread Vitaly Kuznetsov
Sean Christopherson writes: > Add support for KVM_REQ_VM_BUGG in x86, and replace a variety of WARNs > with KVM_BUG() and KVM_BUG_ON(). Return -EIO if a KVM_BUG is hit to > align with the common KVM behavior of rejecting iocts() with -EIO if the > VM is bugged. > > Signed-off-by: Sean

[RFC PATCH 3/3] KVM: x86: Use KVM_BUG/KVM_BUG_ON to handle bugs that are fatal to the VM

2020-09-23 Thread Sean Christopherson
Add support for KVM_REQ_VM_BUGG in x86, and replace a variety of WARNs with KVM_BUG() and KVM_BUG_ON(). Return -EIO if a KVM_BUG is hit to align with the common KVM behavior of rejecting iocts() with -EIO if the VM is bugged. Signed-off-by: Sean Christopherson --- arch/x86/kvm/svm/svm.c | 2