Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp140806rdb; Thu, 25 Jan 2024 10:29:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEj1LCQPpM3gjT4wrPDvB/5J5iS5y4xEqU47Me+LqKWF72+lZQShymOzAKf4OIdhIze+AvA X-Received: by 2002:ac2:4559:0:b0:510:e92:c3b0 with SMTP id j25-20020ac24559000000b005100e92c3b0mr124134lfm.40.1706207362521; Thu, 25 Jan 2024 10:29:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706207362; cv=pass; d=google.com; s=arc-20160816; b=kEmO7qtvczNGm00bErCVy4UFqc/AolLmE4jWymTiqLdVF/riRAvCMNPB3+aDuHLmeH qPzqAI79xFKwAS2FxegqrHv1V4lBwwmhxsge3Q1SiLQqLl+NnCZcmCSTWdocaHp7r+VL Jws0evibDUcRsE+utRYVN4gKa0TM/x1Q6l8wkkmAr7o6BQ1N/SJB/mMnfY+qp+LBvznI wmC/jtsxbAUxUD1Ige4+6eZuZfzpW8eJug/XAEbieoC6aMzkdwMlMwAsbWrBJV/ozAd/ CmfY1Eicrx/yg3LuT0sjOCNF0OJbxbF2P8cOMst98RgqSF+KXhfNwlf+d5EN4z5Rs/vM MJqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=vNoeFfqkZRiYsWsg8X53S1d/fSk6ZpmrreWObpdwhdU=; fh=U/Hd0cPmVpmsXI9UC370Q88/l4pozXEkKxB1Pi0MTn0=; b=QWDPcJw9GEIldWsz+qZsnfvMPEzXTevHgFccCMfjcG9Yx1aZ010+MoNUQk/+ApHdw8 L03lll5xg6Xdqrkg52VdPqTrUj7DHRYr914CKMxOnWi9R65TBEzIWk0AtDyxTVd5TTIC dK0LJnDxr4IO56EZU22TT3nBV/Rwyznfr/qMxUvvnBVhsjTDHzZYrGZ/YKQxyYqTLgdo rLuFjsR0aGHoZfyCvHnPuzWRMzdsEHmoCYeibApE9E7pfGaBzrH1fyBw7CSSwnKIUak1 aJYjMCmDwwPkGO3LHepts1zD5giwuQqzge2I9boI5C+n/sQTTcwl6pm5Kpj3ylQRLVSg uQCA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ott5QImr; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-39113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u8-20020a170906068800b00a2ebec5666esi1181751ejb.829.2024.01.25.10.29.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 10:29:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Ott5QImr; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-39113-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39113-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1E7481F22281 for ; Thu, 25 Jan 2024 18:29:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 478B91420BB; Thu, 25 Jan 2024 18:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ott5QImr"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="O1nYAqt0" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C6E213EFE4; Thu, 25 Jan 2024 18:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206903; cv=none; b=mJwwSXlw7B9Smm+PNG3Ka1AGUp1clty84j0nryPGMp1jUxpC/xoz1VAuxO8tKKkb0uAAihtE508s2S8+gtMSut2ixjt5gamaFnWSckwwL5c4xW2RaUaOfg7VnmHt8lI+4hkWeglLE352pJu0++CwvGcnHaweql+RKayGlLGR40U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206903; c=relaxed/simple; bh=tP+RtK3KGlDtU2n9Hz6fyToQQQhH7l9u6RLL/rUJN8U=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=HEUzeTTj0a/94/iUSku0NFybCCFMChlqKHHXj1Pqg8rEhvl8+KG58UF3kXfeoJO/imsMNhmO75Ytioj5rFdNFRy7uRWeDf+gSeW6KW14rwUjx3JtJ+YTo5WK6wDUMk339Sv2UBLYpzRO4gOYttVOvQm/FHJfL3lF8uuTgcjnBNY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Ott5QImr; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=O1nYAqt0; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 25 Jan 2024 18:21:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706206899; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vNoeFfqkZRiYsWsg8X53S1d/fSk6ZpmrreWObpdwhdU=; b=Ott5QImrLd0e1gO2l35TRKFotL0aL4Eq+rNYRtloWmlJYf+3o5/IpwYHDTDi3+P8fkt06g hKlszGZ9tVnfNZmhbBz+0znNzEi8unZXdrZrx6sgpcXvgIaCh6fF1Wob4nlY8iaGG3AJkl NXkma2jOn7jyoKXBUtLGIZX7G+FoJ542vMBps/95MHD6hdH0YfiutX2GH3ESq8mafl/dDV ho/qxCIAEFgWxhOSZlDZLLf0RucFarYdBJjdvXOseRDMNnX/xtnYRJXFPCkxnsQqckpNZf YqG17d5zSo5QaimRZnHEAeZAkPg87oLDWK5iZqEs/cfT6AlUmGapCrk76yoBwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706206899; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vNoeFfqkZRiYsWsg8X53S1d/fSk6ZpmrreWObpdwhdU=; b=O1nYAqt0wpughfmuTfCO2Iyx8Ma8yBy9zre0o/PDqdmaYVwQ/3rQcZflnHZzrJvErVOL+L caD0y5RO9AxYanBw== From: "tip-bot2 for Xin Li" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fred] x86/trapnr: Add event type macros to Cc: "H. Peter Anvin (Intel)" , Xin Li , Thomas Gleixner , Shan Kang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231205105030.8698-4-xin3.li@intel.com> References: <20231205105030.8698-4-xin3.li@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170620689849.398.17892249218854161455.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/fred branch of tip: Commit-ID: 8df719341e8556f1e2bfa0f78fc433db6eba110b Gitweb: https://git.kernel.org/tip/8df719341e8556f1e2bfa0f78fc433db6eba110b Author: Xin Li AuthorDate: Tue, 05 Dec 2023 02:49:52 -08:00 Committer: Thomas Gleixner CommitterDate: Thu, 25 Jan 2024 19:10:29 +01:00 x86/trapnr: Add event type macros to Intel VT-x classifies events into eight different types, which is inherited by FRED for event identification. As such, event types becomes a common x86 concept, and should be defined in a common x86 header. Add event type macros to , and use them in . Suggested-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li Signed-off-by: Thomas Gleixner Tested-by: Shan Kang Link: https://lore.kernel.org/r/20231205105030.8698-4-xin3.li@intel.com --- 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 f5d2325..8d1154c 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 +#define EVENT_TYPE_OTHER 7 // FRED SYSCALL/SYSENTER, VT-x MTF + /* Interrupts/Exceptions */ #define X86_TRAP_DE 0 /* Divide-by-zero */ diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 0e73616..4dba173 100644 --- a/arch/x86/include/asm/vmx.h +++ b/arch/x86/include/asm/vmx.h @@ -17,6 +17,7 @@ #include #include +#include #include #define VMCS_CONTROL_BIT(x) BIT(VMX_FEATURE_##x & 0x1f) @@ -374,14 +375,14 @@ enum vmcs_field { #define VECTORING_INFO_DELIVER_CODE_MASK INTR_INFO_DELIVER_CODE_MASK #define VECTORING_INFO_VALID_MASK INTR_INFO_VALID_MASK -#define INTR_TYPE_EXT_INTR (0 << 8) /* external interrupt */ -#define INTR_TYPE_RESERVED (1 << 8) /* reserved */ -#define INTR_TYPE_NMI_INTR (2 << 8) /* NMI */ -#define INTR_TYPE_HARD_EXCEPTION (3 << 8) /* processor exception */ -#define INTR_TYPE_SOFT_INTR (4 << 8) /* software interrupt */ -#define INTR_TYPE_PRIV_SW_EXCEPTION (5 << 8) /* ICE breakpoint - undocumented */ -#define INTR_TYPE_SOFT_EXCEPTION (6 << 8) /* software exception */ -#define INTR_TYPE_OTHER_EVENT (7 << 8) /* other event */ +#define INTR_TYPE_EXT_INTR (EVENT_TYPE_EXTINT << 8) /* external interrupt */ +#define INTR_TYPE_RESERVED (EVENT_TYPE_RESERVED << 8) /* reserved */ +#define INTR_TYPE_NMI_INTR (EVENT_TYPE_NMI << 8) /* NMI */ +#define INTR_TYPE_HARD_EXCEPTION (EVENT_TYPE_HWEXC << 8) /* processor exception */ +#define INTR_TYPE_SOFT_INTR (EVENT_TYPE_SWINT << 8) /* software interrupt */ +#define INTR_TYPE_PRIV_SW_EXCEPTION (EVENT_TYPE_PRIV_SWEXC << 8) /* ICE breakpoint */ +#define INTR_TYPE_SOFT_EXCEPTION (EVENT_TYPE_SWEXC << 8) /* software exception */ +#define INTR_TYPE_OTHER_EVENT (EVENT_TYPE_OTHER << 8) /* other event */ /* GUEST_INTERRUPTIBILITY_INFO flags. */ #define GUEST_INTR_STATE_STI 0x00000001