qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org, "Haibin Zhang" <haibinzhang@tencent.com>,
	"David Edmondson" <david.edmondson@oracle.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Laszlo Ersek <lersek@redhat.com>,
	dgilbert@redhat.com, mst@redhat.com
Subject: Re: [PATCH] pci: add romsize property
Date: Tue, 19 Jan 2021 18:10:34 +0100	[thread overview]
Message-ID: <7f0cf9f5-f820-0571-f0f7-b409af19bd1f@redhat.com> (raw)
In-Reply-To: <b9b7e55a-0f90-6680-8e15-992997afdd38@redhat.com>

On 19/01/21 17:51, Philippe Mathieu-Daudé wrote:
>> +    if (pci_dev->romsize != -1 && !is_power_of_2(pci_dev->romsize)) {
>> +        error_setg(errp, "ROM size %d is not a power of two", pci_dev->romsize);
>> +        return;
>> +    }
> Some cloud providers already complained the pow2 check in the pflash
> device (wasting host storage). Personally I find using pow2 easier
> and safer.

This check only applies to the value that is specified on the command 
line or in a global property, not to the file (the purpose of the 
property is exactly to override the file size, no matter if the file 
size is a power of two or not).

Even if there is no value for the property, non-power-of-two ROMs files 
are accepted and changed into the next power of two:

	pdev->romsize = pow2ceil(size);

> The pow2 check looks like a separate change however, maybe add in a
> separate patch? Or maybe not:)

Not a separate patch for the above reason: the check is on the 
newly-introduced property.

Paolo



  reply	other threads:[~2021-01-19 19:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 18:27 [PATCH] pci: add romsize property Paolo Bonzini
2020-12-18 18:54 ` Dr. David Alan Gilbert
2021-01-19 16:31   ` Peter Xu
2021-01-19 16:51 ` Philippe Mathieu-Daudé
2021-01-19 17:10   ` Paolo Bonzini [this message]
2021-01-19 17:19     ` Philippe Mathieu-Daudé
2021-01-19 17:20   ` Laszlo Ersek
2021-01-22 14:54     ` Paolo Bonzini
2021-01-20 10:14   ` David Edmondson
2021-01-22 14:30 ` Michael S. Tsirkin

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=7f0cf9f5-f820-0571-f0f7-b409af19bd1f@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=david.edmondson@oracle.com \
    --cc=dgilbert@redhat.com \
    --cc=haibinzhang@tencent.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=philmd@redhat.com \
    --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).