[PATCH v1] KVM: PPC: Book3S HV: Prevent POWER7/8 TLB flush flushing SLB

2021-11-18 Thread Nicholas Piggin
The POWER9 ERAT flush instruction is a SLBIA with IH=7, which is a reserved value on POWER7/8. On POWER8 this invalidates the SLB entries above index 0, similarly to SLBIA IH=0. If the SLB entries are invalidated, and then the guest is bypassed, the host SLB does not get re-loaded, so the bolted e

Re: [PATCH 0/3] KEXEC_SIG with appended signature

2021-11-18 Thread Nayna
On 11/16/21 04:53, Michal Suchánek wrote: On Mon, Nov 15, 2021 at 06:53:53PM -0500, Nayna wrote: On 11/12/21 03:30, Michal Suchánek wrote: Hello, On Thu, Nov 11, 2021 at 05:26:41PM -0500, Nayna wrote: On 11/8/21 07:05, Michal Suchánek wrote: Hello, The other part is that distributions app

Re: [PATCH v4 00/25] Unify PCI error response checking

2021-11-18 Thread Bjorn Helgaas
On Thu, Nov 18, 2021 at 07:33:10PM +0530, Naveen Naidu wrote: > An MMIO read from a PCI device that doesn't exist or doesn't respond > causes a PCI error. There's no real data to return to satisfy the > CPU read, so most hardware fabricates ~0 data. > > This patch series adds PCI_ERROR_RESPONSE

[PATCH] powerpc/signal32: Use struct_group() to zero spe regs

2021-11-18 Thread Kees Cook
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add a struct_group() for the spe registers so that memset() can correctly reason about the size: In function 'fortify_memset_chk',

Re: [PATCH v3 08/12] KVM: Propagate vcpu explicitly to mark_page_dirty_in_slot()

2021-11-18 Thread David Woodhouse
On 18 November 2021 18:50:55 GMT, Sean Christopherson wrote: >On Thu, Nov 18, 2021, Sean Christopherson wrote: >> On Thu, Nov 18, 2021, David Woodhouse wrote: >> > That leaves the one in TDP MMU handle_changed_spte_dirty_log() which >> > AFAICT can trigger the same crash seen by butt3rflyh4ck —

[PATCH 3/3] of/fdt: Rework early_init_dt_scan_memory() to call directly

2021-11-18 Thread Rob Herring
Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework early_init_dt_scan_memory() to be called directly and use libfdt. Cc: John Crispin Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras

[PATCH 2/3] of/fdt: Rework early_init_dt_scan_root() to call directly

2021-11-18 Thread Rob Herring
Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework early_init_dt_scan_root() to be called directly and use libfdt. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Frank Rowand Cc: linuxppc-dev@lists.ozl

[PATCH 1/3] of/fdt: Rework early_init_dt_scan_chosen() to call directly

2021-11-18 Thread Rob Herring
Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework early_init_dt_scan_chosen() to be called directly and use libfdt. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Frank Rowand Cc: linuxppc-dev@lists.o

[PATCH 0/3] of/fdt: Rework early FDT scanning functions

2021-11-18 Thread Rob Herring
The early FDT scanning functions use of_scan_flat_dt() which implements its own node walking method. This function predates libfdt and is an unnecessary indirection. This series reworks early_init_dt_scan_chosen(), early_init_dt_scan_root(), and early_init_dt_scan_memory() to be called directly

Re: [PATCH 04/11] powerpc/xive: Introduce xive_core_debugfs_create()

2021-11-18 Thread Cédric Le Goater
On 11/18/21 10:21, Michael Ellerman wrote: Cédric Le Goater writes: and fix some compile issues when !CONFIG_DEBUG_FS. Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/common.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/

Re: [PATCH 11/11] powerpc/smp: Add a doorbell=off kernel parameter

2021-11-18 Thread Cédric Le Goater
On 11/18/21 10:24, Michael Ellerman wrote: Cédric Le Goater writes: On 11/11/21 11:41, Michael Ellerman wrote: Cédric Le Goater writes: On processors with a XIVE interrupt controller (POWER9 and above), the kernel can use either doorbells or XIVE to generate CPU IPIs. Sending doorbell is gen

Re: [PATCH v3 08/12] KVM: Propagate vcpu explicitly to mark_page_dirty_in_slot()

2021-11-18 Thread David Woodhouse
On Thu, 2021-11-18 at 13:04 +0100, Paolo Bonzini wrote: > On 11/17/21 22:09, David Woodhouse wrote: > > > { > > > - struct kvm_vcpu *vcpu = kvm_get_running_vcpu(); > > > + struct kvm_vcpu *running_vcpu = kvm_get_running_vcpu(); > > > > > > + WARN_ON_ONCE(vcpu && vcpu != running_vcpu); > > >

[PATCH v4 19/25] PCI/DPC: Use PCI_POSSIBLE_ERROR() to check read from hardware

2021-11-18 Thread Naveen Naidu
An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This helps unify PCI error

[PATCH v4 00/25] Unify PCI error response checking

2021-11-18 Thread Naveen Naidu
An MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. This patch series adds PCI_ERROR_RESPONSE definition and other helper definition PCI_SET_ERROR_RESPONSE and PCI_PO

Re: [PATCH v3 01/25] PCI: Add PCI_ERROR_RESPONSE and it's related definitions

2021-11-18 Thread Naveen Naidu
On 17/11, Bjorn Helgaas wrote: > On Thu, Oct 21, 2021 at 08:37:26PM +0530, Naveen Naidu wrote: > > An MMIO read from a PCI device that doesn't exist or doesn't respond > > causes a PCI error. There's no real data to return to satisfy the > > CPU read, so most hardware fabricates ~0 data. > > > >

Re: [PATCH v3 08/12] KVM: Propagate vcpu explicitly to mark_page_dirty_in_slot()

2021-11-18 Thread Paolo Bonzini
On 11/17/21 22:09, David Woodhouse wrote: { - struct kvm_vcpu *vcpu = kvm_get_running_vcpu(); + struct kvm_vcpu *running_vcpu = kvm_get_running_vcpu(); + WARN_ON_ONCE(vcpu && vcpu != running_vcpu); WARN_ON_ONCE(vcpu->kvm != kvm); Ah, that one needs to be changed to c

Re: [PATCH 1/2] powerpc/mce: Avoid using irq_work_queue() in realmode

2021-11-18 Thread Ganesh
On 11/8/21 19:49, Nicholas Piggin wrote: Excerpts from Ganesh Goudar's message of November 8, 2021 6:38 pm: In realmode mce handler we use irq_work_queue() to defer the processing of mce events, irq_work_queue() can only be called when translation is enabled because it touches memory outside RM

Re: [PATCH 1/2] powerpc/mce: Avoid using irq_work_queue() in realmode

2021-11-18 Thread Ganesh
On 11/12/21 12:42, Daniel Axtens wrote: In realmode mce handler we use irq_work_queue() to defer the processing of mce events, irq_work_queue() can only be called when translation is enabled because it touches memory outside RMA, hence we enable translation before calling irq_work_queue and disa

[PATCH] powerpc/32: Fix hardlockup on vmap stack overflow

2021-11-18 Thread Christophe Leroy
Since the commit c118c7303ad5 ("powerpc/32: Fix vmap stack - Do not activate MMU before reading task struct") a vmap stack overflow results in a hard lockup. This is because emergency_ctx is still addressed with its virtual address allthough data MMU is not active anymore at that time. Fix it by u

Re: [PATCH 11/11] powerpc/smp: Add a doorbell=off kernel parameter

2021-11-18 Thread Michael Ellerman
Cédric Le Goater writes: > On 11/11/21 11:41, Michael Ellerman wrote: >> Cédric Le Goater writes: >>> On processors with a XIVE interrupt controller (POWER9 and above), the >>> kernel can use either doorbells or XIVE to generate CPU IPIs. Sending >>> doorbell is generally preferred to using the X

Re: [PATCH 04/11] powerpc/xive: Introduce xive_core_debugfs_create()

2021-11-18 Thread Michael Ellerman
Cédric Le Goater writes: > and fix some compile issues when !CONFIG_DEBUG_FS. > > Signed-off-by: Cédric Le Goater > --- > arch/powerpc/sysdev/xive/common.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/arch/powerpc/sysdev/xive/common.c > b/arch/pow