[PATCH v4 07/11] mm: kasan: Use is_kernel() helper

2021-09-30 Thread Kefeng Wang
Directly use is_kernel() helper in kernel_or_module_addr(). Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Signed-off-by: Kefeng Wang --- mm/kasan/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/report.c

[PATCH v4 04/11] sections: Move is_kernel_inittext() into sections.h

2021-09-30 Thread Kefeng Wang
The is_kernel_inittext() and init_kernel_text() are with same functionality, let's just keep is_kernel_inittext() and move it into sections.h, then update all the callers. Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Arnd Bergmann Cc: x...@kernel.org Signed-off-by: Kefeng Wang ---

[PATCH v4 10/11] microblaze: Use is_kernel_text() helper

2021-09-30 Thread Kefeng Wang
Use is_kernel_text() helper to simplify code. Cc: Michal Simek Signed-off-by: Kefeng Wang --- arch/microblaze/mm/pgtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c index c1833b159d3b..9f73265aad4e 100644

[PATCH v4 05/11] x86: mm: Rename __is_kernel_text() to is_x86_32_kernel_text()

2021-09-30 Thread Kefeng Wang
Commit b56cd05c55a1 ("x86/mm: Rename is_kernel_text to __is_kernel_text"), add '__' prefix not to get in conflict with existing is_kernel_text() in . We will add __is_kernel_text() for the basic kernel text range check in the next patch, so use private is_x86_32_kernel_text() naming for x86

[PATCH v4 02/11] kallsyms: Fix address-checks for kernel related range

2021-09-30 Thread Kefeng Wang
The is_kernel_inittext/is_kernel_text/is_kernel function should not include the end address(the labels _einittext, _etext and _end) when check the address range, the issue exists since Linux v2.6.12. Cc: Arnd Bergmann Cc: Sergey Senozhatsky Cc: Petr Mladek Reviewed-by: Petr Mladek

[PATCH v4 01/11] kallsyms: Remove arch specific text and data check

2021-09-30 Thread Kefeng Wang
After commit 4ba66a976072 ("arch: remove blackfin port"), no need arch-specific text/data check. Cc: Arnd Bergmann Signed-off-by: Kefeng Wang --- include/asm-generic/sections.h | 16 include/linux/kallsyms.h | 3 +-- kernel/locking/lockdep.c | 3 --- 3 files

Re: [PATCH] powerpc/eeh:Fix some mistakes in comments

2021-09-30 Thread Daniel Axtens
Hi Kai, Thank you for your contribution to the powerpc kernel! > Get rid of warning: > arch/powerpc/kernel/eeh.c:774: warning: expecting prototype for > eeh_set_pe_freset(). Prototype was for eeh_set_dev_freset() instead You haven't said where this warning is from. I thought it might be from

Re: [PATCH] KVM: PPC: Book3S HV: Use GLOBAL_TOC for kvmppc_h_set_dabr/xdabr()

2021-09-30 Thread Jordan Niethe
On Thu, Sep 30, 2021 at 4:13 PM Daniel Axtens wrote: > > Hi Michael, > > > kvmppc_h_set_dabr(), and kvmppc_h_set_xdabr() which jumps into > > it, need to use _GLOBAL_TOC to setup the kernel TOC pointer, because > > kvmppc_h_set_dabr() uses LOAD_REG_ADDR() to load dawr_force_enable. > > This makes

[PATCH v4 03/11] sections: Move and rename core_kernel_data() to is_kernel_core_data()

2021-09-30 Thread Kefeng Wang
Move core_kernel_data() into sections.h and rename it to is_kernel_core_data(), also make it return bool value, then update all the callers. Cc: Arnd Bergmann Cc: Steven Rostedt Cc: Ingo Molnar Cc: "David S. Miller" Signed-off-by: Kefeng Wang --- include/asm-generic/sections.h | 16

[PATCH v4 00/11] sections: Unify kernel sections range check and use

2021-09-30 Thread Kefeng Wang
There are three head files(kallsyms.h, kernel.h and sections.h) which include the kernel sections range check, let's make some cleanup and unify them. 1. cleanup arch specific text/data check and fix address boundary check in kallsyms.h 2. make all the basic/core kernel range check function

Re: [PATCH] KVM: PPC: Book3S HV: Use GLOBAL_TOC for kvmppc_h_set_dabr/xdabr()

2021-09-30 Thread Daniel Axtens
Hi Michael, > kvmppc_h_set_dabr(), and kvmppc_h_set_xdabr() which jumps into > it, need to use _GLOBAL_TOC to setup the kernel TOC pointer, because > kvmppc_h_set_dabr() uses LOAD_REG_ADDR() to load dawr_force_enable. This makes sense. LOAD_REG_ADDR() does ld reg,name@got(r2) and _GLOBAL_TOC

[PATCH v4 06/11] sections: Provide internal __is_kernel() and __is_kernel_text() helper

2021-09-30 Thread Kefeng Wang
An internal __is_kernel() helper which only check the kernel address ranges, and an internal __is_kernel_text() helper which only check text section ranges. Signed-off-by: Kefeng Wang --- include/asm-generic/sections.h | 29 + include/linux/kallsyms.h | 4 ++--

[PATCH v4 11/11] alpha: Use is_kernel_text() helper

2021-09-30 Thread Kefeng Wang
Use is_kernel_text() helper to simplify code. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Signed-off-by: Kefeng Wang --- arch/alpha/kernel/traps.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index

[PATCH v4 08/11] extable: Use is_kernel_text() helper

2021-09-30 Thread Kefeng Wang
The core_kernel_text() should check the gate area, as it is part of kernel text range, use is_kernel_text() in core_kernel_text(). Cc: Steven Rostedt Signed-off-by: Kefeng Wang --- kernel/extable.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/extable.c

[PATCH v4 09/11] powerpc/mm: Use core_kernel_text() helper

2021-09-30 Thread Kefeng Wang
Use core_kernel_text() helper to simplify code, also drop etext, _stext, _sinittext, _einittext declaration which already declared in section.h. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Kefeng Wang

Re: [PATCH v4 10/11] microblaze: Use is_kernel_text() helper

2021-09-30 Thread Michal Simek
On 9/30/21 9:11 AM, Kefeng Wang wrote: > Use is_kernel_text() helper to simplify code. > > Cc: Michal Simek > Signed-off-by: Kefeng Wang > --- > arch/microblaze/mm/pgtable.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/microblaze/mm/pgtable.c

[V2 3/4] powerpc/perf: Expose instruction and data address registers as part of extended regs

2021-09-30 Thread Athira Rajeev
Patch adds support to include Sampled Instruction Address Register (SIAR) and Sampled Data Address Register (SDAR) SPRs as part of extended registers. Update the definition of PERF_REG_PMU_MASK_300/31 and PERF_REG_EXTENDED_MAX to include these SPR's. Signed-off-by: Athira Rajeev ---

[V2 2/4] tools/perf: Refactor the code definition of perf reg extended mask in tools side header file

2021-09-30 Thread Athira Rajeev
PERF_REG_PMU_MASK_300 and PERF_REG_PMU_MASK_31 defines the mask value for extended registers. Current definition of these mask values uses hex constant and does not use registers by name, making it less readable. Patch refactor the macro values in perf tools side header file by or'ing together the

Re: [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler

2021-09-30 Thread Cédric Le Goater
On 9/30/21 12:25, Cédric Le Goater wrote: The IPR drivers tests for MSI support at probe time with MSI vector 0 and when done, frees the IRQ with free_irq(). This test was introduced by 95fecd90397e ("ipr: add test for MSI interrupt support") as an improvement of commit 5a9ef25b14d3 ("[SCSI]

Re: [PATCH v5 10/11] PCI: Replace pci_dev::driver usage by pci_dev::dev.driver

2021-09-30 Thread Frederic Barrat
On 29/09/2021 17:44, Andrew Donnellan wrote: On 29/9/21 11:43 pm, Uwe Kleine-König wrote:> I'm not a huge fan either, I used it to keep the control flow as is and without introducing several calls to to_pci_driver. The whole code looks as follows: list_for_each_entry(afu_dev,

[PATCH v3 3/4] powerpc: Use generic version of arch_is_kernel_initmem_freed()

2021-09-30 Thread Christophe Leroy
Generic version of arch_is_kernel_initmem_freed() now does the same as powerpc version. Remove the powerpc version. Cc: Kefeng Wang Signed-off-by: Christophe Leroy --- v3: No change v2: No change --- arch/powerpc/include/asm/sections.h | 13 - 1 file changed, 13 deletions(-) diff

[PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler

2021-09-30 Thread Cédric Le Goater
The IPR drivers tests for MSI support at probe time with MSI vector 0 and when done, frees the IRQ with free_irq(). This test was introduced by 95fecd90397e ("ipr: add test for MSI interrupt support") as an improvement of commit 5a9ef25b14d3 ("[SCSI] ipr: add MSI support") because a boot failure

[PATCH v3 4/4] s390: Use generic version of arch_is_kernel_initmem_freed()

2021-09-30 Thread Christophe Leroy
Generic version of arch_is_kernel_initmem_freed() now does the same as s390 version. Remove the s390 version. Cc: Gerald Schaefer Cc: Kefeng Wang Acked-by: Heiko Carstens Signed-off-by: Christophe Leroy --- v3: No change v2: No change --- arch/s390/include/asm/sections.h | 12

[V2 4/4] tools/perf: Add perf tools support to expose instruction and data address registers as part of extended regs

2021-09-30 Thread Athira Rajeev
Patch enables presenting of Sampled Instruction Address Register (SIAR) and Sampled Data Address Register (SDAR) SPRs as part of extended regsiters for perf tool. Add these SPR's to sample_reg_mask in the tool side (to use with -I? option). Signed-off-by: Athira Rajeev ---

[V2 0/4] powerpc/perf: Add instruction and data address registers to extended regs

2021-09-30 Thread Athira Rajeev
Patch set adds PMU registers namely Sampled Instruction Address Register (SIAR) and Sampled Data Address Register (SDAR) as part of extended regs in PowerPC. These registers provides the instruction/data address and adding these to extended regs helps in debug purposes. Patch 1/4 and 2/4

[PATCH v3 1/4] mm: Create a new system state and fix core_kernel_text()

2021-09-30 Thread Christophe Leroy
core_kernel_text() considers that until system_state in at least SYSTEM_RUNNING, init memory is valid. But init memory is freed a few lines before setting SYSTEM_RUNNING, so we have a small period of time when core_kernel_text() is wrong. Create an intermediate system state called

[PATCH v3 2/4] mm: Make generic arch_is_kernel_initmem_freed() do what it says

2021-09-30 Thread Christophe Leroy
Commit 7a5da02de8d6 ("locking/lockdep: check for freed initmem in static_obj()") added arch_is_kernel_initmem_freed() which is supposed to report whether an object is part of already freed init memory. For the time being, the generic version of arch_is_kernel_initmem_freed() always reports

[V2 1/4] powerpc/perf: Refactor the code definition of perf reg extended mask

2021-09-30 Thread Athira Rajeev
PERF_REG_PMU_MASK_300 and PERF_REG_PMU_MASK_31 defines the mask value for extended registers. Current definition of these mask values uses hex constant and does not use registers by name, making it less readable. Patch refactor the macro values by or'ing together the actual register value

Re: [PATCH] powerpc/pseries/msi: Add an empty irq_write_msi_msg() handler

2021-09-30 Thread Mahesh J Salgaonkar
On 2021-09-30 12:25:35 Thu, Cédric Le Goater wrote: > The IPR drivers tests for MSI support at probe time with MSI vector 0 > and when done, frees the IRQ with free_irq(). This test was introduced > by 95fecd90397e ("ipr: add test for MSI interrupt support") as an > improvement of commit

[PATCH v2 5/9] xen/x86: make "earlyprintk=xen" work for HVM/PVH DomU

2021-09-30 Thread Jan Beulich
xenboot_write_console() is dealing with these quite fine so I don't see why xenboot_console_setup() would return -ENOENT in this case. Adjust documentation accordingly. Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross --- a/Documentation/admin-guide/kernel-parameters.txt +++

Re: [RFC PATCH 4/8] powerpc: add CPU field to struct thread_info

2021-09-30 Thread Kees Cook
On Thu, Sep 30, 2021 at 08:46:04AM +1000, Michael Ellerman wrote: > Ard Biesheuvel writes: > > On Tue, 28 Sept 2021 at 02:16, Michael Ellerman wrote: > >> > >> Michael Ellerman writes: > >> > Ard Biesheuvel writes: > >> >> On Tue, 14 Sept 2021 at 14:11, Ard Biesheuvel wrote: > >> >>> > >> >>>

[Bug 206669] Little-endian kernel crashing on POWER8 on heavy big-endian PowerKVM load

2021-09-30 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206669 --- Comment #17 from John Paul Adrian Glaubitz (glaub...@physik.fu-berlin.de) --- POWER server crashes with 100% reproducibility when building GCC in a powerpc chroot and GCC in a ppc64 chroot on the ppc64 KVM instance at the same time. And I

[PATCH v2 3/9] xen/x86: make "earlyprintk=xen" work better for PVH Dom0

2021-09-30 Thread Jan Beulich
The xen_hvm_early_write() path better wouldn't be taken in this case; while port 0xE9 can be used, the hypercall path is quite a bit more efficient. Put that first, as it may also work for DomU-s (see also xen_raw_console_write()). While there also bail from the function when the first

[PATCH v2 5/6] memblock: rename memblock_free to memblock_phys_free

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport Since memblock_free() operates on a physical range, make its name reflect it and rename it to memblock_phys_free(), so it will be a logical counterpart to memblock_phys_alloc(). The callers are updated with the below semantic patch: @@ expression addr; expression size; @@ -

[PATCH v2 6/6] memblock: use memblock_free for freeing virtual pointers

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport Rename memblock_free_ptr() to memblock_free() and use memblock_free() when freeing a virtual pointer so that memblock_free() will be a counterpart of memblock_alloc() The callers are updated with the below semantic patch and manual addition of (void *) casting to pointers

[PATCH v2 2/6] xen/x86: free_p2m_page: use memblock_free_ptr() to free a virtual pointer

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport free_p2m_page() wrongly passes a virtual pointer to memblock_free() that treats it as a physical address. Call memblock_free_ptr() instead that gets a virtual address to free the memory. Signed-off-by: Mike Rapoport Reviewed-by: Juergen Gross --- arch/x86/xen/p2m.c | 2

Re: [PATCH v4 07/11] mm: kasan: Use is_kernel() helper

2021-09-30 Thread Alexander Potapenko
On Thu, Sep 30, 2021 at 9:09 AM Kefeng Wang wrote: > > Directly use is_kernel() helper in kernel_or_module_addr(). > > Cc: Andrey Ryabinin > Cc: Alexander Potapenko > Cc: Andrey Konovalov > Cc: Dmitry Vyukov > Signed-off-by: Kefeng Wang Reviewed-by: Alexander Potapenko > --- >

[PATCH v2 3/6] memblock: drop memblock_free_early_nid() and memblock_free_early()

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport memblock_free_early_nid() is unused and memblock_free_early() is an alias for memblock_free(). Replace calls to memblock_free_early() with calls to memblock_free() and remove memblock_free_early() and memblock_free_early_nid(). Signed-off-by: Mike Rapoport ---

[PATCH v2 4/6] memblock: stop aliasing __memblock_free_late with memblock_free_late

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport memblock_free_late() is a NOP wrapper for __memblock_free_late(), there is no point to keep this indirection. Drop the wrapper and rename __memblock_free_late() to memblock_free_late(). Signed-off-by: Mike Rapoport --- include/linux/memblock.h | 7 +-- mm/memblock.c

Re: [PATCH v4 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-09-30 Thread Daniel Borkmann
On 9/29/21 1:18 PM, Hari Bathini wrote: Patch #1 & #2 are simple cleanup patches. Patch #3 refactors JIT compiler code with the aim to simplify adding BPF_PROBE_MEM support. Patch #4 introduces PPC_RAW_BRANCH() macro instead of open coding branch instruction. Patch #5 & #7 add BPF_PROBE_MEM

Re: [PATCH v2 0/6] memblock: cleanup memblock_free interface

2021-09-30 Thread Linus Torvalds
On Thu, Sep 30, 2021 at 11:50 AM Mike Rapoport wrote: > > The first patch is a cleanup of numa_distance allocation in arch_numa I've > spotted during the conversion. > The second patch is a fix for Xen memory freeing on some of the error > paths. Well, at least patch 2 looks like something that

[PATCH v2 1/6] arch_numa: simplify numa_distance allocation

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport Memory allocation of numa_distance uses memblock_phys_alloc_range() without actual range limits, converts the returned physical address to virtual and then only uses the virtual address for further initialization. Simplify this by replacing memblock_phys_alloc_range() with

[PATCH v2 0/6] memblock: cleanup memblock_free interface

2021-09-30 Thread Mike Rapoport
From: Mike Rapoport Hi, Following the discussion on [1] this is the fix for memblock freeing APIs mismatch. The first patch is a cleanup of numa_distance allocation in arch_numa I've spotted during the conversion. The second patch is a fix for Xen memory freeing on some of the error paths. I

Re: [PATCH v2 0/6] memblock: cleanup memblock_free interface

2021-09-30 Thread Mike Rapoport
On Thu, Sep 30, 2021 at 02:20:33PM -0700, Linus Torvalds wrote: > On Thu, Sep 30, 2021 at 11:50 AM Mike Rapoport wrote: > > > > The first patch is a cleanup of numa_distance allocation in arch_numa I've > > spotted during the conversion. > > The second patch is a fix for Xen memory freeing on

[PATCH 1/5] dt-bindings: memory: fsl: convert ifc binding to yaml schema

2021-09-30 Thread Li Yang
Convert the txt binding to yaml format and add description. Drop the "simple-bus" compatible string from the example and not allowed by the binding any more. This will help to enforce the correct probe order between parent device and child devices, but will require the ifc driver to probe the

[PATCH 3/5] ARM: dts: ls1021a: remove "simple-bus" compatible from ifc node

2021-09-30 Thread Li Yang
The binding of ifc device has been updated. Update dts to match accordingly. Signed-off-by: Li Yang --- arch/arm/boot/dts/ls1021a.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi index

Re: [PATCH] powerpc/eeh:Fix some mistakes in comments

2021-09-30 Thread 宋凯
Hi Daniel, > Hi Kai, > > Thank you for your contribution to the powerpc kernel! > > > Get rid of warning: > > arch/powerpc/kernel/eeh.c:774: warning: expecting prototype for > > eeh_set_pe_freset(). Prototype was for eeh_set_dev_freset() instead > > You haven't said where this warning is from. I

[PATCH 0/5] convert ifc binding to yaml and drop "simple-bus"

2021-09-30 Thread Li Yang
Convert the ifc binding to yaml schema, in the mean while remove the "simple-bus" compatible from the binding to make sure ifc device probes before any of the child devices. Update the driver and existing DTSes accordingly. DTS changes should be merged together with the driver/binding changes if

[PATCH 4/5] arm64: dts: remove "simple-bus" compatible from ifc node

2021-09-30 Thread Li Yang
The binding of ifc device has been updated. Update dts to match accordingly. Signed-off-by: Li Yang --- arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi | 2 +- arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 2 +- arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 2 +-

[PATCH 5/5] powerpc/mpc85xx: remove "simple-bus" compatible from ifc node

2021-09-30 Thread Li Yang
The binding of ifc device has been updated. Update dts to match accordingly. Signed-off-by: Li Yang --- arch/powerpc/boot/dts/fsl/b4si-post.dtsi | 2 +- arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi | 2 +- arch/powerpc/boot/dts/fsl/bsc9132si-post.dtsi | 2 +-

[PATCH 2/5] memory: fsl_ifc: populate child devices without relying on simple-bus

2021-09-30 Thread Li Yang
After we update the binding to not use simple-bus compatible for the controller, we need the driver to populate the child devices explicitly. Signed-off-by: Li Yang --- drivers/memory/fsl_ifc.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/memory/fsl_ifc.c

Re: Add Apple M1 support to PASemi i2c driver

2021-09-30 Thread Christian Zigotzky
Typo: Damian Correct: Damien On 01 October 2021 at 06:47 am, Christian Zigotzky wrote: On 27 September 2021 at 07:39 am, Sven Peter wrote: > Hi Christian, > > Thanks already for volunteering to test this! > Hello Sven, Damian (Hypex) has successfully tested the RC3 of kernel 5.15 with your

Re: Add Apple M1 support to PASemi i2c driver

2021-09-30 Thread Christian Zigotzky
On 27 September 2021 at 07:39 am, Sven Peter wrote: > Hi Christian, > > Thanks already for volunteering to test this! > Hello Sven, Damian (Hypex) has successfully tested the RC3 of kernel 5.15 with your modified i2c driver on his Nemo board yesterday. [1] @Darren Could you also please check