linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 3/9] xen/x86: make "earlyprintk=xen" work better for PVH Dom0
       [not found] <9a26d4ff-80a1-e0c1-f528-31a8568d41f7@suse.com>
@ 2021-09-30 12:17 ` Jan Beulich
  2021-09-30 12:18 ` [PATCH v2 5/9] xen/x86: make "earlyprintk=xen" work for HVM/PVH DomU Jan Beulich
  1 sibling, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2021-09-30 12:17 UTC (permalink / raw)
  To: Juergen Gross, Boris Ostrovsky
  Cc: xen-devel@lists.xenproject.org, Stefano Stabellini,
	linuxppc-dev@lists.ozlabs.org, lkml, Roger Pau Monné

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>

--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -632,17 +632,16 @@ static void xenboot_write_console(struct
 	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)


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

* [PATCH v2 5/9] xen/x86: make "earlyprintk=xen" work for HVM/PVH DomU
       [not found] <9a26d4ff-80a1-e0c1-f528-31a8568d41f7@suse.com>
  2021-09-30 12:17 ` [PATCH v2 3/9] xen/x86: make "earlyprintk=xen" work better for PVH Dom0 Jan Beulich
@ 2021-09-30 12:18 ` Jan Beulich
  1 sibling, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2021-09-30 12:18 UTC (permalink / raw)
  To: Juergen Gross, Boris Ostrovsky
  Cc: xen-devel@lists.xenproject.org, Stefano Stabellini,
	linuxppc-dev@lists.ozlabs.org, lkml, Roger Pau Monné

xenboot_write_console() is dealing with these quite fine so I don't see
why xenboot_console_setup() would return -ENOENT in this case.

Adjust documentation accordingly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>

--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -1266,7 +1266,7 @@
 			The VGA and EFI output is eventually overwritten by
 			the real console.
 
-			The xen output can only be used by Xen PV guests.
+			The xen option can only be used in Xen domains.
 
 			The sclp output can only be used on s390.
 
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -618,10 +618,8 @@ static int __init xenboot_console_setup(
 {
 	static struct xencons_info xenboot;
 
-	if (xen_initial_domain())
+	if (xen_initial_domain() || !xen_pv_domain())
 		return 0;
-	if (!xen_pv_domain())
-		return -ENODEV;
 
 	return xencons_info_pv_init(&xenboot, 0);
 }


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

end of thread, other threads:[~2021-09-30 12:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <9a26d4ff-80a1-e0c1-f528-31a8568d41f7@suse.com>
2021-09-30 12:17 ` [PATCH v2 3/9] xen/x86: make "earlyprintk=xen" work better for PVH Dom0 Jan Beulich
2021-09-30 12:18 ` [PATCH v2 5/9] xen/x86: make "earlyprintk=xen" work for HVM/PVH DomU Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).