From patchwork Wed Jul 30 21:18:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rustad, Mark D" X-Patchwork-Id: 4651691 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 300D9C0338 for ; Wed, 30 Jul 2014 21:19:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 224392018E for ; Wed, 30 Jul 2014 21:19:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECF422017A for ; Wed, 30 Jul 2014 21:18:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751440AbaG3VSx (ORCPT ); Wed, 30 Jul 2014 17:18:53 -0400 Received: from mga14.intel.com ([192.55.52.115]:53159 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751309AbaG3VSw (ORCPT ); Wed, 30 Jul 2014 17:18:52 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 30 Jul 2014 14:11:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,767,1400050800"; d="scan'208";a="569649033" Received: from mdrustad-wks.jf.intel.com ([134.134.176.106]) by fmsmga001.fm.intel.com with ESMTP; 30 Jul 2014 14:18:45 -0700 Subject: [PATCH V2 1/4] x86/kvm: Resolve some missing-initializers warnings From: Mark D Rustad To: gleb@kernel.org, pbonzini@redhat.com Cc: mark.d.rustad@intel.com, jeffrey.t.kirsher@intel.com, kvm@vger.kernel.org Date: Wed, 30 Jul 2014 14:18:45 -0700 Message-ID: <20140730211845.127128.56203.stgit@mdrustad-wks.jf.intel.com> In-Reply-To: <1406294825-21393-1-git-send-email-jeffrey.t.kirsher@intel.com> References: <1406294825-21393-1-git-send-email-jeffrey.t.kirsher@intel.com> User-Agent: StGit/0.17-dirty MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Resolve some missing-initializers warnings that appear in W=2 builds. They are resolved by adding the name as a parameter to the macros and having the macro generate all four fields of the structure. Signed-off-by: Mark Rustad Signed-off-by: Jeff Kirsher --- V2: Change macro to supply all four fields instead of using a designated initializer. Also fix up the array terminator. --- arch/x86/kvm/x86.c | 71 ++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ef432f891d30..623aea52ceba 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -82,8 +82,9 @@ u64 __read_mostly efer_reserved_bits = ~((u64)(EFER_SCE | EFER_LME | EFER_LMA)); static u64 __read_mostly efer_reserved_bits = ~((u64)EFER_SCE); #endif -#define VM_STAT(x) offsetof(struct kvm, stat.x), KVM_STAT_VM -#define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU +#define VM_STAT(name, x) name, offsetof(struct kvm, stat.x), KVM_STAT_VM, NULL +#define VCPU_STAT(name, x) name, offsetof(struct kvm_vcpu, stat.x), \ + KVM_STAT_VCPU, NULL static void update_cr8_intercept(struct kvm_vcpu *vcpu); static void process_nmi(struct kvm_vcpu *vcpu); @@ -128,39 +129,39 @@ static struct kvm_shared_msrs_global __read_mostly shared_msrs_global; static struct kvm_shared_msrs __percpu *shared_msrs; struct kvm_stats_debugfs_item debugfs_entries[] = { - { "pf_fixed", VCPU_STAT(pf_fixed) }, - { "pf_guest", VCPU_STAT(pf_guest) }, - { "tlb_flush", VCPU_STAT(tlb_flush) }, - { "invlpg", VCPU_STAT(invlpg) }, - { "exits", VCPU_STAT(exits) }, - { "io_exits", VCPU_STAT(io_exits) }, - { "mmio_exits", VCPU_STAT(mmio_exits) }, - { "signal_exits", VCPU_STAT(signal_exits) }, - { "irq_window", VCPU_STAT(irq_window_exits) }, - { "nmi_window", VCPU_STAT(nmi_window_exits) }, - { "halt_exits", VCPU_STAT(halt_exits) }, - { "halt_wakeup", VCPU_STAT(halt_wakeup) }, - { "hypercalls", VCPU_STAT(hypercalls) }, - { "request_irq", VCPU_STAT(request_irq_exits) }, - { "irq_exits", VCPU_STAT(irq_exits) }, - { "host_state_reload", VCPU_STAT(host_state_reload) }, - { "efer_reload", VCPU_STAT(efer_reload) }, - { "fpu_reload", VCPU_STAT(fpu_reload) }, - { "insn_emulation", VCPU_STAT(insn_emulation) }, - { "insn_emulation_fail", VCPU_STAT(insn_emulation_fail) }, - { "irq_injections", VCPU_STAT(irq_injections) }, - { "nmi_injections", VCPU_STAT(nmi_injections) }, - { "mmu_shadow_zapped", VM_STAT(mmu_shadow_zapped) }, - { "mmu_pte_write", VM_STAT(mmu_pte_write) }, - { "mmu_pte_updated", VM_STAT(mmu_pte_updated) }, - { "mmu_pde_zapped", VM_STAT(mmu_pde_zapped) }, - { "mmu_flooded", VM_STAT(mmu_flooded) }, - { "mmu_recycled", VM_STAT(mmu_recycled) }, - { "mmu_cache_miss", VM_STAT(mmu_cache_miss) }, - { "mmu_unsync", VM_STAT(mmu_unsync) }, - { "remote_tlb_flush", VM_STAT(remote_tlb_flush) }, - { "largepages", VM_STAT(lpages) }, - { NULL } + { VCPU_STAT("pf_fixed", pf_fixed) }, + { VCPU_STAT("pf_guest", pf_guest) }, + { VCPU_STAT("tlb_flush", tlb_flush) }, + { VCPU_STAT("invlpg", invlpg) }, + { VCPU_STAT("exits", exits) }, + { VCPU_STAT("io_exits", io_exits) }, + { VCPU_STAT("mmio_exits", mmio_exits) }, + { VCPU_STAT("signal_exits", signal_exits) }, + { VCPU_STAT("irq_window", irq_window_exits) }, + { VCPU_STAT("nmi_window", nmi_window_exits) }, + { VCPU_STAT("halt_exits", halt_exits) }, + { VCPU_STAT("halt_wakeup", halt_wakeup) }, + { VCPU_STAT("hypercalls", hypercalls) }, + { VCPU_STAT("request_irq", request_irq_exits) }, + { VCPU_STAT("irq_exits", irq_exits) }, + { VCPU_STAT("host_state_reload", host_state_reload) }, + { VCPU_STAT("efer_reload", efer_reload) }, + { VCPU_STAT("fpu_reload", fpu_reload) }, + { VCPU_STAT("insn_emulation", insn_emulation) }, + { VCPU_STAT("insn_emulation_fail", insn_emulation_fail) }, + { VCPU_STAT("irq_injections", irq_injections) }, + { VCPU_STAT("nmi_injections", nmi_injections) }, + { VM_STAT("mmu_shadow_zapped", mmu_shadow_zapped) }, + { VM_STAT("mmu_pte_write", mmu_pte_write) }, + { VM_STAT("mmu_pte_updated", mmu_pte_updated) }, + { VM_STAT("mmu_pde_zapped", mmu_pde_zapped) }, + { VM_STAT("mmu_flooded", mmu_flooded) }, + { VM_STAT("mmu_recycled", mmu_recycled) }, + { VM_STAT("mmu_cache_miss", mmu_cache_miss) }, + { VM_STAT("mmu_unsync", mmu_unsync) }, + { VM_STAT("remote_tlb_flush", remote_tlb_flush) }, + { VM_STAT("largepages", lpages) }, + { NULL, 0, 0, NULL } }; u64 __read_mostly host_xcr0;