|
From: | Paolo Bonzini |
Subject: | Re: [PATCH] pci: add romsize property |
Date: | Tue, 19 Jan 2021 18:10:34 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |