qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
To: Alexander Graf <agraf@suse.de>
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com,
	Paul Brook <paul@codesourcery.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH] arm boot: added QOM device definition
Date: Wed, 8 Feb 2012 23:04:00 +1000	[thread overview]
Message-ID: <CAEgOgz77CRb5dpt4ck5DntKZL587ZghwjVoRipse3xtLM8GD+Q@mail.gmail.com> (raw)
In-Reply-To: <1116A54F-BE1E-4620-BDC8-6B6A1A63D3B6@suse.de>

[-- Attachment #1: Type: text/plain, Size: 3302 bytes --]

On Wed, Feb 8, 2012 at 10:41 PM, Alexander Graf <agraf@suse.de> wrote:

>
> On 08.02.2012, at 13:27, Paul Brook wrote:
>
> >> 2012/2/8 Paul Brook <paul@codesourcery.com>
> >>
> >>>>> I suspect we want to replace the arm_load_kernel call with an
> >>>>> arm_linux_loader device with appropriate properties.
> >>>>
> >>>> Ok, so does this mean the machine model would still explicitly
> >>>> instantiate the bootloader device?
> >>>
> >>> Yes.  Bootloaders inherently have machine specific knowledge.  They
> need
> >>> to know ram location, board ID, secondary CPU boot protocols, etc.
> >>> Requiring the user specify all these things separately from the rest of
> >>> the machine description is IMO not acceptable.
> >>
> >> So what im suggesting here is that machines export these properties to a
> >> globally accessible location. Perhaps via the machine opts mechanism?
> Then
> >> we are in a best of both worls situation where machine models do not
> need
> >> bootloader awareness yet bootloaders can still query qemu for ram_size,
> >> smp#, board_id and friends.
> >
> > Hmm, I suppose this might work.  I'm not sure what you think the benefit
> of
> > this is though.  Fact is the machine needs to have bootloader awareness,
> > whether it be instantating an object or setting magic variables.
> > Having devices rummage around in global state feels messy.  I'd much
> rather
> > use actual properties on the device.  IMO changing the bootloader is
> similar
> > complexity to (say) changing a UART. i.e. it's a board-level change not
> an
> > end-user level change.  Board-level changes are something that will
> happen
> > after QOM conversion, i.e. when we replace machine->init with a board
> config
> > file.
>
>
> Yeah, basically the variable flow goes:
>
>  vl.c -> machine_opts -> machine_init() -> device properties ->
> device_init()
>

So that the machine init function that creates the bootloader device
> enumerates the machine_opts (just like is done in Peter's patches) and then
> passes those on to the bootloader device as device properties.
>
>
So in patch 4/4 in Peters series where he adds a new bootloader feature
(the -dtb switch) its done slightly differently, the machine model does not
handle the machine_opts at all, i.e. The machine model has no awareness of
this dtb argument. Instead the arm boot loader directly queries the
machine_opts API itself:

@@ -251,6 +317,9 @@ void arm_load_kernel(CPUState *env, struct
arm_boot_info *info)
        exit(1);
    }

+    info->dtb_filename = qemu_opt_get(qemu_opts_find(
qemu_find_opts("machine"),
+                                                     0), "dtb");
+

There is no path through the machine_init for this particular property.
What I am suggesting is that a similar approach is take for machine model
set properties (such as ram_size), but instead of the command line setting
the props its done by the machine model. The machine model qemu_opt_set()
the ram_size = whatever. Then the bootloader qemu_opt_get()s it. If you did
this for the key properties related to boot then you would remove the need
for machines to have awareness of their boot process.


> The rationale behind machine opts is that they're basically a dynamic
> number of properties for the not-yet-existing machine object.
>
>
> Alex
>
>

[-- Attachment #2: Type: text/html, Size: 4500 bytes --]

  reply	other threads:[~2012-02-08 13:04 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-08  7:55 [Qemu-devel] [RFC PATCH] arm boot: added QOM device definition Peter A. G. Crosthwaite
2012-02-08  9:06 ` Paul Brook
2012-02-08 10:11   ` Peter Crosthwaite
2012-02-08 10:44     ` Paul Brook
2012-02-08 11:10       ` Peter Crosthwaite
2012-02-08 11:39         ` Paul Brook
2012-02-08 11:59           ` Peter Crosthwaite
2012-02-08 12:27             ` Paul Brook
2012-02-08 12:41               ` Alexander Graf
2012-02-08 13:04                 ` Peter Crosthwaite [this message]
2012-02-08 13:10                   ` Alexander Graf
2012-02-08 13:30                     ` Peter Crosthwaite
2012-02-08 13:35                       ` Alexander Graf
2012-02-08 14:05                         ` Peter Crosthwaite
2012-02-08 14:17                           ` Alexander Graf
2012-02-08 14:20                           ` Paul Brook
2012-02-08 14:39                             ` Peter Crosthwaite
2012-02-08 14:56                               ` Paul Brook
2012-02-08 15:14                                 ` Peter Crosthwaite
2012-02-08 15:57                                   ` Paul Brook
2012-02-08 16:03                                     ` Peter Crosthwaite
2012-02-08 16:15                                       ` Paul Brook
2012-02-08 16:35                                         ` Anthony Liguori
2012-02-09  1:22                                           ` Peter Crosthwaite
2012-02-09 12:03                                             ` Paul Brook
2012-02-08 16:20                                       ` Anthony Liguori
2012-02-08 13:47                 ` Anthony Liguori
2012-02-20 19:43                   ` Peter Maydell
2012-02-20 19:51                     ` Andreas Färber
2012-02-20 19:56                       ` Peter Maydell
2012-02-21  9:15                         ` Peter Crosthwaite
2012-02-21 10:20                           ` Peter Maydell
2012-02-08 13:41 ` Anthony Liguori
2012-02-09 13:22 ` Andreas Färber
2012-02-10  2:11   ` Peter Crosthwaite

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=CAEgOgz77CRb5dpt4ck5DntKZL587ZghwjVoRipse3xtLM8GD+Q@mail.gmail.com \
    --to=peter.crosthwaite@petalogix.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=paul@codesourcery.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).