Re: [PATCH v4 13/46] KVM: PPC: Book3S 64: Move GUEST_MODE_SKIP test into KVM

2021-03-31 Thread Paul Mackerras
On Tue, Mar 23, 2021 at 11:02:32AM +1000, Nicholas Piggin wrote: > Move the GUEST_MODE_SKIP logic into KVM code. This is quite a KVM > internal detail that has no real need to be in common handlers. > > Also add a comment explaining why this thing exists. [snip] > diff --git

Re: [PATCH v4 12/46] KVM: PPC: Book3S 64: move KVM interrupt entry to a common entry point

2021-03-31 Thread Paul Mackerras
On Tue, Mar 23, 2021 at 11:02:31AM +1000, Nicholas Piggin wrote: > Rather than bifurcate the call depending on whether or not HV is > possible, and have the HV entry test for PR, just make a single > common point which does the demultiplexing. This makes it simpler > to add another type of exit

Re: [PATCH v4 15/46] KVM: PPC: Book3S 64: Move hcall early register setup to KVM

2021-03-31 Thread Paul Mackerras
On Tue, Mar 23, 2021 at 11:02:34AM +1000, Nicholas Piggin wrote: > System calls / hcalls have a different calling convention than > other interrupts, so there is code in the KVMTEST to massage these > into the same form as other interrupt handlers. > > Move this work into the KVM hcall handler.

Re: [PATCH v4 29/46] KVM: PPC: Book3S HV P9: Implement the rest of the P9 path in C

2021-03-31 Thread Alexey Kardashevskiy
On 3/23/21 12:02 PM, Nicholas Piggin wrote: Almost all logic is moved to C, by introducing a new in_guest mode that selects and branches very early in the interrupt handler to the P9 exit code. The remaining assembly is only about 160 lines of low level stack setup, with VCPU vs host

Re: [PATCH v10 01/10] powerpc/mm: Implement set_memory() routines

2021-03-31 Thread Aneesh Kumar K.V
Jordan Niethe writes: > From: Russell Currey > > The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, > and are generally useful primitives to have. This implementation is > designed to be completely generic across powerpc's many MMUs. > > It's possible that this could

Re: [PATCH] powerpc/8xx: Load modules closer to kernel text

2021-03-31 Thread Michael Ellerman
Christophe Leroy writes: > Le 31/03/2021 à 15:39, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> On the 8xx, TASK_SIZE is 0x8000. The space between TASK_SIZE and >>> PAGE_OFFSET is not used. >>> >>> Use it to load modules in order to minimise the distance between >>> kernel text

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-03-31 Thread Xiongwei Song
Segher Boessenkool 于2021年4月1日周四 上午6:15写道: > On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: > > So perhaps: > > > > EXC_SYSTEM_RESET > > EXC_MACHINE_CHECK > > EXC_DATA_STORAGE > > EXC_DATA_SEGMENT > > EXC_INST_STORAGE > > EXC_INST_SEGMENT > >

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-03-31 Thread Xiongwei Song
Michael Ellerman 于2021年3月31日周三 下午5:58写道: > Xiongwei Song writes: > > From: Xiongwei Song > > > > Create a new header named traps.h, define macros to list ppc exception > > types in traps.h, replace the reference of the real trap values with > > these macros. > > Personally I find the hex

Re: [PATCH v3 1/9] powerpc/xive: Use cpu_to_node() instead of "ibm,chip-id" property

2021-03-31 Thread David Gibson
On Wed, Mar 31, 2021 at 04:45:06PM +0200, Cédric Le Goater wrote: > The 'chip_id' field of the XIVE CPU structure is used to choose a > target for a source located on the same chip when possible. The XIVE > driver queries the chip id value from the "ibm,chip-id" DT property > but this property is

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-03-31 Thread Michael Ellerman
Segher Boessenkool writes: > On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: >> So perhaps: >> >> EXC_SYSTEM_RESET >> EXC_MACHINE_CHECK >> EXC_DATA_STORAGE >> EXC_DATA_SEGMENT >> EXC_INST_STORAGE >> EXC_INST_SEGMENT >> EXC_EXTERNAL_INTERRUPT >> EXC_ALIGNMENT >>

Re: [PATCH] powerpc/vdso: Separate vvar vma from vdso

2021-03-31 Thread Dmitry Safonov
On 3/31/21 10:59 AM, Michael Ellerman wrote: > Christophe Leroy writes: [..] >> >>> @@ -133,7 +135,13 @@ static int __arch_setup_additional_pages(struct >>> linux_binprm *bprm, int uses_int >>> * install_special_mapping or the perf counter mmap tracking code >>> * will fail to

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-03-31 Thread Segher Boessenkool
On Wed, Mar 31, 2021 at 08:58:17PM +1100, Michael Ellerman wrote: > So perhaps: > > EXC_SYSTEM_RESET > EXC_MACHINE_CHECK > EXC_DATA_STORAGE > EXC_DATA_SEGMENT > EXC_INST_STORAGE > EXC_INST_SEGMENT > EXC_EXTERNAL_INTERRUPT > EXC_ALIGNMENT > EXC_PROGRAM_CHECK >

Re: [PATCH] powerpc/vdso: Separate vvar vma from vdso

2021-03-31 Thread Dmitry Safonov
On 3/30/21 11:17 AM, Christophe Leroy wrote: > > > Le 26/03/2021 à 20:17, Dmitry Safonov a écrit : [..] >> --- a/arch/powerpc/kernel/vdso.c >> +++ b/arch/powerpc/kernel/vdso.c >> @@ -55,10 +55,10 @@ static int vdso_mremap(const struct >> vm_special_mapping *sm, struct vm_area_struc >>   { >>

Re: [PATCH] docs: powerpc: Fix misspellings and grammar errors

2021-03-31 Thread Jonathan Corbet
He Ying writes: > Reported-by: Hulk Robot > Signed-off-by: He Ying > --- > Documentation/powerpc/booting.rst| 2 +- > Documentation/powerpc/dawr-power9.rst| 2 +- > Documentation/powerpc/eeh-pci-error-recovery.rst | 2 +- > Documentation/powerpc/elfnote.rst

Re: [PATCH 6/8] drivers: firmware: efi: libstub: enable generic commandline

2021-03-31 Thread Daniel Walker
On Wed, Mar 31, 2021 at 06:10:08PM +0200, Ard Biesheuvel wrote: > (+ Arvind) > > On Tue, 30 Mar 2021 at 19:57, Daniel Walker wrote: > > > > This adds code to handle the generic command line changes. > > The efi code appears that it doesn't benefit as much from this design > > as it could. > > >

Re: [PATCH v2 3/7] powerpc: convert config files to generic cmdline

2021-03-31 Thread Daniel Walker
On Wed, Mar 31, 2021 at 12:52:19PM +0100, Will Deacon wrote: > On Tue, Mar 30, 2021 at 10:35:21AM -0700, Daniel Walker wrote: > > On Mon, Mar 29, 2021 at 11:07:51AM +0100, Will Deacon wrote: > > > On Thu, Mar 25, 2021 at 12:59:56PM -0700, Daniel Walker wrote: > > > > On Thu, Mar 25, 2021 at

[PATCH RESEND v1 4/4] powerpc/vdso: Add support for time namespaces

2021-03-31 Thread Christophe Leroy
This patch adds the necessary glue to provide time namespaces. Things are mainly copied from ARM64. __arch_get_timens_vdso_data() calculates timens vdso data position based on the vdso data position, knowing it is the next page in vvar. This avoids having to redo the mflr/bcl/mflr/mtlr dance to

[PATCH RESEND v1 3/4] powerpc/vdso: Separate vvar vma from vdso

2021-03-31 Thread Christophe Leroy
From: Dmitry Safonov Since commit 511157ab641e ("powerpc/vdso: Move vdso datapage up front") VVAR page is in front of the VDSO area. In result it breaks CRIU (Checkpoint Restore In Userspace) [1], where CRIU expects that "[vdso]" from /proc/../maps points at ELF/vdso image, rather than at VVAR

[PATCH RESEND v1 1/4] lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline()

2021-03-31 Thread Christophe Leroy
In the same spirit as commit c966533f8c6c ("lib/vdso: Mark do_hres() and do_coarse() as __always_inline"), mark do_hres_timens() and do_coarse_timens() __always_inline. The measurement below in on a non timens process, ie on the fastest path. On powerpc32, without the patch:

[PATCH RESEND v1 2/4] lib/vdso: Add vdso_data pointer as input to __arch_get_timens_vdso_data()

2021-03-31 Thread Christophe Leroy
For the same reason as commit e876f0b69dc9 ("lib/vdso: Allow architectures to provide the vdso data pointer"), powerpc wants to avoid calculation of relative position to code. As the timens_vdso_data is next page to vdso_data, provide vdso_data pointer to __arch_get_timens_vdso_data() in order to

[PATCH RESEND v1 0/4] powerpc/vdso: Add support for time namespaces

2021-03-31 Thread Christophe Leroy
[Sorry, resending with complete destination list, I used the wrong script on the first delivery] This series adds support for time namespaces on powerpc. All timens selftests are successfull. Christophe Leroy (3): lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline()

Re: [PATCH 6/8] drivers: firmware: efi: libstub: enable generic commandline

2021-03-31 Thread Ard Biesheuvel
(+ Arvind) On Tue, 30 Mar 2021 at 19:57, Daniel Walker wrote: > > This adds code to handle the generic command line changes. > The efi code appears that it doesn't benefit as much from this design > as it could. > > For example, if you had a prepend command line with "nokaslr" then > you might

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Robin Murphy
On 2021-03-16 15:38, Christoph Hellwig wrote: [...] diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index f1e38526d5bd40..996dfdf9d375dd 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Robin Murphy
On 2021-03-31 16:32, Will Deacon wrote: On Wed, Mar 31, 2021 at 02:09:37PM +0100, Robin Murphy wrote: On 2021-03-31 12:49, Will Deacon wrote: On Tue, Mar 30, 2021 at 05:28:19PM +0100, Robin Murphy wrote: On 2021-03-30 14:58, Will Deacon wrote: On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Will Deacon
On Wed, Mar 31, 2021 at 02:09:37PM +0100, Robin Murphy wrote: > On 2021-03-31 12:49, Will Deacon wrote: > > On Tue, Mar 30, 2021 at 05:28:19PM +0100, Robin Murphy wrote: > > > On 2021-03-30 14:58, Will Deacon wrote: > > > > On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: > > > > > On

[PATCH v1 4/4] powerpc/vdso: Add support for time namespaces

2021-03-31 Thread Christophe Leroy
This patch adds the necessary glue to provide time namespaces. Things are mainly copied from ARM64. __arch_get_timens_vdso_data() calculates timens vdso data position based on the vdso data position, knowing it is the next page in vvar. This avoids having to redo the mflr/bcl/mflr/mtlr dance to

[PATCH v1 3/4] powerpc/vdso: Separate vvar vma from vdso

2021-03-31 Thread Christophe Leroy
From: Dmitry Safonov Since commit 511157ab641e ("powerpc/vdso: Move vdso datapage up front") VVAR page is in front of the VDSO area. In result it breaks CRIU (Checkpoint Restore In Userspace) [1], where CRIU expects that "[vdso]" from /proc/../maps points at ELF/vdso image, rather than at VVAR

[PATCH v1 1/4] lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline()

2021-03-31 Thread Christophe Leroy
In the same spirit as commit c966533f8c6c ("lib/vdso: Mark do_hres() and do_coarse() as __always_inline"), mark do_hres_timens() and do_coarse_timens() __always_inline. The measurement below in on a non timens process, ie on the fastest path. On powerpc32, without the patch:

[PATCH v1 2/4] lib/vdso: Add vdso_data pointer as input to __arch_get_timens_vdso_data()

2021-03-31 Thread Christophe Leroy
For the same reason as commit e876f0b69dc9 ("lib/vdso: Allow architectures to provide the vdso data pointer"), powerpc wants to avoid calculation of relative position to code. As the timens_vdso_data is next page to vdso_data, provide vdso_data pointer to __arch_get_timens_vdso_data() in order to

[PATCH v1 0/4] powerpc/vdso: Add support for time namespaces

2021-03-31 Thread Christophe Leroy
This series adds support for time namespaces on powerpc. All timens selftests are successfull. Christophe Leroy (3): lib/vdso: Mark do_hres_timens() and do_coarse_timens() __always_inline() lib/vdso: Add vdso_data pointer as input to __arch_get_timens_vdso_data() powerpc/vdso: Add

[PATCH v3 9/9] powerpc/xive: Modernize XIVE-IPI domain with an 'alloc' handler

2021-03-31 Thread Cédric Le Goater
Instead of calling irq_create_mapping() to map the IPI for a node, introduce an 'alloc' handler. This is usually an extension to support hierarchy irq_domains which is not exactly the case for XIVE-IPI domain. However, we can now use the irq_domain_alloc_irqs() routine which allocates the IRQ

[PATCH v3 8/9] powerpc/xive: Map one IPI interrupt per node

2021-03-31 Thread Cédric Le Goater
ipistorm [*] can be used to benchmark the raw interrupt rate of an interrupt controller by measuring the number of IPIs a system can sustain. When applied to the XIVE interrupt controller of POWER9 and POWER10 systems, a significant drop of the interrupt rate can be observed when crossing the

[PATCH v3 2/9] powerpc/xive: Introduce an IPI interrupt domain

2021-03-31 Thread Cédric Le Goater
The IPI interrupt is a special case of the XIVE IRQ domain. When mapping and unmapping the interrupts in the Linux interrupt number space, the HW interrupt number 0 (XIVE_IPI_HW_IRQ) is checked to distinguish the IPI interrupt from other interrupts of the system. Simplify the XIVE interrupt

[PATCH v3 6/9] powerpc/xive: Simplify the dump of XIVE interrupts under xmon

2021-03-31 Thread Cédric Le Goater
Move the xmon routine under XIVE subsystem and rework the loop on the interrupts taking into account the xive_irq_domain to filter out IPIs. Reviewed-by: Greg Kurz Signed-off-by: Cédric Le Goater --- arch/powerpc/include/asm/xive.h | 1 + arch/powerpc/sysdev/xive/common.c | 14

[PATCH v3 7/9] powerpc/xive: Fix xmon command "dxi"

2021-03-31 Thread Cédric Le Goater
When under xmon, the "dxi" command dumps the state of the XIVE interrupts. If an interrupt number is specified, only the state of the associated XIVE interrupt is dumped. This form of the command lacks an irq_data parameter which is nevertheless used by xmon_xive_get_irq_config(), leading to an

[PATCH v3 5/9] powerpc/xive: Drop check on irq_data in xive_core_debug_show()

2021-03-31 Thread Cédric Le Goater
When looping on IRQ descriptor, irq_data is always valid. Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 930914b7d528 ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Reviewed-by: Greg Kurz Signed-off-by: Cédric Le Goater ---

[PATCH v3 0/9] powerpc/xive: Map one IPI interrupt per node

2021-03-31 Thread Cédric Le Goater
Hello, ipistorm [*] can be used to benchmark the raw interrupt rate of an interrupt controller by measuring the number of IPIs a system can sustain. When applied to the XIVE interrupt controller of POWER9 and POWER10 systems, a significant drop of the interrupt rate can be observed when

[PATCH v3 1/9] powerpc/xive: Use cpu_to_node() instead of "ibm, chip-id" property

2021-03-31 Thread Cédric Le Goater
The 'chip_id' field of the XIVE CPU structure is used to choose a target for a source located on the same chip when possible. The XIVE driver queries the chip id value from the "ibm,chip-id" DT property but this property is not available on all platforms. It was first introduced on the PowerNV

[PATCH v3 4/9] powerpc/xive: Simplify xive_core_debug_show()

2021-03-31 Thread Cédric Le Goater
Now that the IPI interrupt has its own domain, the checks on the HW interrupt number XIVE_IPI_HW_IRQ and on the chip can be replaced by a check on the domain. Reviewed-by: Greg Kurz Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/common.c | 18 -- 1 file changed, 4

[PATCH v3 3/9] powerpc/xive: Remove useless check on XIVE_IPI_HW_IRQ

2021-03-31 Thread Cédric Le Goater
The IPI interrupt has its own domain now. Testing the HW interrupt number is not needed anymore. Reviewed-by: Greg Kurz Signed-off-by: Cédric Le Goater --- arch/powerpc/sysdev/xive/common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/xive/common.c

[PATCH v6 9/9] powerpc/qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32

2021-03-31 Thread guoren
From: Guo Ren We don't have native hw xchg16 instruction, so let qspinlock generic code to deal with it. Using the full-word atomic xchg instructions implement xchg16 has the semantic risk for atomic operations. This patch cancels the dependency of on qspinlock generic code on architecture's

[PATCH v6 8/9] xtensa: qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32

2021-03-31 Thread guoren
From: Guo Ren We don't have native hw xchg16 instruction, so let qspinlock generic code to deal with it. Using the full-word atomic xchg instructions implement xchg16 has the semantic risk for atomic operations. This patch cancels the dependency of on qspinlock generic code on architecture's

[PATCH v6 7/9] sparc: qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32

2021-03-31 Thread guoren
From: Guo Ren We don't have native hw xchg16 instruction, so let qspinlock generic code to deal with it. Using the full-word atomic xchg instructions implement xchg16 has the semantic risk for atomic operations. This patch cancels the dependency of on qspinlock generic code on architecture's

[PATCH v6 6/9] openrisc: qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32

2021-03-31 Thread guoren
From: Guo Ren We don't have native hw xchg16 instruction, so let qspinlock generic code to deal with it. Using the full-word atomic xchg instructions implement xchg16 has the semantic risk for atomic operations. This patch cancels the dependency of on qspinlock generic code on architecture's

[PATCH v6 5/9] csky: Convert custom spinlock/rwlock to generic qspinlock/qrwlock

2021-03-31 Thread guoren
From: Guo Ren Update the C-SKY port to use the generic qspinlock and qrwlock. C-SKY only support ldex.w/stex.w with word(double word) size & align access. So it must select XCHG32 to let qspinlock only use word atomic xchg_tail. Default is still ticket lock. Signed-off-by: Guo Ren Cc: Waiman

[PATCH v6 4/9] csky: locks: Optimize coding convention

2021-03-31 Thread guoren
From: Guo Ren - Using smp_cond_load_acquire in arch_spin_lock by Peter's advice. - Using __smp_acquire_fence in arch_spin_trylock - Using smp_store_release in arch_spin_unlock All above are just coding conventions and won't affect the function. TODO in smp_cond_load_acquire for

[PATCH v6 3/9] riscv: locks: Introduce ticket-based spinlock implementation

2021-03-31 Thread guoren
From: Guo Ren This patch introduces a ticket lock implementation for riscv, along the same lines as the implementation for arch/arm & arch/csky. We still use qspinlock as default. Signed-off-by: Guo Ren Cc: Peter Zijlstra Cc: Anup Patel Cc: Arnd Bergmann --- arch/riscv/Kconfig

[PATCH v6 2/9] riscv: Convert custom spinlock/rwlock to generic qspinlock/qrwlock

2021-03-31 Thread guoren
From: Michael Clark Update the RISC-V port to use the generic qspinlock and qrwlock. This patch requires support for xchg_xtail for full-word which are added by a previous patch: Guo added select ARCH_USE_QUEUED_SPINLOCKS_XCHG32 in Kconfig Guo fixed up compile error which made by below

[PATCH v6 1/9] locking/qspinlock: Add ARCH_USE_QUEUED_SPINLOCKS_XCHG32

2021-03-31 Thread guoren
From: Guo Ren Some architectures don't have sub-word swap atomic instruction, they only have the full word's one. The sub-word swap only improve the performance when: NR_CPUS < 16K * 0- 7: locked byte * 8: pending * 9-15: not used * 16-17: tail index * 18-31: tail cpu (+1) The 9-15

[PATCH v6 0/9] riscv: Add qspinlock/qrwlock

2021-03-31 Thread guoren
From: Guo Ren Current riscv is still using baby spinlock implementation. It'll cause fairness and cache line bouncing problems. Many people are involved and pay the efforts to improve it: - The first version of patch was made in 2019.1:

[PATCH] powerpc/ptrace: Don't return error when getting/setting FP regs without CONFIG_PPC_FPU_REGS

2021-03-31 Thread Christophe Leroy
An #ifdef CONFIG_PPC_FPU_REGS is missing in arch_ptrace() leading to the following Oops because [REGSET_FPR] entry is not initialised in native_regsets[]. [ 41.917608] BUG: Unable to handle kernel instruction fetch [ 41.922849] Faulting instruction address: 0xff8fd228 [ 41.927760] Oops:

Re: [PATCH] powerpc/8xx: Load modules closer to kernel text

2021-03-31 Thread Christophe Leroy
Le 31/03/2021 à 15:39, Michael Ellerman a écrit : Christophe Leroy writes: On the 8xx, TASK_SIZE is 0x8000. The space between TASK_SIZE and PAGE_OFFSET is not used. Use it to load modules in order to minimise the distance between kernel text and modules and avoid trampolines in modules

[PATCH v2] powerpc/signal32: Fix Oops on sigreturn with unmapped VDSO

2021-03-31 Thread Christophe Leroy
PPC32 encounters a KUAP fault when trying to handle a signal with VDSO unmapped. Kernel attempted to read user page (7fc07ec0) - exploit attempt? (uid: 0) BUG: Unable to handle kernel data access on read at 0x7fc07ec0 Faulting instruction address: 0xc00111d4 Oops:

[PATCH] selftests: timens: Fix gettime_perf to work on powerpc

2021-03-31 Thread Christophe Leroy
On powerpc: - VDSO library is named linux-vdso32.so.1 or linux-vdso64.so.1 - clock_gettime is named __kernel_clock_gettime() Ensure gettime_perf tries these names before giving up. Signed-off-by: Christophe Leroy --- tools/testing/selftests/timens/gettime_perf.c | 8 1 file changed, 8

Re: [PATCH] powerpc/8xx: Load modules closer to kernel text

2021-03-31 Thread Michael Ellerman
Christophe Leroy writes: > On the 8xx, TASK_SIZE is 0x8000. The space between TASK_SIZE and > PAGE_OFFSET is not used. > > Use it to load modules in order to minimise the distance between > kernel text and modules and avoid trampolines in modules to access > kernel functions or other module

Re: [PATCH] powerpc/signal32: Fix Oops on sigreturn with unmapped VDSO

2021-03-31 Thread Michael Ellerman
Christophe Leroy writes: > PPC32 encounters a KUAP fault when trying to handle a signal with > VDSO unmapped. > > Kernel attempted to read user page (7fc07ec0) - exploit attempt? (uid: > 0) > BUG: Unable to handle kernel data access on read at 0x7fc07ec0 > Faulting instruction

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Robin Murphy
On 2021-03-31 12:49, Will Deacon wrote: On Tue, Mar 30, 2021 at 05:28:19PM +0100, Robin Murphy wrote: On 2021-03-30 14:58, Will Deacon wrote: On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: On 2021-03-30 14:11, Will Deacon wrote: On Tue, Mar 16, 2021 at 04:38:22PM +0100,

Re: [PATCH -next] powerpc/eeh: Remove unused inline function eeh_dev_phb_init_dynamic()

2021-03-31 Thread YueHaibing
On 2021/3/26 13:08, Daniel Axtens wrote: > Hi, > >> commit 475028efc708 ("powerpc/eeh: Remove eeh_dev_phb_init_dynamic()") >> left behind this, so can remove it. > > I had a look: the inline that you are removing here is for the > !CONFIG_EEH case, which explains why it was missed the first

[PATCH -next] powerpc/eeh: Add correct inline functions

2021-03-31 Thread YueHaibing
pseries_eeh_add_device_early()/pseries_eeh_add_device_tree_early() is never used since adding, however pseries_eeh_init_edev() and pseries_eeh_init_edev_recursive() need their inline versions. Fixes: b6eebb093cad ("powerpc/eeh: Make early EEH init pseries specific") Signed-off-by: YueHaibing ---

Re: [PATCH v10 01/10] powerpc/mm: Implement set_memory() routines

2021-03-31 Thread Christophe Leroy
Le 31/03/2021 à 13:16, Michael Ellerman a écrit : Hi Jordan, A few nits below ... Jordan Niethe writes: From: Russell Currey The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, and are generally useful primitives to have. This implementation is designed to be

Re: [PATCH v2 3/7] powerpc: convert config files to generic cmdline

2021-03-31 Thread Will Deacon
On Tue, Mar 30, 2021 at 10:35:21AM -0700, Daniel Walker wrote: > On Mon, Mar 29, 2021 at 11:07:51AM +0100, Will Deacon wrote: > > On Thu, Mar 25, 2021 at 12:59:56PM -0700, Daniel Walker wrote: > > > On Thu, Mar 25, 2021 at 01:03:55PM +0100, Christophe Leroy wrote: > > > > > > > > Ok, so you agree

Re: [PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-31 Thread Will Deacon
On Tue, Mar 30, 2021 at 05:28:19PM +0100, Robin Murphy wrote: > On 2021-03-30 14:58, Will Deacon wrote: > > On Tue, Mar 30, 2021 at 02:19:38PM +0100, Robin Murphy wrote: > > > On 2021-03-30 14:11, Will Deacon wrote: > > > > On Tue, Mar 16, 2021 at 04:38:22PM +0100, Christoph Hellwig wrote: > > > >

Re: [PATCH v10 06/10] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime

2021-03-31 Thread Michael Ellerman
Jordan Niethe writes: > From: Russell Currey > > Optionally run W+X checks when dumping pagetable information to > debugfs' kernel_page_tables. > > To use: > $ echo 1 > /sys/kernel/debug/check_wx_pages > $ cat /sys/kernel/debug/kernel_page_tables > > and check the kernel log. Useful for

Re: [PATCH v10 01/10] powerpc/mm: Implement set_memory() routines

2021-03-31 Thread Michael Ellerman
Hi Jordan, A few nits below ... Jordan Niethe writes: > From: Russell Currey > > The set_memory_{ro/rw/nx/x}() functions are required for STRICT_MODULE_RWX, > and are generally useful primitives to have. This implementation is > designed to be completely generic across powerpc's many MMUs. >

Re: [PATCH v10 05/10] powerpc/bpf: Write protect JIT code

2021-03-31 Thread Christophe Leroy
Le 31/03/2021 à 12:37, Michael Ellerman a écrit : Jordan Niethe writes: Once CONFIG_STRICT_MODULE_RWX is enabled there will be no need to override bpf_jit_free() because it is now possible to set images read-only. So use the default implementation. Also add the necessary call to

Re: [PATCH v10 05/10] powerpc/bpf: Write protect JIT code

2021-03-31 Thread Michael Ellerman
Jordan Niethe writes: > Once CONFIG_STRICT_MODULE_RWX is enabled there will be no need to > override bpf_jit_free() because it is now possible to set images > read-only. So use the default implementation. > > Also add the necessary call to bpf_jit_binary_lock_ro() which will > remove write

Re: [PATCH v3] powerpc/papr_scm: Implement support for H_SCM_FLUSH hcall

2021-03-31 Thread Michael Ellerman
"Aneesh Kumar K.V" writes: > Shivaprasad G Bhat writes: > >> Add support for ND_REGION_ASYNC capability if the device tree >> indicates 'ibm,hcall-flush-required' property in the NVDIMM node. >> Flush is done by issuing H_SCM_FLUSH hcall to the hypervisor. >> >> If the flush request failed, the

Re: [PATCH] powerpc/vdso: Separate vvar vma from vdso

2021-03-31 Thread Michael Ellerman
Christophe Leroy writes: > Le 26/03/2021 à 20:17, Dmitry Safonov a écrit : >> Since commit 511157ab641e ("powerpc/vdso: Move vdso datapage up front") >> VVAR page is in front of the VDSO area. In result it breaks CRIU >> (Checkpoint Restore In Userspace) [1], where CRIU expects that "[vdso]" >>

Re: [PATCH v2] powerpc/traps: Enhance readability for trap types

2021-03-31 Thread Michael Ellerman
Xiongwei Song writes: > From: Xiongwei Song > > Create a new header named traps.h, define macros to list ppc exception > types in traps.h, replace the reference of the real trap values with > these macros. Personally I find the hex values easier to recognise, but I realise that's probably not

Re: [PATCH v2] mm: Move mem_init_print_info() into mm_init()

2021-03-31 Thread Russell King - ARM Linux admin
On Wed, Mar 17, 2021 at 09:52:10AM +0800, Kefeng Wang wrote: > mem_init_print_info() is called in mem_init() on each architecture, > and pass NULL argument, so using void argument and move it into mm_init(). > > Acked-by: Dave Hansen > Signed-off-by: Kefeng Wang Acked-by: Russell King # for

Re: [PATCH v2] mm: Move mem_init_print_info() into mm_init()

2021-03-31 Thread Mike Rapoport
On Wed, Mar 17, 2021 at 09:52:10AM +0800, Kefeng Wang wrote: > mem_init_print_info() is called in mem_init() on each architecture, > and pass NULL argument, so using void argument and move it into mm_init(). > > Acked-by: Dave Hansen > Signed-off-by: Kefeng Wang Acked-by: Mike Rapoport > ---

[PATCH -next] powerpc: Remove duplicated include from time.c

2021-03-31 Thread Qiheng Lin
Remove duplicated include. Reported-by: Hulk Robot Signed-off-by: Qiheng Lin --- arch/powerpc/kernel/time.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index b67d93a609a2..2c8762002b21 100644 --- a/arch/powerpc/kernel/time.c +++

Re: WARNING: CPU: 0 PID: 1 at arch/powerpc/lib/feature-fixups.c:109 do_feature_fixups+0xb0/0xf0

2021-03-31 Thread Christophe Leroy
Hi Paul, Le 30/03/2021 à 12:37, Paul Menzel a écrit : Dear Linux folks, On the POWER8 system IBM S822LC, Linux 5.12-rc5+ logs the warning below. ``` [    0.724118] Unable to patch feature section at (ptrval) - (ptrval) with (ptrval) - (ptrval) [    0.724185]

[PATCH] powerpc/vdso: Make sure vdso_wrapper.o is rebuilt everytime vdso.so is rebuilt

2021-03-31 Thread Christophe Leroy
Commit bce74491c300 ("powerpc/vdso: fix unnecessary rebuilds of vgettimeofday.o") moved vdso32_wrapper.o and vdso64_wrapper.o out of arch/powerpc/kernel/vdso[32/64]/ and removed the dependencies in the Makefile. This leads to the wrappers not being re-build hence the kernel embedding the old vdso

Re: [PATCH 1/2] powerpc/vdso: fix unnecessary rebuilds of vgettimeofday.o

2021-03-31 Thread Christophe Leroy
Le 28/01/2021 à 05:01, Masahiro Yamada a écrit : On Thu, Dec 24, 2020 at 2:12 AM Masahiro Yamada wrote: vgettimeofday.o is unnecessarily rebuilt. Adding it to 'targets' is not enough to fix the issue. Kbuild is correctly rebuilding it because the command line is changed. PowerPC builds

Re: [PATCH] PCI: Try to find two continuous regions for child resource

2021-03-31 Thread Kai-Heng Feng
On Tue, Mar 30, 2021 at 12:23 AM Bjorn Helgaas wrote: > > On Mon, Mar 29, 2021 at 04:47:59PM +0800, Kai-Heng Feng wrote: > > Built-in grahpics on HP EliteDesk 805 G6 doesn't work because graphics > > can't get the BAR it needs: > > [0.611504] pci_bus :00: root bus resource [mem > >

Re: [PATCH printk v2 2/5] printk: remove safe buffers

2021-03-31 Thread John Ogness
On 2021-03-30, John Ogness wrote: > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index e971c0a9ec9e..f090d6a1b39e 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1772,16 +1759,21 @@ static struct task_struct *console_owner; > static bool