* [PATCH 0/2] kunit: qemu_configs: Add MIPS configurations
@ 2025-02-12 12:49 Thomas Weißschuh
2025-02-12 12:49 ` [PATCH 1/2] MIPS: mm: Avoid blocking DMA zone with memory map memblock allocation Thomas Weißschuh
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2025-02-12 12:49 UTC (permalink / raw)
To: Thomas Bogendoerfer, Paul Burton, Brendan Higgins, David Gow, Rae Moar
Cc: linux-mips, linux-kernel, linux-kselftest, kunit-dev,
Thomas Weißschuh, Mike Rapoport, Andrew Morton, linux-mm
Add basic support to run various MIPS variants via kunit_tool using the
virtualized malta platform.
Various kunit tests from drivers/firmware/cirrus/ are failing on MIPS.
They are fixed in [0].
[0] https://lore.kernel.org/lkml/20250211-cs_dsp-kunit-strings-v1-1-d9bc2035d154@linutronix.de/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Thomas Weißschuh (2):
MIPS: mm: Avoid blocking DMA zone with memory map memblock allocation
kunit: qemu_configs: Add MIPS configurations
arch/mips/mm/init.c | 2 ++
tools/testing/kunit/qemu_configs/mips.py | 18 ++++++++++++++++++
tools/testing/kunit/qemu_configs/mips64.py | 19 +++++++++++++++++++
tools/testing/kunit/qemu_configs/mips64el.py | 19 +++++++++++++++++++
tools/testing/kunit/qemu_configs/mipsel.py | 18 ++++++++++++++++++
5 files changed, 76 insertions(+)
---
base-commit: 6e24361511062dba8c5f7e59d51b29cdfa859523
change-id: 20241014-kunit-mips-e4fe1c265ed7
Best regards,
--
Thomas Weißschuh <thomas.weissschuh@linutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH 1/2] MIPS: mm: Avoid blocking DMA zone with memory map memblock allocation
2025-02-12 12:49 [PATCH 0/2] kunit: qemu_configs: Add MIPS configurations Thomas Weißschuh
@ 2025-02-12 12:49 ` Thomas Weißschuh
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Weißschuh @ 2025-02-12 12:49 UTC (permalink / raw)
To: Thomas Bogendoerfer, Paul Burton, Brendan Higgins, David Gow, Rae Moar
Cc: linux-mips, linux-kernel, linux-kselftest, kunit-dev,
Thomas Weißschuh, Mike Rapoport, Andrew Morton, linux-mm
On MIPS the memblock allocator is configured to allocate bottom-up.
The memory map is allocated by the mm core through memblock and uses
MEMBLOCK_LOW_LIMIT as minimal address. This constant is defined as zero because
it assumes that "we are using top down, so it is safe to use 0 here".
So the memory map is allocated as close to 0 as possible, right where the DMA
zone will end up. As the memory map is allocated permanently and also larger
than the DMA zone, it makes the DMA zone unusable.
Temporarily switch to top-down allocation for the call to free_area_init() so
the memory map allocation does not fall into the DMA zone.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
Another solution would be to change alloc_node_mem_map() in the mm core
to use __pa(MAX_DMA_ADDRESS) for the min_addr when calling
memmap_alloc(), as is done by the other callers of memmap_alloc().
Looping in the memblock maintainers for discussion.
This is reliably reproducible in QEMU. To reproduce, use the kunit
configuration from patch 2 of this series and run it like so:
./tools/testing/kunit/kunit.py run --arch mips64el --cross_compile $CROSS_COMPILE cs_dsp_wmfwV3_err_halo.wmfw_v2_coeff_description_exceeds_block
To: Mike Rapoport <rppt@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
---
arch/mips/mm/init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 4583d1a2a73e7ff36a42f6017d9aef008e45df6e..712eb4762917261416f1fca2d9925a42107ef6c1 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -435,7 +435,9 @@ void __init paging_init(void)
#endif
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
+ memblock_set_bottom_up(false);
free_area_init(max_zone_pfns);
+ memblock_set_bottom_up(true);
}
#ifdef CONFIG_64BIT
--
2.48.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-12 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-12 12:49 [PATCH 0/2] kunit: qemu_configs: Add MIPS configurations Thomas Weißschuh
2025-02-12 12:49 ` [PATCH 1/2] MIPS: mm: Avoid blocking DMA zone with memory map memblock allocation Thomas Weißschuh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox