Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-04 Thread Sean Christopherson
On Fri, Nov 04, 2022, Isaku Yamahata wrote: > Thanks for the patch series. I the rebased TDX KVM patch series and it worked. > Since cpu offline needs to be rejected in some cases(To keep at least one cpu > on a package), arch hook for cpu offline is needed. I hate to bring this up because I

Re: [PATCH 02/44] KVM: Initialize IRQ FD after arch hardware setup

2022-11-04 Thread Sean Christopherson
On Fri, Nov 04, 2022, Chao Gao wrote: > On Wed, Nov 02, 2022 at 11:18:29PM +, Sean Christopherson wrote: > > > >+r = kvm_irqfd_init(); > >+if (r) > >+goto err_irqfd; > >+ > > r = kvm_async_pf_init(); > > if (r) > >-goto out_free_4; > >+goto

Re: [RFC PATCH 3/6] powerpc/powernv: Keep MSR in register across OPAL entry/return path

2022-11-04 Thread Christophe Leroy
Le 04/11/2022 à 18:27, Andrew Donnellan a écrit : > When we enter and return from an OPAL call, there's three pieces of state > we have to save and restore: the stack pointer, the PACA pointer, and the > MSR. However, there's only two registers that OPAL is guaranteed to > preserve for us (r1

Re: [RFC PATCH 1/6] powerpc/64s: Fix assembly to support larger values of THREAD_SIZE

2022-11-04 Thread Christophe Leroy
Le 04/11/2022 à 18:27, Andrew Donnellan a écrit : > When CONFIG_VMAP_STACK is enabled, we set THREAD_SIZE to be at least the > size of a page. > > There's a few bits of assembly in the book3s64 code that use THREAD_SIZE in > immediate mode instructions, which can only take an operand of up to

[RFC PATCH 4/6] powerpc/powernv: Convert pointers to physical addresses in OPAL call args

2022-11-04 Thread Andrew Donnellan
A number of OPAL calls take addresses as arguments (e.g. buffers with strings to print, etc). These addresses need to be physical addresses, as OPAL runs in real mode. Since the hardware ignores the top two bits of the address in real mode, passing addresses in the kernel's linear map works fine

[RFC PATCH 6/6] powerpc/64s: Enable CONFIG_VMAP_STACK

2022-11-04 Thread Andrew Donnellan
Enable CONFIG_VMAP_STACK for book3s64. To do this, we need to make some slight adjustments to set the stack SLB entry up for vmalloc rather than linear. For now, only enable if KVM_BOOK3S_64_HV is disabled (there's some real mode handlers we need to fix there). Signed-off-by: Andrew Donnellan

[RFC PATCH 5/6] powerpc/powernv/idle: Convert stack pointer to physical address

2022-11-04 Thread Andrew Donnellan
When we go into idle, we must disable the MMU. Currently, we can still access the stack once the MMU is disabled, because the stack is in the linear map. Once we enable CONFIG_VMAP_STACK, the normal stack pointer will be in the vmalloc area. To cope with this, manually convert the stack pointer

[RFC PATCH 2/6] powerpc/64s: Helpers to switch between linear and vmapped stack pointers

2022-11-04 Thread Andrew Donnellan
powerpc unfortunately has too many places where we run stuff in real mode. With CONFIG_VMAP_STACK enabled, this means we need to be able to swap the stack pointer to use the linear mapping when we enter a real mode section, and back afterwards. Store the top bits of the stack pointer in both the

[RFC PATCH 3/6] powerpc/powernv: Keep MSR in register across OPAL entry/return path

2022-11-04 Thread Andrew Donnellan
When we enter and return from an OPAL call, there's three pieces of state we have to save and restore: the stack pointer, the PACA pointer, and the MSR. However, there's only two registers that OPAL is guaranteed to preserve for us (r1 for the stack pointer and r13 for the PACA), so the MSR gets

[RFC PATCH 0/6] VMAP_STACK support for book3s64

2022-11-04 Thread Andrew Donnellan
This series begins implementing VMAP_STACK support for book3s64 platforms, building on the existing 32-bit work that Christophe Leroy has done. Right now, it doesn't boot on my POWER9 machine - I'm sending this as is because I'm about to go on holidays for a couple of weeks, and I'll pick it up

[RFC PATCH 1/6] powerpc/64s: Fix assembly to support larger values of THREAD_SIZE

2022-11-04 Thread Andrew Donnellan
When CONFIG_VMAP_STACK is enabled, we set THREAD_SIZE to be at least the size of a page. There's a few bits of assembly in the book3s64 code that use THREAD_SIZE in immediate mode instructions, which can only take an operand of up to 16 bits signed, which isn't quite large enough. Fix these

Re: [PATCH v3 0/9] PCI/AER: Fix and optimize usage of status clearing api

2022-11-04 Thread Zhuo Chen
Hi Bjorn, a gentle reminder. Thanks and regards. On 9/28/22 6:59 PM, Zhuo Chen wrote: Hello. Here comes patch v3, which contains some fixes and optimizations of aer api usage. The v1 and v2 can be found on the mailing list. v3: - Modifications to comments proposed by Sathyanarayanan. Remove

Re: [PATCH 08/44] KVM: x86: Move hardware setup/unsetup to init/exit

2022-11-04 Thread Sean Christopherson
On Fri, Nov 04, 2022, Yuan Yao wrote: > On Wed, Nov 02, 2022 at 11:18:35PM +, Sean Christopherson wrote: > > To avoid having to unwind various setup, e.g registration of several > > notifiers, slot in the vendor hardware setup before the registration of > > said notifiers and callbacks.

Re: [PATCH 33/44] KVM: x86: Do VMX/SVM support checks directly in vendor code

2022-11-04 Thread Sean Christopherson
On Fri, Nov 04, 2022, Paolo Bonzini wrote: > On 11/3/22 19:58, Sean Christopherson wrote: > > > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > > index 3e508f239098..ebe617ab0b37 100644 > > --- a/arch/x86/kernel/cpu/common.c > > +++ b/arch/x86/kernel/cpu/common.c > >

Re: [RFC PATCH 01/19] powerpc/perf: callchain validate kernel stack pointer bounds

2022-11-04 Thread Segher Boessenkool
On Mon, Oct 31, 2022 at 03:54:22PM +1000, Nicholas Piggin wrote: > Could the user set r1 to be equal to the address matching the first > interrupt frame - STACK_INT_FRAME_SIZE, which is in the previous page > due to the kernel redzone, and induce the kernel to load the marker from > there?

Re: [PATCH 1/2] tools/perf: Fix printing os->prefix in CSV metrics output

2022-11-04 Thread Disha Goel
On 11/4/22 12:59 PM, Athira Rajeev wrote: On 03-Nov-2022, at 9:45 PM, Ian Rogers wrote: On Wed, Nov 2, 2022 at 1:36 AM Athira Rajeev wrote: On 18-Oct-2022, at 2:26 PM, Athira Rajeev wrote: Perf stat with CSV output option prints an extra empty string as first field in metrics output

Re: [PATCH 08/44] KVM: x86: Move hardware setup/unsetup to init/exit

2022-11-04 Thread Yuan Yao
On Wed, Nov 02, 2022 at 11:18:35PM +, Sean Christopherson wrote: > Now that kvm_arch_hardware_setup() is called immediately after > kvm_arch_init(), fold the guts of kvm_arch_hardware_(un)setup() into > kvm_arch_{init,exit}() as a step towards dropping one of the hooks. > > To avoid having to

Re: [PATCH 03/44] KVM: Allocate cpus_hardware_enabled after arch hardware setup

2022-11-04 Thread Yuan Yao
On Wed, Nov 02, 2022 at 11:18:30PM +, Sean Christopherson wrote: > Allocate cpus_hardware_enabled after arch hardware setup so that arch > "init" and "hardware setup" are called back-to-back and thus can be > combined in a future patch. cpus_hardware_enabled is never used before >

Re: [PATCH 33/44] KVM: x86: Do VMX/SVM support checks directly in vendor code

2022-11-04 Thread Paolo Bonzini
On 11/3/22 19:58, Sean Christopherson wrote: diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 3e508f239098..ebe617ab0b37 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -191,6 +191,8 @@ static void default_init(struct cpuinfo_x86 *c)

Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-04 Thread Paolo Bonzini
On 11/4/22 08:17, Isaku Yamahata wrote: On Wed, Nov 02, 2022 at 11:18:27PM +, Sean Christopherson wrote: Non-x86 folks, please test on hardware when possible. I made a _lot_ of mistakes when moving code around. Thankfully, x86 was the trickiest code to deal with, and I'm fairly

Re: [PATCH 1/2] tools/perf: Fix printing os->prefix in CSV metrics output

2022-11-04 Thread Athira Rajeev
> On 03-Nov-2022, at 9:45 PM, Ian Rogers wrote: > > On Wed, Nov 2, 2022 at 1:36 AM Athira Rajeev > wrote: >> >> >> >>> On 18-Oct-2022, at 2:26 PM, Athira Rajeev >>> wrote: >>> >>> Perf stat with CSV output option prints an extra empty >>> string as first field in metrics output line.

Re: [PATCH 36/44] KVM: x86: Do compatibility checks when onlining CPU

2022-11-04 Thread Isaku Yamahata
On Thu, Nov 03, 2022 at 10:34:10PM +, Sean Christopherson wrote: > On Thu, Nov 03, 2022, Isaku Yamahata wrote: > > On Wed, Nov 02, 2022 at 11:19:03PM +, > > Sean Christopherson wrote: > > > diff --git a/arch/x86/include/asm/kvm_host.h > > > b/arch/x86/include/asm/kvm_host.h > > > index

Re: [PATCH 00/44] KVM: Rework kvm_init() and hardware enabling

2022-11-04 Thread Isaku Yamahata
On Wed, Nov 02, 2022 at 11:18:27PM +, Sean Christopherson wrote: > Non-x86 folks, please test on hardware when possible. I made a _lot_ of > mistakes when moving code around. Thankfully, x86 was the trickiest code > to deal with, and I'm fairly confident that I found all the bugs I >