public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] virtio_console: fix order of fields cols and rows
@ 2025-09-18 16:18 Michael S. Tsirkin
  2025-09-18 17:17 ` Matias Ezequiel Vara Larsen
       [not found] ` <aOyHZnkkLQBCMAa-@codewreck.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Michael S. Tsirkin @ 2025-09-18 16:18 UTC (permalink / raw)
  To: virtio-comment; +Cc: Filip Hejsek, Maximilian Immanuel Brandtner

Filip Hejsek pointed out the following:

The problem is that for a long time, the
Linux kernel used a different field order from what was specified in the
virtio spec. The kernel implementation was apparently merged around 2010,
while the virtio spec came in 2014, so when a previous version of this
patch series was being discussed here on the qemu-devel mailing list in
2020, it was decided that QEMU should match the Linux implementation,
and ideally, the virtio spec should be changed.

There are about 15 years' worth
of kernel versions with the swapped field order, including the kernel
currently shipped in Debian stable. The effects of the swapped dimensions
can sometimes be quite annoying - e.g. if you have a terminal with
24 rows, this will be interpreted as 24 columns, and your shell may limit
line editing to this small space, most of which will be taken by your
prompt.

While commit 5326ab737a47278dbd16ed3ee7380b26c7056ddd in Linux made it
match the spec, no one seems to have implemented it yet host side. It
seems better to just drop the change (it was only in 2 releases so far),
going back to the status quo.

Change the spec to match.

Reported-by: Filip Hejsek <filip.hejsek@gmail.com>
Cc: "Maximilian Immanuel Brandtner" <maxbr@linux.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 device-types/console/description.tex | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/device-types/console/description.tex b/device-types/console/description.tex
index 40a2ba4..c18dc08 100644
--- a/device-types/console/description.tex
+++ b/device-types/console/description.tex
@@ -59,8 +59,8 @@ \subsection{Device configuration layout}\label{sec:Device Types / Console Device
 
 \begin{lstlisting}
 struct virtio_console_config {
-        le16 cols;
         le16 rows;
+        le16 cols;
         le32 max_nr_ports;
         le32 emerg_wr;
 };
-- 
MST


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-13  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 16:18 [PATCH] virtio_console: fix order of fields cols and rows Michael S. Tsirkin
2025-09-18 17:17 ` Matias Ezequiel Vara Larsen
     [not found] ` <aOyHZnkkLQBCMAa-@codewreck.org>
2025-10-13  8:01   ` Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox