[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v11 05/37] x86/trapnr: Add event type macros to <asm/trapnr.h>
- To: Xin Li <xin3.li@xxxxxxxxx>, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-edac@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx
- From: Nikolay Borisov <nik.borisov@xxxxxxxx>
- Date: Tue, 26 Sep 2023 11:10:51 +0300
- 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=TyZEe6WbNYUl0OlEuOpwvuzVbgy4StGtpHEjSLuTn/I=; b=Eqan70rzVaXbRYv8THfTRE3yN7h7D3ApmrK6Q/rYKBTahB/SkTta4kJmNRRS8kbTBVA5+Cj9nacRwZ76uVF59nBPW5GbiHP0vvnlWE7WIC2wcp9ELTDA5RXkadXlZ1lHMx5IsBJq5/3tCCC5H3H36idXpz0uTq+s8QebPKVj76gINCAJ4MEmWBnxa01E7UKQinRd5P3N/okL0UmAhuxxAwWnwtIEFSB2VQLB9xOKN8b5eo6gM2lHuJz8C6QihwA1pIQIB3UgvmFBfMrTE5YOdOBRaISSvluKRzeSxrnFRpwRFkJENkdcEE3pg7nCdt1bVA0SaoOScpQD/o1vubSzpg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mJIiNVnIi1U9Gun+B5TKso75IXXKPeqFiqfKgkSr+CD/Ht+FavBSUI2qkPuyrqFFkF5+wKorbHqtt0yYUaCS7brK64Qq/uyDLWLIYguFw7mDdxxyeRuQ5+rfnmPMjAohrAyhQ+bs78++draT+5QApwpWpG1XBBxTsa2F1DkTKprKmW5njIkSQop2z+6G6RkgGemMc0AW5IqGrBUdwCZzsJwPpqGwJ4SvxEp+OiTG6FZGpltkSNoxsZHn47Tgo9Ds6GBHNfu4mm4RjMX0psThqZjfa9Ehuy51NyDKjoC9/3dN6T/UZR9+utgmehJoVW1B180GrKHPdzfyAUHaMX4Uqw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, luto@xxxxxxxxxx, pbonzini@xxxxxxxxxx, seanjc@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, jgross@xxxxxxxx, ravi.v.shankar@xxxxxxxxx, mhiramat@xxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, jiangshanlai@xxxxxxxxx
- Delivery-date: Tue, 26 Sep 2023 08:11:04 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 23.09.23 г. 12:41 ч., Xin Li wrote:
Intel VT-x classifies events into eight different types, which is
inherited by FRED for event identification. As such, event type
becomes a common x86 concept, and should be defined in a common x86
header.
Add event type macros to <asm/trapnr.h>, and use it in <asm/vmx.h>.
Suggested-by: H. Peter Anvin (Intel) <hpa@xxxxxxxxx>
Tested-by: Shan Kang <shan.kang@xxxxxxxxx>
Signed-off-by: Xin Li <xin3.li@xxxxxxxxx>
---
Changes since v10:
* A few comment fixes and improvements (Andrew Cooper).
---
arch/x86/include/asm/trapnr.h | 12 ++++++++++++
arch/x86/include/asm/vmx.h | 17 +++++++++--------
2 files changed, 21 insertions(+), 8 deletions(-)
diff --git a/arch/x86/include/asm/trapnr.h b/arch/x86/include/asm/trapnr.h
index f5d2325aa0b7..8d1154cdf787 100644
--- a/arch/x86/include/asm/trapnr.h
+++ b/arch/x86/include/asm/trapnr.h
@@ -2,6 +2,18 @@
#ifndef _ASM_X86_TRAPNR_H
#define _ASM_X86_TRAPNR_H
+/*
+ * Event type codes used by FRED, Intel VT-x and AMD SVM
+ */
+#define EVENT_TYPE_EXTINT 0 // External interrupt
+#define EVENT_TYPE_RESERVED 1
+#define EVENT_TYPE_NMI 2 // NMI
+#define EVENT_TYPE_HWEXC 3 // Hardware originated traps, exceptions
+#define EVENT_TYPE_SWINT 4 // INT n
+#define EVENT_TYPE_PRIV_SWEXC 5 // INT1
+#define EVENT_TYPE_SWEXC 6 // INTO, INT3
nit: This turned into INTO (Oh) rather than INT0( zero) in v11
<nit>
|