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

2024-07-31 Thread Mike Rapoport
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 Rapoport (Microsoft) --- Documentation/admi

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

2024-07-31 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_

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

2024-07-31 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 v3 23/26] of, numa: return -EINVAL when no numa-node-id is found

2024-07-31 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 v3 22/26] mm: numa_memblks: use memblock_{start,end}_of_DRAM() when sanitizing meminfo

2024-07-31 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 v3 21/26] mm: numa_memblks: make several functions and variables static

2024-07-31 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 --- include/li

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

2024-07-31 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 v3 19/26] mm: introduce numa_emulation

2024-07-31 Thread Mike Rapoport
From: "Mike Rapoport (Microsoft)" Move numa_emulation codfrom 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 --- arch/x86/Kconfig | 8 -

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

2024-07-31 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 --- arch/x86/include/asm/numa

[PATCH v3 17/26] mm: introduce numa_memblks

2024-07-31 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 v3 16/26] x86/numa: numa_{add,remove}_cpu: make cpu parameter unsigned

2024-07-31 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 v3 15/26] x86/numa_emu: use a helper function to get MAX_DMA32_PFN

2024-07-31 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 --- arch/x86/i

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

2024-07-31 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 --- arch/x86/i

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

2024-07-31 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 v3 12/26] x86/numa: move FAKE_NODE_* defines to numa_emu

2024-07-31 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 v3 11/26] x86/numa: use get_pfn_range_for_nid to verify that node spans memory

2024-07-31 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 v3 10/26] x86/numa: simplify numa_distance allocation

2024-07-31 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 v3 09/26] arch, mm: pull out allocation of NODE_DATA to generic code

2024-07-31 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 v3 08/26] arch, mm: move definition of node_data to generic code

2024-07-31 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 v3 07/26] mm: drop CONFIG_HAVE_ARCH_NODEDATA_EXTENSION

2024-07-31 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 memblock_alloc(), remove arch_refresh_nodedata() and cleanup

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

2024-07-31 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 v3 05/26] MIPS: loongson64: rename __node_data to node_data

2024-07-31 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 v3 04/26] MIPS: sgi-ip27: drop HAVE_ARCH_NODEDATA_EXTENSION

2024-07-31 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 v3 03/26] MIPS: sgi-ip27: ensure node_possible_map only contains valid nodes

2024-07-31 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) --- arch/mips/sgi-ip27/ip27-smp.c |

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

2024-07-31 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 v3 01/26] mm: move kernel/numa.c to mm/

2024-07-31 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 --- kernel/Makefile | 1 - mm/Makefile

[PATCH v3 00/26] mm: introduce numa_memblks

2024-07-31 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 AUTOSEL 5.10 20/38] hwspinlock: Introduce hwspin_lock_bust()

2024-07-31 Thread Sasha Levin
From: Richard Maina [ Upstream commit 7c327d56597d8de1680cf24e956b704270d3d84a ] When a remoteproc crashes or goes down unexpectedly this can result in a state where locks held by the remoteproc will remain locked possibly resulting in deadlock. This new API hwspin_lock_bust() allows hwspinlock

[PATCH AUTOSEL 5.15 26/47] hwspinlock: Introduce hwspin_lock_bust()

2024-07-31 Thread Sasha Levin
From: Richard Maina [ Upstream commit 7c327d56597d8de1680cf24e956b704270d3d84a ] When a remoteproc crashes or goes down unexpectedly this can result in a state where locks held by the remoteproc will remain locked possibly resulting in deadlock. This new API hwspin_lock_bust() allows hwspinlock

[PATCH AUTOSEL 6.1 31/61] hwspinlock: Introduce hwspin_lock_bust()

2024-07-31 Thread Sasha Levin
From: Richard Maina [ Upstream commit 7c327d56597d8de1680cf24e956b704270d3d84a ] When a remoteproc crashes or goes down unexpectedly this can result in a state where locks held by the remoteproc will remain locked possibly resulting in deadlock. This new API hwspin_lock_bust() allows hwspinlock

[PATCH AUTOSEL 6.6 40/83] hwspinlock: Introduce hwspin_lock_bust()

2024-07-31 Thread Sasha Levin
From: Richard Maina [ Upstream commit 7c327d56597d8de1680cf24e956b704270d3d84a ] When a remoteproc crashes or goes down unexpectedly this can result in a state where locks held by the remoteproc will remain locked possibly resulting in deadlock. This new API hwspin_lock_bust() allows hwspinlock

[PATCH AUTOSEL 6.10 059/121] hwspinlock: Introduce hwspin_lock_bust()

2024-07-31 Thread Sasha Levin
From: Richard Maina [ Upstream commit 7c327d56597d8de1680cf24e956b704270d3d84a ] When a remoteproc crashes or goes down unexpectedly this can result in a state where locks held by the remoteproc will remain locked possibly resulting in deadlock. This new API hwspin_lock_bust() allows hwspinlock

Re: [PATCH 1/2] Documentation: embargoed-hardware-issues.rst: minor cleanups and fixes

2024-07-31 Thread Greg Kroah-Hartman
On Tue, Jul 30, 2024 at 11:59:26AM -0600, Jonathan Corbet wrote: > Greg Kroah-Hartman writes: > > > The embargoed-hardware-issues.rst file needed a bunch of minor grammar, > > punctuation, and syntax cleanups based on feedback we have gotten over > > the past few years. The main change here is t

Re: [PATCH v12 11/24] virt: geniezone: Add ioeventfd support

2024-07-31 Thread Simon Horman
On Tue, Jul 30, 2024 at 04:24:23PM +0800, Liju-clr Chen wrote: > From: Yingshiuan Pan > > Ioeventfd leverages eventfd to provide asynchronous notification > mechanism for VMM. VMM can register a mmio address and bind with an > eventfd. Once a mmio trap occurs on this registered region, its > corr