KVM: Add infrastructure and macro to mark VM as bugged
commit 0b8f11737cffc1a406d1134b58687abc29d76b52 upstream Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <3a0998645c328bf0895f1290e61821b70f048549.1625186503.git.isaku.yamahata@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> [SG: Adjusted context for kernel version 4.19] Signed-off-by: Stefan Ghinea <stefan.ghinea@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b99aba316b
commit
055afe675f
@@ -2820,7 +2820,7 @@ static long kvm_vcpu_ioctl(struct file *filp,
|
||||
struct kvm_fpu *fpu = NULL;
|
||||
struct kvm_sregs *kvm_sregs = NULL;
|
||||
|
||||
if (vcpu->kvm->mm != current->mm)
|
||||
if (vcpu->kvm->mm != current->mm || vcpu->kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
if (unlikely(_IOC_TYPE(ioctl) != KVMIO))
|
||||
@@ -3026,7 +3026,7 @@ static long kvm_vcpu_compat_ioctl(struct file *filp,
|
||||
void __user *argp = compat_ptr(arg);
|
||||
int r;
|
||||
|
||||
if (vcpu->kvm->mm != current->mm)
|
||||
if (vcpu->kvm->mm != current->mm || vcpu->kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
switch (ioctl) {
|
||||
@@ -3081,7 +3081,7 @@ static long kvm_device_ioctl(struct file *filp, unsigned int ioctl,
|
||||
{
|
||||
struct kvm_device *dev = filp->private_data;
|
||||
|
||||
if (dev->kvm->mm != current->mm)
|
||||
if (dev->kvm->mm != current->mm || dev->kvm->vm_bugged)
|
||||
return -EIO;
|
||||
|
||||
switch (ioctl) {
|
||||
@@ -3244,7 +3244,7 @@ static long kvm_vm_ioctl(struct file *filp,
|
||||
void __user *argp = (void __user *)arg;
|
||||
int r;
|
||||
|
||||
if (kvm->mm != current->mm)
|
||||
if (kvm->mm != current->mm || kvm->vm_bugged)
|
||||
return -EIO;
|
||||
switch (ioctl) {
|
||||
case KVM_CREATE_VCPU:
|
||||
@@ -3422,7 +3422,7 @@ static long kvm_vm_compat_ioctl(struct file *filp,
|
||||
struct kvm *kvm = filp->private_data;
|
||||
int r;
|
||||
|
||||
if (kvm->mm != current->mm)
|
||||
if (kvm->mm != current->mm || kvm->vm_bugged)
|
||||
return -EIO;
|
||||
switch (ioctl) {
|
||||
case KVM_GET_DIRTY_LOG: {
|
||||
|
||||
Reference in New Issue
Block a user