[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y6F4s0K2b2G8aMve@hirez.programming.kicks-ass.net>
Date: Tue, 20 Dec 2022 09:56:19 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Xin Li <xin3.li@...el.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, kvm@...r.kernel.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com,
andrew.cooper3@...rix.com, seanjc@...gle.com, pbonzini@...hat.com,
ravi.v.shankar@...el.com
Subject: Re: [RFC PATCH 14/32] x86/fred: header file with FRED definitions
> +/*
> + * FRED return instructions
> + *
> + * Replace with "ERETS"/"ERETU" once binutils support FRED return instructions.
binutils version that supports these instructions goes here...
> + */
> +#define ERETS _ASM_BYTES(0xf2,0x0f,0x01,0xca)
> +#define ERETU _ASM_BYTES(0xf3,0x0f,0x01,0xca)
> +
> +/*
> + * Event stack level macro for the FRED_STKLVLS MSR.
> + * Usage example: FRED_STKLVL(X86_TRAP_DF, 3)
> + * Multiple values can be ORd together.
> + */
> +#define FRED_STKLVL(v,l) (_AT(unsigned long, l) << (2*(v)))
> +
> +/* FRED_CONFIG MSR */
> +#define FRED_CONFIG_CSL_MASK 0x3
> +#define FRED_CONFIG_SHADOW_STACK_SPACE _BITUL(3)
> +#define FRED_CONFIG_REDZONE(b) __ALIGN_KERNEL_MASK((b), _UL(0x3f))
> +#define FRED_CONFIG_INT_STKLVL(l) (_AT(unsigned long, l) << 9)
> +#define FRED_CONFIG_ENTRYPOINT(p) _AT(unsigned long, (p))
> +
> +/* FRED event type and vector bit width and counts */
> +#define FRED_EVENT_TYPE_BITS 3 /* only 3 bits used in FRED 3.0 */
> +#define FRED_EVENT_TYPE_COUNT _BITUL(FRED_EVENT_TYPE_BITS)
> +#define FRED_EVENT_VECTOR_BITS 8
> +#define FRED_EVENT_VECTOR_COUNT _BITUL(FRED_EVENT_VECTOR_BITS)
> +
> +/* FRED EVENT_TYPE_OTHER vector numbers */
> +#define FRED_SYSCALL 1
> +#define FRED_SYSENTER 2
> +
> +/* Flags above the CS selector (regs->csl) */
> +#define FRED_CSL_ENABLE_NMI _BITUL(28)
> +#define FRED_CSL_ALLOW_SINGLE_STEP _BITUL(25)
> +#define FRED_CSL_INTERRUPT_SHADOW _BITUL(24)
What's the state of IBT WAIT-FOR-ENDBR vs this? That really should also
get a high CS bit.
Powered by blists - more mailing lists