Avi Kivity wrote: > On 10/14/2009 01:06 AM, Jan Kiszka wrote: >> This plugs an NMI-related hole in the VCPU synchronization between >> kernel and user space. So far, neither pending NMIs nor the inhibit NMI >> mask was properly read/set which was able to cause problems on >> vmsave/restore, live migration and system reset. Fix it by making use >> of the new VCPU substate interface. >> >> >> +struct kvm_nmi_state { >> + __u8 pending; >> + __u8 masked; >> + __u8 pad1[2]; >> +}; >> > > Best to be conservative and use 64-bit alignment. Who knows what we > might put after this someday. OK. >> @@ -513,6 +513,8 @@ struct kvm_x86_ops { >> unsigned char *hypercall_addr); >> void (*set_irq)(struct kvm_vcpu *vcpu); >> void (*set_nmi)(struct kvm_vcpu *vcpu); >> + int (*get_nmi_mask)(struct kvm_vcpu *vcpu); >> + void (*set_nmi_mask)(struct kvm_vcpu *vcpu, int masked); >> > > Prefer bool for booleans, please. OK. > > Needs a KVM_CAP as well. KVM_CAP_VCPU_STATE will imply KVM_CAP_NMI_STATE, so I skipped the latter (user space code would use the former anyway to avoid yet another #ifdef layer). Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux -- 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