public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH kvmtool 2/6] arm: fdt: add stdout-path to /chosen node
Date: Fri, 1 Feb 2019 06:26:58 +0000	[thread overview]
Message-ID: <20190201062654.GA4308@brain-police> (raw)
In-Reply-To: <20190131145711.6e6a4bcb@donnerap.cambridge.arm.com>

On Thu, Jan 31, 2019 at 02:57:11PM +0000, Andre Przywara wrote:
> On Wed, 30 Jan 2019 18:20:19 +0000
> Will Deacon <will.deacon@arm.com> wrote:
> > On Fri, Jan 25, 2019 at 06:07:57PM +0000, Andre Przywara wrote:
> > > The DT spec describes the stdout-path property in the /chosen node
> > > to contain the DT path for a default device usable for outputting
> > > characters. The Linux kernel uses this for earlycon (without
> > > further parameters), other DT users might rely on this as well.
> > > 
> > > Add a property containing the path to our emulated 8250 serial
> > > device.
> > > 
> > > Even when we use the virtio console, the serial console is still
> > > there and works, so we can expose this unconditionally. Putting the
> > > virtio console path in there will not work anyway.
> > > 
> > > Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> > > ---
> > >  arm/fdt.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/arm/fdt.c b/arm/fdt.c
> > > index 28ba1c2c..8cda3ded 100644
> > > --- a/arm/fdt.c
> > > +++ b/arm/fdt.c
> > > @@ -143,6 +143,7 @@ static int setup_fdt(struct kvm *kvm)
> > >  	_FDT(fdt_property_cell(fdt, "linux,pci-probe-only", 1));
> > >  	_FDT(fdt_property_string(fdt, "bootargs",
> > > kvm->cfg.real_cmdline)); _FDT(fdt_property_u64(fdt, "kaslr-seed",
> > > kvm->cfg.arch.kaslr_seed));
> > > +	_FDT(fdt_property_string(fdt, "stdout-path",
> > > "/U6_16550A@3f8"));  
> > 
> > Since the last string here has to match the one in hw/serial.c, I
> > think we should be retrieving it from there rather than hardcoding it
> > here.
> 
> Are you thinking about something like setting a "char
> *primary_console_path" in hw/serial.c:serial8250_generate_fdt_node(),
> then using this here in arm/fdt.c?
> Or shall the generate function directly set the stdout-path?

It's probably a bit dodgy doing it from the generate function, because I
think we'd then be relying on the the /chosen node being created before the
serial node (which is true, but I wouldn't like to rely on it).

So I think either have a way to register the primary console device, or a
way to squirrel the string away somewhere. Is there a variant of stdout-path
which uses a phandle instead of a string?  That might end up being cleaner
to implement.

Will

  reply	other threads:[~2019-02-01  6:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 18:07 [PATCH kvmtool 0/6] Various convenience fixes Andre Przywara
2019-01-25 18:07 ` [PATCH kvmtool 1/6] arm: turn pr_info() into pr_debug() messages Andre Przywara
2019-01-25 18:07 ` [PATCH kvmtool 2/6] arm: fdt: add stdout-path to /chosen node Andre Przywara
2019-01-30 18:20   ` Will Deacon
2019-01-31 14:57     ` Andre Przywara
2019-02-01  6:26       ` Will Deacon [this message]
2019-02-01 11:03         ` Andre Przywara
2019-01-25 18:07 ` [PATCH kvmtool 3/6] Makefile: support -s switch Andre Przywara
2019-01-30 18:20   ` Will Deacon
2019-01-31 13:48     ` Andre Przywara
2019-01-25 18:07 ` [PATCH kvmtool 4/6] Makefile: Remove echoing of kvmtools version file Andre Przywara
2019-01-30 18:20   ` Will Deacon
2019-01-31 18:36     ` Andre Przywara
2019-01-25 18:08 ` [PATCH kvmtool 5/6] arm: pmu: Improve PMU error reporting Andre Przywara
2019-01-25 18:08 ` [PATCH kvmtool 6/6] arm: Auto-detect guest GIC type Andre Przywara
2019-01-30 18:20   ` Will Deacon
2019-01-31 18:46     ` Andre Przywara
2019-01-30 18:20 ` [PATCH kvmtool 0/6] Various convenience fixes Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190201062654.GA4308@brain-police \
    --to=will.deacon@arm.com \
    --cc=andre.przywara@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox