diff mbox series

kunit: qemu_configs: sparc: use Zilog console

Message ID 20250214-kunit-qemu-sparc-console-v1-1-ba1dfdf8f0b1@linutronix.de (mailing list archive)
State New
Delegated to: Brendan Higgins
Headers show
Series kunit: qemu_configs: sparc: use Zilog console | expand

Commit Message

Thomas Weißschuh Feb. 14, 2025, 1:27 p.m. UTC
The driver for the 8250 console is not used, as no port is found.
Instead the prom0 bootconsole is used the whole time.
The prom driver translates '\n' to '\r\n' before handing of the message
off to the firmware. The firmware performs the same translation again.
In the final output produced by QEMU each line ends with '\r\r\n'.
This breaks the kunit parser, which can only handle '\r\n' and '\n'.

Use the Zilog console instead. It works correctly, is the one documented
by the QEMU manual and also saves a bit of codesize:
Before=4051011, After=4023326, chg -0.68%

Observed on QEMU 9.2.0.

Fixes: 87c9c1631788 ("kunit: tool: add support for QEMU")
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
---
 tools/testing/kunit/qemu_configs/sparc.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


---
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
change-id: 20250214-kunit-qemu-sparc-console-73ece282d867

Best regards,

Comments

David Gow Feb. 15, 2025, 6:49 a.m. UTC | #1
On Fri, 14 Feb 2025 at 21:27, Thomas Weißschuh
<thomas.weissschuh@linutronix.de> wrote:
>
> The driver for the 8250 console is not used, as no port is found.
> Instead the prom0 bootconsole is used the whole time.
> The prom driver translates '\n' to '\r\n' before handing of the message
> off to the firmware. The firmware performs the same translation again.
> In the final output produced by QEMU each line ends with '\r\r\n'.
> This breaks the kunit parser, which can only handle '\r\n' and '\n'.
>
> Use the Zilog console instead. It works correctly, is the one documented
> by the QEMU manual and also saves a bit of codesize:
> Before=4051011, After=4023326, chg -0.68%
>
> Observed on QEMU 9.2.0.
>
> Fixes: 87c9c1631788 ("kunit: tool: add support for QEMU")
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
> ---

Thanks very much, this works fine here!

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David

>  tools/testing/kunit/qemu_configs/sparc.py | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/kunit/qemu_configs/sparc.py b/tools/testing/kunit/qemu_configs/sparc.py
> index e975c4331a7c2a74f8ade61c3f31ff0d37314545..256d9573b44646533d1a6f768976628adc87921e 100644
> --- a/tools/testing/kunit/qemu_configs/sparc.py
> +++ b/tools/testing/kunit/qemu_configs/sparc.py
> @@ -2,8 +2,9 @@ from ..qemu_config import QemuArchParams
>
>  QEMU_ARCH = QemuArchParams(linux_arch='sparc',
>                            kconfig='''
> -CONFIG_SERIAL_8250=y
> -CONFIG_SERIAL_8250_CONSOLE=y''',
> +CONFIG_SERIAL_SUNZILOG=y
> +CONFIG_SERIAL_SUNZILOG_CONSOLE=y
> +''',
>                            qemu_arch='sparc',
>                            kernel_path='arch/sparc/boot/zImage',
>                            kernel_command_line='console=ttyS0 mem=256M',
>
> ---
> base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> change-id: 20250214-kunit-qemu-sparc-console-73ece282d867
>
> Best regards,
> --
> Thomas Weißschuh <thomas.weissschuh@linutronix.de>
>
diff mbox series

Patch

diff --git a/tools/testing/kunit/qemu_configs/sparc.py b/tools/testing/kunit/qemu_configs/sparc.py
index e975c4331a7c2a74f8ade61c3f31ff0d37314545..256d9573b44646533d1a6f768976628adc87921e 100644
--- a/tools/testing/kunit/qemu_configs/sparc.py
+++ b/tools/testing/kunit/qemu_configs/sparc.py
@@ -2,8 +2,9 @@  from ..qemu_config import QemuArchParams
 
 QEMU_ARCH = QemuArchParams(linux_arch='sparc',
 			   kconfig='''
-CONFIG_SERIAL_8250=y
-CONFIG_SERIAL_8250_CONSOLE=y''',
+CONFIG_SERIAL_SUNZILOG=y
+CONFIG_SERIAL_SUNZILOG_CONSOLE=y
+''',
 			   qemu_arch='sparc',
 			   kernel_path='arch/sparc/boot/zImage',
 			   kernel_command_line='console=ttyS0 mem=256M',