]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
xen/x86: make "earlyprintk=xen" work better for PVH Dom0
authorJan Beulich <jbeulich@suse.com>
Thu, 30 Sep 2021 12:17:41 +0000 (14:17 +0200)
committerJuergen Gross <jgross@suse.com>
Tue, 5 Oct 2021 06:36:00 +0000 (08:36 +0200)
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 <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/4fd89dcb-cfc5-c740-2e94-bb271e432d3e@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/tty/hvc/hvc_xen.c

index 92c9a476defc998f5cf8dfd6185127cf68b479b5..ee7ea8d762faea64a7ec10ed2c8effdcab5a4238 100644 (file)
@@ -621,17 +621,16 @@ static void xenboot_write_console(struct console *console, const char *string,
        unsigned int linelen, off = 0;
        const char *pos;
 
+       if (dom0_write_console(0, string, len) >= 0)
+               return;
+
        if (!xen_pv_domain()) {
                xen_hvm_early_write(0, string, len);
                return;
        }
 
-       dom0_write_console(0, string, len);
-
-       if (xen_initial_domain())
+       if (domU_write_console(0, "(early) ", 8) < 0)
                return;
-
-       domU_write_console(0, "(early) ", 8);
        while (off < len && NULL != (pos = strchr(string+off, '\n'))) {
                linelen = pos-string+off;
                if (off + linelen > len)