[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/3] SVM: sync VM-exit perf counters with known VM-exit reasons
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Wed, 5 Jan 2022 14:58:11 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SqkPX7FWlaMH1FnPGqWT6XCdFCtT6FzcXUuscARTGtE=; b=Nf2W0JjnrWDZPSop/fovTwHH0Kpsi/St3yVYju4H1CW1+DDllu2gJ4dtdgFsN+/v6sx7ZX4s015v89OMRQP46VOudvL/wytjR4nbNUB0Zig2OBt0ro9Mi18XrKYxAqj6iduEzk8zobAWN5u6nqv1cy0VUzip3fl/byN7UOFgB6p3NABU6tjMr7jT51VI21k05L2+6ye3X0FBW4LvYmwneZ6SvkSOgWZt1t2Mcydfw/KdfyclmE1jQ7Wq+uDbtu5GF0gNKEZD120+twiUnvFi5iZdiR9TOttY4G9EoTzh/9iDLv7lh8TMfnR8JxGlGCftBV7Cc9+yjCcSppmlNnu4KQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iEIB9rQEhl9p4nCS0lm6BaTvDaMfs+ZnD2IDakzAQRczWQh4kif0eerd/RipUXWQzMGGrD95cKsu3aQADPMPCLXhRohuiUg5EOy1DVPtAkES2gtegQ093W0kaVduGrQ+M/eMFOx9m7TR6un3Ryv+mpRMbayuAkjCRBZaTSkXWtqtMgJPO5PFAxL+f8JAy683U+aYPexVOptF8Ks2wm4kt1/e49sjeUshVAnHQjhVbDI7kfjfq9OB/xYD+hsw0IY8eSbHWr34ZWT65rccs8mzbnWRlxIo/0J57cOg3AD7w34SrfPawzHH408jaBPVrhYSHwx2eaq0CSMRU88nW7pNRg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Wed, 05 Jan 2022 13:58:18 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
This has gone out of sync over time, resulting in NPF and XSETBV exits
incrementing the same counter. Introduce a simplistic mechanism to
hopefully keep things in better sync going forward.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
v2: Use sentinel comments only.
--- a/xen/arch/x86/include/asm/hvm/svm/vmcb.h
+++ b/xen/arch/x86/include/asm/hvm/svm/vmcb.h
@@ -302,7 +302,9 @@ enum VMEXIT_EXITCODE
VMEXIT_MWAIT_CONDITIONAL= 140, /* 0x8c */
VMEXIT_XSETBV = 141, /* 0x8d */
VMEXIT_RDPRU = 142, /* 0x8e */
+ /* Remember to also update VMEXIT_NPF_PERFC! */
VMEXIT_NPF = 1024, /* 0x400, nested paging fault */
+ /* Remember to also update SVM_PERF_EXIT_REASON_SIZE! */
VMEXIT_INVALID = -1
};
--- a/xen/arch/x86/include/asm/perfc_defn.h
+++ b/xen/arch/x86/include/asm/perfc_defn.h
@@ -11,8 +11,8 @@ PERFCOUNTER_ARRAY(exceptions,
PERFCOUNTER_ARRAY(vmexits, "vmexits", VMX_PERF_EXIT_REASON_SIZE)
PERFCOUNTER_ARRAY(cause_vector, "cause vector", VMX_PERF_VECTOR_SIZE)
-#define VMEXIT_NPF_PERFC 141
-#define SVM_PERF_EXIT_REASON_SIZE (1+141)
+#define VMEXIT_NPF_PERFC 143
+#define SVM_PERF_EXIT_REASON_SIZE (VMEXIT_NPF_PERFC + 1)
PERFCOUNTER_ARRAY(svmexits, "SVMexits", SVM_PERF_EXIT_REASON_SIZE)
#endif /* CONFIG_HVM */
|