Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757784AbbEEQp4 (ORCPT ); Tue, 5 May 2015 12:45:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42245 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755855AbbEEQpz (ORCPT ); Tue, 5 May 2015 12:45:55 -0400 Message-ID: <5548F3BE.70404@redhat.com> Date: Tue, 05 May 2015 18:45:50 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Bandan Das CC: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, guangrong.xiao@linux.intel.com, Yang Zhang , wanpeng.li@linux.intel.com Subject: Re: [PATCH 07/13] KVM: x86: API changes for SMM support References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-8-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1861 Lines: 50 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/