summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPedro Tôrres <t0rr3sp3dr0@gmail.com>2024-12-31 06:26:59 -0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-04 15:55:02 +0000
commitf6e19abd978a0c7ad9d5eea11c1db34e2522b2b1 (patch)
treeee7eb9b662b097d02ae43bfc10ea343da55e9cf6
parentdca265a8ca9bc01656ff6bc1fc881bdee132de9a (diff)
downloadedk2-f6e19abd978a0c7ad9d5eea11c1db34e2522b2b1.tar.gz
OvmfPkg/VirtioSerialDxe: respond CONSOLE_PORT with PORT_OPEN
The VirtIO spec states that "Upon receipt of a VIRTIO_CONSOLE_CONSOLE_PORT message, the driver SHOULD treat the port in a manner suitable for text console access and MUST respond with a VIRTIO_CONSOLE_PORT_OPEN message, which MUST have value set to 1". See https://docs.oasis-open.org/virtio/virtio/v1.3/virtio-v1.3.html#x1-3330002. The current driver implementation, however, does not comply with that and only sends PORT_OPEN messages upon receipt of PORT_OPEN messages. This causes a problem in platforms like Apple's Virtualization Framework, where PORT_OPEN messages are not sent back to the driver after CONSOLE_PORT messages are received by the device, a behaviour that is compliant with the VirtIO specification. This patch addresses this issue by always responding CONSOLE_PORT messages with PORT_OPEN messages. Signed-off-by: Pedro Tôrres <t0rr3sp3dr0@gmail.com>
-rw-r--r--OvmfPkg/VirtioSerialDxe/VirtioSerial.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/OvmfPkg/VirtioSerialDxe/VirtioSerial.c b/OvmfPkg/VirtioSerialDxe/VirtioSerial.c
index fd34ad75a9..e0266ad006 100644
--- a/OvmfPkg/VirtioSerialDxe/VirtioSerial.c
+++ b/OvmfPkg/VirtioSerialDxe/VirtioSerial.c
@@ -165,6 +165,7 @@ VirtioSerialRxControl (
if (Control.Id < MAX_PORTS) {
VirtioSerialPortSetConsole (Dev, Control.Id);
Dev->NumConsoles++;
+ VirtioSerialPortSetDeviceOpen (Dev, Control.Id, 1);
}
break;