All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Hongbo Zhang <hongbo.zhang@linaro.org>,
	Radoslaw Biernacki <radoslaw.biernacki@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH v7 2/2] hw/arm: Add arm SBSA reference machine, devices part
Date: Wed, 08 May 2019 15:59:32 +0200	[thread overview]
Message-ID: <87mujxavy3.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA-poCxPqPtfhx4mUJ5pcOjn1Hz-WNxEt29f=JgpFMi4Kg@mail.gmail.com> (Peter Maydell's message of "Tue, 30 Apr 2019 15:16:59 +0100")

Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 18 Apr 2019 at 05:05, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>
>> Following the previous patch, this patch adds peripheral devices to the
>> newly introduced SBSA-ref machine.
>>
>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>> ---
>>  hw/arm/sbsa-ref.c | 451 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 451 insertions(+)
>
> Some fairly minor comments on this one.
>
>> +static void create_flash(const SBSAMachineState *vms,
>> +                         MemoryRegion *sysmem,
>> +                         MemoryRegion *secure_sysmem)
>> +{
>> +    /*
>> +     * Create one secure and nonsecure flash devices to fill SBSA_FLASH
>> +     * space in the memmap, file passed via -bios goes in the first one.
>> +     */
>> +    hwaddr flashsize = vms->memmap[SBSA_FLASH].size / 2;
>> +    hwaddr flashbase = vms->memmap[SBSA_FLASH].base;
>> +
>> +    create_one_flash("sbsa-ref.flash0", flashbase, flashsize,
>> +                     bios_name, secure_sysmem);
>> +    create_one_flash("sbsa-ref.flash1", flashbase + flashsize, flashsize,
>> +                     NULL, sysmem);
>> +}
>
> I think Markus might have an opinion on the best way to create
> flash devices on a new board model. Is "just create two flash
> devices the way the virt board does" the right thing?

Short answer: create flash devices the way the ARM virt board does now,
after commit e0561e60f17, merged into master today.  Possibly less
backward compatibility stuff you don't need.  As is, your patch creates
them the way the ARM virt board did before commit e0561e60f17.  Please
consider updating.

Longer answer:

The old way to configure block backends is -drive.

The newer -blockdev is more flexible.  Libvirt is in the process of
transitioning from -drive to -blockdev entirely.  Other users with
similar needs for flexibility may do the same.  We hope to deprecate
-drive eventually.

The traditional way to configure onboard flash is -drive if=pflash.
Works, but we need a way to configure with -blockdev for full
flexibility, and to support libvirt ditching -drive entirely.

I recently improved the i386 PC machine types (commit ebc29e1beab) and
the ARM virt machine types (commit e0561e60f17) to support flash
configuration with -blockdev.

I recommend new boards support flash configuration with -blockdev from
the start.

Questions?

WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Hongbo Zhang <hongbo.zhang@linaro.org>,
	Radoslaw Biernacki <radoslaw.biernacki@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v7 2/2] hw/arm: Add arm SBSA reference machine, devices part
Date: Wed, 08 May 2019 15:59:32 +0200	[thread overview]
Message-ID: <87mujxavy3.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <CAFEAcA-poCxPqPtfhx4mUJ5pcOjn1Hz-WNxEt29f=JgpFMi4Kg@mail.gmail.com> (Peter Maydell's message of "Tue, 30 Apr 2019 15:16:59 +0100")

Peter Maydell <peter.maydell@linaro.org> writes:

> On Thu, 18 Apr 2019 at 05:05, Hongbo Zhang <hongbo.zhang@linaro.org> wrote:
>>
>> Following the previous patch, this patch adds peripheral devices to the
>> newly introduced SBSA-ref machine.
>>
>> Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org>
>> ---
>>  hw/arm/sbsa-ref.c | 451 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 451 insertions(+)
>
> Some fairly minor comments on this one.
>
>> +static void create_flash(const SBSAMachineState *vms,
>> +                         MemoryRegion *sysmem,
>> +                         MemoryRegion *secure_sysmem)
>> +{
>> +    /*
>> +     * Create one secure and nonsecure flash devices to fill SBSA_FLASH
>> +     * space in the memmap, file passed via -bios goes in the first one.
>> +     */
>> +    hwaddr flashsize = vms->memmap[SBSA_FLASH].size / 2;
>> +    hwaddr flashbase = vms->memmap[SBSA_FLASH].base;
>> +
>> +    create_one_flash("sbsa-ref.flash0", flashbase, flashsize,
>> +                     bios_name, secure_sysmem);
>> +    create_one_flash("sbsa-ref.flash1", flashbase + flashsize, flashsize,
>> +                     NULL, sysmem);
>> +}
>
> I think Markus might have an opinion on the best way to create
> flash devices on a new board model. Is "just create two flash
> devices the way the virt board does" the right thing?

Short answer: create flash devices the way the ARM virt board does now,
after commit e0561e60f17, merged into master today.  Possibly less
backward compatibility stuff you don't need.  As is, your patch creates
them the way the ARM virt board did before commit e0561e60f17.  Please
consider updating.

Longer answer:

The old way to configure block backends is -drive.

The newer -blockdev is more flexible.  Libvirt is in the process of
transitioning from -drive to -blockdev entirely.  Other users with
similar needs for flexibility may do the same.  We hope to deprecate
-drive eventually.

The traditional way to configure onboard flash is -drive if=pflash.
Works, but we need a way to configure with -blockdev for full
flexibility, and to support libvirt ditching -drive entirely.

I recently improved the i386 PC machine types (commit ebc29e1beab) and
the ARM virt machine types (commit e0561e60f17) to support flash
configuration with -blockdev.

I recommend new boards support flash configuration with -blockdev from
the start.

Questions?


  parent reply	other threads:[~2019-05-08 13:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18  4:04 [Qemu-arm] [PATCH v7 0/2] Add Arm SBSA Reference Machine Hongbo Zhang
2019-04-18  4:04 ` [Qemu-devel] " Hongbo Zhang
2019-04-18  4:04 ` Hongbo Zhang
2019-04-18  4:04 ` [Qemu-arm] [PATCH v7 1/2] hw/arm: Add arm SBSA reference machine, skeleton part Hongbo Zhang
2019-04-18  4:04   ` [Qemu-devel] " Hongbo Zhang
2019-04-18  4:04   ` Hongbo Zhang
2019-04-30 14:03   ` Peter Maydell
2019-04-30 14:03     ` Peter Maydell
2019-05-08 11:22     ` [Qemu-arm] " Hongbo Zhang
2019-05-08 11:22       ` [Qemu-devel] " Hongbo Zhang
2019-05-09 14:27       ` Igor Mammedov
2019-05-09 14:40         ` [Qemu-arm] " Peter Maydell
2019-05-09 14:40           ` [Qemu-devel] " Peter Maydell
2019-04-18  4:04 ` [Qemu-arm] [PATCH v7 2/2] hw/arm: Add arm SBSA reference machine, devices part Hongbo Zhang
2019-04-18  4:04   ` [Qemu-devel] " Hongbo Zhang
2019-04-18  4:04   ` Hongbo Zhang
2019-04-30 14:16   ` [Qemu-arm] " Peter Maydell
2019-04-30 14:16     ` [Qemu-devel] " Peter Maydell
2019-04-30 14:16     ` Peter Maydell
2019-05-08 11:30     ` [Qemu-arm] " Hongbo Zhang
2019-05-08 11:30       ` [Qemu-devel] " Hongbo Zhang
2019-05-08 17:48       ` Radoslaw Biernacki
2019-05-09  8:46         ` [Qemu-arm] " Peter Maydell
2019-05-09  8:46           ` [Qemu-devel] " Peter Maydell
2019-05-08 13:59     ` Markus Armbruster [this message]
2019-05-08 13:59       ` Markus Armbruster
2019-06-02  3:16       ` [Qemu-arm] " Hongbo Zhang
2019-06-02  3:16         ` Hongbo Zhang
2019-06-03 10:54   ` [Qemu-arm] " Philippe Mathieu-Daudé
2019-06-03 10:54     ` Philippe Mathieu-Daudé
2019-06-16 11:41     ` Hongbo Zhang
2019-06-17 11:08       ` [Qemu-arm] " Philippe Mathieu-Daudé
2019-06-17 11:08         ` Philippe Mathieu-Daudé
2019-06-17  2:44     ` [Qemu-arm] " Hongbo Zhang
2019-06-17  2:44       ` Hongbo Zhang
2019-04-30 14:18 ` [Qemu-arm] [PATCH v7 0/2] Add Arm SBSA Reference Machine Peter Maydell
2019-04-30 14:18   ` [Qemu-devel] " Peter Maydell
2019-04-30 14:18   ` Peter Maydell

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=87mujxavy3.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=hongbo.zhang@linaro.org \
    --cc=leif.lindholm@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=radoslaw.biernacki@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.