Re: [PATCH v5 02/10] locking/mutex: introduce devm_mutex_init

2024-03-07 Thread Christophe Leroy
builds > frequently calling mutex_destroy() is just ignored which is safe for now > but wrong formally and can lead to a problem if mutex_destroy() will be > extended so introduce devm_mutex_init() > > Signed-off-by: George Stark > Signed-off-by: Christophe Leroy > --- > Hell

Re: [PATCH 3/3] macintosh/ams: Fix unused variable warning

2024-03-06 Thread Christophe Leroy
Le 07/03/2024 à 06:32, Michael Ellerman a écrit : > Christophe Leroy writes: >> Le 06/03/2024 à 13:58, Michael Ellerman a écrit : >>> If both CONFIG_SENSORS_AMS_PMU and CONFIG_SENSORS_AMS_I2C are unset, >>> there is an unused variable warning in the ams driver: >&g

Re: [PATCH 3/3] macintosh/ams: Fix unused variable warning

2024-03-06 Thread Christophe Leroy
Le 06/03/2024 à 13:58, Michael Ellerman a écrit : > If both CONFIG_SENSORS_AMS_PMU and CONFIG_SENSORS_AMS_I2C are unset, > there is an unused variable warning in the ams driver: > >drivers/macintosh/ams/ams-core.c: In function 'ams_init': >drivers/macintosh/ams/ams-core.c:181:29:

Re: [RESEND2 PATCH net v4 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock

2024-03-05 Thread Christophe Leroy
: >> On 2/23/24 00:38, Christophe Leroy wrote: >>> Le 22/02/2024 à 18:07, Sean Anderson a écrit : >>>> [Vous ne recevez pas souvent de courriers de sean.ander...@linux.dev. >>>> Découvrez pourquoi ceci est important à >>>> https://aka.ms/LearnAboutSenderI

Re: [PATCH v3 02/10] mm/ppc: Replace pXd_is_leaf() with pXd_leaf()

2024-03-05 Thread Christophe Leroy
h/powerpc/include/asm/pgtable.h. because similar > fallback macros for pXd_leaf() are already defined in > include/linux/pgtable.h. > > Cc: Michael Ellerman > Cc: Nicholas Piggin > Cc: "Aneesh Kumar K.V" > Cc: "Naveen N. Rao" > Cc: linuxppc-dev@lists.

Re: [PATCH v3 01/10] mm/ppc: Define pXd_large() with pXd_leaf()

2024-03-05 Thread Christophe Leroy
macro to pXd_leaf(). > Define it unconditionally just like pXd_leaf(). This helps to prepare > merging the two APIs. > > Cc: Michael Ellerman > Cc: Nicholas Piggin > Cc: Christophe Leroy > Cc: "Aneesh Kumar K.V" > Cc: "Naveen N. Rao" > Cc: linuxppc-

[PATCH] powerpc/bpf/32: Fix failing test_bpf tests

2024-03-05 Thread Christophe Leroy
filter opcode 0006 (@1) unsupported jited:0 261 PASS test_bpf: Summary: 1040 PASSED, 10 FAILED, [924/1038 JIT'ed] Fix them by adding missing processing. Fixes: daabb2b098e0 ("bpf/tests: add tests for cpuv4 instructions") Signed-off-by: Christophe Leroy --- arch/powerpc/incl

Re: [PATCH v2 3/3] arch/powerpc: Remove from backlight code

2024-03-05 Thread Christophe Leroy
Le 05/03/2024 à 11:04, Thomas Zimmermann a écrit : > Hi > > Am 05.03.24 um 10:25 schrieb Christophe Leroy: >> >> Le 05/03/2024 à 10:01, Thomas Zimmermann a écrit : >>> Replace with a forward declaration in to >>> resolves an unnecessary depende

Re: [PATCH v2 3/3] arch/powerpc: Remove from backlight code

2024-03-05 Thread Christophe Leroy
Le 05/03/2024 à 10:01, Thomas Zimmermann a écrit : > Replace with a forward declaration in to > resolves an unnecessary dependency. Remove pmac_backlight_curve_lookup() > and struct fb_info from source and header files. The function and the > framebuffer struct is unused. No functional

Re: [PATCH] powerpc/pseries: fix max polling time in plpks_confirm_object_flushed() function

2024-03-04 Thread Christophe Leroy
Le 04/03/2024 à 07:53, Nayna Jain a écrit : > [Vous ne recevez pas souvent de courriers de na...@linux.ibm.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > usleep_range() function takes input time and range in usec. However, > currently it is

Re: [PATCH] powerpc: include linux/backlight.h from asm/backlight.h

2024-03-04 Thread Christophe Leroy
Le 04/03/2024 à 11:32, Thomas Zimmermann a écrit : > Hi > > Am 04.03.24 um 10:55 schrieb Jani Nikula: >> Removal of the backlight include from fb.h uncovered an implicit >> dependency in powerpc asm/backlight.h. Add the explicit include. >> >> Reported-by: Naresh Kamboju >> Closes: >>

Re: [PATCH v2 5/9] mm: Initialize struct vm_unmapped_area_info

2024-03-04 Thread Christophe Leroy
Le 02/03/2024 à 02:51, Kees Cook a écrit : > On Sat, Mar 02, 2024 at 12:47:08AM +, Edgecombe, Rick P wrote: >> On Wed, 2024-02-28 at 09:21 -0800, Kees Cook wrote: >>> I totally understand. If the "uninitialized" warnings were actually >>> reliable, I would agree. I look at it this way: >>>

Re: BUG: Bad page map in process init pte:c0ab684c pmd:01182000 (on a PowerMac G4 DP)

2024-02-29 Thread Christophe Leroy
Le 29/02/2024 à 02:09, Erhard Furtner a écrit : > On Mon, 12 Dec 2022 14:31:35 +1000 > "Nicholas Piggin" wrote: > >> On Thu Dec 1, 2022 at 7:44 AM AEST, Erhard F. wrote: >>> Getting this at boot sometimes, but not always (PowerMac G4 DP, kernel >>> 6.0.9): >>> >>> [...] >>> Freeing unused

Re: [PATCH v2 5/9] mm: Initialize struct vm_unmapped_area_info

2024-02-28 Thread Christophe Leroy
Le 28/02/2024 à 18:01, Edgecombe, Rick P a écrit : > On Wed, 2024-02-28 at 13:22 +0000, Christophe Leroy wrote: >>> Any preference? Or maybe am I missing your point and talking >>> nonsense? >>> >> >> So my preference would go to the addi

Re: [revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure

2024-02-28 Thread Christophe Leroy
Le 28/02/2024 à 15:43, Eric Dumazet a écrit : > On Wed, Feb 28, 2024 at 3:07 PM Vadim Fedorenko > wrote: >> >> On 28/02/2024 11:09, Tasmiya Nalatwad wrote: >>> Greetings, >>> >>> [revert 0d60d8df6f49] [net/net-next] [6.8-rc5] Build Failure >>> >>> Reverting below commit fixes the issue >>> >>>

Re: [PATCH v2 5/9] mm: Initialize struct vm_unmapped_area_info

2024-02-28 Thread Christophe Leroy
Le 27/02/2024 à 21:25, Edgecombe, Rick P a écrit : > On Tue, 2024-02-27 at 18:16 +0000, Christophe Leroy wrote: >>>> Why doing a full init of the struct when all fields are re- >>>> written a few >>>> lines after ? >>> >>> It's a n

Re: [PATCH 0/5] mm/treewide: Replace pXd_large() with pXd_leaf()

2024-02-28 Thread Christophe Leroy
Le 28/02/2024 à 09:53, pet...@redhat.com a écrit : > From: Peter Xu > > [based on latest akpm/mm-unstable, commit 1274e7646240] > > These two APIs are mostly always the same. It's confusing to have both of > them. Merge them into one. Here I used pXd_leaf() only because pXd_leaf() > is a

Re: [PATCH v2 5/9] mm: Initialize struct vm_unmapped_area_info

2024-02-27 Thread Christophe Leroy
Le 27/02/2024 à 19:07, Kees Cook a écrit : > On Tue, Feb 27, 2024 at 07:02:59AM +0000, Christophe Leroy wrote: >> >> >> Le 26/02/2024 à 20:09, Rick Edgecombe a écrit : >>> Future changes will need to add a field to struct vm_unmapped_area_info. >>>

Re: [PATCH 1/4] arch: consolidate existing CONFIG_PAGE_SIZE_*KB definitions

2024-02-27 Thread Christophe Leroy
Le 27/02/2024 à 16:40, Arnd Bergmann a écrit : > On Mon, Feb 26, 2024, at 17:55, Samuel Holland wrote: >> On 2024-02-26 10:14 AM, Arnd Bergmann wrote: >>> >>> +config HAVE_PAGE_SIZE_4KB >>> + bool >>> + >>> +config HAVE_PAGE_SIZE_8KB >>> + bool >>> + >>> +config HAVE_PAGE_SIZE_16KB >>> +

Re: Increasing build coverage for drivers/spi/spi-ppc4xx.c

2024-02-27 Thread Christophe Leroy
Le 27/02/2024 à 15:00, Uwe Kleine-König a écrit : > On Tue, Feb 27, 2024 at 01:52:07PM +0000, Christophe Leroy wrote: >> >> >> Le 27/02/2024 à 11:58, Uwe Kleine-König a écrit : >>> Hello Christophe, >>> >>> On Tue, Feb 27, 2024 at 10:25:15AM +,

Re: Increasing build coverage for drivers/spi/spi-ppc4xx.c

2024-02-27 Thread Christophe Leroy
Le 27/02/2024 à 11:58, Uwe Kleine-König a écrit : > Hello Christophe, > > On Tue, Feb 27, 2024 at 10:25:15AM +, Christophe Leroy wrote: >> Le 27/02/2024 à 09:46, Uwe Kleine-König a écrit : >>> recently the spi-ppc4xx.c driver suffered from build errors and warnings

Re: Increasing build coverage for drivers/spi/spi-ppc4xx.c

2024-02-27 Thread Christophe Leroy
Le 27/02/2024 à 09:46, Uwe Kleine-König a écrit : > Hello, > > recently the spi-ppc4xx.c driver suffered from build errors and warnings > that were undetected for longer than I expected. I think it would be > very beneficial if this driver was enabled in (at least) a powerpc > allmodconfig

Re: [PATCH v2 5/9] mm: Initialize struct vm_unmapped_area_info

2024-02-26 Thread Christophe Leroy
Le 26/02/2024 à 20:09, Rick Edgecombe a écrit : > Future changes will need to add a field to struct vm_unmapped_area_info. > This would cause trouble for any archs that don't initialize the > struct. Currently every user sets each field, so if new fields are > added, the core code parsing the

Re: [PATCH 2/4] arch: simplify architecture specific page size configuration

2024-02-26 Thread Christophe Leroy
while > leaving the arhcitecture specific ones as the user visible > place for configuring it, to avoid breaking user configs. > > Signed-off-by: Arnd Bergmann Reviewed-by: Christophe Leroy (powerpc32) > --- > arch/arc/Kconfig | 3 +++ > arch/arc/include/uapi/as

Re: [PATCH 1/4] arch: consolidate existing CONFIG_PAGE_SIZE_*KB definitions

2024-02-26 Thread Christophe Leroy
Le 26/02/2024 à 17:14, Arnd Bergmann a écrit : > From: Arnd Bergmann > > These four architectures define the same Kconfig symbols for configuring > the page size. Move the logic into a common place where it can be shared > with all other architectures. > > Signed-off-by: Arnd Bergmann > ---

Re: [PATCH 4/4] vdso: avoid including asm/page.h

2024-02-26 Thread Christophe Leroy
Le 26/02/2024 à 17:14, Arnd Bergmann a écrit : > From: Arnd Bergmann > > The recent change to the vdso_data_store broke building compat VDSO > on at least arm64 because it includes headers outside of the include/vdso/ > namespace: I understand that powerpc64 also has an issue, see

Re: [PATCH v9 2/2] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests

2024-02-23 Thread Christophe Leroy
Le 22/02/2024 à 03:55, Charlie Jenkins a écrit : > The test cases for ip_fast_csum and csum_ipv6_magic were failing on a > variety of architectures that are big endian or do not support > misalgined accesses. Both of these test cases are changed to support big > and little endian architectures.

Re: [PATCH v9 1/2] lib: checksum: Fix type casting in checksum kunits

2024-02-23 Thread Christophe Leroy
Le 22/02/2024 à 03:55, Charlie Jenkins a écrit : > The checksum functions use the types __wsum and __sum16. These need to > be explicitly casted to, because will cause sparse errors otherwise. This is not the correct fix. When you forcibly cast, you shut up sparse and hide warnings but you

Re: "test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:589" at boot with CONFIG_CHECKSUM_KUNIT=y enabled on a Talos II, kernel 6.8-rc5

2024-02-23 Thread Christophe Leroy
Le 23/02/2024 à 08:00, Charlie Jenkins a écrit : > On Fri, Feb 23, 2024 at 06:58:14AM +0000, Christophe Leroy wrote: >> >> >> Le 23/02/2024 à 07:12, Charlie Jenkins a écrit : >>> On Fri, Feb 23, 2024 at 05:59:07AM +, Christophe Leroy wrote: >>>> Hi E

Re: "test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:589" at boot with CONFIG_CHECKSUM_KUNIT=y enabled on a Talos II, kernel 6.8-rc5

2024-02-22 Thread Christophe Leroy
Le 23/02/2024 à 07:12, Charlie Jenkins a écrit : > On Fri, Feb 23, 2024 at 05:59:07AM +0000, Christophe Leroy wrote: >> Hi Erhard, hi Charlie, >> >> Le 23/02/2024 à 02:26, Erhard Furtner a écrit : >>> Greetings! >>> >>> Looks like my

Re: "test_ip_fast_csum: ASSERTION FAILED at lib/checksum_kunit.c:589" at boot with CONFIG_CHECKSUM_KUNIT=y enabled on a Talos II, kernel 6.8-rc5

2024-02-22 Thread Christophe Leroy
Hi Erhard, hi Charlie, Le 23/02/2024 à 02:26, Erhard Furtner a écrit : > Greetings! > > Looks like my Talos II (running a BE kernel+system) fails some of the kernels > internal unit tests. One of the failing tests is checksum_kunit, enabled via > CONFIG_CHECKSUM_KUNIT=y: > > [...] > KTAP

Re: [RESEND2 PATCH net v4 2/2] soc: fsl: qbman: Use raw spinlock for cgr_lock

2024-02-22 Thread Christophe Leroy
Le 22/02/2024 à 18:07, Sean Anderson a écrit : > [Vous ne recevez pas souvent de courriers de sean.ander...@linux.dev. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > cgr_lock may be locked with interrupts already disabled by >

Re: [PATCH 1/2] powerpc: Refactor __kernel_map_pages()

2024-02-22 Thread Christophe Leroy
Le 22/02/2024 à 06:32, Michael Ellerman a écrit : > Christophe Leroy writes: >> __kernel_map_pages() is almost identical for PPC32 and RADIX. >> >> Refactor it. >> >> On PPC32 it is not needed for KFENCE, but to keep it simple >> just make it similar to

Re: [PATCH 2/2] powerpc: Don't ignore errors from set_memory_{n}p() in __kernel_map_pages()

2024-02-21 Thread Christophe Leroy
Le 21/02/2024 à 13:09, Michael Ellerman a écrit : > Christophe Leroy writes: >> set_memory_p() and set_memory_np() can fail. >> >> As mentioned in linux/mm.h: >> >> /* >> * To support DEBUG_PAGEALLOC architecture must ensure that >> * __kernel_m

Re: [PATCH 1/4] mm/vmalloc: allow arch-specific vmalloc_node overrides

2024-02-21 Thread Christophe Leroy
Le 21/02/2024 à 06:43, Christoph Hellwig a écrit : > On Tue, Feb 20, 2024 at 02:32:53PM -0600, Maxwell Bland wrote: >> Present non-uniform use of __vmalloc_node and __vmalloc_node_range makes >> enforcing appropriate code and data seperation untenable on certain >> microarchitectures, as

Re: [PATCH 0/4] arm64: mm: support dynamic vmalloc/pmd configuration

2024-02-21 Thread Christophe Leroy
Le 20/02/2024 à 21:32, Maxwell Bland a écrit : > [Vous ne recevez pas souvent de courriers de mbl...@motorola.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > Reworks ARM's virtual memory allocation infrastructure to support > dynamic

Re: [PATCH 3/4] arm64: separate code and data virtual memory allocation

2024-02-21 Thread Christophe Leroy
Le 20/02/2024 à 21:32, Maxwell Bland a écrit : > [Vous ne recevez pas souvent de courriers de mbl...@motorola.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > Current BPF and kprobe instruction allocation interfaces do not match > the base

Re: [PATCH 2/4] mm: pgalloc: support address-conditional pmd allocation

2024-02-21 Thread Christophe Leroy
Le 20/02/2024 à 21:32, Maxwell Bland a écrit : > [Vous ne recevez pas souvent de courriers de mbl...@motorola.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > While other descriptors (e.g. pud) allow allocations conditional on > which virtual

Re: [PATCH 1/4] mm/vmalloc: allow arch-specific vmalloc_node overrides

2024-02-21 Thread Christophe Leroy
Le 20/02/2024 à 21:32, Maxwell Bland a écrit : > [Vous ne recevez pas souvent de courriers de mbl...@motorola.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > Present non-uniform use of __vmalloc_node and __vmalloc_node_range makes > enforcing

Re: [PATCH v4 01/11] dt-bindings: wiiu: Document the Nintendo Wii U devicetree

2024-02-20 Thread Christophe Leroy
Michael, Le 19/11/2022 à 12:30, Ash Logan a écrit : > Adds schema for the various Wii U devicetree nodes used. > > Signed-off-by: Ash Logan There's an issue at https://github.com/linuxppc/issues/issues/410 with kernel v6.4 as a target to merging thing, any plan ? It still applies without

Re: [PATCH v3] powerpc: macio: Make remove callback of macio driver void returned

2024-02-20 Thread Christophe Leroy
Hi Michael, ping ? Le 01/02/2023 à 15:36, Dawei Li a écrit : > Commit fc7a6209d571 ("bus: Make remove callback return void") forces > bus_type::remove be void-returned, it doesn't make much sense for any > bus based driver implementing remove callbalk to return non-void to > its caller. > >

Re: [PATCH v1 2/2] powerpc/debug: hook to user return notifier infrastructure

2024-02-20 Thread Christophe Leroy
Le 20/02/2024 à 09:51, Christophe Leroy a écrit : > > > Le 19/12/2023 à 07:33, Michael Ellerman a écrit : >> Aneesh Kumar K.V writes: >>> Luming Yu writes: >>> >>>> Before we have powerpc to use the generic entry infrastructure, >>>>

Re: [PATCH v1 2/2] powerpc/debug: hook to user return notifier infrastructure

2024-02-20 Thread Christophe Leroy
Le 19/12/2023 à 07:33, Michael Ellerman a écrit : > Aneesh Kumar K.V writes: >> Luming Yu writes: >> >>> Before we have powerpc to use the generic entry infrastructure, >>> the call to fire user return notifier is made temporarily in powerpc >>> entry code. >>> >> >> It is still not clear what

Re: [PATCH v1 1/1] hvc_console: Allow backends to set I/O buffer size

2024-02-20 Thread Christophe Leroy
Hi, Le 15/01/2023 à 20:56, Geoff Levand a écrit : > To allow HVC backends to set the I/O buffer sizes to values that are most > efficient for the backend, change the macro definitions where the buffer sizes > are set to be conditional on whether or not the macros are already defined. > Also,

Re: [PATCH 4/4] Revert "powerpc/ps3_defconfig: Disable PPC64_BIG_ENDIAN_ELF_ABI_V2"

2024-02-20 Thread Christophe Leroy
Le 19/01/2024 à 11:27, Geoff Levand a écrit : > Patches provided by Nicholas Piggin enable PS3 > support for ELFv2. The said patches are https://patchwork.ozlabs.org/project/linuxppc-dev/cover/20231227072405.63751-1-npig...@gmail.com/ > > Signed-off-by: Geoff Levand > --- >

Re: [PATCH 0/4] powerpc/ps3 Add ELFv2 support

2024-02-20 Thread Christophe Leroy
Hi, Le 19/01/2024 à 11:27, Geoff Levand a écrit : > The following changes since commit 44a1aad2fe6c10bfe0589d8047057b10a4c18a19: > >Merge branch 'topic/ppc-kvm' into next (2023-12-29 15:30:45 +1100) > > are available in the Git repository at: > >

Re: [PATCH 02/12] powerpc/pseries: Restructure hvc_get_chars() endianness

2024-02-19 Thread Christophe Leroy
Michael ? Any reason for not picking that one ? Le 30/10/2023 à 14:16, Aneesh Kumar K.V a écrit : > Benjamin Gray writes: > >> Sparse reports an endian mismatch in hvc_get_chars(). >> >> At first it seemed like the retbuf should be __be64[], but actually >> retbuf holds serialized registers

Re: [PATCH 00/13] kmsan: Enable on powerpc

2024-02-19 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > This series provides the minimal support for Kernal Memory Sanitizer on > powerpc pseries le guests. Kernal Memory Sanitizer is a tool which detects > uses of uninitialized memory. Currently KMSAN is clang only. > > The clang support for

Re: [PATCH 01/13] kmsan: Export kmsan_handle_dma

2024-02-19 Thread Christophe Leroy
Le 14/12/2023 à 06:55, Nicholas Miehlbradt a écrit : > kmsan_handle_dma is required by virtio drivers. Export kmsan_handle_dma > so that the drivers can be compiled as modules. > > Signed-off-by: Nicholas Miehlbradt > --- > mm/kmsan/hooks.c | 1 + > 1 file changed, 1 insertion(+) > > diff

Re: [PATCH] powerpc/code-patching: Disable KASAN in __patch_instructions()

2024-02-18 Thread Christophe Leroy
Le 13/02/2024 à 05:36, Benjamin Gray a écrit : > The memset/memcpy functions are by default instrumented by KASAN, which > complains about user memory access when using a poking page in > userspace. > > Using a userspace address is expected though, so don't instrument with > KASAN for this

Re: [PATCH v3] powerpc: Add gpr1 and fpu save/restore functions

2024-02-17 Thread Christophe Leroy
Le 16/02/2024 à 18:24, Timothy Pearson a écrit : > When building the kernel in size optimized mode with the amdgpu module > enabled, > gcc will begin referencing external gpr1 and fpu save/restore functions. This > will then cause a linker failure as we do not link against libgcc which >

Re: [PATCH v1 4/5] powerpc: Remove cpu-as-y completely

2024-02-16 Thread Christophe Leroy
Le 20/02/2023 à 07:00, Michael Ellerman a écrit : > Christophe Leroy writes: >> cpu-as-y is there to force assembler building options. >> But there is no need for that. Gcc is passed the necessary >> options and it automatically pass the appropriate option to >&

[PATCH 2/2] powerpc: Don't ignore errors from set_memory_{n}p() in __kernel_map_pages()

2024-02-16 Thread Christophe Leroy
/issues/7 Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/hash.h | 2 +- arch/powerpc/mm/book3s64/hash_utils.c | 3 ++- arch/powerpc/mm/pageattr.c| 10 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm

[PATCH 1/2] powerpc: Refactor __kernel_map_pages()

2024-02-16 Thread Christophe Leroy
__kernel_map_pages() is almost identical for PPC32 and RADIX. Refactor it. On PPC32 it is not needed for KFENCE, but to keep it simple just make it similar to PPC64. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/pgtable.h | 10 -- arch/powerpc/include/asm

[PATCH] powerpc: Handle error in mark_rodata_ro() and mark_initmem_nx()

2024-02-16 Thread Christophe Leroy
mark_rodata_ro() and mark_initmem_nx() use functions that can fail like set_memory_nx() and set_memory_ro(), leading to a not protected kernel. In case of failure, panic. Link: https://github.com/KSPP/linux/issues/7 Signed-off-by: Christophe Leroy --- arch/powerpc/mm/book3s32/mmu.c | 7

[PATCH] powerpc/kprobes: Handle error returned by set_memory_rox()

2024-02-16 Thread Christophe Leroy
set_memory_rox() can fail. In case it fails, free allocated memory and return NULL. Link: https://github.com/KSPP/linux/issues/7 Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/kprobes.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH] powerpc: Implement set_memory_rox()

2024-02-16 Thread Christophe Leroy
rmation. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/set_memory.h | 7 +++ arch/powerpc/mm/pageattr.c| 4 2 files changed, 11 insertions(+) diff --git a/arch/powerpc/include/asm/set_memory.h b/arch/powerpc/include/asm/set_memory.h index 7ebc807aa8cc.

[PATCH] powerpc: Use user_mode() macro when possible

2024-02-16 Thread Christophe Leroy
There is a nice macro to check user mode. Use it instead of open coding anding with MSR_PR to increase readability and avoid having to comment what that anding is for. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/interrupt.h | 2 +- arch/powerpc/kernel/syscall.c| 2

[PATCH] powerpc/trace: Restrict hash_fault trace event to HASH MMU

2024-02-16 Thread Christophe Leroy
'perf list' on powerpc 8xx shows an event named "1:hash_fault". This event is pointless because trace_hash_fault() is called only from mm/book3s64/hash_utils.c Only define it when CONFIG_PPC_64S_HASH_MMU is selected. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/t

Re: [PATCH v4] powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.

2024-02-14 Thread Christophe Leroy
0008364] > machine_check_early_common+0x134/0x1f8 > > Fix this by avoiding use of nmi_enter()/nmi_exit() in real mode if percpu > first chunk is not embedded. > > Signed-off-by: Mahesh Salgaonkar Reviewed-by: Christophe Leroy > --- > Changes in v4: > - Fix coding style

Re: [PATCH v3] powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.

2024-02-14 Thread Christophe Leroy
l mode if percpu > first chunk is not embedded. > > Signed-off-by: Mahesh Salgaonkar > --- > Changes in v3: > - Address comments from Christophe Leroy to avoid using #ifdefs in the >code > - v2 at > https://lore.kernel.org/linuxppc-dev/20240205053647.1763446-1-mah...@linux

Re: [PATCH v2] powerpc: Add gpr1 and fpu save/restore functions

2024-02-13 Thread Christophe Leroy
Le 12/02/2024 à 18:14, Timothy Pearson a écrit : > When building the kernel in size optimized mode with the amdgpu module > enabled, > gcc will begin referencing external gpr1 and fpu save/restore functions. This > will then cause a linker failure as we do not link against libgcc which >

[PATCH] powerpc: Force inlining of arch_vmap_p{u/m}d_supported()

2024-02-13 Thread Christophe Leroy
rot) || | ^~~ Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402131836.ou1tduoi-...@intel.com/ Fixes: 8309c9d71702 ("powerpc: inline huge vmap supported functions") Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/vmalloc.h | 4 ++-- 1 fi

Re: [PATCH v2 0/5] powerpc: struct bus_type cleanup

2024-02-13 Thread Christophe Leroy
Hi Le 12/02/2024 à 21:04, Ricardo B. Marliere a écrit : > This series is part of an effort to cleanup the users of the driver > core, as can be seen in many recent patches authored by Greg across the > tree (e.g. [1]). Patch 1/5 is a prerequisite to 2/5, but the others have > no dependency. They

Re: [PATCH v2 2/2] powerpc/bpf: enable kfunc call

2024-02-12 Thread Christophe Leroy
Le 01/02/2024 à 18:12, Hari Bathini a écrit : > With module addresses supported, override bpf_jit_supports_kfunc_call() > to enable kfunc support. Module address offsets can be more than 32-bit > long, so override bpf_jit_supports_far_kfunc_call() to enable 64-bit > pointers. What's the impact

Re: [PATCH v2 1/2] powerpc/bpf: ensure module addresses are supported

2024-02-12 Thread Christophe Leroy
Le 01/02/2024 à 18:12, Hari Bathini a écrit : > Currently, bpf jit code on powerpc assumes all the bpf functions and > helpers to be kernel text. This is false for kfunc case, as function > addresses are mostly module addresses in that case. Ensure module > addresses are supported to enable

Re: [PATCH] powerpc/ftrace: Ignore ftrace locations in exit text sections

2024-02-12 Thread Christophe Leroy
Le 09/02/2024 à 08:59, Naveen N Rao a écrit : > Michael reported that we are seeing ftrace bug on bootup when KASAN is > enabled, and if we are using -fpatchable-function-entry: > > ftrace: allocating 47780 entries in 18 pages > ftrace-powerpc: 0xc20b3d5c: No module provided

Re: [PATCH] powerpc/cputable: Add missing PPC_FEATURE_BOOKE on PPC64 Book-E

2024-02-12 Thread Christophe Leroy
nd expect PPC_FEATURE_BOOKE. > Debugging an application with gdb is no longer working on e5500/e6500 > because the 64-bit detection relies on PPC_FEATURE_BOOKE for Book-E. > > Fixes: e320a76db4b0 ("powerpc/cputable: Split cpu_specs[] out of cputable.h") > Signed-off-by: David Engra

Re: [PATCH v2] powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.

2024-02-12 Thread Christophe Leroy
Le 05/02/2024 à 06:36, Mahesh Salgaonkar a écrit : > [Vous ne recevez pas souvent de courriers de mah...@linux.ibm.com. Découvrez > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] > > nmi_enter()/nmi_exit() touches per cpu variables which can lead to kernel >

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-31 Thread Christophe Leroy
Le 31/01/2024 à 16:17, Marek Szyprowski a écrit : > [Vous ne recevez pas souvent de courriers de m.szyprow...@samsung.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Hi Christophe, > > On 31.01.2024 12:58, Christophe

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-31 Thread Christophe Leroy
Hi, Le 30/01/2024 à 18:48, Marek Szyprowski a écrit : > [Vous ne recevez pas souvent de courriers de m.szyprow...@samsung.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > Dear All, > > On 30.01.2024 12:03, Christophe Ler

BUG: KASAN: vmalloc-out-of-bounds in memset32 (bpf_prog_pack_free)

2024-01-31 Thread Christophe Leroy
Hi, Got the following BUG while loading module test_bpf.ko No time to investigate for now. root@vgoip:~# insmod test_bpf.ko [ 263.409030] == [ 263.416415] BUG: KASAN: vmalloc-out-of-bounds in memset32+0x5c/0xa0 [ 263.422952]

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-30 Thread Christophe Leroy
Le 30/01/2024 à 21:27, Luis Chamberlain a écrit : > On Tue, Jan 30, 2024 at 06:48:11PM +0100, Marek Szyprowski wrote: >> Dear All, >> >> On 30.01.2024 12:03, Christophe Leroy wrote: >>> Le 30/01/2024 à 10:16, Chen-Yu Tsai a écrit : >>>> [Vous

Re: [PATCH 1/3] init: Declare rodata_enabled and mark_rodata_ro() at all time

2024-01-30 Thread Christophe Leroy
n wrote: >> On Thu, Dec 21, 2023 at 10:02:46AM +0100, Christophe Leroy wrote: >>> Declaring rodata_enabled and mark_rodata_ro() at all time >>> helps removing related #ifdefery in C files. >>> >>> Signed-off-by: Christophe Leroy >> >> Very nice

[PATCH v2 5/5] mm: ptdump: add check_wx_pages debugfs attribute

2024-01-30 Thread Christophe Leroy
Add a readable attribute in debugfs to trigger a W^X pages check at any time. To trigger the test, just read /sys/kernel/debug/check_wx_pages It will report FAILED if the test failed, SUCCESS otherwise. Detailed result is provided into dmesg. Signed-off-by: Christophe Leroy --- v2: Make

[PATCH v2 4/5] mm: ptdump: Have ptdump_check_wx() return bool

2024-01-30 Thread Christophe Leroy
Have ptdump_check_wx() return true when the check is successful or false otherwise. Signed-off-by: Christophe Leroy --- v2: New --- arch/arm64/mm/ptdump.c | 11 --- arch/powerpc/mm/ptdump/ptdump.c | 13 + arch/riscv/mm/ptdump.c | 11 --- arch/s390

[PATCH v2 3/5] powerpc,s390: ptdump: Define ptdump_check_wx() regardless of CONFIG_DEBUG_WX

2024-01-30 Thread Christophe Leroy
Following patch will use ptdump_check_wx() regardless of CONFIG_DEBUG_WX, so define it at all times on powerpc and s390 just like other architectures. Though keep the WARN_ON_ONCE() only when CONFIG_DEBUG_WX is set. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ptdump/ptdump.c | 7

[PATCH v2 2/5] arm64, powerpc, riscv, s390, x86: ptdump: Refactor CONFIG_DEBUG_WX

2024-01-30 Thread Christophe Leroy
-by: Christophe Leroy Reviewed-by: Alexandre Ghiti --- v2: For x86 change macro ptdump_check_wx() to ptdump_check_wx --- arch/arm64/include/asm/ptdump.h | 7 --- arch/arm64/mm/mmu.c | 2 -- arch/powerpc/mm/mmu_decl.h | 6 -- arch/powerpc/mm/pgtable_32.c| 4

[PATCH v2 1/5] arm: ptdump: Rename CONFIG_DEBUG_WX to CONFIG_ARM_DEBUG_WX

2024-01-30 Thread Christophe Leroy
CONFIG_DEBUG_WX is a core option defined in mm/Kconfig.debug To avoid any future conflict, rename ARM version into CONFIG_ARM_DEBUG_WX. Signed-off-by: Christophe Leroy --- v2: Fixed left-over debug_checkwx() in mark_rodata_ro() and updated defconfigs --- arch/arm/Kconfig.debug

[PATCH v2 0/5] mm: ptdump: Refactor CONFIG_DEBUG_WX and check_wx_pages debugfs attribute

2024-01-30 Thread Christophe Leroy
(). Then implement a debugfs attribute that can be used to trigger a W^X test at anytime and regardless of CONFIG_DEBUG_WX Changes in v2: - Fixed a few build failures (patch 1 and 2) - Added patch 4 - Make the attribute return SUCCESS/FAILURE as suggested by Heiko (patch 5) Christophe Leroy (5): arm

Re: [PATCH v2 08/15] mm/pgtable: make pte_next_pfn() independent of set_ptes()

2024-01-25 Thread Christophe Leroy
> Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy > --- > include/linux/pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h > index f6d0e3513948a..351cd9dc7194f 100644 > -

Re: [PATCH v2 10/15] powerpc/mm: use pte_next_pfn() in set_ptes()

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 20:32, David Hildenbrand a écrit : > Let's use our handy new helper. Note that the implementation is slightly > different, but shouldn't really make a difference in practice. > > Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy > --- >

Re: [PATCH v2 04/15] powerpc/pgtable: define PFN_PTE_SHIFT

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 20:32, David Hildenbrand a écrit : > We want to make use of pte_next_pfn() outside of set_ptes(). Let's > simply define PFN_PTE_SHIFT, required by pte_next_pfn(). > > Signed-off-by: David Hildenbrand Reviewed-by: Christophe Leroy > --- > arch/powerpc/inc

Re: [PATCH] powerpc/papr_scm: Move duplicate definitions to common header files

2024-01-25 Thread Christophe Leroy
Le 18/04/2022 à 06:38, Shivaprasad G Bhat a écrit : > papr_scm and ndtest share common PDSM payload structs like > nd_papr_pdsm_health. Presently these structs are duplicated across > papr_pdsm.h and ndtest.h header files. Since 'ndtest' is essentially > arch independent and can run on platforms

Re: [PATCH v6 (proposal)] powerpc/cpu: enable nr_cpus for crash kernel

2024-01-25 Thread Christophe Leroy
Hi, Le 22/05/2018 à 10:23, Pingfan Liu a écrit : > For kexec -p, the boot cpu can be not the cpu0, this causes the problem > to alloc paca[]. In theory, there is no requirement to assign cpu's logical > id as its present seq by device tree. But we have something like > cpu_first_thread_sibling(),

Re: [PATCH] powerpc/fadump: update kernel logs before fadump crash begins

2024-01-25 Thread Christophe Leroy
Hi, Le 06/06/2020 à 06:45, Sourabh Jain a écrit : When we hit the fadump crash via the panic path the pstore update is missing. This is observed when commit 8341f2f222d7 ("sysrq: Use panic() to force a crash") changed the sysrq-trigger to take panic path instead of die path. The PPC panic

Re: [PATCH] powerpc: build-time fixup alternate feature relative addresses

2024-01-25 Thread Christophe Leroy
Hi Nic, Le 21/05/2017 à 03:01, Nicholas Piggin a écrit : Implement build-time fixup of alternate feature relative addresses for the out-of-line ("else") patch code. This is done post-link with a new powerpc build tool that parses relocations and fixup structures, and adjusts branch

Re: [PATCH 8/8] powerpc/rtas: consume retry statuses in sys_rtas()

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 17:33, Nathan Lynch a écrit : > Christophe Leroy writes: >> Hi Nathan, >> >> Le 06/03/2023 à 22:33, Nathan Lynch via B4 Relay a écrit : >>> From: Nathan Lynch >>> >>> The kernel can handle retrying RTAS function calls in response

Re: [PATCH 8/8] powerpc/rtas: consume retry statuses in sys_rtas()

2024-01-25 Thread Christophe Leroy
Hi Nathan, Le 06/03/2023 à 22:33, Nathan Lynch via B4 Relay a écrit : > From: Nathan Lynch > > The kernel can handle retrying RTAS function calls in response to > -2/990x in the sys_rtas() handler instead of relaying the intermediate > status to user space. From this series with still have

Re: [PATCH v2] powerpc/6xx: set High BAT Enable flag on G2_LE cores

2024-01-25 Thread Christophe Leroy
bootloader already. > > Fixes: e4d6654ebe6e ("powerpc/mm/32s: rework mmu_mapin_ram()") > Signed-off-by: Matthias Schiffer Reviewed-by: Christophe Leroy > --- > > v2: > - Use the G2_LE name for cores that have this HID2 register > - Extend __setup_cpu_603 in

Re: [PATCH] powerpc/cell: Code cleanup for spufs_mfc_flush

2024-01-25 Thread Christophe Leroy
Le 25/01/2024 à 11:08, Kunwu Chan a écrit : > This part was commented from commit a33a7d7309d7 > ("[PATCH] spufs: implement mfc access for PPE-side DMA") > in about 18 years before. > > If there are no plans to enable this part code in the future, > we can remove this dead code. > >

Re: [PATCH] powerpc/iommu: Code cleanup for cell/iommu.c

2024-01-24 Thread Christophe Leroy
Le 25/01/2024 à 03:46, Kunwu Chan a écrit : > This part was commented from commit 165785e5c0be ("[POWERPC] Cell > iommu support") in about 17 years before. > > If there are no plans to enable this part code in the future, > we can remove this dead code. > > Signed-off-by: Kunwu Chan > --- >

Re: ps3_gelic_net.c issue (linux kernel 6.8-rc1)

2024-01-24 Thread Christophe Leroy
Hi, Le 24/01/2024 à 09:41, sambat goson a écrit : > > Hi, > I've just test it and find below code not proper in function > "gelic_descr_prepare_rx", line 398. > it causes error as my attached file. > > descr->skb = netdev_alloc_skb(*card->netdev, rx_skb_size); > if (!descr->skb) { >

Re: [PATCH] KVM: PPC: code cleanup for kvmppc_book3s_irqprio_deliver

2024-01-24 Thread Christophe Leroy
Le 24/01/2024 à 10:36, Kunwu Chan a écrit : > This part was commented from commit 2f4cf5e42d13 ("Add book3s.c") > in about 14 years before. > If there are no plans to enable this part code in the future, > we can remove this dead code. > > Signed-off-by: Kunwu Chan > --- >

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 12:38, Ryan Roberts a écrit : > On 23/01/2024 11:31, David Hildenbrand wrote: > If high bits are used for > something else, then we might produce a garbage PTE on overflow, but that > shouldn't really matter I concluded for folio_pte_batch() purposes, we'd >

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 12:08, Ryan Roberts a écrit : > On 23/01/2024 10:48, David Hildenbrand wrote: >> On 23.01.24 11:34, Ryan Roberts wrote: >>> On 22/01/2024 19:41, David Hildenbrand wrote: We want to make use of pte_next_pfn() outside of set_ptes(). Let's simpliy define PFN_PTE_SHIFT,

Re: [PATCH v1 01/11] arm/pgtable: define PFN_PTE_SHIFT on arm and arm64

2024-01-23 Thread Christophe Leroy
Le 23/01/2024 à 11:48, David Hildenbrand a écrit : > On 23.01.24 11:34, Ryan Roberts wrote: >> On 22/01/2024 19:41, David Hildenbrand wrote: >>> We want to make use of pte_next_pfn() outside of set_ptes(). Let's >>> simpliy define PFN_PTE_SHIFT, required by pte_next_pfn(). >>> >>> Signed-off-by:

Re: [PING PATCH] powerpc/kasan: Fix addr error caused by page alignment

2024-01-22 Thread Christophe Leroy
Le 23/01/2024 à 02:45, Jiangfeng Xiao a écrit : > [Vous ne recevez pas souvent de courriers de xiaojiangf...@huawei.com. > Découvrez pourquoi ceci est important à > https://aka.ms/LearnAboutSenderIdentification ] > > In kasan_init_region, when k_start is not page aligned, > at the begin of

Re: [PATCH] powerpc/6xx: set High BAT Enable flag on G2 cores

2024-01-19 Thread Christophe Leroy
Le 19/01/2024 à 14:41, Matthias Schiffer a écrit : >> >> Thinking about it once more, can we do even more simple ? >> >> Why do we need that __setup_cpu_g2() at all ? >> >> You could just add the following into __set_cpu_603() >> >> diff --git a/arch/powerpc/kernel/cpu_setup_6xx.S >>

Re: [PATCH v2 06/13] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing

2024-01-15 Thread Christophe Leroy
Le 15/01/2024 à 19:37, Jason Gunthorpe a écrit : > On Wed, Jan 03, 2024 at 05:14:16PM +0800, pet...@redhat.com wrote: >> From: Peter Xu >> >> Hugepd format for GUP is only used in PowerPC with hugetlbfs. There are >> some kernel usage of hugepd (can refer to hugepd_populate_kernel() for >>

<    1   2   3   4   5   6   7   8   9   10   >