Re: [PATCH v2 07/14] mm: khugepaged: collapse_pte_mapped_thp() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
On 2024/9/5 14:32, Muchun Song wrote: On Aug 30, 2024, at 14:54, Qi Zheng wrote: On 2024/8/29 16:10, Muchun Song wrote: On 2024/8/22 15:13, Qi Zheng wrote: In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after acquring the ptl, so convert it to using pte_offset_map_r

Re: [PATCH v2 07/14] mm: khugepaged: collapse_pte_mapped_thp() use pte_offset_map_rw_nolock()

2024-09-04 Thread Muchun Song
> On Aug 30, 2024, at 14:54, Qi Zheng wrote: > > > > On 2024/8/29 16:10, Muchun Song wrote: >> On 2024/8/22 15:13, Qi Zheng wrote: >>> In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after >>> acquring the ptl, so convert it to using pte_offset_map_rw_nolock(). At >>> this

Re: [PATCH] kexec/crash: no crash update when kexec in progress

2024-09-04 Thread Baoquan He
On 09/04/24 at 02:55pm, Sourabh Jain wrote: > Hello Baoquan, > > On 30/08/24 16:47, Baoquan He wrote: > > On 08/20/24 at 12:10pm, Sourabh Jain wrote: > > > Hello Baoquan, > > > ..snip... > > > 2. A patch to return early from the `crash_handle_hotplug_event()` > > > function > > > if `kexec_

[PATCH 4/5] perf/powerpc: Count dropped samples in core-book3s PMU

2024-09-04 Thread Namhyung Kim
Due to the hardware limitation, sometimes it could sample kernel address while attr.exclude_kernel is set. In that case it silently drops the sample. Let's count that case in the new dropped_samples counter. Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Naveen N Rao Cc: K

[PATCH v2] mm: z3fold: deprecate CONFIG_Z3FOLD

2024-09-04 Thread Yosry Ahmed
The z3fold compressed pages allocator is rarely used, most users use zsmalloc. The only disadvantage of zsmalloc in comparison is the dependency on MMU, and zbud is a more common option for !MMU as it was the default zswap allocator for a long time. Historically, zsmalloc had worse latency than zb

Re: [PATCH 2/2] mm: make copy_to_kernel_nofault() not fault on user addresses

2024-09-04 Thread Omar Sandoval
On Wed, Sep 04, 2024 at 09:50:56AM +0200, Christophe Leroy wrote: > Hi, > > Le 02/09/2024 à 07:31, Omar Sandoval a écrit : > > [Vous ne recevez pas souvent de courriers de osan...@osandov.com. Découvrez > > pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification > > ] > > >

[PATCH 5/5] perf: Correct perf sampling with guest VMs

2024-09-04 Thread Colton Lewis
Previously any PMU overflow interrupt that fired while a VCPU was loaded was recorded as a guest event whether it truly was or not. This resulted in nonsense perf recordings that did not honor perf_event_attr.exclude_guest and recorded guest IPs where it should have recorded host IPs. Reorganize t

[PATCH 3/5] powerpc: perf: Use perf_arch_instruction_pointer()

2024-09-04 Thread Colton Lewis
Make sure powerpc uses the arch-specific function now that those have been reorganized. Signed-off-by: Colton Lewis --- arch/powerpc/perf/callchain.c| 2 +- arch/powerpc/perf/callchain_32.c | 2 +- arch/powerpc/perf/callchain_64.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) dif

[PATCH 4/5] x86: perf: Refactor misc flag assignments

2024-09-04 Thread Colton Lewis
Break the assignment logic for misc flags into their own respective functions to reduce the complexity of the nested logic. Signed-off-by: Colton Lewis --- arch/x86/events/core.c| 31 +++ arch/x86/include/asm/perf_event.h | 2 ++ 2 files changed, 25 inser

[PATCH 2/5] perf: Hoist perf_instruction_pointer() and perf_misc_flags()

2024-09-04 Thread Colton Lewis
For clarity, rename the arch-specific definitions of these functions to perf_arch_* to denote they are arch-specifc. Define the generic-named functions in one place where they can call the arch-specific ones as needed. Signed-off-by: Colton Lewis --- arch/arm64/include/asm/perf_event.h

[PATCH 0/5] Correct perf sampling with guest VMs

2024-09-04 Thread Colton Lewis
This series cleans up perf recording around guest events and improves the accuracy of the resulting perf reports. Perf was incorrectly counting any PMU overflow interrupt that occured while a VCPU was loaded as a guest event even when the events were not truely guest events. This lead to much less

[PATCH 1/5] arm: perf: Drop unused functions

2024-09-04 Thread Colton Lewis
perf_instruction_pointer() and perf_misc_flags() aren't used anywhere in this particular perf implementation. Drop them. Signed-off-by: Colton Lewis --- arch/arm/include/asm/perf_event.h | 7 --- arch/arm/kernel/perf_callchain.c | 17 - 2 files changed, 24 deletions(-) dif

Re: [PATCH 3/3] mm: Care about shadow stack guard gap when getting an unmapped area

2024-09-04 Thread Deepak Gupta
On Tue, Sep 03, 2024 at 08:57:20PM +0100, Mark Brown wrote: On Tue, Sep 03, 2024 at 03:41:49PM -0400, Liam R. Howlett wrote: * Mark Brown [240902 15:09]: > +static inline unsigned long stack_guard_placement(vm_flags_t vm_flags) > +{ > + if (vm_flags & VM_SHADOW_STACK) > + return PA

Re: [PATCH 2/3] mm: Pass vm_flags to generic_get_unmapped_area()

2024-09-04 Thread Deepak Gupta
On Mon, Sep 02, 2024 at 08:08:14PM +0100, Mark Brown wrote: In preparation for using vm_flags to ensure guard pages for shadow stacks supply them as an argument to generic_get_unmapped_area(). The only user outside of the core code is the PowerPC book3s64 implementation which is trivially wrappin

Re: [PATCH 3/3] mm: Care about shadow stack guard gap when getting an unmapped area

2024-09-04 Thread Deepak Gupta
On Mon, Sep 02, 2024 at 08:08:15PM +0100, Mark Brown wrote: As covered in the commit log for c44357c2e76b ("x86/mm: care about shadow stack guard gap during placement") our current mmap() implementation does not take care to ensure that a new mapping isn't placed with existing mappings inside it'

Re: [PATCH v2] bus: fsl-mc: constify the struct device_type usage

2024-09-04 Thread Ricardo B. Marliere
On 4 Sep 24 11:17, Ricardo B. Marliere wrote: > Since commit aed65af1cc2f ("drivers: make device_type const"), the driver > core can properly handle constant struct device_type. Move all the > device_type variables used in the bus to be constant structures as well, > placing it into read-only memo

[PATCH v2] bus: fsl-mc: constify the struct device_type usage

2024-09-04 Thread Ricardo B. Marliere
ruct device_type fsl_mc_bus_dpseci_type; +extern const struct device_type fsl_mc_bus_dpdmux_type; +extern const struct device_type fsl_mc_bus_dpdcei_type; +extern const struct device_type fsl_mc_bus_dpaiop_type; +extern const struct device_type fsl_mc_bus_dpci_type; +extern const struct device_

Re: Profiling of vdso_test_random

2024-09-04 Thread Adhemerval Zanella Netto
On 04/09/24 08:41, Christophe Leroy wrote: > Hi, > > I'm done a 'perf record' on vdso_test_random reduced to vdso test only, and I > get the following function usage profile. > > Do you see the same type of percentage on your platforms ? > > I would have expected most of the time to be spent

[PATCH 00/15] timers: Cleanup delay/sleep related mess

2024-09-04 Thread Anna-Maria Behnsen
Hi, a question about which sleeping function should be used in acpi_os_sleep() started a discussion and examination about the existing documentation and implementation of functions which insert a sleep/delay. The result of the discussion was, that the documentation is outdated and the implemented

[PATCH 13/15] powerpc/rtas: Use fsleep() to minimize additional sleep duration

2024-09-04 Thread Anna-Maria Behnsen
When commit 38f7b7067dae ("powerpc/rtas: rtas_busy_delay() improvements") was introduced, documentation about proper usage of sleep realted functions was outdated. The commit message references the usage of a HZ=100 system. When using a 20ms sleep duration on such a system and therefore using msle

Re: [RFC v1 10/10] book3s64/hash: Disable kfence if not early init

2024-09-04 Thread IBM
Christophe Leroy writes: > Le 31/07/2024 à 09:56, Ritesh Harjani (IBM) a écrit : >> [Vous ne recevez pas souvent de courriers de ritesh.l...@gmail.com. >> Découvrez pourquoi ceci est important à >> https://aka.ms/LearnAboutSenderIdentification ] >> >> Enable kfence on book3s64 hash only when e

Re: [RFC v1 09/10] book3s64/radix: Refactoring common kfence related functions

2024-09-04 Thread IBM
Christophe Leroy writes: > Le 31/07/2024 à 09:56, Ritesh Harjani (IBM) a écrit : >> [Vous ne recevez pas souvent de courriers de ritesh.l...@gmail.com. >> Découvrez pourquoi ceci est important à >> https://aka.ms/LearnAboutSenderIdentification ] >> >> Both radix and hash on book3s requires to

Re: [RFC v1 01/10] book3s64/hash: Remove kfence support temporarily

2024-09-04 Thread IBM
Sorry for the delayed response. Was pulled into something else. Christophe Leroy writes: > Le 31/07/2024 à 09:56, Ritesh Harjani (IBM) a écrit : >> [Vous ne recevez pas souvent de courriers de ritesh.l...@gmail.com. >> Découvrez pourquoi ceci est important à >> https://aka.ms/LearnAboutSende

[PATCH net-next v3 4/8] net: ethernet: fs_enet: only protect the .restart() call in .adjust_link

2024-09-04 Thread Maxime Chevallier
When .adjust_link() gets called, it runs in thread context, with the phydev->lock held. We only need to protect the fep->fecp/fccp/sccp register that are accessed within the .restart() function from concurrent access from the interrupts. These registers are being protected by the fep->lock spinloc

[PATCH net-next v3 6/8] net: ethernet: fs_enet: use macros for speed and duplex values

2024-09-04 Thread Maxime Chevallier
The PHY speed and duplex should be manipulated using the SPEED_XXX and DUPLEX_XXX macros available. Use it in the fcc, fec and scc MAC for fs_enet. Acked-by: Christophe Leroy Reviewed-by: Christophe Leroy Reviewed-by: Andrew Lunn Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/frees

[PATCH net-next v3 1/8] net: ethernet: fs_enet: convert to SPDX

2024-09-04 Thread Maxime Chevallier
The ENET driver has SPDX tags in the header files, but they were missing in the C files. Change the licence information to SPDX format. Acked-by: Christophe Leroy Reviewed-by: Christophe Leroy Reviewed-by: Andrew Lunn Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/freescale/fs_enet

[PATCH net-next v3 7/8] net: ethernet: fs_enet: simplify clock handling with devm accessors

2024-09-04 Thread Maxime Chevallier
devm_clock_get_enabled() can be used to simplify clock handling for the PER register clock. Reviewed-by: Andrew Lunn Signed-off-by: Maxime Chevallier --- .../ethernet/freescale/fs_enet/fs_enet-main.c| 16 drivers/net/ethernet/freescale/fs_enet/fs_enet.h | 2 -- 2 files cha

[PATCH net-next v3 8/8] net: ethernet: fs_enet: phylink conversion

2024-09-04 Thread Maxime Chevallier
fs_enet is a quite old but still used Ethernet driver found on some NXP devices. It has support for 10/100 Mbps ethernet, with half and full duplex. Some variants of it can use RMII, while other integrations are MII-only. Add phylink support, thus removing custom fixed-link hanldling. This also a

[PATCH net-next v3 5/8] net: ethernet: fs_enet: drop unused phy_info and mii_if_info

2024-09-04 Thread Maxime Chevallier
There's no user of the struct phy_info, the 'phy' field and the mii_if_info in the fs_enet driver, probably dating back when phylib wasn't as widely used. Drop these from the driver code. As the definition for struct mii_if_info is no longer required, drop the include for linux/mii.h altogether i

[PATCH net-next v3 2/8] net: ethernet: fs_enet: cosmetic cleanups

2024-09-04 Thread Maxime Chevallier
Due to the age of the driver and the slow recent activity on it, the code has taken some layers of dust. Clean the main driver file up so that it passes checkpatch and also conforms with the net coding style. Changes include : - Re-ordering of the variable declarations for RCT - Fixing the comme

[PATCH net-next v3 3/8] net: ethernet: fs_enet: drop the .adjust_link custom fs_ops

2024-09-04 Thread Maxime Chevallier
There's no in-tree user for the fs_ops .adjust_link() function, so we can always use the generic one in fe_enet-main. Acked-by: Christophe Leroy Reviewed-by: Christophe Leroy Reviewed-by: Andrew Lunn Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c |

[PATCH net-next v3 0/8] net: ethernet: fs_enet: Cleanup and phylink conversion

2024-09-04 Thread Maxime Chevallier
Hi everyone, This is V3 of a series that cleans-up fs_enet, with the ultimate goal of converting it to phylink (patch 8). The main changes compared to V2 are : - Reviewed-by tags from Andrew were gathered - Patch 5 now includes the removal of now unused includes, thanks Andrew for spotting t

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Marc Zyngier
On Wed, 04 Sep 2024 17:17:58 +0100, Will Deacon wrote: > > On Wed, Sep 04, 2024 at 01:55:03PM +0100, Joey Gouly wrote: > > On Wed, Sep 04, 2024 at 12:43:02PM +0100, Will Deacon wrote: > > > Right, there's quite a lot I need to do: > > > > > > - Uncorrupt your patches > > > - Fix the conflict in

[PATCH v2 2/3] mm: Pass vm_flags to generic_get_unmapped_area()

2024-09-04 Thread Mark Brown
In preparation for using vm_flags to ensure guard pages for shadow stacks supply them as an argument to generic_get_unmapped_area(). The only user outside of the core code is the PowerPC book3s64 implementation which is trivially wrapping the generic implementation in the radix_enabled() case. No

[PATCH v2 3/3] mm: Care about shadow stack guard gap when getting an unmapped area

2024-09-04 Thread Mark Brown
As covered in the commit log for c44357c2e76b ("x86/mm: care about shadow stack guard gap during placement") our current mmap() implementation does not take care to ensure that a new mapping isn't placed with existing mappings inside it's own guard gaps. This is particularly important for shadow st

[PATCH v2 0/3] mm: Care about shadow stack guard gap when getting an unmapped area

2024-09-04 Thread Mark Brown
As covered in the commit log for c44357c2e76b ("x86/mm: care about shadow stack guard gap during placement") our current mmap() implementation does not take care to ensure that a new mapping isn't placed with existing mappings inside it's own guard gaps. This is particularly important for shadow st

[PATCH v2 1/3] mm: Make arch_get_unmapped_area() take vm_flags by default

2024-09-04 Thread Mark Brown
When we introduced arch_get_unmapped_area_vmflags() in 961148704acd ("mm: introduce arch_get_unmapped_area_vmflags()") we did so as part of properly supporting guard pages for shadow stacks on x86_64, which uses a custom arch_get_unmapped_area(). Equivalent features are also present on both arm64 a

Re: Profiling of vdso_test_random

2024-09-04 Thread Jason A. Donenfeld
On Wed, Sep 4, 2024 at 1:41 PM Christophe Leroy wrote: > > Hi, > > I'm done a 'perf record' on vdso_test_random reduced to vdso test only, > and I get the following function usage profile. > > Do you see the same type of percentage on your platforms ? > > I would have expected most of the time to

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Will Deacon
On Wed, Sep 04, 2024 at 01:55:03PM +0100, Joey Gouly wrote: > On Wed, Sep 04, 2024 at 12:43:02PM +0100, Will Deacon wrote: > > Right, there's quite a lot I need to do: > > > > - Uncorrupt your patches > > - Fix the conflict in the kvm selftests > > - Drop the unnecessary ISBs > > - Fix the ESR che

Re: [PATCH net-next v2 3/7] net: ethernet: fs_enet: drop the .adjust_link custom fs_ops

2024-09-04 Thread Maxime Chevallier
On Wed, 4 Sep 2024 14:36:58 +0200 Andrew Lunn wrote: > On Wed, Sep 04, 2024 at 10:27:11AM +0200, Maxime Chevallier wrote: > > Hi Andrew, > > > > On Fri, 30 Aug 2024 23:06:08 +0200 > > Andrew Lunn wrote: > > > > > > --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c > > > > +++ b/dri

Re: [PATCH 00/15] timers: Cleanup delay/sleep related mess

2024-09-04 Thread Rafael J. Wysocki
On Wed, Sep 4, 2024 at 3:05 PM Anna-Maria Behnsen wrote: > > Hi, > > a question about which sleeping function should be used in acpi_os_sleep() > started a discussion and examination about the existing documentation and > implementation of functions which insert a sleep/delay. > > The result of th

Re: [PATCH v5 0/5] Wire up getrandom() vDSO implementation on powerpc

2024-09-04 Thread Christophe Leroy
Le 04/09/2024 à 16:16, Jason A. Donenfeld a écrit : Hi Christophe, Michael, On Mon, Sep 02, 2024 at 09:17:17PM +0200, Christophe Leroy wrote: This series wires up getrandom() vDSO implementation on powerpc. Tested on PPC32 on real hardware. Tested on PPC64 (both BE and LE) on QEMU: Perform

Re: [PATCH v5 0/5] Wire up getrandom() vDSO implementation on powerpc

2024-09-04 Thread Jason A. Donenfeld
Hi Christophe, Michael, On Mon, Sep 02, 2024 at 09:17:17PM +0200, Christophe Leroy wrote: > This series wires up getrandom() vDSO implementation on powerpc. > > Tested on PPC32 on real hardware. > Tested on PPC64 (both BE and LE) on QEMU: > > Performance on powerpc 885: > ~# ./vdso_test_ge

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Joey Gouly
On Wed, Sep 04, 2024 at 12:43:02PM +0100, Will Deacon wrote: > On Wed, Sep 04, 2024 at 12:32:21PM +0100, Joey Gouly wrote: > > On Wed, Sep 04, 2024 at 11:22:54AM +0100, Will Deacon wrote: > > > On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > > > > On Mon, Sep 02, 2024 at 08:08:08PM +0

Re: [PATCH net-next v2 3/7] net: ethernet: fs_enet: drop the .adjust_link custom fs_ops

2024-09-04 Thread Andrew Lunn
On Wed, Sep 04, 2024 at 10:27:11AM +0200, Maxime Chevallier wrote: > Hi Andrew, > > On Fri, 30 Aug 2024 23:06:08 +0200 > Andrew Lunn wrote: > > > > --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c > > > +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c > > > @@ -649,12 +649,

Re: [PATCH v5 5/5] powerpc/vdso: Wire up getrandom() vDSO implementation on VDSO64

2024-09-04 Thread Madhavan Srinivasan
On 9/3/24 12:47 AM, Christophe Leroy wrote: Extend getrandom() vDSO implementation to VDSO64 Tested on QEMU on both ppc64_defconfig and ppc64le_defconfig. The results are not precise as it is QEMU on an x86 laptop, but no need to be precise to see the benefit. ~ # ./vdso_test_getrandom bench

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Will Deacon
On Wed, Sep 04, 2024 at 12:32:21PM +0100, Joey Gouly wrote: > On Wed, Sep 04, 2024 at 11:22:54AM +0100, Will Deacon wrote: > > On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > > > On Mon, Sep 02, 2024 at 08:08:08PM +0100, Catalin Marinas wrote: > > > > On Tue, Aug 27, 2024 at 12:38:04P

Profiling of vdso_test_random

2024-09-04 Thread Christophe Leroy
Hi, I'm done a 'perf record' on vdso_test_random reduced to vdso test only, and I get the following function usage profile. Do you see the same type of percentage on your platforms ? I would have expected most of the time to be spent in __arch_chacha20_blocks_nostack() but that's in fact not

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Catalin Marinas
On Wed, Sep 04, 2024 at 11:22:54AM +0100, Will Deacon wrote: > On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > > commit 3141fb86bee8d48ae47cab1594dad54f974a8899 > > Author: Joey Gouly > > Date: Tue Sep 3 15:47:26 2024 +0100 > > > > fixup! arm64: context switch POR_EL0 register

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Joey Gouly
On Wed, Sep 04, 2024 at 11:22:54AM +0100, Will Deacon wrote: > On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > > On Mon, Sep 02, 2024 at 08:08:08PM +0100, Catalin Marinas wrote: > > > On Tue, Aug 27, 2024 at 12:38:04PM +0100, Will Deacon wrote: > > > > On Fri, Aug 23, 2024 at 07:40:52

Re: [PATCH] soc: fsl: cpm1: qmc: Fix dependency on fsl_soc.h

2024-09-04 Thread Herve Codina
Hi Christophe, On Wed, 4 Sep 2024 09:51:09 +0200 Christophe Leroy wrote: > QMC driver requires fsl_soc.h to use function get_immrbase(). > This header is provided by powerpc architecture and the functions > it declares are defined only when FSL_SOC is selected. > > Today the dependency is the

Re: [kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds

2024-09-04 Thread Thomas Huth
On 04/09/2024 12.50, Andrew Jones wrote: clang complains about GNU extensions such as variable sized types not being at the end of structs unless -Wno-gnu is used. We may eventually want -Wno-gnu, but for now let's just handle the warnings as they come. Add -Wno-gnu-variable-sized-type-not-at-end

[kvm-unit-tests PATCH v2 4/4] riscv: gitlab-ci: Add clang build tests

2024-09-04 Thread Andrew Jones
Test building 32 and 64-bit with clang. Throw a test of in- and out- of-tree building in too by swapping which is done to which (32-bit vs. 64-bit) with respect to the gcc build tests. Acked-by: Thomas Huth Signed-off-by: Andrew Jones --- .gitlab-ci.yml | 43

[kvm-unit-tests PATCH v2 3/4] configure: Support cross compiling with clang

2024-09-04 Thread Andrew Jones
When a user specifies the compiler with --cc assume it's already fully named, even if the user also specifies a cross-prefix. This allows clang to be selected for the compiler, which doesn't use prefixes, but also still provide a cross prefix for binutils. If a user needs a prefix on the compiler t

[kvm-unit-tests PATCH v2 2/4] Makefile: Prepare for clang EFI builds

2024-09-04 Thread Andrew Jones
clang complains about GNU extensions such as variable sized types not being at the end of structs unless -Wno-gnu is used. We may eventually want -Wno-gnu, but for now let's just handle the warnings as they come. Add -Wno-gnu-variable-sized-type-not-at-end to avoid the warning issued for the initrd

[kvm-unit-tests PATCH v2 1/4] riscv: Drop mstrict-align

2024-09-04 Thread Andrew Jones
The spec says unaligned accesses are supported, so this isn't required and clang doesn't support it. A platform might have slow unaligned accesses, but kvm-unit-tests isn't about speed anyway. Reviewed-by: Thomas Huth Signed-off-by: Andrew Jones --- riscv/Makefile | 2 +- 1 file changed, 1 inse

[kvm-unit-tests PATCH v2 0/4] Support cross compiling with clang

2024-09-04 Thread Andrew Jones
Modify configure to allow --cc=clang and a cross-prefix to be specified together (as well as --cflags). This allows compiling with clang, but using cross binutils for everything else, including the linker. So far tested on riscv 32- and 64-bit and aarch64 (with some hacks to the code to get it to c

Re: [PATCH net-next v2 7/7] net: ethernet: fs_enet: phylink conversion

2024-09-04 Thread Maxime Chevallier
Hi Jakub, On Mon, 2 Sep 2024 18:55:43 -0700 Jakub Kicinski wrote: > On Thu, 29 Aug 2024 18:15:30 +0200 Maxime Chevallier wrote: > > @@ -582,15 +591,12 @@ static void fs_timeout_work(struct work_struct *work) > > > > dev->stats.tx_errors++; > > > > - spin_lock_irqsave(&fep->lock, flags)

Re: [kvm-unit-tests PATCH 0/3] Support cross compiling with clang

2024-09-04 Thread Andrew Jones
On Tue, Sep 03, 2024 at 06:30:47PM GMT, Andrew Jones wrote: > Modify configure to allow --cc=clang and a cross-prefix to be specified > together (as well as --cflags). This allows compiling with clang, but > using cross binutils for everything else, including the linker. So far > tested on riscv 32

Re: [PATCH v5 06/30] arm64: context switch POR_EL0 register

2024-09-04 Thread Will Deacon
On Tue, Sep 03, 2024 at 03:54:13PM +0100, Joey Gouly wrote: > On Mon, Sep 02, 2024 at 08:08:08PM +0100, Catalin Marinas wrote: > > On Tue, Aug 27, 2024 at 12:38:04PM +0100, Will Deacon wrote: > > > On Fri, Aug 23, 2024 at 07:40:52PM +0100, Catalin Marinas wrote: > > > > On Fri, Aug 23, 2024 at 06:0

Re: [PATCH] kexec/crash: no crash update when kexec in progress

2024-09-04 Thread Sourabh Jain
Hello Baoquan, On 30/08/24 16:47, Baoquan He wrote: On 08/20/24 at 12:10pm, Sourabh Jain wrote: Hello Baoquan, On 19/08/24 11:45, Baoquan He wrote: On 08/19/24 at 09:45am, Sourabh Jain wrote: Hello Michael and Boaquan On 01/08/24 12:21, Sourabh Jain wrote: Hello Michael, On 01/08/24 08:04

Re: [PATCH v2] powerpc/pseries/eeh: Fix pseries_eeh_err_inject

2024-09-04 Thread Mahesh J Salgaonkar
On 2024-08-23 10:11:58 Fri, Narayana Murty N wrote: > VFIO_EEH_PE_INJECT_ERR ioctl is currently failing on pseries > due to missing implementation of err_inject eeh_ops for pseries. > This patch implements pseries_eeh_err_inject in eeh_ops/pseries > eeh_ops. Implements support for injecting MMIO lo

Re: [PATCH net-next v2 4/7] net: ethernet: fs_enet: drop unused phy_info and mii_if_info

2024-09-04 Thread Maxime Chevallier
Hi Andrew, On Fri, 30 Aug 2024 23:07:56 +0200 Andrew Lunn wrote: > On Thu, Aug 29, 2024 at 06:15:27PM +0200, Maxime Chevallier wrote: > > There's no user of the struct phy_info, the 'phy' field and the > > mii_if_info in the fs_enet driver, probably dating back when phylib > > wasn't as widely u

[PATCH v3 14/14] mm: khugepaged: retract_page_tables() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In retract_page_tables(), we may modify the pmd entry after acquiring the pml and ptl, so we should also check whether the pmd entry is stable. Using pte_offset_map_rw_nolock() + pmd_same() to do it. Signed-off-by: Qi Zheng --- mm/khugepaged.c | 17 - 1 file changed, 16 insertion

[PATCH v3 13/14] mm: pgtable: remove pte_offset_map_nolock()

2024-09-04 Thread Qi Zheng
Now no users are using the pte_offset_map_nolock(), remove it. Signed-off-by: Qi Zheng --- Documentation/mm/split_page_table_lock.rst | 3 --- include/linux/mm.h | 2 -- mm/pgtable-generic.c | 21 - 3 files changed, 26 deletions

[PATCH v3 12/14] mm: multi-gen LRU: walk_pte_range() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In walk_pte_range(), we may modify the pte entry after holding the ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the ptl held, so we should get pmdval and do pmd_same() check to ensure the stability of pmd entry. Signed-off-by: Qi

[PATCH v3 11/14] mm: userfaultfd: move_pages_pte() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In move_pages_pte(), we may modify the dst_pte and src_pte after acquiring the ptl, so convert it to using pte_offset_map_rw_nolock(). But since we already do the pte_same() check, there is no need to get pmdval to do pmd_same() check, just pass a dummy variable to it. Signed-off-by: Qi Zheng ---

[PATCH v3 10/14] mm: page_vma_mapped_walk: map_pte() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In the caller of map_pte(), we may modify the pvmw->pte after acquiring the pvmw->ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the pvmw->ptl held, so we should get pmdval and do pmd_same() check to ensure the stability of pvmw->pm

[PATCH v3 08/14] mm: copy_pte_range() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In copy_pte_range(), we may modify the src_pte entry after holding the src_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE page in retract_page_tables() without holding the read lock of mmap_lock, so we still need to get pmdval and do pmd_same() check after the ptl

[PATCH v3 09/14] mm: mremap: move_ptes() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In move_ptes(), we may modify the new_pte after acquiring the new_ptl, so convert it to using pte_offset_map_rw_nolock(). Since we may free the PTE page in retract_page_tables() without holding the read lock of mmap_lock, so we still need to do a pmd_same() check after holding the PTL. Signed-off-

[PATCH v3 07/14] mm: khugepaged: collapse_pte_mapped_thp() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In collapse_pte_mapped_thp(), we may modify the pte and pmd entry after acquring the ptl, so convert it to using pte_offset_map_rw_nolock(). At this time, the pte_same() check is not performed after the PTL held. So we should get pgt_pmd and do pmd_same() check after the ptl held. For the case whe

[PATCH v3 06/14] mm: handle_pte_fault() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In handle_pte_fault(), we may modify the vmf->pte after acquiring the vmf->ptl, so convert it to using pte_offset_map_rw_nolock(). But since we will do the pte_same() check, so there is no need to get pmdval to do pmd_same() check, just pass a dummy variable to it. Signed-off-by: Qi Zheng Acked-b

[PATCH v3 05/14] mm: khugepaged: __collapse_huge_page_swapin() use pte_offset_map_ro_nolock()

2024-09-04 Thread Qi Zheng
In __collapse_huge_page_swapin(), we just use the ptl for pte_same() check in do_swap_page(). In other places, we directly use pte_offset_map_lock(), so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- mm/khugepage

[PATCH v3 04/14] mm: filemap: filemap_fault_recheck_pte_none() use pte_offset_map_ro_nolock()

2024-09-04 Thread Qi Zheng
In filemap_fault_recheck_pte_none(), we just do pte_none() check, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- mm/filemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/filemap.

[PATCH v3 03/14] powerpc: assert_pte_locked() use pte_offset_map_ro_nolock()

2024-09-04 Thread Qi Zheng
In assert_pte_locked(), we just get the ptl and assert if it was already held, so convert it to using pte_offset_map_ro_nolock(). Signed-off-by: Qi Zheng Acked-by: David Hildenbrand Reviewed-by: Muchun Song --- arch/powerpc/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH v3 02/14] arm: adjust_pte() use pte_offset_map_rw_nolock()

2024-09-04 Thread Qi Zheng
In do_adjust_pte(), we may modify the pte entry. The corresponding pmd entry may have been modified concurrently. Therefore, in order to ensure the stability if pmd entry, use pte_offset_map_rw_nolock() to replace pte_offset_map_nolock(), and do pmd_same() check after holding the PTL. Signed-off-b

[PATCH v3 01/14] mm: pgtable: introduce pte_offset_map_{ro|rw}_nolock()

2024-09-04 Thread Qi Zheng
Currently, the usage of pte_offset_map_nolock() can be divided into the following two cases: 1) After acquiring PTL, only read-only operations are performed on the PTE page. In this case, the RCU lock in pte_offset_map_nolock() will ensure that the PTE page will not be freed, and there is no

[PATCH v3 00/14] introduce pte_offset_map_{ro|rw}_nolock()

2024-09-04 Thread Qi Zheng
the next-20240904 Changes in v2: - rename pte_offset_map_{readonly|maywrite}_nolock() to pte_offset_map_{ro|rw}_nolock() (LEROY Christophe) - make pte_offset_map_rw_nolock() not accept NULL parameters (David Hildenbrand) - rebase onto the next-20240822 Hi all, As proposed by David

Re: [PATCH net-next v2 3/7] net: ethernet: fs_enet: drop the .adjust_link custom fs_ops

2024-09-04 Thread Maxime Chevallier
Hi Andrew, On Fri, 30 Aug 2024 23:06:08 +0200 Andrew Lunn wrote: > > --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c > > +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c > > @@ -649,12 +649,7 @@ static void fs_adjust_link(struct net_device *dev) > > unsigned long flags

[PATCH] soc: fsl: cpm1: qmc: Fix dependency on fsl_soc.h

2024-09-04 Thread Christophe Leroy
QMC driver requires fsl_soc.h to use function get_immrbase(). This header is provided by powerpc architecture and the functions it declares are defined only when FSL_SOC is selected. Today the dependency is the following: depends on CPM1 || QUICC_ENGINE || \ (FSL_SOC &&

Re: [PATCH 2/2] mm: make copy_to_kernel_nofault() not fault on user addresses

2024-09-04 Thread Christophe Leroy
Hi, Le 02/09/2024 à 07:31, Omar Sandoval a écrit : [Vous ne recevez pas souvent de courriers de osan...@osandov.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] From: Omar Sandoval I found that on x86, copy_to_kernel_nofault() still faults on addre

Re: [PATCH v1 1/2] powerpc/mmiotrace: Add MMIO Tracing tool for PowerPC

2024-09-04 Thread 虞陆铭
Hi, the patch set and mmio trace capability helped us to track down to the root cause of a mysterious EEH only on powernv platform triggered by a testpmd dpdk user mode driver (UIO) by comparing the mmio trace from UIO and native kernel driver from the same nic. And the problem is solved by s

[PATCH 1/7] tracing: add ftrace_regs to function_graph_enter()

2024-09-04 Thread Sven Schnelle
Will be used later for showing function arguments in the function graph tracer. Signed-off-by: Sven Schnelle --- arch/arm/kernel/ftrace.c | 2 +- arch/arm64/kernel/ftrace.c | 2 +- arch/csky/kernel/ftrace.c | 2 +- arch/loongarch/kernel/ftrace.c | 2 +- arch/loonga