2015-05-27 19:05+0200, Paolo Bonzini: > This patch includes changes to the external API for SMM support. > All the changes are predicated by the availability of a new > capability, KVM_CAP_X86_SMM, which is added at the end of the > patch series. > > Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> > --- > diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h > @@ -309,7 +312,13 @@ struct kvm_vcpu_events { > - __u32 reserved[10]; > + struct { > + __u8 smm; > + __u8 pending; > + __u8 smm_inside_nmi; (The 'u8 flags' discussion made me see that we just lost 21 bits here, but it seems worth the sacrifice.) > + __u8 pad; > + } smi; > + __u32 reserved[9]; > @@ -3237,6 +3250,18 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, > + if (events->flags & KVM_VCPUEVENT_VALID_SMM) { > + if (events->smi.smm) > + vcpu->arch.hflags |= HF_SMM_MASK; > + else > + vcpu->arch.hflags &= ~HF_SMM_MASK; > + vcpu->arch.smi_pending = events->smi.pending; > + if (events->smi.smm_inside_nmi) > + vcpu->arch.hflags |= ~HF_SMM_INSIDE_NMI_MASK; ~~~ ~~ ~ HF_SMM_INSIDE_NMI_MASK. > + else > + vcpu->arch.hflags &= ~HF_SMM_INSIDE_NMI_MASK; (Looks like a use case for a new helper, __assign_bit(HF_SMM_INSIDE_NMI_MASK, &vcpu->arch.hflags, events->smi.smm_inside_nmi);) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html