Skip to contentSkip to conversation

kunit: tool: Use qemu-system-i386 for i386 runs

PATCH In review David Gow 3 participants 4 messages May 13, 2022 – May 17, 2022

Subsystems (2)
lore
Share & tools
lore

David Gow

author
#0 lore raw

PATCH 1/1 kunit: tool: Use qemu-system-i386 for i386 runs

We're currently using the x86_64 qemu for i386 builds. While this is not incorrect, it's probably more sensible to use the i386 one, which will at least fail properly if we accidentally were to build a 64-bit kernel.

---
 tools/testing/kunit/qemu_configs/i386.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/kunit/qemu_configs/i386.py +1 -1
index 52b80be40e4b..4463ebefd567 100644
@@ -4,7 +4,7 @@ QEMU_ARCH = QemuArchParams(linux_arch='i386',
 			   kconfig='''
 CONFIG_SERIAL_8250=y
 CONFIG_SERIAL_8250_CONSOLE=y''',
-			   qemu_arch='x86_64',
+			   qemu_arch='i386',
 			   kernel_path='arch/x86/boot/bzImage',
 			   kernel_command_line='console=ttyS0',
 			   extra_qemu_params=[])
Signature · 1 line
2.36.0.550.gb090851708-goog
Tested-by on v1 1/1
#1 lore raw
Quoted 6 lines · David Gow

We're currently using the x86_64 qemu for i386 builds. While this is not incorrect, it's probably more sensible to use the i386 one, which will at least fail properly if we accidentally were to build a 64-bit kernel.

Works for me:
[10:55:58] Testing complete. Ran 201 tests: passed: 165, skipped: 36 [10:55:58] Elapsed time: 21.268s total, 0.003s configuring, 4.009s building, 16.967s running

Side note:
I ran into an unrelated bug where running on QEMU in general seems to hang when you try to filter to a test suite that doesn't exist. I've confirmed it happens on i386 before this patch, and it at least also happens on x86_64.

#2 lore raw
Quoted 16 lines · Daniel Latypov
Quoted 6 lines · David Gow

We're currently using the x86_64 qemu for i386 builds. While this is not incorrect, it's probably more sensible to use the i386 one, which will at least fail properly if we accidentally were to build a 64-bit kernel.

Works for me:
[10:55:58] Testing complete. Ran 201 tests: passed: 165, skipped: 36 [10:55:58] Elapsed time: 21.268s total, 0.003s configuring, 4.009s building, 16.967s running

Quoted 5 lines

Side note:
I ran into an unrelated bug where running on QEMU in general seems to hang when you try to filter to a test suite that doesn't exist. I've confirmed it happens on i386 before this patch, and it at least also happens on x86_64.

Ah, this "unrelated bug" is my fault, specifically commit a02353f49162 ("kunit: bail out of test filtering logic quicker if OOM"). The use of _any_ filter glob is broken on kunit.py + QEMU.

Fix is https://lore.kernel.org/linux-kselftest/[email protected]/

Reviewed-by on v1 1/1
#3 lore raw
In reply to David Gow
Quoted 6 lines · David Gow

We're currently using the x86_64 qemu for i386 builds. While this is not incorrect, it's probably more sensible to use the i386 one, which will at least fail properly if we accidentally were to build a 64-bit kernel.

A very sensible thing to do! When I was writing this, I probably copied and pasted the x64_64 qemu config and then forgot to change everything to i386 - whoops.