Commit ce5977b1 authored by Li RongQing's avatar Li RongQing Committed by Paolo Bonzini

KVM: x86: don't print when fail to read/write pv eoi memory

If guest gives MSR_KVM_PV_EOI_EN a wrong value, this printk() will
be trigged, and kernel log is spammed with the useless message

Fixes: 0d88800d ("kvm: x86: ioapic and apic debug macros cleanup")
Reported-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
Cc: stable@kernel.org
Message-Id: <1636026974-50555-1-git-send-email-lirongqing@baidu.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 2df4a5eb
...@@ -676,31 +676,25 @@ static inline bool pv_eoi_enabled(struct kvm_vcpu *vcpu) ...@@ -676,31 +676,25 @@ static inline bool pv_eoi_enabled(struct kvm_vcpu *vcpu)
static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu) static bool pv_eoi_get_pending(struct kvm_vcpu *vcpu)
{ {
u8 val; u8 val;
if (pv_eoi_get_user(vcpu, &val) < 0) { if (pv_eoi_get_user(vcpu, &val) < 0)
printk(KERN_WARNING "Can't read EOI MSR value: 0x%llx\n",
(unsigned long long)vcpu->arch.pv_eoi.msr_val);
return false; return false;
}
return val & KVM_PV_EOI_ENABLED; return val & KVM_PV_EOI_ENABLED;
} }
static void pv_eoi_set_pending(struct kvm_vcpu *vcpu) static void pv_eoi_set_pending(struct kvm_vcpu *vcpu)
{ {
if (pv_eoi_put_user(vcpu, KVM_PV_EOI_ENABLED) < 0) { if (pv_eoi_put_user(vcpu, KVM_PV_EOI_ENABLED) < 0)
printk(KERN_WARNING "Can't set EOI MSR value: 0x%llx\n",
(unsigned long long)vcpu->arch.pv_eoi.msr_val);
return; return;
}
__set_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention); __set_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention);
} }
static void pv_eoi_clr_pending(struct kvm_vcpu *vcpu) static void pv_eoi_clr_pending(struct kvm_vcpu *vcpu)
{ {
if (pv_eoi_put_user(vcpu, KVM_PV_EOI_DISABLED) < 0) { if (pv_eoi_put_user(vcpu, KVM_PV_EOI_DISABLED) < 0)
printk(KERN_WARNING "Can't clear EOI MSR value: 0x%llx\n",
(unsigned long long)vcpu->arch.pv_eoi.msr_val);
return; return;
}
__clear_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention); __clear_bit(KVM_APIC_PV_EOI_PENDING, &vcpu->arch.apic_attention);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment