From patchwork Mon Dec 19 09:47:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 9479955 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A2B460237 for ; Mon, 19 Dec 2016 09:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36AA7284A2 for ; Mon, 19 Dec 2016 09:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B8FF284A7; Mon, 19 Dec 2016 09:54:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C63CC284A2 for ; Mon, 19 Dec 2016 09:54:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755629AbcLSJxO (ORCPT ); Mon, 19 Dec 2016 04:53:14 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:34962 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754689AbcLSJrY (ORCPT ); Mon, 19 Dec 2016 04:47:24 -0500 Received: by mail-wm0-f67.google.com with SMTP id a20so17591558wme.2; Mon, 19 Dec 2016 01:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=eG+L9WDWhcIcHRWZaDhqHb4n6F3Q6xOwK/6BWgyKGEs=; b=g5iHeT118+DWAeRbcqzhGhtY8c/MNyDQ/pQaN6d+IkhQTy9UOl/xcVqJmZejGyi279 g2YThnrdndDLHArJgITT5g7Xhp0XZ3vcrbrjBcmgtj/TFa2NKcD9nSADL9VvrUo9478/ lA+0nmoBylgGyWsuZCq0lumMrcR2D4rGONZbsU2LDpbXSEKgnD+79EKJVtmn9YfaAMyF /pgTOOm2ztA2QVWjYkjjOxCTWQNkgBMnbd6ttq0I5pz2F5vj6dkKT0nqGC7qfrLSlKBg kwf+hRyrpUAnBrp59mz0QEkdqocHy1FC7kY1DmejaOWhUWKZ23apsoF0ULvk7TBQBJoX 3DWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=eG+L9WDWhcIcHRWZaDhqHb4n6F3Q6xOwK/6BWgyKGEs=; b=mEv0M0OgALKe4wta+xRZs+YXbyd6aRbzgHoeWj6G88jJYZ4qB0/rCaAF978IAY21Ex pGWlJQMG0Yqas3FE0qM6r+SigAAdDQH21GJsRIad2DrrJYwbHgcoMcVsakfPLWPq9vmA tjC471Hf7WInYrMKPvS5e/HyTPDQcMkmiC1Bd1+zl18PR5AVn/YAPFsyhMelzfu7pDTj l7ymOeDEz8ODjGpX2oUcuuSgAEo+0hEo9TuTLmMy3athvPiuqSl1meQIq7hZu6zvxmq4 9Huy5nWsAzfbuS0V/gtMnPANOOz3hSYcN4+Ib/xjDZT8hOYxF4JX7f4xWwFK4E2Tc9fb 5vVg== X-Gm-Message-State: AIkVDXKkjU1uy2gkLfa4FowdbSjk/bx+wXvSXEEYvDsex6zCAgX9/GBgee8icosrU6OHAw== X-Received: by 10.28.71.14 with SMTP id u14mr12018030wma.52.1482140843151; Mon, 19 Dec 2016 01:47:23 -0800 (PST) Received: from 640k.lan (94-39-188-115.adsl-ull.clienti.tiscali.it. [94.39.188.115]) by smtp.gmail.com with ESMTPSA id g73sm16375189wme.16.2016.12.19.01.47.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 01:47:22 -0800 (PST) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: rkrcmar@redhat.com, rkagan@virtuozzo.com, dplotnikov@virtuozzo.com Subject: [PATCH 1/6] KVM: x86: add VCPU stat for KVM_REQ_EVENT processing Date: Mon, 19 Dec 2016 10:47:13 +0100 Message-Id: <1482140838-6303-2-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1482140838-6303-1-git-send-email-pbonzini@redhat.com> References: <1482140838-6303-1-git-send-email-pbonzini@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Paolo Bonzini --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/x86.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 994d8ed9fc6c..08cfd45a9452 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -850,6 +850,7 @@ struct kvm_vcpu_stat { u64 hypercalls; u64 irq_injections; u64 nmi_injections; + u64 req_event; }; struct x86_instruction_info; diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e95d94edbdc3..e9b512090865 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -180,6 +180,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { { "insn_emulation_fail", VCPU_STAT(insn_emulation_fail) }, { "irq_injections", VCPU_STAT(irq_injections) }, { "nmi_injections", VCPU_STAT(nmi_injections) }, + { "req_event", VCPU_STAT(req_event) }, { "mmu_shadow_zapped", VM_STAT(mmu_shadow_zapped) }, { "mmu_pte_write", VM_STAT(mmu_pte_write) }, { "mmu_pte_updated", VM_STAT(mmu_pte_updated) }, @@ -6691,6 +6692,7 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) } if (kvm_check_request(KVM_REQ_EVENT, vcpu) || req_int_win) { + ++vcpu->stat.req_event; kvm_apic_accept_events(vcpu); if (vcpu->arch.mp_state == KVM_MP_STATE_INIT_RECEIVED) { r = 1;