lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230706064519.GC2833176@hirez.programming.kicks-ass.net>
Date:   Thu, 6 Jul 2023 08:45:19 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Xin Li <xin3.li@...el.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org,
        tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, hpa@...or.com, seanjc@...gle.com,
        pbonzini@...hat.com
Subject: Re: [PATCH] x86/trapnr: Add event type macros to <asm/trapnr.h>

On Wed, Jul 05, 2023 at 10:14:43PM -0700, Xin Li wrote:

> +/*
> + * Event type codes used by both Intel VT-x and FRED
> + */
> +/* Maskable external interrupt */
> +#define EVENT_TYPE_HWINT	0
> +#define EVENT_TYPE_RESERVED	1
> +#define EVENT_TYPE_NMI		2
> +/* Hardware exceptions (e.g., page fault) */
> +#define EVENT_TYPE_HWFAULT	3
> +/* Software interrupt (INT n) */
> +#define EVENT_TYPE_SWINT	4
> +/* INT1 (ICEBP) */
> +#define EVENT_TYPE_PRIVSW	5
> +/* Software exception (INT3 or INTO) */
> +#define EVENT_TYPE_SWFAULT	6
> +/* VT-x MTF or FRED SYSCALL/SYSENTER */
> +#define EVENT_TYPE_OTHER	7

So I know tglx hates on tail comments, but I find the below *MUCH* more
readable than the above horror show.

> -#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 */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ