Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1343131

Re: [PATCH 1/2] hvc_xen: add earlycon support

From Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] hvc_xen: add earlycon support
Date 2016-02-25 13:00 +0100
Message-ID <r62Km-3eF-11@gated-at.bofh.it> (permalink)
References <r5GJQ-4si-9@gated-at.bofh.it> <r5GJQ-4si-17@gated-at.bofh.it> <r5IVj-5Xo-1@gated-at.bofh.it> <r5K13-6Gg-11@gated-at.bofh.it> <r5Lqb-7M2-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 24 Feb 2016, Konrad Rzeszutek Wilk wrote:
> > I could do the same here by dropping the if (!xen_pv_domain()) check
> > above, but then if somebody specifies earlyprintk=xenboot on a non-Xen
> > environment, I expect Linux would crash.
> 
> Nah, you made it "Work" with:
> commit eb5ef07151ba3c3cb4bcef0c8f146ff1115eaa55
> Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Date:   Fri Jan 27 18:31:36 2012 +0000
> 
>     hvc_xen: support PV on HVM consoles
> 
> But this patch:
> 
> commit 04b772d2b819f0dda2163e3193fa7cd447a6245c
> 
> xen/hvc: If we use xen_raw_printk let it also work on HVM guests.
>     
>     The xen_raw_printk works great for debugging purposes. We use
>     for PV guests and we can also use it for HVM guests.
>     
>     However, for HVM guests we have a fallback of using the 0xe9
>     port in case the hypervisor does not support an HVM guest of
>     using the console_io hypercall. As such lets use 0xe9 during
>     early bootup, and once the hyper-page is setup and if the
>     console_io hypercall is supported - use that. Otherwise we
>     will fallback to using the 0xe9 after early bootup.
>     
>     We also alter the return value for dom0_write_console to return
>     an error value instead of zero. The HVC API has been supporting
>     returning error values for quite some time.
>     
>     P.S.
>     To use (and to see the output in the Xen ring buffer) one has to build
>     the hypervisor with 'debug=y'.
> 
> Should make it possible for HVM guests to actually work with HVM x86 guests
> if tweaked.

That only makes xen_raw_printk and xen_raw_console_write work with HVM
x86 guests, not the generic early_printk calls, usually enabled in PV
guests with "earlyprintk=xen" on the kernel command line.

But the xen_cpuid_base() check and outbs could be used in
xenboot_write_console too to make early_printk work. I'll add a patch
for that.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] hvc_xen: add earlycon support Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-24 13:30 +0100
  Re: [PATCH 1/2] hvc_xen: add earlycon support Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2016-02-24 15:50 +0100
    Re: [PATCH 1/2] hvc_xen: add earlycon support Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-24 17:00 +0100
      Re: [Xen-devel] [PATCH 1/2] hvc_xen: add earlycon support Andrew Cooper <andrew.cooper3@citrix.com> - 2016-02-24 18:30 +0100
        Re: [Xen-devel] [PATCH 1/2] hvc_xen: add earlycon support Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-25 13:10 +0100
      Re: [PATCH 1/2] hvc_xen: add earlycon support Stefano Stabellini <stefano.stabellini@eu.citrix.com> - 2016-02-25 13:00 +0100

csiph-web