qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Hongbo Zhang <hongbo.zhang@linaro.org>,
	Tanmay Jagdale <tanmay.jagdale@linaro.org>,
	Qemu-block <qemu-block@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	Radoslaw Biernacki <radoslaw.biernacki@gmail.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Max Reitz <mreitz@redhat.com>, Leif Lindholm <leif@nuviainc.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH] hw/block/pflash_cfi01: Limit maximum flash size to 256 MiB
Date: Thu, 4 Jun 2020 16:30:55 +0100	[thread overview]
Message-ID: <CAFEAcA9qVBdLZMO4e+oSaL6kwpF9WS+RdeL3DxBNKVMPwnQ=TQ@mail.gmail.com> (raw)
In-Reply-To: <5dbecc86-f9df-249d-7439-36c358dc5aba@redhat.com>

On Thu, 4 Jun 2020 at 16:16, Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> On 5/25/20 10:59 PM, Peter Maydell wrote:
> > What problem is this check solving? Is there some implementation
> > imposed limitation or a limit within the flash header format
> > that means larger sizes don't work? If so, what's the restriction?
>
> I am not confident maintaining virtual device with no specifications.

This isn't a virtual device, is it? The CFI spec exists and defines
what these flash devices behave like.

> If someone come with a datasheet for a pflash > 256MB then we can add
> another commit to relax this restriction.
> If someone is forced to use a >256MB and such hardware does not exist,
> I'd rather have a document in docs/specs/pflash_cfi01.rst describing the
> CFI fields.
>
> IOW this is not a hardware limitation, but a maintenance protection.
>
> I am worried with the recent EDK2 activity with the SBSA-ref, and I
> don't want to give false hope to developers that they can create any
> kind of pflash with the current device model.
>
> If I reword this better in the commit description, is my argument
> acceptable?

Not really; I think we should know what we're limiting against.
Currently you're checking total_len, but this is just sector_len * nb_blocs,
so if there's a problem with silly large values then it's probably
actually a problem with one of those being over-sized which would
still show up even if the total_len was less than 256MB.
(I suspect the underlying limit here is what the cfi_table entries
0x2D..0x30 impose on blocks_per_device and sector_len_per_device.)

thanks
-- PMM


  reply	other threads:[~2020-06-04 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 15:58 [PATCH] hw/block/pflash_cfi01: Limit maximum flash size to 256 MiB Philippe Mathieu-Daudé
2020-05-25 19:02 ` Laszlo Ersek
2020-05-25 20:59 ` Peter Maydell
2020-06-04 15:16   ` Philippe Mathieu-Daudé
2020-06-04 15:30     ` Peter Maydell [this message]
2020-06-04 15:55       ` Philippe Mathieu-Daudé
2020-06-04 16:03         ` 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='CAFEAcA9qVBdLZMO4e+oSaL6kwpF9WS+RdeL3DxBNKVMPwnQ=TQ@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=armbru@redhat.com \
    --cc=hongbo.zhang@linaro.org \
    --cc=kwolf@redhat.com \
    --cc=leif@nuviainc.com \
    --cc=lersek@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=radoslaw.biernacki@gmail.com \
    --cc=tanmay.jagdale@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 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).