Re: [PATCH v3 02/24] modules: collect module meta-data

2021-06-23 Thread Paolo Bonzini
Oh well. Let's add a to-do marker. Paolo Il mer 23 giu 2021, 09:36 Gerd Hoffmann ha scritto: > On Tue, Jun 22, 2021 at 06:03:45PM +0200, Paolo Bonzini wrote: > > On 21/06/21 14:52, Gerd Hoffmann wrote: > > > ninja: error: 'libui-curses.a.p/meson-generated_.._config-host.h.o', > needed by 'ui-cu

Re: [RFC PATCH 0/9] hw/sd: Allow card size not power of 2 again

2021-06-23 Thread Alexander Bulekov
On 210623 2000, Philippe Mathieu-Daudé wrote: > Hi Ubi-Wan Kenubi and Tom, > > In commit a9bcedd (SD card size has to be power of 2) we decided > to restrict SD card size to avoid security problems (CVE-2020-13253) > but this became not practical to some users. > > This RFC series tries to remove

[PATCH] hw/sd: sdhci: Enable 64-bit system bus capability in the default SD/MMC host controller

2021-06-23 Thread Joanne Koong
The default SD/MMC host controller uses SD spec v2.00. 64-bit system bus capability was added in v2. In this change, we arrive at 0x157834b4 by computing (0x057834b4 | (1ul << 28)) where 28 represents the BUS64BIT SDHC_CAPAB field. Signed-off-by: Joanne Koong --- hw/sd/sdhci-internal.h | 4 ++-

[RFC PATCH 6/9] tests/acceptance: Use image_expand() in test_arm_orangepi_bionic_20_08

2021-06-23 Thread Philippe Mathieu-Daudé
U-Boot expects the SD card size to be at least 2GiB, so expand the SD card image to this size before using it. Signed-off-by: Philippe Mathieu-Daudé --- TODO: U-Boot reference? --- tests/acceptance/boot_linux_console.py | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git

[PATCH 5/9] tests/acceptance: Use image_expand() in test_arm_orangepi_uboot_netbsd9

2021-06-23 Thread Philippe Mathieu-Daudé
The NetBSD OrangePi image must be at least 2GiB, not less. Expand the SD card image to this size before using it. Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/boot_li

[PATCH 4/9] tests/acceptance: Extract image_expand() helper

2021-06-23 Thread Philippe Mathieu-Daudé
To be able to expand an image to a non-power-of-2 value, extract image_expand() from image_pow2ceil_expand(). Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/acceptance/boot_

[RFC PATCH 9/9] hw/sd: Allow card size not power of 2 again

2021-06-23 Thread Philippe Mathieu-Daudé
In commit a9bcedd15a5 ("hw/sd/sdcard: Do not allow invalid SD card sizes") we tried to protect us from CVE-2020-13253 by only allowing card with power-of-2 sizes. However doing so we disrupted valid user cases. As a compromise, allow any card size, but warn only power of 2 sizes are supported, stil

[RFC PATCH 7/9] tests/acceptance: Do not expand SD card image in test_arm_orangepi_sd

2021-06-23 Thread Philippe Mathieu-Daudé
XXX it seems to work... Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index c4c0f0b393d..48c0ba09117 100644 --- a/tests/acceptanc

[PATCH 8/9] tests/acceptance: Remove now unused pow2ceil()

2021-06-23 Thread Philippe Mathieu-Daudé
We don't use pow2ceil() anymore, remove it. Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 12 1 file changed, 12 deletions(-) diff --git a/tests/acceptance/boot_linux_console.py b/tests/acceptance/boot_linux_console.py index 48c0ba09117..77bc80

[PATCH 3/9] tests/acceptance: Tag NetBSD tests as 'os:netbsd'

2021-06-23 Thread Philippe Mathieu-Daudé
Avocado allows us to select set of tests using tags. When wanting to run all tests using a NetBSD guest OS, it is convenient to have them tagged, add the 'os:netbsd' tag. Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/boot_linux_console.py | 1 + tests/acceptance/ppc_prep_40p.py

[PATCH 2/9] hw/sd: Extract address_in_range() helper, log invalid accesses

2021-06-23 Thread Philippe Mathieu-Daudé
Multiple commands have to check the address requested is valid. Extract this code pattern as a new address_in_range() helper, and log invalid accesses as guest errors. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 32 1 file changed, 20 insertions(+), 12

[PATCH 1/9] hw/sd: When card is in wrong state, log which state it is

2021-06-23 Thread Philippe Mathieu-Daudé
We report the card is in an inconsistent state, but don't precise in which state it is. Add this information, as it is useful when debugging problems. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.

[RFC PATCH 0/9] hw/sd: Allow card size not power of 2 again

2021-06-23 Thread Philippe Mathieu-Daudé
Hi Ubi-Wan Kenubi and Tom, In commit a9bcedd (SD card size has to be power of 2) we decided to restrict SD card size to avoid security problems (CVE-2020-13253) but this became not practical to some users. This RFC series tries to remove the limitation, keeping our functional tests working. It is

Re: SD/MMC host controller + 64-bit system bus

2021-06-23 Thread Joanne Koong
Great!! I'm happy to do so. Thanks for the reply! On Tue, Jun 22, 2021 at 1:51 PM Philippe Mathieu-Daudé wrote: > Hi Joanne, > > On 6/22/21 8:07 PM, Joanne Koong wrote: > > Hello! I noticed that the default SD/MMC host controller only supports a > > 32-bit system bus. Is there a reason 64-bit sy

Re: [PATCH v2 2/1] qemu-img: Add "backing":true to unallocated map segments

2021-06-23 Thread Nir Soffer
On Wed, Jun 23, 2021 at 7:04 PM Kevin Wolf wrote: > > Am 23.06.2021 um 15:58 hat Nir Soffer geschrieben: > > On Wed, Jun 23, 2021 at 11:58 AM Kevin Wolf wrote: > > > > > > Am 22.06.2021 um 18:56 hat Nir Soffer geschrieben: > > > > On Tue, Jun 22, 2021 at 6:38 PM Kevin Wolf wrote: > > > > > > > >

Re: [PATCH v2 2/1] qemu-img: Add "backing":true to unallocated map segments

2021-06-23 Thread Kevin Wolf
Am 23.06.2021 um 15:58 hat Nir Soffer geschrieben: > On Wed, Jun 23, 2021 at 11:58 AM Kevin Wolf wrote: > > > > Am 22.06.2021 um 18:56 hat Nir Soffer geschrieben: > > > On Tue, Jun 22, 2021 at 6:38 PM Kevin Wolf wrote: > > > > > > > > Am 11.06.2021 um 21:03 hat Eric Blake geschrieben: > > > > > T

Re: [PATCH v4 7/7] block: detect DKIOCGETBLOCKCOUNT/SIZE before use

2021-06-23 Thread Max Reitz
On 08.06.21 15:16, Paolo Bonzini wrote: From: Joelle van Dyne iOS hosts do not have these defined so we fallback to the default behaviour. Co-authored-by: Warner Losh Reviewed-by: Peter Maydell Signed-off-by: Joelle van Dyne Message-Id: <20210315180341.31638-...@getutm.app> Signed-off-by: P

Re: [PATCH v4 5/7] block: feature detection for host block support

2021-06-23 Thread Max Reitz
On 08.06.21 15:16, Paolo Bonzini wrote: From: Joelle van Dyne On Darwin (iOS), there are no system level APIs for directly accessing host block devices. We detect this at configure time. Signed-off-by: Joelle van Dyne Message-Id: <20210315180341.31638-...@getutm.app> Signed-off-by: Paolo Bonz

Re: [PATCH v4 1/7] file-posix: fix max_iov for /dev/sg devices

2021-06-23 Thread Max Reitz
On 08.06.21 21:14, Vladimir Sementsov-Ogievskiy wrote: 08.06.2021 16:16, Paolo Bonzini wrote: Even though it was only called for devices that have bs->sg set (which must be character devices), sg_get_max_segments looked at /sys/dev/block which only works for block devices. On Linux the sg drive

[PATCH v2 6/6] block/iscsi: Do not force-cap *pnum

2021-06-23 Thread Max Reitz
bdrv_co_block_status() does it for us, we do not need to do it here. The advantage of not capping *pnum is that bdrv_co_block_status() can cache larger data regions than requested by its caller. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- blo

[PATCH v2 4/6] block/file-posix: Do not force-cap *pnum

2021-06-23 Thread Max Reitz
bdrv_co_block_status() does it for us, we do not need to do it here. The advantage of not capping *pnum is that bdrv_co_block_status() can cache larger data regions than requested by its caller. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- blo

[PATCH v2 3/6] block: Clarify that @bytes is no limit on *pnum

2021-06-23 Thread Max Reitz
.bdrv_co_block_status() implementations are free to return a *pnum that exceeds @bytes, because bdrv_co_block_status() in block/io.c will clamp *pnum as necessary. On the other hand, if drivers' implementations return values for *pnum that are as large as possible, our recently introduced block-st

[PATCH v2 1/6] block: Drop BDS comment regarding bdrv_append()

2021-06-23 Thread Max Reitz
There is a comment above the BDS definition stating care must be taken to consider handling newly added fields in bdrv_append(). Actually, this comment should have said "bdrv_swap()" as of 4ddc07cac (nine years ago), and in any case, bdrv_swap() was dropped in 8e419aefa (six years ago). So no suc

[PATCH v2 5/6] block/gluster: Do not force-cap *pnum

2021-06-23 Thread Max Reitz
bdrv_co_block_status() does it for us, we do not need to do it here. The advantage of not capping *pnum is that bdrv_co_block_status() can cache larger data regions than requested by its caller. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- blo

[PATCH v2 2/6] block: block-status cache for data regions

2021-06-23 Thread Max Reitz
As we have attempted before (https://lists.gnu.org/archive/html/qemu-devel/2019-01/msg06451.html, "file-posix: Cache lseek result for data regions"; https://lists.nongnu.org/archive/html/qemu-block/2021-02/msg00934.html, "file-posix: Cache next hole"), this patch seeks to reduce the number of SEEK_

[PATCH v2 0/6] block: block-status cache for data regions

2021-06-23 Thread Max Reitz
Hi, See the cover letter from v1 for the general idea: https://lists.nongnu.org/archive/html/qemu-block/2021-06/msg00843.html The biggest change here in v2 is that instead of having a common CoMutex protect the block-status cache, we’re using RCU now. So to read from the cache, or even to inva

Re: Running iotest linters from check-python-* CI jobs

2021-06-23 Thread John Snow
On 6/23/21 6:55 AM, Kevin Wolf wrote: Am 22.06.2021 um 18:24 hat John Snow geschrieben: On 6/22/21 11:52 AM, Max Reitz wrote: On 22.06.21 16:57, John Snow wrote: Hi Kevin: At one point I had the idea to augment the Python linter CI jobs to also run the iotest linters. I thought it would be co

Re: [PATCH v2 2/1] qemu-img: Add "backing":true to unallocated map segments

2021-06-23 Thread Nir Soffer
On Wed, Jun 23, 2021 at 11:58 AM Kevin Wolf wrote: > > Am 22.06.2021 um 18:56 hat Nir Soffer geschrieben: > > On Tue, Jun 22, 2021 at 6:38 PM Kevin Wolf wrote: > > > > > > Am 11.06.2021 um 21:03 hat Eric Blake geschrieben: > > > > To save the user from having to check 'qemu-img info --backing-cha

Re: [PATCH] block: BDRV_O_NO_IO for backing file on creation

2021-06-23 Thread Kevin Wolf
Am 22.06.2021 um 16:00 hat Max Reitz geschrieben: > When creating an image file with a backing file, we generally try to > open the backing file (unless -u was specified), mostly to verify that > it is there, but also to get the file size if none was specified for the > new image. > > For neither

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Philippe Mathieu-Daudé
On 6/23/21 11:11 AM, Bin Meng wrote: > On Wed, Jun 23, 2021 at 4:52 PM Philippe Mathieu-Daudé > wrote: >> >> On 6/23/21 10:39 AM, Bin Meng wrote: >>> On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: The number of blocks is defined in the lower bits [15:0] >>> >>> I checked the p

Re: Running iotest linters from check-python-* CI jobs

2021-06-23 Thread Kevin Wolf
Am 22.06.2021 um 18:24 hat John Snow geschrieben: > On 6/22/21 11:52 AM, Max Reitz wrote: > > On 22.06.21 16:57, John Snow wrote: > > > Hi Kevin: > > > > > > At one point I had the idea to augment the Python linter CI jobs to > > > also run the iotest linters. I thought it would be convenient to >

Re: [PATCH 0/2] introduce QEMU_AUTO_VFREE

2021-06-23 Thread Kevin Wolf
Am 19.06.2021 um 16:21 hat Vladimir Sementsov-Ogievskiy geschrieben: > Hi all! > > There is a good movement to use g_autofree macro, that helps to > automatically call g_free on exit from code block. > > We lack similar possibility for qemu_memalign() functions family. Let's > add, it seems rathe

Re: [PATCH v4 6/6] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

2021-06-23 Thread Paolo Bonzini
On 22/06/21 12:39, Vladimir Sementsov-Ogievskiy wrote: 22.06.2021 13:20, Paolo Bonzini wrote: On 22/06/21 11:36, Vladimir Sementsov-Ogievskiy wrote: OK, I agree, let's keep it. You can also have a finished job, but get a stale value for error_is_read or ret.  The issue is not in getting the

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Cédric Le Goater
On 6/23/21 11:12 AM, Bin Meng wrote: > On Wed, Jun 23, 2021 at 4:55 PM Cédric Le Goater wrote: >> >> On 6/23/21 10:39 AM, Bin Meng wrote: >>> On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: The number of blocks is defined in the lower bits [15:0] >>> >>> I checked the physical s

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Bin Meng
On Wed, Jun 23, 2021 at 4:55 PM Cédric Le Goater wrote: > > On 6/23/21 10:39 AM, Bin Meng wrote: > > On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: > >> > >> The number of blocks is defined in the lower bits [15:0] > > > > I checked the physical spec v8.00 and it says bits [31:0] for CMD

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Bin Meng
On Wed, Jun 23, 2021 at 4:52 PM Philippe Mathieu-Daudé wrote: > > On 6/23/21 10:39 AM, Bin Meng wrote: > > On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: > >> > >> The number of blocks is defined in the lower bits [15:0] > > > > I checked the physical spec v8.00 and it says bits [31:0] f

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Cédric Le Goater
On 6/23/21 10:52 AM, Philippe Mathieu-Daudé wrote: > On 6/23/21 10:39 AM, Bin Meng wrote: >> On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: >>> >>> The number of blocks is defined in the lower bits [15:0] >> >> I checked the physical spec v8.00 and it says bits [31:0] for CMD23 argument.

Re: [PATCH v2 2/1] qemu-img: Add "backing":true to unallocated map segments

2021-06-23 Thread Kevin Wolf
Am 22.06.2021 um 18:56 hat Nir Soffer geschrieben: > On Tue, Jun 22, 2021 at 6:38 PM Kevin Wolf wrote: > > > > Am 11.06.2021 um 21:03 hat Eric Blake geschrieben: > > > To save the user from having to check 'qemu-img info --backing-chain' > > > or other followup command to determine which "depth":n

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Cédric Le Goater
On 6/23/21 10:39 AM, Bin Meng wrote: > On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: >> >> The number of blocks is defined in the lower bits [15:0] > > I checked the physical spec v8.00 and it says bits [31:0] for CMD23 argument. May be that's an eMMC thing. That's what I read from the

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Philippe Mathieu-Daudé
On 6/23/21 10:39 AM, Bin Meng wrote: > On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: >> >> The number of blocks is defined in the lower bits [15:0] > > I checked the physical spec v8.00 and it says bits [31:0] for CMD23 argument. Watch out, we only support 1-3: enum SDPhySpecification

Re: [PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Bin Meng
On Wed, Jun 23, 2021 at 4:30 PM Cédric Le Goater wrote: > > The number of blocks is defined in the lower bits [15:0] I checked the physical spec v8.00 and it says bits [31:0] for CMD23 argument. > > Signed-off-by: Cédric Le Goater > --- > hw/sd/sd.c | 2 +- > 1 file changed, 1 insertion(+), 1

[PATCH] sd: mmc: Fix SET_BLOCK_COUNT command argument

2021-06-23 Thread Cédric Le Goater
The number of blocks is defined in the lower bits [15:0] Signed-off-by: Cédric Le Goater --- hw/sd/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a73d80661a10..a2553a502edc 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1358,7 +1358,7 @@ stat

Re: [PATCH v3 02/24] modules: collect module meta-data

2021-06-23 Thread Gerd Hoffmann
On Tue, Jun 22, 2021 at 06:03:45PM +0200, Paolo Bonzini wrote: > On 21/06/21 14:52, Gerd Hoffmann wrote: > > ninja: error: 'libui-curses.a.p/meson-generated_.._config-host.h.o', needed > > by 'ui-curses.modinfo.test', missing and no known rule to make it > > > > Hmm, not sure where this comes fro