projects
/
linux-flexiantxendom0.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
KVM: Ensure all vcpus are consistent with in-kernel irqchip settings
[linux-flexiantxendom0.git]
/
arch
/
x86
/
kvm
/
x86.c
diff --git
a/arch/x86/kvm/x86.c
b/arch/x86/kvm/x86.c
index
778018b
..
759af84
100644
(file)
--- a/
arch/x86/kvm/x86.c
+++ b/
arch/x86/kvm/x86.c
@@
-3070,6
+3070,9
@@
long kvm_arch_vm_ioctl(struct file *filp,
r = -EEXIST;
if (kvm->arch.vpic)
goto create_irqchip_unlock;
r = -EEXIST;
if (kvm->arch.vpic)
goto create_irqchip_unlock;
+ r = -EINVAL;
+ if (atomic_read(&kvm->online_vcpus))
+ goto create_irqchip_unlock;
r = -ENOMEM;
vpic = kvm_create_pic(kvm);
if (vpic) {
r = -ENOMEM;
vpic = kvm_create_pic(kvm);
if (vpic) {
@@
-5858,6
+5861,11
@@
void kvm_arch_check_processor_compat(void *rtn)
kvm_x86_ops->check_processor_compatibility(rtn);
}
kvm_x86_ops->check_processor_compatibility(rtn);
}
+bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
+{
+ return irqchip_in_kernel(vcpu->kvm) == (vcpu->arch.apic != NULL);
+}
+
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
{
struct page *page;
int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
{
struct page *page;