Re: [PATCH v12 00/37] x86: enable FRED for x86-64

2023-10-05 Thread Nikolay Borisov
On 3.10.23 г. 9:24 ч., Xin Li wrote: This patch set enables the Intel flexible return and event delivery (FRED) architecture for x86-64. Which tree is this based on now? I tried running 'b4 diff' but it complains it can't find some context around arch/x86/kernel/cpu/common.c . I have

Re: [PATCH v11 05/37] x86/trapnr: Add event type macros to

2023-09-26 Thread Nikolay Borisov
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 , and use it in .

Re: [PATCH v10 33/38] x86/entry: Add fred_entry_from_kvm() for VMX to handle IRQ/NMI

2023-09-21 Thread Nikolay Borisov
On 14.09.23 г. 7:48 ч., Xin Li wrote: In IRQ/NMI induced VM exits, KVM VMX needs to execute the respective handlers, which requires the software to create a FRED stack frame, and use it to invoke the handlers. Add fred_irq_entry_from_kvm() for this job. Export fred_entry_from_kvm() because

Re: [PATCH v10 28/38] x86/fred: FRED entry/exit and dispatch code

2023-09-21 Thread Nikolay Borisov
On 14.09.23 г. 7:47 ч., Xin Li wrote: From: "H. Peter Anvin (Intel)" The code to actually handle kernel and event entry/exit using FRED. It is split up into two files thus: - entry_64_fred.S contains the actual entrypoints and exit code, and saves and restores registers. - entry_fred.c

Re: [PATCH v10 16/38] x86/ptrace: Add FRED additional information to the pt_regs structure

2023-09-21 Thread Nikolay Borisov
On 20.09.23 г. 20:23 ч., Li, Xin3 wrote: +struct fred_ss { + u64 ss : 16, // SS selector Is this structure conformant to the return state as described in FRED 5.0? — The stack segment of the interrupted context, 64 bits formatted as follows: • Bits 15:0 contain the SS

Re: [PATCH v10 16/38] x86/ptrace: Add FRED additional information to the pt_regs structure

2023-09-20 Thread Nikolay Borisov
On 14.09.23 г. 7:47 ч., Xin Li wrote: FRED defines additional information in the upper 48 bits of cs/ss fields. Therefore add the information definitions into the pt_regs structure. Specially introduce a new structure fred_ss to denote the FRED flags above SS selector, which avoids FRED_SSX_

Re: [PATCH v10 13/38] x86/cpu: Add X86_CR4_FRED macro

2023-09-20 Thread Nikolay Borisov
On 14.09.23 г. 7:47 ч., Xin Li wrote: From: "H. Peter Anvin (Intel)" Add X86_CR4_FRED macro for the FRED bit in %cr4. This bit must not be changed after initialization, so add it to the pinned CR4 bits. Signed-off-by: H. Peter Anvin (Intel) Tested-by: Shan Kang Signed-off-by: Xin Li ---

Re: [PATCH v10 09/38] x86/fred: Disable FRED support if CONFIG_X86_FRED is disabled

2023-09-20 Thread Nikolay Borisov
On 14.09.23 г. 7:47 ч., Xin Li wrote: From: "H. Peter Anvin (Intel)" Add CONFIG_X86_FRED to to make cpu_feature_enabled() work correctly with FRED. Originally-by: Megha Dey Signed-off-by: H. Peter Anvin (Intel) Tested-by: Shan Kang Signed-off-by: Xin Li ---

Re: [PATCH v10 06/38] Documentation/x86/64: Add a documentation for FRED

2023-09-20 Thread Nikolay Borisov
On 14.09.23 г. 7:47 ч., Xin Li wrote: Briefly introduce FRED, and its advantages compared to IDT. Signed-off-by: Xin Li --- Documentation/arch/x86/x86_64/fred.rst | 98 + Documentation/arch/x86/x86_64/index.rst | 1 + 2 files changed, 99 insertions(+) create

Re: [PATCH v10 03/38] x86/msr: Add the WRMSRNS instruction support

2023-09-20 Thread Nikolay Borisov
On 14.09.23 г. 7:47 ч., Xin Li wrote: Add an always inline API __wrmsrns() to embed the WRMSRNS instruction into the code. Tested-by: Shan Kang Signed-off-by: Xin Li --- arch/x86/include/asm/msr.h | 18 ++ 1 file changed, 18 insertions(+) diff --git