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

2024-08-06 Thread Jinjie Ruan
From: Mahesh Salgaonkar [ Upstream commit 0db880fc865ffb522141ced4bfa66c12ab1fbb70 ] nmi_enter()/nmi_exit() touches per cpu variables which can lead to kernel crash when invoked during real mode interrupt handling (e.g. early HMI/MCE interrupt handler) if percpu allocation comes from vmalloc are

Re: [PATCH v12 54/84] KVM: arm64: Mark "struct page" pfns accessed/dirty before dropping mmu_lock

2024-08-06 Thread Fuad Tabba
Hi Oliver, On Tue, 6 Aug 2024 at 00:26, Oliver Upton wrote: > > [+cc Fuad] > > Fuad, you mentioned in commit 9c30fc615daa ("KVM: arm64: Move setting > the page as dirty out of the critical section") that restructuring > around the MMU lock was helpful for reuse (presumably for pKVM), but I > lack

Re: [PATCH v12 54/84] KVM: arm64: Mark "struct page" pfns accessed/dirty before dropping mmu_lock

2024-08-06 Thread Marc Zyngier
On Tue, 06 Aug 2024 00:26:54 +0100, Oliver Upton wrote: > > On Mon, Aug 05, 2024 at 11:26:03PM +, Oliver Upton wrote: > > [+cc Fuad] > > Take 2! > > > Fuad, you mentioned in commit 9c30fc615daa ("KVM: arm64: Move setting > > the page as dirty out of the critical section") that restructuring

[PATCH v5 2/4] arch_topology: Support SMT control for OF based system

2024-08-06 Thread Yicong Yang
From: Yicong Yang On building the topology from the devicetree, we've already gotten the SMT thread number of each core. Update the largest SMT thread number to enable the SMT control. Signed-off-by: Yicong Yang --- drivers/base/arch_topology.c | 13 + 1 file changed, 13 insertions

[PATCH v5 0/4] Support SMT control on arm64

2024-08-06 Thread Yicong Yang
From: Yicong Yang The core CPU control framework supports runtime SMT control which is not yet supported on arm64. Besides the general vulnerabilities concerns we want this runtime control on our arm64 server for: - better single CPU performance in some cases - saving overall power consumption

[PATCH v5 3/4] arm64: topology: Support SMT control on ACPI based system

2024-08-06 Thread Yicong Yang
From: Yicong Yang For ACPI we'll build the topology from PPTT and we cannot directly get the SMT number of each core. Instead using a temporary xarray to record the SMT number of each core when building the topology and we can know the largest SMT number in the system. Then we can enable the supp

[PATCH v5 1/4] cpu/SMT: Provide a default topology_is_primary_thread()

2024-08-06 Thread Yicong Yang
From: Yicong Yang Currently if architectures want to support HOTPLUG_SMT they need to provide a topology_is_primary_thread() telling the framework which thread in the SMT cannot offline. However arm64 doesn't have a restriction on which thread in the SMT cannot offline, a simplest choice is that

[PATCH v5 4/4] arm64: Kconfig: Enable HOTPLUG_SMT

2024-08-06 Thread Yicong Yang
From: Yicong Yang Enable HOTPLUG_SMT for SMT control. Signed-off-by: Yicong Yang --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a2f8ff354ca6..bd3bc2f5e0ec 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -238,

Re: [PATCH v4 04/29] arm64: disable trapping of POR_EL0 to EL2

2024-08-06 Thread Joey Gouly
On Thu, Jul 25, 2024 at 04:44:13PM +0100, Dave Martin wrote: > Hi, > > On Fri, May 03, 2024 at 02:01:22PM +0100, Joey Gouly wrote: > > Allow EL0 or EL1 to access POR_EL0 without being trapped to EL2. > > > > Signed-off-by: Joey Gouly > > Cc: Catalin Marinas > > Cc: Will Deacon > > Acked-by: Ca

Re: [PATCH v4 18/29] arm64: add POE signal support

2024-08-06 Thread Joey Gouly
On Thu, Aug 01, 2024 at 05:22:45PM +0100, Dave Martin wrote: > On Thu, Aug 01, 2024 at 04:54:41PM +0100, Joey Gouly wrote: > > On Thu, Jul 25, 2024 at 05:00:18PM +0100, Dave Martin wrote: > > > Hi, > > > > > > On Fri, May 03, 2024 at 02:01:36PM +0100, Joey Gouly wrote: > > > > Add PKEY support to

[RFC PATCH 1/6] ALSA: compress: add Sample Rate Converter codec support

2024-08-06 Thread Shengjiu Wang
Add Sample Rate Converter(SRC) codec support, define the output format and rate for SRC. Signed-off-by: Shengjiu Wang --- include/uapi/sound/compress_offload.h | 2 ++ include/uapi/sound/compress_params.h | 9 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/uapi

[RFC PATCH 0/6] ASoC: fsl: add memory to memory function for ASRC

2024-08-06 Thread Shengjiu Wang
This function is base on the accelerator implementation for compress API: https://patchwork.kernel.org/project/alsa-devel/patch/20240731083843.59911-1-pe...@perex.cz/ Audio signal processing also has the requirement for memory to memory similar as Video. This asrc memory to memory (memory ->asrc-

[RFC PATCH 2/6] ASoC: fsl_asrc: define functions for memory to memory usage

2024-08-06 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage. m2m_prepare: prepare for the start step m2m_start: the start step m2m_unprepare: unprepare for stop step, optional m2m_stop: stop step m2m_check_format: check format is supported or not m2m_calc_out_len: calculate o

[RFC PATCH 3/6] ASoC: fsl_easrc: define functions for memory to memory usage

2024-08-06 Thread Shengjiu Wang
ASRC can be used on memory to memory case, define several functions for m2m usage and export them as function pointer. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 226 ++ sound/soc/fsl/fsl_easrc.h | 4 + 2 files changed, 230 insertions(+) d

[RFC PATCH 4/6] ASoC: fsl_asrc_m2m: Add memory to memory function

2024-08-06 Thread Shengjiu Wang
Implement the ASRC memory to memory function using the compress framework, user can use this function with compress ioctl interface. This feature can be shared by ASRC and EASRC drivers Signed-off-by: Shengjiu Wang --- sound/soc/fsl/Kconfig | 1 + sound/soc/fsl/Makefile |

[RFC PATCH 5/6] ASoC: fsl_asrc: register m2m platform device

2024-08-06 Thread Shengjiu Wang
Register m2m platform device, that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.c | 37 + 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 01e3af5b1bea

[RFC PATCH 6/6] ASoC: fsl_easrc: register m2m platform device

2024-08-06 Thread Shengjiu Wang
Register m2m platform device,that user can use M2M feature. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_easrc.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 959a8e2dd716..

[PATCH -next] powerpc: Fix a config comment typo in asm/percpu.h

2024-08-06 Thread Jinjie Ruan
commit 0db880fc865f ("powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.") has a config comment typo, fix it. Signed-off-by: Jinjie Ruan --- arch/powerpc/include/asm/percpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/percpu.h b/arch/powe

Re: [RFC PATCH 1/6] ALSA: compress: add Sample Rate Converter codec support

2024-08-06 Thread Pierre-Louis Bossart
On 8/6/24 12:26, Shengjiu Wang wrote: > Add Sample Rate Converter(SRC) codec support, define the output > format and rate for SRC. > > Signed-off-by: Shengjiu Wang > --- > include/uapi/sound/compress_offload.h | 2 ++ > include/uapi/sound/compress_params.h | 9 - > 2 files changed, 1

Re: [RFC PATCH 1/6] ALSA: compress: add Sample Rate Converter codec support

2024-08-06 Thread Jeff Brower
All- "The sample rate converter is not an encoder ..." Indeed, an encoder creates a compressed bitstream from audio data (typically linear PCM samples), normally for transmission of some type. A sample rate converter generates audio data from audio data, and is normally applied prior to an

Re: [PATCH -next] powerpc: Fix a config comment typo in asm/percpu.h

2024-08-06 Thread Christophe Leroy
Le 06/08/2024 à 13:23, Jinjie Ruan a écrit : [Vous ne recevez pas souvent de courriers de ruanjin...@huawei.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ] commit 0db880fc865f ("powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.") has a con

Re: [PATCH -next] powerpc: Fix a config comment typo in asm/percpu.h

2024-08-06 Thread Jinjie Ruan
On 2024/8/6 20:50, Christophe Leroy wrote: > > > Le 06/08/2024 à 13:23, Jinjie Ruan a écrit : >> [Vous ne recevez pas souvent de courriers de ruanjin...@huawei.com. >> Découvrez pourquoi ceci est important à >> https://aka.ms/LearnAboutSenderIdentification ] >> >> commit 0db880fc865f ("powerpc

Re: [PATCH v3 2/8] mm/mprotect: Remove NUMA_HUGE_PTE_UPDATES

2024-08-06 Thread David Hildenbrand
Right. I don't have a reason to change numa_pte_updates semantics yet so far, but here there's the problem where numa_huge_pte_updates can be ambiguous when there is even PUD involved. In general, I don't know how I should treat this counter in PUD path even if NUMA isn't involved in dax yet; it

Re: [PATCH v3 02/26] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" sgi-ip27 is the only system that defines NODE_DATA() differently than the rest of NUMA machines. Add node_data array of struct pglist pointers that will point to __node_data[node]->pglist and redefine NODE_DATA() to use

Re: [PATCH v3 03/26] MIPS: sgi-ip27: ensure node_possible_map only contains valid nodes

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" For SGI IP27 machines node_possible_map is statically set to NODE_MASK_ALL and it is not updated during NUMA initialization. Ensure that it only contains nodes present in the system. Signed-off-by: Mike Rapoport (Micros

Re: [PATCH v3 04/26] MIPS: sgi-ip27: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to sgi-ip27 to silence a compilation error that happened because sgi-ip27 didn't define array of pg_data_t as no

Re: [PATCH v3 06/26] MIPS: loongson64: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to loongson64 to silence a compilation error that happened because loongson64 didn't define array of pg_data_t a

Re: [PATCH v3 10/26] x86/numa: simplify numa_distance allocation

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Allocation of numa_distance uses memblock_phys_alloc_range() to limit allocation to be below the last mapped page. But NUMA initializaition runs after the direct map is populated and there is also code in setup_arch() th

Re: [PATCH v3 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Instead of looping over numa_meminfo array to detect node's start and end addresses use get_pfn_range_for_init(). This is shorter and make it easier to lift numa_memblks to generic code. Signed-off-by: Mike Rapoport (Mi

Re: [PATCH v3 12/26] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" The definitions of FAKE_NODE_MIN_SIZE and FAKE_NODE_MIN_HASH_MASK are only used by numa emulation code, make them local to arch/x86/mm/numa_emulation.c Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Came

Re: [PATCH v3 13/26] x86/numa_emu: simplify allocation of phys_dist

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" By the time numa_emulation() is called, all physical memory is already mapped in the direct map and there is no need to define limits for memblock allocation. Replace memblock_phys_alloc_range() with memblock_alloc(). S

Re: [PATCH v3 14/26] x86/numa_emu: split __apicid_to_node update to a helper function

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent so that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Tested-by: Zi Y

Re: [PATCH v3 15/26] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent so that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Tested-by: Zi Y

Re: [PATCH v3 16/26] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" CPU id cannot be negative. Making it unsigned also aligns with declarations in include/asm-generic/numa.h used by arm64 and riscv and allows sharing numa emulation code with these architectures. Signed-off-by: Mike Rapo

Re: [PATCH v3 17/26] mm: introduce numa_memblks

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Move code dealing with numa_memblks from arch/x86 to mm/ and add Kconfig options to let x86 select it in its Kconfig. This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Mi

Re: [PATCH v3 18/26] mm: move numa_distance and related code from x86 to numa_memblks

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Move code dealing with numa_distance array from arch/x86 to mm/numa_memblks.c This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_6

Re: [PATCH v3 19/26] mm: introduce numa_emulation

2024-08-06 Thread David Hildenbrand
On 05.08.24 22:09, Dan Williams wrote: Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c s/codfrom/code from/ I am surprised that numa-emulation stayed x86 only for so long. I think it is useful facility for debugging NUMA sca

Re: [PATCH v3 19/26] mm: introduce numa_emulation

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c This code will be later reused by arch_numa. I'm confused why documentation lists for "numa=fake=" [KNL, ARM64, RISCV, X86, EARLY] -- Cheers, David / dhil

Re: [PATCH v3 20/26] mm: numa_memblks: introduce numa_memblks_init

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Move most of x86::numa_init() to numa_memblks so that the latter will be more self-contained. With this numa_memblk data structures should not be exposed to the architecture specific code. Signed-off-by: Mike Rapoport (

Re: [PATCH v3 21/26] mm: numa_memblks: make several functions and variables static

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Make functions and variables that are exclusively used by numa_memblks static. Move numa_nodemask_from_meminfo() before its callers to avoid forward declaration. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Y

Re: [PATCH v3 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" numa_cleanup_meminfo() moves blocks outside system RAM to numa_reserved_meminfo and it uses 0 and PFN_PHYS(max_pfn) to determine the memory boundaries. Replace the memory range boundaries with more portable memblock_star

Re: [PATCH v3 23/26] of, numa: return -EINVAL when no numa-node-id is found

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Currently of_numa_parse_memory_nodes() returns 0 if no "memory" node in device tree contains "numa-node-id" property. This makes of_numa_init() to return "success" despite no NUMA nodes were actually parsed and set up. a

Re: [PATCH v3 19/26] mm: introduce numa_emulation

2024-08-06 Thread David Hildenbrand
On 06.08.24 15:20, David Hildenbrand wrote: On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom arch/x86 to mm/numa_emulation.c This code will be later reused by arch_numa. I'm confused why documentation lists for "numa=fake=" [KNL, ARM64,

Re: [PATCH v3 26/26] docs: move numa=fake description to kernel-parameters.txt

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" NUMA emulation can be now enabled on arm64 and riscv in addition to x86. Move description of numa=fake parameters from x86 documentation of admin-guide/kernel-parameters.txt Suggested-by: Zi Yan Signed-off-by: Mike Rap

Re: [PATCH v3 25/26] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" The x86 implementation of range-to-target_node lookup (i.e. phys_to_target_node() and memory_add_physaddr_to_nid()) relies on numa_memblks. Since numa_memblks are now part of the generic code, move these functions from x

Re: [PATCH v3 24/26] arch_numa: switch over to numa_memblks

2024-08-06 Thread David Hildenbrand
On 01.08.24 08:08, Mike Rapoport wrote: From: "Mike Rapoport (Microsoft)" Until now arch_numa was directly translating firmware NUMA information to memblock. Using numa_memblks as an intermediate step has a few advantages: * alignment with more battle tested x86 implementation * availability o

Re: [PATCH v4 15/29] arm64: handle PKEY/POE faults

2024-08-06 Thread Dave Martin
Hi, On Thu, Aug 01, 2024 at 05:01:10PM +0100, Joey Gouly wrote: > On Thu, Jul 25, 2024 at 04:57:09PM +0100, Dave Martin wrote: > > On Fri, May 03, 2024 at 02:01:33PM +0100, Joey Gouly wrote: > > > If a memory fault occurs that is due to an overlay/pkey fault, report > > > that to > > > userspace

Re: [PATCH v4 15/29] arm64: handle PKEY/POE faults

2024-08-06 Thread Joey Gouly
On Tue, Aug 06, 2024 at 02:33:37PM +0100, Dave Martin wrote: > Hi, > > On Thu, Aug 01, 2024 at 05:01:10PM +0100, Joey Gouly wrote: > > On Thu, Jul 25, 2024 at 04:57:09PM +0100, Dave Martin wrote: > > > On Fri, May 03, 2024 at 02:01:33PM +0100, Joey Gouly wrote: > > > > If a memory fault occurs tha

Re: [PATCH v4 18/29] arm64: add POE signal support

2024-08-06 Thread Joey Gouly
On Tue, Aug 06, 2024 at 11:35:32AM +0100, Joey Gouly wrote: > On Thu, Aug 01, 2024 at 05:22:45PM +0100, Dave Martin wrote: > > On Thu, Aug 01, 2024 at 04:54:41PM +0100, Joey Gouly wrote: > > > On Thu, Jul 25, 2024 at 05:00:18PM +0100, Dave Martin wrote: > > > > Hi, > > > > > > > > On Fri, May 03,

Re: [PATCH v4 15/29] arm64: handle PKEY/POE faults

2024-08-06 Thread Dave Martin
Hi, On Tue, Aug 06, 2024 at 02:43:57PM +0100, Joey Gouly wrote: > On Tue, Aug 06, 2024 at 02:33:37PM +0100, Dave Martin wrote: > > Hi, > > > > On Thu, Aug 01, 2024 at 05:01:10PM +0100, Joey Gouly wrote: > > > On Thu, Jul 25, 2024 at 04:57:09PM +0100, Dave Martin wrote: > > > > On Fri, May 03, 202

Re: [PATCH v4 18/29] arm64: add POE signal support

2024-08-06 Thread Dave Martin
On Tue, Aug 06, 2024 at 03:31:03PM +0100, Joey Gouly wrote: > On Tue, Aug 06, 2024 at 11:35:32AM +0100, Joey Gouly wrote: > > On Thu, Aug 01, 2024 at 05:22:45PM +0100, Dave Martin wrote: > > > On Thu, Aug 01, 2024 at 04:54:41PM +0100, Joey Gouly wrote: > > > > On Thu, Jul 25, 2024 at 05:00:18PM +01

Re: [PATCH v12 56/84] KVM: RISC-V: Mark "struct page" pfns dirty iff a stage-2 PTE is installed

2024-08-06 Thread Anup Patel
On Sat, Jul 27, 2024 at 5:24 AM Sean Christopherson wrote: > > Don't mark pages dirty if KVM bails from the page fault handler without > installing a stage-2 mapping, i.e. if the page is guaranteed to not be > written by the guest. > > In addition to being a (very) minor fix, this paves the way fo

Re: [PATCH v12 57/84] KVM: RISC-V: Mark "struct page" pfns accessed before dropping mmu_lock

2024-08-06 Thread Anup Patel
On Sat, Jul 27, 2024 at 5:24 AM Sean Christopherson wrote: > > Mark pages accessed before dropping mmu_lock when faulting in guest memory > so that RISC-V can convert to kvm_release_faultin_page() without tripping > its lockdep assertion on mmu_lock being held. Marking pages accessed > outside of

Re: [PATCH v12 58/84] KVM: RISC-V: Use kvm_faultin_pfn() when mapping pfns into the guest

2024-08-06 Thread Anup Patel
On Sat, Jul 27, 2024 at 5:24 AM Sean Christopherson wrote: > > Convert RISC-V to __kvm_faultin_pfn()+kvm_release_faultin_page(), which > are new APIs to consolidate arch code and provide consistent behavior > across all KVM architectures. > > Signed-off-by: Sean Christopherson For KVM RISC-V: Ac

Re: [PATCH v12 54/84] KVM: arm64: Mark "struct page" pfns accessed/dirty before dropping mmu_lock

2024-08-06 Thread Sean Christopherson
On Tue, Aug 06, 2024, Marc Zyngier wrote: > On Tue, 06 Aug 2024 00:26:54 +0100, > Oliver Upton wrote: > > > > On Mon, Aug 05, 2024 at 11:26:03PM +, Oliver Upton wrote: > > > [+cc Fuad] > > > > Take 2! > > > > > Fuad, you mentioned in commit 9c30fc615daa ("KVM: arm64: Move setting > > > the

[PATCH v2 1/1] dt-bindings: soc: fsl: add missed compatible string fsl,ls*-isc

2024-08-06 Thread Frank Li
Add compatible string, fsl,ls1088a-isc, fsl,ls2080a-isc, fsl,lx2160a-isc. Fix the below warning: arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dtb: /soc/syscon@1f7: failed to match any schema with compatible: ['fsl,ls2080a-isc', 'syscon'] Signed-off-by: Frank Li --- Change from v1 to v2 - fi

Re: [PATCH v3 2/8] mm/mprotect: Remove NUMA_HUGE_PTE_UPDATES

2024-08-06 Thread Peter Xu
On Tue, Aug 06, 2024 at 03:02:00PM +0200, David Hildenbrand wrote: > > Right. > > > > I don't have a reason to change numa_pte_updates semantics yet so far, but > > here there's the problem where numa_huge_pte_updates can be ambiguous when > > there is even PUD involved. > > > > In general, I don

Re: [PATCH v3 2/8] mm/mprotect: Remove NUMA_HUGE_PTE_UPDATES

2024-08-06 Thread David Hildenbrand
On 06.08.24 18:26, Peter Xu wrote: On Tue, Aug 06, 2024 at 03:02:00PM +0200, David Hildenbrand wrote: Right. I don't have a reason to change numa_pte_updates semantics yet so far, but here there's the problem where numa_huge_pte_updates can be ambiguous when there is even PUD involved. In gene

Re: [PATCH v3 2/8] mm/mprotect: Remove NUMA_HUGE_PTE_UPDATES

2024-08-06 Thread Peter Xu
On Tue, Aug 06, 2024 at 06:32:10PM +0200, David Hildenbrand wrote: > On 06.08.24 18:26, Peter Xu wrote: > > On Tue, Aug 06, 2024 at 03:02:00PM +0200, David Hildenbrand wrote: > > > > Right. > > > > > > > > I don't have a reason to change numa_pte_updates semantics yet so far, > > > > but > > > >

Re: [PATCH v4 1/1] dt-bindings: soc: fsl: Convert rcpm to yaml format

2024-08-06 Thread Rob Herring (Arm)
On Fri, 02 Aug 2024 11:22:19 -0400, Frank Li wrote: > Convert dt-binding rcpm from txt to yaml format. > Add fsl,ls1028a-rcpm compatible string. > > Additional changes: > - Add missed compatible string fsl,-rcpm. > - Remove map fsl,-rcpm to fsl,qoriq-rcpm-. > > Signed-off-by: Frank Li > --- >

Re: [PATCH v2 1/1] dt-bindings: soc: fsl: add missed compatible string fsl,ls*-isc

2024-08-06 Thread Rob Herring (Arm)
On Tue, 06 Aug 2024 12:21:21 -0400, Frank Li wrote: > Add compatible string, fsl,ls1088a-isc, fsl,ls2080a-isc, fsl,lx2160a-isc. > Fix the below warning: > arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dtb: /soc/syscon@1f7: > failed to match any schema with compatible: ['fsl,ls2080a-isc', 'sy

Re: [PATCH 1/2] ACPI: extlog: Trace CPER Non-standard Section Body

2024-08-06 Thread Dan Williams
Fabio M. De Francesco wrote: > In extlog_print(), trace "Non-standard Section Body" reported by firmware > to the OS via Common Platform Error Record (CPER) (UEFI v2.10 Appendix N > 2.3) to add further debug information and so to make ELOG log > consistently with ghes_do_proc() (GHES). I think thi

Re: PCI: Work around PCIe link training failures

2024-08-06 Thread Bjorn Helgaas
On Mon, Aug 05, 2024 at 06:06:59PM -0600, Matthew W Carlis wrote: > Hello again. I just realized that my first response to this thread two weeks > ago was not actually starting from the end of the discussion. I hope I found > it now... Must say sorry for this I am still figuring out how to follow t

Re: [PATCH 2/2] ACPI: extlog: Trace CPER PCI Express Error Section

2024-08-06 Thread Dan Williams
Fabio M. De Francesco wrote: > Currently, extlog_print() (ELOG) only reports CPER PCIe section (UEFI > v2.10, Appendix N.2.7) to the kernel log via print_extlog_rcd(). I think the critical detail is is that print_extlog_rcd() is only triggered when ras_userspace_consumers() returns true. The obser

Re: [PATCH v3] PCI: Fix crash during pci_dev hot-unplug on pseries KVM guest

2024-08-06 Thread Bjorn Helgaas
On Sat, Aug 03, 2024 at 12:03:25AM +0530, Amit Machhiwal wrote: > With CONFIG_PCI_DYNAMIC_OF_NODES [1], a hot-plug and hot-unplug sequence > of a PCI device attached to a PCI-bridge causes following kernel Oops on > a pseries KVM guest: What is unique about pseries here? There's nothing specific

Re: PPC64: G5 & 4k/64k page size (was: Re: Call for report - G5/PPC970 status)

2024-08-06 Thread John Paul Adrian Glaubitz
Hi, On Fri, 2019-12-13 at 08:47 +0100, Romain Dolbeau wrote: > Le jeu. 12 déc. 2019 à 22:40, Andreas Schwab a écrit : > > I'm using 4K pages, in case that matters > > Yes it does matter, as it seems to be the difference between "working" > and "not working" :-) > Thank you for the config & point

Re: [PATCH 1/2] ACPI: extlog: Trace CPER Non-standard Section Body

2024-08-06 Thread Bjorn Helgaas
On Mon, May 27, 2024 at 04:43:40PM +0200, Fabio M. De Francesco wrote: > In extlog_print(), trace "Non-standard Section Body" reported by firmware > to the OS via Common Platform Error Record (CPER) (UEFI v2.10 Appendix N > 2.3) to add further debug information and so to make ELOG log > consistentl

[PATCH v3 14/16] modules: Support extended MODVERSIONS info

2024-08-06 Thread Matthew Maurer
Adds a new format for MODVERSIONS which stores each field in a separate ELF section. This initially adds support for variable length names, but could later be used to add additional fields to MODVERSIONS in a backwards compatible way if needed. Any new fields will be ignored by old user tooling, un

Re: [PATCH 2/2] ACPI: extlog: Trace CPER PCI Express Error Section

2024-08-06 Thread Bjorn Helgaas
On Mon, May 27, 2024 at 04:43:41PM +0200, Fabio M. De Francesco wrote: > Currently, extlog_print() (ELOG) only reports CPER PCIe section (UEFI > v2.10, Appendix N.2.7) to the kernel log via print_extlog_rcd(). Instead, > the similar ghes_do_proc() (GHES) prints to kernel log and calls > pci_print_a

[PATCH 1/2] mm: update the memmap stat before page is freed

2024-08-06 Thread Pasha Tatashin
It is more logical to update the stat before the page is freed, to avoid use after free scenarios. Fixes: 15995a352474 ("mm: report per-page metadata information") Signed-off-by: Pasha Tatashin --- mm/hugetlb_vmemmap.c | 4 ++-- mm/page_ext.c| 8 2 files changed, 6 insertions(+)

[PATCH 2/2] mm: keep nid around during hot-remove

2024-08-06 Thread Pasha Tatashin
nid is needed during memory hot-remove in order to account the information about the memmap overhead that is being removed. In addition, we cannot use page_pgdat(pfn_to_page(pfn)) during hotremove after remove_pfn_range_from_zone(). We also cannot determine nid from walking through memblocks afte

[PATCH -next v2] powerpc: Remove useless config comment in asm/percpu.h

2024-08-06 Thread Jinjie Ruan
commit 0db880fc865f ("powerpc: Avoid nmi_enter/nmi_exit in real mode interrupt.") has a config comment typo, and the #if/#else/#endif section is small and doesn't nest additional #ifdefs so the comment is useless and should be removed completely. Signed-off-by: Jinjie Ruan Suggested-by: Christoph

Re: [PATCH] powerpc/476: Drop explicit initialization of struct i2c_device_id::driver_data to 0

2024-08-06 Thread Christophe Leroy
Le 04/08/2024 à 13:20, Uwe Kleine-König a écrit : This driver doesn't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. Well, even if the member was used, a 0 init is useless because as soon as you initialise one field of the struct, the compile

[PATCH v4 00/26] mm: introduce numa_memblks

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Hi, Following the discussion about handling of CXL fixed memory windows on arm64 [1] I decided to bite the bullet and move numa_memblks from x86 to the generic code so they will be available on arm64/riscv and maybe on loongarch sometime later. While it could b

[PATCH v4 01/26] mm: move kernel/numa.c to mm/

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The stub functions in kernel/numa.c belong to mm/ rather than to kernel/ Signed-off-by: Mike Rapoport (Microsoft) Acked-by: David Hildenbrand Reviewed-by: Jonathan Cameron Tested-by: Zi Yan # for x86_64 and arm64 Tested-by: Jonathan Cameron [arm64 + CXL via

[PATCH v4 02/26] MIPS: sgi-ip27: make NODE_DATA() the same as on all other architectures

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" sgi-ip27 is the only system that defines NODE_DATA() differently than the rest of NUMA machines. Add node_data array of struct pglist pointers that will point to __node_data[node]->pglist and redefine NODE_DATA() to use node_data array. This will allow pulling

[PATCH v4 03/26] MIPS: sgi-ip27: ensure node_possible_map only contains valid nodes

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" For SGI IP27 machines node_possible_map is statically set to NODE_MASK_ALL and it is not updated during NUMA initialization. Ensure that it only contains nodes present in the system. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Teste

[PATCH v4 04/26] MIPS: sgi-ip27: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to sgi-ip27 to silence a compilation error that happened because sgi-ip27 didn't define array of pg_data_t as node_data like most other architectures did.

[PATCH v4 05/26] MIPS: loongson64: rename __node_data to node_data

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Make definition of node_data match other architectures. This will allow pulling declaration of node_data to the generic mm code in the following commit. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jiaxun Yang Reviewed-by: David Hildenbrand Reviewed-

[PATCH v4 06/26] MIPS: loongson64: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Commit f8f9f21c7848 ("MIPS: Fix build error for loongson64 and sgi-ip27") added HAVE_ARCH_NODEDATA_EXTENSION to loongson64 to silence a compilation error that happened because loongson64 didn't define array of pg_data_t as node_data like most other architectures

[PATCH v4 07/26] arch, mm: move definition of node_data to generic code

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Every architecture that supports NUMA defines node_data in the same way: struct pglist_data *node_data[MAX_NUMNODES]; No reason to keep multiple copies of this definition and its forward declarations, especially when such forward declaration is the only

[PATCH v4 08/26] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" There are no users of HAVE_ARCH_NODEDATA_EXTENSION left, so arch_alloc_nodedata() and arch_refresh_nodedata() are not needed anymore. Replace the call to arch_alloc_nodedata() in free_area_init() with a new helper alloc_offline_node_data(), remove arch_refresh_n

[PATCH v4 09/26] arch, mm: pull out allocation of NODE_DATA to generic code

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Architectures that support NUMA duplicate the code that allocates NODE_DATA on the node-local memory with slight variations in reporting of the addresses where the memory was allocated. Use x86 version as the basis for the generic alloc_node_data() function and

[PATCH v4 10/26] x86/numa: simplify numa_distance allocation

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Allocation of numa_distance uses memblock_phys_alloc_range() to limit allocation to be below the last mapped page. But NUMA initializaition runs after the direct map is populated and there is also code in setup_arch() that adjusts memblock limit to reflect how m

[PATCH v4 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Instead of looping over numa_meminfo array to detect node's start and end addresses use get_pfn_range_for_init(). This is shorter and make it easier to lift numa_memblks to generic code. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_64

[PATCH v4 12/26] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The definitions of FAKE_NODE_MIN_SIZE and FAKE_NODE_MIN_HASH_MASK are only used by numa emulation code, make them local to arch/x86/mm/numa_emulation.c Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Tested-by: Zi Yan # for x86_64 and a

[PATCH v4 13/26] x86/numa_emu: simplify allocation of phys_dist

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" By the time numa_emulation() is called, all physical memory is already mapped in the direct map and there is no need to define limits for memblock allocation. Replace memblock_phys_alloc_range() with memblock_alloc(). Signed-off-by: Mike Rapoport (Microsoft) R

[PATCH v4 14/26] x86/numa_emu: split __apicid_to_node update to a helper function

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent so that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Tested-by: Zi Yan # for x86_64 and arm64 Tested-by: Jona

[PATCH v4 15/26] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" This is required to make numa emulation code architecture independent so that it can be moved to generic code in following commits. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Cameron Tested-by: Zi Yan # for x86_64 and arm64 Tested-by: Jona

[PATCH v4 16/26] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" CPU id cannot be negative. Making it unsigned also aligns with declarations in include/asm-generic/numa.h used by arm64 and riscv and allows sharing numa emulation code with these architectures. Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Jonathan Ca

[PATCH v4 17/26] mm: introduce numa_memblks

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move code dealing with numa_memblks from arch/x86 to mm/ and add Kconfig options to let x86 select it in its Kconfig. This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_64

[PATCH v4 18/26] mm: move numa_distance and related code from x86 to numa_memblks

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move code dealing with numa_distance array from arch/x86 to mm/numa_memblks.c This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_64 and arm64 Reviewed-by: Jonathan Cameron

[PATCH v4 19/26] mm: introduce numa_emulation

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move numa_emulation code from arch/x86 to mm/numa_emulation.c This code will be later reused by arch_numa. No functional changes. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_64 and arm64 Reviewed-by: Jonathan Cameron Tested-by: Jona

[PATCH v4 20/26] mm: numa_memblks: introduce numa_memblks_init

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move most of x86::numa_init() to numa_memblks so that the latter will be more self-contained. With this numa_memblk data structures should not be exposed to the architecture specific code. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_6

[PATCH v4 21/26] mm: numa_memblks: make several functions and variables static

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Make functions and variables that are exclusively used by numa_memblks static. Move numa_nodemask_from_meminfo() before its callers to avoid forward declaration. Signed-off-by: Mike Rapoport (Microsoft) Tested-by: Zi Yan # for x86_64 and arm64 Reviewed-by: Jo

[PATCH v4 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" numa_cleanup_meminfo() moves blocks outside system RAM to numa_reserved_meminfo and it uses 0 and PFN_PHYS(max_pfn) to determine the memory boundaries. Replace the memory range boundaries with more portable memblock_start_of_DRAM() and memblock_end_of_DRAM(). S

[PATCH v4 23/26] of, numa: return -EINVAL when no numa-node-id is found

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Currently of_numa_parse_memory_nodes() returns 0 if no "memory" node in device tree contains "numa-node-id" property. This makes of_numa_init() to return "success" despite no NUMA nodes were actually parsed and set up. arch_numa workarounds this by returning an

[PATCH v4 24/26] arch_numa: switch over to numa_memblks

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Until now arch_numa was directly translating firmware NUMA information to memblock. Using numa_memblks as an intermediate step has a few advantages: * alignment with more battle tested x86 implementation * availability of NUMA emulation * maintaining node inform

[PATCH v4 25/26] mm: make range-to-target_node lookup facility a part of numa_memblks

2024-08-06 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" The x86 implementation of range-to-target_node lookup (i.e. phys_to_target_node() and memory_add_physaddr_to_nid()) relies on numa_memblks. Since numa_memblks are now part of the generic code, move these functions from x86 to mm/numa_memblks.c and select CONFIG_