Re: [PATCH 07/13] KVM: x86: API changes for SMM support

From: Paolo Bonzini
Date: Tue May 05 2015 - 12:45:59 EST




On 05/05/2015 18:36, Bandan Das wrote:
>> > @@ -3116,29 +3121,31 @@ static void kvm_vcpu_ioctl_x86_get_vcpu_events(struct kvm_vcpu *vcpu,
>> > struct kvm_vcpu_events *events)
>> > {
>> > process_nmi(vcpu);
>> > +
>> > + memset(events, 0, sizeof(*events));
> I think that it's better that the caller memsets this before passing it over
> to the *_get_vcpu_events function.

I should have actually removed the

memset(&events->reserved, 0, sizeof(events->reserved));

and padding memsets as well. But I'll instead remove the memset and
make sure to zero out events->smi.pad.

>> >
>> > /* in (pre_kvm_run), out (post_kvm_run) */
>> > __u64 cr8;
>> > @@ -814,6 +814,7 @@ struct kvm_ppc_smmu_info {
>> > #define KVM_CAP_S390_INJECT_IRQ 113
>> > #define KVM_CAP_S390_IRQ_STATE 114
>> > #define KVM_CAP_PPC_HWRNG 115
>> > +#define KVM_CAP_X86_SMM 120
> Why didn't we reserve the next available number here ?

Because it will be a while before this series is ready, and I got bored
of having to modify QEMU every time somebody used the next capability. :)

Paolo

>> > #ifdef KVM_CAP_IRQ_ROUTING
>> >
>> > @@ -1199,6 +1200,8 @@ struct kvm_s390_ucas_mapping {
>> > /* Available with KVM_CAP_S390_IRQ_STATE */
>> > #define KVM_S390_SET_IRQ_STATE _IOW(KVMIO, 0xb5, struct kvm_s390_irq_state)
>> > #define KVM_S390_GET_IRQ_STATE _IOW(KVMIO, 0xb6, struct kvm_s390_irq_state)
>> > +/* Available with KVM_CAP_X86_SMM */
>> > +#define KVM_SMI _IO(KVMIO, 0xb7)
>> >
>> > #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
>> > #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/