@@ -1133,6 +1133,8 @@ struct kvm_arch {
enum kvm_irqchip_mode irqchip_mode;
u8 nr_reserved_ioapic_pins;
bool eoi_intercept_unsupported;
+ bool smm_unsupported;
+ bool init_sipi_unsupported;
bool disabled_lapic_found;
@@ -128,6 +128,10 @@ static inline bool kvm_msi_route_invalid(struct kvm *kvm,
.data = e->msi.data };
return (kvm->arch.eoi_intercept_unsupported &&
msg.arch_data.is_level) ||
+ (kvm->arch.smm_unsupported &&
+ msg.arch_data.delivery_mode == APIC_DELIVERY_MODE_SMI) ||
+ (kvm->arch.init_sipi_unsupported &&
+ msg.arch_data.delivery_mode == APIC_DELIVERY_MODE_INIT) ||
(kvm->arch.x2apic_format && (msg.address_hi & 0xff));
}
@@ -4553,8 +4553,7 @@ static int kvm_vcpu_ioctl_nmi(struct kvm_vcpu *vcpu)
static int kvm_vcpu_ioctl_smi(struct kvm_vcpu *vcpu)
{
- /* TODO: use more precise flag */
- if (vcpu->arch.guest_state_protected)
+ if (vcpu->kvm->arch.smm_unsupported)
return -EINVAL;
kvm_make_request(KVM_REQ_SMI, vcpu);