Re: [PATCH v2] powerpc: Move arch_trigger_cpumask_backtrace from nmi.h to irq.h

2023-06-23 Thread Michael Ellerman
Douglas Anderson writes: > The powerpc architecture was the only one that defined > arch_trigger_cpumask_backtrace() in asm/nmi.h instead of > asm/irq.h. Move it to be consistent. > > This fixes compile time errors introduced by commit 7ca8fe94aa92 > ("watchdog/hardlockup: define HARDLOCKUP_DETECT

Re: [PATCH net] ibmvnic: Do not reset dql stats on NON_FATAL err

2023-06-23 Thread Simon Horman
On Fri, Jun 23, 2023 at 09:52:26AM +0200, Simon Horman wrote: > + maintainers and blamed authors A second time, because something went wrong with the first attempt. > On Thu, Jun 22, 2023 at 02:03:32PM -0500, Nick Child wrote: > > All ibmvnic resets, make a call to netdev_tx_reset_queue() when >

[kvm-unit-tests PATCH 0/2] Rework LDFLAGS and link with noexecstack

2023-06-23 Thread Thomas Huth
I noticed that the latest version of ld (in Fedora rawhide) emits a warning on x86 and s390x, complaining about missing .note.GNU-stack section that implies an executable stack. It can be silenced by linking with "-z noexecstack". While trying to add this switch globally to the kvm-unit-tests, I h

[kvm-unit-tests PATCH 1/2] Rework the common LDFLAGS to become more useful again

2023-06-23 Thread Thomas Huth
Currently the LDFLAGS settings from the main Makefile are ignored in most architecture specific directories (except s390x), which is very confusing when you try to add a linker switch for all architectures. Let's change this so that all architectures extend the common LDFLAGS instead of replacing

[kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld

2023-06-23 Thread Thomas Huth
Newer versions of ld (from binutils 2.40) complain on s390x and x86: ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker We can silence these warn

Re: [kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld

2023-06-23 Thread Sean Christopherson
On Fri, Jun 23, 2023, Thomas Huth wrote: > Newer versions of ld (from binutils 2.40) complain on s390x and x86: > > ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies > executable stack > ld: NOTE: This behaviour is deprecated and will be removed in a >fu

Re: [PATCH] powerpc/iommu: TCEs are incorrectly manipulated with DLPAR add/remove of memory

2023-06-23 Thread Gaurav Batra
Hello Michael, Did you get a chance to look into this patch? I don't mean to rush you. Just wondering if there is anything I can do to help make the patch to Upstream. Thanks, Gaurav On 6/13/23 12:17 PM, Gaurav Batra wrote: Hello Michael, I found this bug while going though the code. This

Re: [PATCH v2 10/14] objtool: Add support for relative switch tables

2023-06-23 Thread Christophe Leroy
Le 22/06/2023 à 13:48, Peter Zijlstra a écrit : > On Thu, Jun 22, 2023 at 12:54:32PM +0200, Christophe Leroy wrote: >> On powerpc, switch tables are relative, than means the address of the >> table is added to the value of the entry in order to get the pointed >> address: (r10 is the table addres

Re: [kvm-unit-tests PATCH 2/2] Link with "-z noexecstack" to avoid warning from newer versions of ld

2023-06-23 Thread Thomas Huth
On 23/06/2023 16.24, Sean Christopherson wrote: On Fri, Jun 23, 2023, Thomas Huth wrote: Newer versions of ld (from binutils 2.40) complain on s390x and x86: ld: warning: s390x/cpu.o: missing .note.GNU-stack section implies executable stack ld: NOTE: This behaviour is depreca

Re: [PATCH v2 14/14] powerpc: Implement UACCESS validation on PPC32

2023-06-23 Thread Christophe Leroy
Le 22/06/2023 à 13:56, Peter Zijlstra a écrit : > On Thu, Jun 22, 2023 at 12:54:36PM +0200, Christophe Leroy wrote: > >> diff --git a/tools/objtool/check.c b/tools/objtool/check.c >> index f850ab892ad5..8ac5711a055f 100644 >> --- a/tools/objtool/check.c >> +++ b/tools/objtool/check.c >> @@ -218,

[PATCH v3 01/15] powerpc/kuap: Avoid unnecessary reads of MD_AP

2023-06-23 Thread Christophe Leroy
A disassembly of interrupt_exit_kernel_prepare() shows a useless read of MD_AP register. This is shown by r9 being re-used immediately without doing anything with the value read. c000e0e0: 60 00 00 00 nop c000e0e4: ===> 7d 3a c2 a6 mfmd_ap r9< c000e0e8: 7d 20 00

[PATCH v3 02/15] powerpc/kuap: Avoid useless jump_label on empty function

2023-06-23 Thread Christophe Leroy
Disassembly of interrupt_enter_prepare() shows a pointless nop before the mftb c000abf0 : c000abf0: 81 23 00 84 lwz r9,132(r3) c000abf4: 71 29 40 00 andi. r9,r9,16384 c000abf8: 41 82 00 28 beq-c000ac20 c000abfc: ===> 60 00 00 00 nop <

[PATCH v3 00/15] powerpc/objtool: uaccess validation for PPC32 (v3)

2023-06-23 Thread Christophe Leroy
This series adds UACCESS validation for PPC32. It includes half a dozen of changes to objtool core. It is almost mature, performs code analysis for all PPC32, only missing marking of UACCESS enable/disable for book3s/32. Most object files are correctly decoded, only a few 'unreachable instruction

[PATCH v3 13/15] objtool: Prepare noreturns.h for more architectures

2023-06-23 Thread Christophe Leroy
noreturns.h is a mix of x86 specific functions and more generic core functions. In preparation of inclusion of powerpc, split x86 functions out of noreturns.h into arch/noreturns.h Signed-off-by: Christophe Leroy --- .../objtool/arch/x86/include/arch/noreturns.h | 20 +++ tools/

[PATCH v3 04/15] powerpc/kuap: Make disabling KUAP at boottime impossible except on book3s/64

2023-06-23 Thread Christophe Leroy
It is possible to disable KUAP at boottime with 'nosmap' parameter. That is implemented with jump_label hence adds a 'nop' in front of each open/close of userspace access. >From a security point of view it makes sence to disallow disabling KUAP. And on processors like the 8xx where 'nop' is not s

[PATCH v3 09/15] objtool: Add INSN_RETURN_CONDITIONAL

2023-06-23 Thread Christophe Leroy
Most functions have an unconditional return at the end, like this one: : 0: 81 22 04 d0 lwz r9,1232(r2) 4: 38 60 00 00 li r3,0 8: 2c 09 00 00 cmpwi r9,0 c: 4d 82 00 20 beqlr <== Conditional re

[PATCH v3 11/15] objtool: Remove too strict constraint in jump table search

2023-06-23 Thread Christophe Leroy
In code there is often a pattern like: load jump table address do some test conditional jump to label1: do something unconditional jump to label2: label1: do something else read jump table dynamic jump label2: do other job her

[PATCH v3 10/15] objtool: Add support for relative switch tables

2023-06-23 Thread Christophe Leroy
On powerpc, switch tables are relative, than means the address of the table is added to the value of the entry in order to get the pointed address: (r10 is the table address, r4 the index in the table) lis r10,0 <== Load r10 with upper part of .rodata address R_PPC_

[PATCH v3 14/15] powerpc/bug: Annotate reachable after warning trap

2023-06-23 Thread Christophe Leroy
This commit is copied from commit bfb1a7c91fb7 ("x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm") 'twi 31,0,0' is a BUG instruction, which is by default a dead end. But the same instruction is used for WARNINGs and the execution resumes with the following instruction. Mark it reachable

[PATCH v3 12/15] objtool: Add support for more complex UACCESS control

2023-06-23 Thread Christophe Leroy
On x86, UACCESS is controlled by two instructions: STAC and CLAC. STAC instruction enables UACCESS while CLAC disables UACCESS. This is simple enough for objtool to locate UACCESS enable and disable. But on powerpc it is a bit more complex, the same instruction is used for enabling and disabling U

[PATCH v3 07/15] objtool: Allow an architecture to disable objtool on ASM files

2023-06-23 Thread Christophe Leroy
Supporting objtool on ASM files requires quite an effort. Features like UACCESS validation don't require ASM files validation. In order to allow architectures to enable objtool validation without spending unnecessary effort on cleaning up ASM files, provide an option to disable objtool validation

[PATCH v3 03/15] powerpc/kuap: Refactor static branch for disabling kuap

2023-06-23 Thread Christophe Leroy
All but book3s/64 use a static branch key for disabling kuap. book3s/64 uses a memory feature. Refactor all targets except book3s/64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/kup.h | 7 --- arch/powerpc/include/asm/book3s/64/kup.h | 1 + arch/powerpc/

[PATCH v3 06/15] Revert "powerpc/bug: Provide better flexibility to WARN_ON/__WARN_FLAGS() with asm goto"

2023-06-23 Thread Christophe Leroy
This reverts commit 1e688dd2a3d6759d416616ff07afc4bb836c4213. That commit aimed at optimising the code around generation of WARN_ON/BUG_ON but this leads to a lot of dead code erroneously generated by GCC. That dead code becomes a problem when we start using objtool validation because objtool wil

[PATCH v3 15/15] powerpc: Implement UACCESS validation on PPC32

2023-06-23 Thread Christophe Leroy
In order to implement UACCESS validation, objtool support for powerpc needs to be enhanced to decode more instructions. It also requires implementation of switch tables finding. On PPC32 it is similar to x86, switch tables are anonymous in .rodata, the difference is that the value is relative to i

[PATCH v3 05/15] powerpc/kuap: KUAP enabling/disabling functions must be __always_inline

2023-06-23 Thread Christophe Leroy
Objtool reports following warnings: arch/powerpc/kernel/signal_32.o: warning: objtool: __prevent_user_access.constprop.0+0x4 (.text+0x4): redundant UACCESS disable arch/powerpc/kernel/signal_32.o: warning: objtool: user_access_begin+0x2c (.text+0x4c): return with UACCESS enabled

[PATCH v3 08/15] objtool: Fix JUMP_ENTRY_SIZE for bi-arch like powerpc

2023-06-23 Thread Christophe Leroy
struct jump_entry { s32 code; s32 target; long key; }; It means that the size of the third argument depends on whether we are building a 32 bits or 64 bits kernel. Therefore JUMP_ENTRY_SIZE must depend on elf_class_addrsize(elf). To

Re: [PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

2023-06-23 Thread Aditya Gupta
Hello, Namhyung, On 23/06/23 04:55, Namhyung Kim wrote: Ok, I found two problems. ... The first one is related to this message. It couldn't find the script (task-analyzer.py) because PERF_EXEC_PATH is not set. Running with --exec-path=$PWD was ok, but I got a segfault. The other problem is i

Re: [PATCH 00/79] fs: new accessors for inode->i_ctime

2023-06-23 Thread Christian Brauner
On Wed, Jun 21, 2023 at 03:52:27PM -0400, Jeff Layton wrote: > On Wed, 2023-06-21 at 15:21 -0400, Steven Rostedt wrote: > > On Wed, 21 Jun 2023 10:45:05 -0400 > > Jeff Layton wrote: > > > > > Most of this conversion was done via coccinelle, with a few of the more > > > non-standard accesses done

Re: [kvm-unit-tests PATCH 0/2] Rework LDFLAGS and link with noexecstack

2023-06-23 Thread Andrew Jones
On Fri, Jun 23, 2023 at 02:54:14PM +0200, Thomas Huth wrote: > I noticed that the latest version of ld (in Fedora rawhide) emits > a warning on x86 and s390x, complaining about missing .note.GNU-stack > section that implies an executable stack. It can be silenced by > linking with "-z noexecstack".

Re: [PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

2023-06-23 Thread Aditya Gupta
Hello Namhyung, On 23/06/23 04:55, Namhyung Kim wrote: Ok, I found two problems. ... The first one is related to this message. It couldn't find the script (task-analyzer.py) because PERF_EXEC_PATH is not set. Running with --exec-path=$PWD was ok, but I got a segfault. The other problem is in

Re: [PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

2023-06-23 Thread Aditya Gupta
Hello Namhyung, On 23/06/23 04:55, Namhyung Kim wrote: Ok, I found two problems. ... The first one is related to this message. It couldn't find the script (task-analyzer.py) because PERF_EXEC_PATH is not set. Running with --exec-path=$PWD was ok, but I got a segfault. The other problem is in

Re: [PATCH 15/17] perf tests task_analyzer: fix bad substitution ${$1}

2023-06-23 Thread Namhyung Kim
Hello Aditya, On Fri, Jun 23, 2023 at 11:19 AM Aditya Gupta wrote: > > Hello, Namhyung, > > On 23/06/23 04:55, Namhyung Kim wrote: > > Ok, I found two problems. > > > > ... > > > > The first one is related to this message. It couldn't find the script > > (task-analyzer.py) because PERF_EXEC_PATH

Re: [PATCH 00/22] tools/perf: Fix shellcheck coding/formatting issues of perf tool shell scripts

2023-06-23 Thread Namhyung Kim
Hello, On Wed, Jun 21, 2023 at 1:30 AM Athira Rajeev wrote: > > Patchset covers a set of fixes for coding/formatting issues observed while > running shellcheck tool on the perf shell scripts. > > This cleanup is a pre-requisite to include a build option for shellcheck > discussed here: https://ww

Re: [v3,17/19] arch/sparc: Implement fb_is_primary_device() in source file

2023-06-23 Thread Guenter Roeck
difficult to determine since this patch can not easily be reverted. Guenter --- # bad: [8d2be868b42c08290509c60515865f4de24ea704] Add linux-next specific files for 20230623 # good: [45a3e24f65e90a047bef86f927ebdc4c710edaa1] Linux 6.4-rc7 git bisect start 'HEAD' 'v6.4-rc7' # go