Module Name:    src
Committed By:   bouyer
Date:           Sun May  3 17:23:14 UTC 2020

Modified Files:
        src/sys/arch/xen/x86: pvh_consinit.c

Log Message:
Hanble dom0 console. This one doesn't need a ring to be mapped, and
can be used earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/xen/x86/pvh_consinit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/x86/pvh_consinit.c
diff -u src/sys/arch/xen/x86/pvh_consinit.c:1.1 src/sys/arch/xen/x86/pvh_consinit.c:1.2
--- src/sys/arch/xen/x86/pvh_consinit.c:1.1	Sat May  2 16:44:36 2020
+++ src/sys/arch/xen/x86/pvh_consinit.c	Sun May  3 17:23:14 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pvh_consinit.c,v 1.1 2020/05/02 16:44:36 bouyer Exp $ */
+/* $NetBSD: pvh_consinit.c,v 1.2 2020/05/03 17:23:14 bouyer Exp $ */
 
 /*
  * Copyright (c) 2020 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.1 2020/05/02 16:44:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pvh_consinit.c,v 1.2 2020/05/03 17:23:14 bouyer Exp $");
 
 #include "xencons.h"
 #include <sys/param.h>
@@ -59,7 +59,7 @@ xen_pvh_consinit(void)
 	 * boot stage.
 	 */
 	static int initted = 0;
-	if (initted == 0) {
+	if (initted == 0 && !xendomain_is_dom0()) {
 		/* pmap not up yet, fall back to printk() */
 		cn_tab = &pvh_xencons;
 		initted++;
@@ -68,6 +68,12 @@ xen_pvh_consinit(void)
 		return;
 	}
 	initted++;
+	if (xendomain_is_dom0()) {
+		xenconscn_attach(); /* no ring in this case */
+		initted++; /* don't init console twice */
+		return;
+	}
+		
 #if NXENCONS > 0
 	/* we can now map the xencons rings. */
 	struct xen_hvm_param xen_hvm_param;

Reply via email to