qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 7/8] Provide a Console Terminal Block in the HWRPB.


From: Richard Henderson
Subject: Re: [PATCH 7/8] Provide a Console Terminal Block in the HWRPB.
Date: Sun, 6 Jun 2021 12:27:23 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 6/2/21 8:53 PM, Jason Thorpe wrote:
+  hwrpb.hwrpb.ctbt_offset = offsetof(struct hwrpb_combine, ctb);
+  hwrpb.hwrpb.ctb_size = sizeof(hwrpb.ctb);
+  if (have_vga && !CONFIG_NOGRAPHICS(config))
+    {
+      hwrpb.ctb.term_type = CTB_GRAPHICS;
+      hwrpb.ctb.turboslot = (CTB_TURBOSLOT_TYPE_PCI << 16) |
+                           (pci_vga_bus << 8) | pci_vga_dev;
+    }
+  else
+    {
+      hwrpb.ctb.term_type = CTB_PRINTERPORT;
+    }

I'm concerned that you're initializing only 1 or 2 slots of 34.

It would seem that at a bare minimum the struct should be zeroed, and the device-independent header (4 slots) should be set.

I notice you're setting term_type (offset 56) and not type (offset 0), which is where my documentation says that CTB_GRAPHICS goes (Console Interface Architecture 2.3.8.2 Console Terminal Block Table).

I'm also confused that this

+ * Format of the Console Terminal Block Type 4 `turboslot' field:

says "type 4", but you're actually using type 3 (GRAPHICS) above.

But I do see that what you're filling in is exactly what netbsd examines -- no header checks, no size checks, or anything. And that openbsd has an exact copy of that code.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]