[PATCH] x86/pvh: Override opt_console_xen earlier

Andrew Cooper posted 1 patch 3 years, 12 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20200427121944.1443-1-andrew.cooper3@citrix.com
xen/arch/x86/boot/head.S | 3 +++
xen/arch/x86/setup.c     | 5 -----
2 files changed, 3 insertions(+), 5 deletions(-)
[PATCH] x86/pvh: Override opt_console_xen earlier
Posted by Andrew Cooper 3 years, 12 months ago
This allows printk() to work from the start of day, and backtraces from as
early as the IDT is set up.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/boot/head.S | 3 +++
 xen/arch/x86/setup.c     | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 153a53f250..150f7f90a2 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -402,6 +402,9 @@ __pvh_start:
 
         mov     %ebx, sym_esi(pvh_start_info_pa)
 
+        /* Force xen console.  Will revert to user choice in init code. */
+        movb    $-1, sym_esi(opt_console_xen)
+
         /* Prepare gdt and segments */
         add     %esi, sym_esi(gdt_boot_base)
         lgdt    sym_esi(gdt_boot_descr)
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 885919d5c3..eb56d78c2f 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -728,11 +728,6 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( pvh_boot )
     {
-        /*
-         * Force xen console to be enabled. We will reset it later in console
-         * initialisation code.
-         */
-        opt_console_xen = -1;
         ASSERT(mbi_p == 0);
         pvh_init(&mbi, &mod);
     }
-- 
2.11.0


Re: [PATCH] x86/pvh: Override opt_console_xen earlier
Posted by Wei Liu 3 years, 12 months ago
On Mon, Apr 27, 2020 at 01:19:44PM +0100, Andrew Cooper wrote:
> This allows printk() to work from the start of day, and backtraces from as
> early as the IDT is set up.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Wei Liu <wl@xen.org>