Skip to content

Commit adf330a

Browse files
jbeulichjgross1
authored andcommitted
xen/x86: make "earlyprintk=xen" work better for PVH Dom0
The xen_hvm_early_write() path better wouldn't be taken in this case; while port 0xE9 can be used, the hypercall path is quite a bit more efficient. Put that first, as it may also work for DomU-s (see also xen_raw_console_write()). While there also bail from the function when the first domU_write_console() failed - later ones aren't going to succeed. Signed-off-by: Jan Beulich <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent cae7d81 commit adf330a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/tty/hvc/hvc_xen.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,17 +621,16 @@ static void xenboot_write_console(struct console *console, const char *string,
621621
unsigned int linelen, off = 0;
622622
const char *pos;
623623

624+
if (dom0_write_console(0, string, len) >= 0)
625+
return;
626+
624627
if (!xen_pv_domain()) {
625628
xen_hvm_early_write(0, string, len);
626629
return;
627630
}
628631

629-
dom0_write_console(0, string, len);
630-
631-
if (xen_initial_domain())
632+
if (domU_write_console(0, "(early) ", 8) < 0)
632633
return;
633-
634-
domU_write_console(0, "(early) ", 8);
635634
while (off < len && NULL != (pos = strchr(string+off, '\n'))) {
636635
linelen = pos-string+off;
637636
if (off + linelen > len)

0 commit comments

Comments
 (0)