From patchwork Fri Aug 27 17:41:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 12462593 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 531E7C432BE for ; Fri, 27 Aug 2021 17:41:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30EE360E90 for ; Fri, 27 Aug 2021 17:41:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236929AbhH0RmL (ORCPT ); Fri, 27 Aug 2021 13:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbhH0RmK (ORCPT ); Fri, 27 Aug 2021 13:42:10 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8585C061757 for ; Fri, 27 Aug 2021 10:41:21 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id q26-20020aa7961a000000b003ef3d207770so1152075pfg.16 for ; Fri, 27 Aug 2021 10:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=yA8GvsKQ2KeyW1CCPabYTh5PAhjqu8+nGZffh6KNxP4=; b=HTZ32sK9reTHnDyc2R55ncThdHKTRlXfD9mhuPdx8yRXYy1uKTbs236uIzcT6IaP95 ubXU9RNfTOxSkJX7yaoTkrFNx4TByKhp0MFEunuTYZLT/D/5OKNdiDLnXOmPppCRyfyf WIoHIUzY8x6szKoXlAWCSCwgIINuV+JCIjtlxaXH6Yl8hx878QII9eJlZ28sRqR9XCyC M//jjJYeuJsqXOxjpHL4kjFt1I55y+KAlB7aZulRljlwGwp+t+89DoK48NU2BbnF0+PG ym2Lk6GEYZbGrDcii63BwF3A9Rrjira67lWjsM8MVzpzBma6CWO6apxRcqQ/sCzbpLyl eoOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=yA8GvsKQ2KeyW1CCPabYTh5PAhjqu8+nGZffh6KNxP4=; b=cfrNtUkrrKZWfu1s1f1zywreFTNVgo+t8oi5FAFvaNIo42ZossbLo2+I+trfNCPpeo 39rirMgmj+awPt60UG1a3QUm43+MxG3TrS9j+W8aKZloQlmhL3q2R1dtUJa0uT0I6qET LwQ2ih0h0N5Y1bA5JK1IS2f9m1EDfojOXKeRUB7vp7+7jriAo8A+UCRvMjPqIXM/OlaG yGJoIRxg5EtRwf/WILEGr/Fm7Y6UqG+BBa6hmvgWf9Dv+aou5SZAS+uf/pixYKtanuzy jDQhCw3nLji/I/7PaTXNNElyw+6/f94yRHHj1l9J+jY9SNZ3tgKWGXJ1ANdoxKDm2S/q yAuQ== X-Gm-Message-State: AOAM532VqzbAROfMCMc//DfAnpMM8hsjG8XFMme3PhovxY594HbHIn90 gXB6/6Jn6FC4ZxYkNLh9MF60Lf8B9c7dT5JgdlDL3Ys9FkIB/yFcDitV1UeCvOTiocEMeEdz7Si 30P85p9bTpbQnwYajwAl3PsMfj3K4u1/4wrhDch+6K8EbiZlQo9oHrMk8seTbaRw69prrsGc= X-Google-Smtp-Source: ABdhPJzLBH4JcYAWzejXEbUs+yJnNNycOFVtZivK2+sTkBsEPxLfmfayQTnaZy9SrADo8k/IY06hVb1C0mPmNI6WxA== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:aa7:999c:0:b0:3f2:8100:79c2 with SMTP id k28-20020aa7999c000000b003f2810079c2mr5113621pfh.80.1630086081106; Fri, 27 Aug 2021 10:41:21 -0700 (PDT) Date: Fri, 27 Aug 2021 17:41:09 +0000 Message-Id: <20210827174110.3723076-1-jingzhangos@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog Subject: [PATCH 1/2] KVM: stats: Add counters for VMX all/L2/nested exit reasons From: Jing Zhang To: KVM , Paolo Bonzini , David Matlack , Peter Shier , Oliver Upton , Sean Christopherson , Peter Feiner , Jim Mattson Cc: Jing Zhang Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org These stats will be used to monitor the nested virtualization use in VMs. Most importantly: VMXON exits are evidence that the guest has enabled VMX, VMLAUNCH/VMRESUME exits are evidence that the guest has run an L2. Original-by: Peter Feiner Signed-off-by: Jing Zhang --- arch/x86/include/asm/kvm_host.h | 4 ++++ arch/x86/include/uapi/asm/vmx.h | 1 + arch/x86/kvm/vmx/vmx.c | 7 ++++++- arch/x86/kvm/x86.c | 5 ++++- include/linux/kvm_host.h | 4 ++++ 5 files changed, 19 insertions(+), 2 deletions(-) base-commit: 680c7e3be6a3d502248771fe42c911f99d7e006c diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 09b256db394a..dd2380c9ea96 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -34,6 +34,7 @@ #include #include #include +#include #define __KVM_HAVE_ARCH_VCPU_DEBUGFS @@ -1257,6 +1258,9 @@ struct kvm_vcpu_stat { u64 directed_yield_attempted; u64 directed_yield_successful; u64 guest_mode; + u64 vmx_all_exits[EXIT_REASON_NUM]; + u64 vmx_l2_exits[EXIT_REASON_NUM]; + u64 vmx_nested_exits[EXIT_REASON_NUM]; }; struct x86_instruction_info; diff --git a/arch/x86/include/uapi/asm/vmx.h b/arch/x86/include/uapi/asm/vmx.h index 946d761adbd3..563b3901ef7a 100644 --- a/arch/x86/include/uapi/asm/vmx.h +++ b/arch/x86/include/uapi/asm/vmx.h @@ -91,6 +91,7 @@ #define EXIT_REASON_UMWAIT 67 #define EXIT_REASON_TPAUSE 68 #define EXIT_REASON_BUS_LOCK 74 +#define EXIT_REASON_NUM (EXIT_REASON_BUS_LOCK + 1) #define VMX_EXIT_REASONS \ { EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \ diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index fada1055f325..5cd9f02a458a 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -5890,6 +5890,8 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) u32 vectoring_info = vmx->idt_vectoring_info; u16 exit_handler_index; + ++vcpu->stat.vmx_all_exits[exit_reason.basic]; + /* * Flush logged GPAs PML buffer, this will make dirty_bitmap more * updated. Another good is, in kvm_vm_ioctl_get_dirty_log, before @@ -5915,6 +5917,7 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) return handle_invalid_guest_state(vcpu); if (is_guest_mode(vcpu)) { + ++vcpu->stat.vmx_l2_exits[exit_reason.basic]; /* * PML is never enabled when running L2, bail immediately if a * PML full exit occurs as something is horribly wrong. @@ -5935,8 +5938,10 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) */ nested_mark_vmcs12_pages_dirty(vcpu); - if (nested_vmx_reflect_vmexit(vcpu)) + if (nested_vmx_reflect_vmexit(vcpu)) { + ++vcpu->stat.vmx_nested_exits[exit_reason.basic]; return 1; + } } if (exit_reason.failed_vmentry) { diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 86539c1686fa..245ad1d147dd 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -277,7 +277,10 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = { STATS_DESC_COUNTER(VCPU, nested_run), STATS_DESC_COUNTER(VCPU, directed_yield_attempted), STATS_DESC_COUNTER(VCPU, directed_yield_successful), - STATS_DESC_ICOUNTER(VCPU, guest_mode) + STATS_DESC_ICOUNTER(VCPU, guest_mode), + STATS_DESC_LINHIST_COUNTER(VCPU, vmx_all_exits, EXIT_REASON_NUM, 1), + STATS_DESC_LINHIST_COUNTER(VCPU, vmx_l2_exits, EXIT_REASON_NUM, 1), + STATS_DESC_LINHIST_COUNTER(VCPU, vmx_nested_exits, EXIT_REASON_NUM, 1), }; const struct kvm_stats_header kvm_vcpu_stats_header = { diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index e4d712e9f760..47e986450b06 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1429,6 +1429,10 @@ struct _kvm_stats_desc { #define STATS_DESC_PCOUNTER(SCOPE, name) \ STATS_DESC_PEAK(SCOPE, name, KVM_STATS_UNIT_NONE, \ KVM_STATS_BASE_POW10, 0) +/* Linear histogram for counter */ +#define STATS_DESC_LINHIST_COUNTER(SCOPE, name, sz, bsz) \ + STATS_DESC_LINEAR_HIST(SCOPE, name, KVM_STATS_UNIT_NONE, \ + KVM_STATS_BASE_POW10, 0, sz, bsz) /* Cumulative time in nanosecond */ #define STATS_DESC_TIME_NSEC(SCOPE, name) \ From patchwork Fri Aug 27 17:41:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 12462595 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-26.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4ED3C43214 for ; Fri, 27 Aug 2021 17:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAFB560E90 for ; Fri, 27 Aug 2021 17:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237006AbhH0RmN (ORCPT ); Fri, 27 Aug 2021 13:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbhH0RmM (ORCPT ); Fri, 27 Aug 2021 13:42:12 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32D09C061757 for ; Fri, 27 Aug 2021 10:41:23 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id r1-20020a62e401000000b003f27c6ae031so1688199pfh.20 for ; Fri, 27 Aug 2021 10:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=BiRBmZK1PG8vtC7K8U5YhEk+AMuFdq7Zxq4OxUPgKWk=; b=pIneK38fIZN0zToEv8bF1uyakxu13I5L7FWXWcg6Si2RYqk1ulHB5NNH3tN+pfacKO uLt0rwc0O9GbEDMeYVBmmeUOmCy09ql2q5O9/GxKm0MluJjFCxpJ2PghoMGjZ5Hi0HP7 q+3pB54Us6udm/u3FM8HDp8mHOL6BktnriudDrIuVwvnE9JTI/v1PM+x4eo934U+nVlR UGgkeaGv5dWmqfLwzt0HPlInErlf9i7r8VTJurz949mHioTvlFBGKYXVRoZbbkegN/+i A45+crc/pdYF4DEc+V+ex4yDj+o4oqoAgltkN045Rku7ffreTsQPVErZCyNKaLlucrRa i4qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=BiRBmZK1PG8vtC7K8U5YhEk+AMuFdq7Zxq4OxUPgKWk=; b=Jf4FwQrlWpU9G72tTX8S5MNT9PvySeR5h8BCfrMDNDO5jei8yEtOb83laJjsQfA7pl YofX1ZA2lN7rFfM/iaN5+XlTTiI+x3vFJ2s95F7aw/+E+0jnfoWwgEymvSWFNneYUmFW 2qvczqVKWn3EBoB4WgxNZDcZtei9tHJ104EC0cUGSzQGHrz7l90Q8vI0spKED43SeMgO UTqzf5dLCYnZ2qi+i7tlEUWUYezgCiokgKDD/8ZEW9uVhn34JQNKjseSfmUbnobFMkZg ofF2VdTwCvEfu2NwI2DNoNBo8ASw+MSEVGimCnzNAGBNLyFr7jpCFCZZ8PiMP6NEVUXA ioEQ== X-Gm-Message-State: AOAM5326E4oWPxUtAtATZOWqOXg0WK/usu/hKdH8aoiU7sEYsnS6OZnA zexknBtMAPg1S7QFj58n8XuTYCE16lpoHDH1ayXGO/d4fB/ravnLkaVnUiJVmrz1dQ1B9TNfSPX XQFvbuTIoBywgw29jPT111gqfPRrYOKz0qnuutZ6B/ZDU1FUeE5L2MIRziOj39LjFGmSrgQk= X-Google-Smtp-Source: ABdhPJz1fsiBm8CeitaiFkZZ4+07wa8S7r772pYCRzJ7KbNRSW4B7gF4gXq3lf4kOQU4axAWLWiimp7us7xkBGQcKQ== X-Received: from jgzg.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1acf]) (user=jingzhangos job=sendgmr) by 2002:aa7:8198:0:b029:3dd:a2ec:9ea8 with SMTP id g24-20020aa781980000b02903dda2ec9ea8mr10174025pfi.11.1630086082609; Fri, 27 Aug 2021 10:41:22 -0700 (PDT) Date: Fri, 27 Aug 2021 17:41:10 +0000 In-Reply-To: <20210827174110.3723076-1-jingzhangos@google.com> Message-Id: <20210827174110.3723076-2-jingzhangos@google.com> Mime-Version: 1.0 References: <20210827174110.3723076-1-jingzhangos@google.com> X-Mailer: git-send-email 2.33.0.259.gc128427fd7-goog Subject: [PATCH 2/2] KVM: stats: Add counters for SVM exit reasons From: Jing Zhang To: KVM , Paolo Bonzini , David Matlack , Peter Shier , Oliver Upton , Sean Christopherson , Peter Feiner , Jim Mattson Cc: Jing Zhang Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Three different exit code ranges are named as low, high and vmgexit, which start from 0x0, 0x400 and 0x80000000. Original-by: Jim Mattson Signed-off-by: Jing Zhang --- arch/x86/include/asm/kvm_host.h | 7 +++++++ arch/x86/include/uapi/asm/svm.h | 7 +++++++ arch/x86/kvm/svm/svm.c | 21 +++++++++++++++++++++ arch/x86/kvm/x86.c | 9 +++++++++ 4 files changed, 44 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index dd2380c9ea96..6e3c11a29afe 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -35,6 +35,7 @@ #include #include #include +#include #define __KVM_HAVE_ARCH_VCPU_DEBUGFS @@ -1261,6 +1262,12 @@ struct kvm_vcpu_stat { u64 vmx_all_exits[EXIT_REASON_NUM]; u64 vmx_l2_exits[EXIT_REASON_NUM]; u64 vmx_nested_exits[EXIT_REASON_NUM]; + u64 svm_exits_low[SVM_EXIT_LOW_END - SVM_EXIT_LOW_START]; + u64 svm_exits_high[SVM_EXIT_HIGH_END - SVM_EXIT_HIGH_START]; + u64 svm_vmgexits[SVM_VMGEXIT_END - SVM_VMGEXIT_START]; + u64 svm_vmgexit_unsupported_event; + u64 svm_exit_sw; + u64 svm_exit_err; }; struct x86_instruction_info; diff --git a/arch/x86/include/uapi/asm/svm.h b/arch/x86/include/uapi/asm/svm.h index efa969325ede..153ebc4ac70e 100644 --- a/arch/x86/include/uapi/asm/svm.h +++ b/arch/x86/include/uapi/asm/svm.h @@ -2,6 +2,7 @@ #ifndef _UAPI__SVM_H #define _UAPI__SVM_H +#define SVM_EXIT_LOW_START 0x000 #define SVM_EXIT_READ_CR0 0x000 #define SVM_EXIT_READ_CR2 0x002 #define SVM_EXIT_READ_CR3 0x003 @@ -95,17 +96,23 @@ #define SVM_EXIT_CR14_WRITE_TRAP 0x09e #define SVM_EXIT_CR15_WRITE_TRAP 0x09f #define SVM_EXIT_INVPCID 0x0a2 +#define SVM_EXIT_LOW_END 0xa3 + +#define SVM_EXIT_HIGH_START 0x400 #define SVM_EXIT_NPF 0x400 #define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401 #define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402 #define SVM_EXIT_VMGEXIT 0x403 +#define SVM_EXIT_HIGH_END 0x404 /* SEV-ES software-defined VMGEXIT events */ +#define SVM_VMGEXIT_START 0x80000000 #define SVM_VMGEXIT_MMIO_READ 0x80000001 #define SVM_VMGEXIT_MMIO_WRITE 0x80000002 #define SVM_VMGEXIT_NMI_COMPLETE 0x80000003 #define SVM_VMGEXIT_AP_HLT_LOOP 0x80000004 #define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005 +#define SVM_VMGEXIT_END 0x80000006 #define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0 #define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1 #define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 1a70e11f0487..e04bd201dd53 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -3291,6 +3291,7 @@ static int handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) struct vcpu_svm *svm = to_svm(vcpu); struct kvm_run *kvm_run = vcpu->run; u32 exit_code = svm->vmcb->control.exit_code; + size_t index; trace_kvm_exit(exit_code, vcpu, KVM_ISA_SVM); @@ -3337,6 +3338,26 @@ static int handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) if (exit_fastpath != EXIT_FASTPATH_NONE) return 1; + if (exit_code >= SVM_EXIT_LOW_START && + exit_code < SVM_EXIT_LOW_END) { + index = exit_code - SVM_EXIT_LOW_START; + ++vcpu->stat.svm_exits_low[index]; + } else if (exit_code >= SVM_EXIT_HIGH_START && + exit_code < SVM_EXIT_HIGH_END) { + index = exit_code - SVM_EXIT_HIGH_START; + ++vcpu->stat.svm_exits_high[index]; + } else if (exit_code >= SVM_VMGEXIT_START && + exit_code < SVM_VMGEXIT_END) { + index = exit_code - SVM_VMGEXIT_START; + ++vcpu->stat.svm_vmgexits[index]; + } else if (exit_code == SVM_VMGEXIT_UNSUPPORTED_EVENT) { + ++vcpu->stat.svm_vmgexit_unsupported_event; + } else if (exit_code == SVM_EXIT_SW) { + ++vcpu->stat.svm_exit_sw; + } else if (exit_code == SVM_EXIT_ERR) { + ++vcpu->stat.svm_exit_err; + } + return svm_invoke_exit_handler(vcpu, exit_code); } diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 245ad1d147dd..df75e4b2711e 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -281,6 +281,15 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = { STATS_DESC_LINHIST_COUNTER(VCPU, vmx_all_exits, EXIT_REASON_NUM, 1), STATS_DESC_LINHIST_COUNTER(VCPU, vmx_l2_exits, EXIT_REASON_NUM, 1), STATS_DESC_LINHIST_COUNTER(VCPU, vmx_nested_exits, EXIT_REASON_NUM, 1), + STATS_DESC_LINHIST_COUNTER(VCPU, svm_exits_low, + SVM_EXIT_LOW_END - SVM_EXIT_LOW_START, 1), + STATS_DESC_LINHIST_COUNTER(VCPU, svm_exits_high, + SVM_EXIT_HIGH_END - SVM_EXIT_HIGH_START, 1), + STATS_DESC_LINHIST_COUNTER(VCPU, svm_vmgexits, + SVM_VMGEXIT_END - SVM_VMGEXIT_START, 1), + STATS_DESC_COUNTER(VCPU, svm_vmgexit_unsupported_event), + STATS_DESC_COUNTER(VCPU, svm_exit_sw), + STATS_DESC_COUNTER(VCPU, svm_exit_err), }; const struct kvm_stats_header kvm_vcpu_stats_header = {