Re: [PATCH v2 14/48] include/hw/s390x: replace assert(false) with g_assert_not_reached()

2024-09-12 Thread Philippe Mathieu-Daudé
On 12/9/24 09:38, Pierrick Bouvier wrote: This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Pierrick Bouvier --- inc

Re: [PATCH 00/39] Use g_assert_not_reached instead of (g_)assert(0,false)

2024-09-11 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Pierrick Bouvier (39): docs/spin: replace assert(0) with g_assert_not_reached() hw/acpi: replace assert(0) with g_assert_not_reached() hw/arm: replace assert(0) with g_assert_not_reached() hw/char: replace assert(0) with g_assert_not_reached(

Re: [PATCH 27/39] hw/gpio: remove break after g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/gpio/nrf51_gpio.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 30/39] hw/pci-host: remove break after g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/pci-host/gt64120.c | 2 -- 1 file changed, 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 36/39] ui: remove break after g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:16, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- ui/qemu-pixman.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 28/39] hw/misc: remove break after g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/misc/imx6_ccm.c | 1 - hw/misc/mac_via.c | 2 -- 2 files changed, 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 07/39] hw/watchdog: replace assert(0) with g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/watchdog/watchdog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 10/39] system: replace assert(0) with g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- system/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 04/39] hw/char: replace assert(0) with g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/char/avr_usart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 05/39] hw/core: replace assert(0) with g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/core/numa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 19/39] hw/pci: replace assert(false) with g_assert_not_reached()

2024-09-10 Thread Philippe Mathieu-Daudé
Hi Pierrick, On 11/9/24 00:15, Pierrick Bouvier wrote: Signed-off-by: Pierrick Bouvier --- hw/pci/pci-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index f0508682d2b..c6950e21bd4 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pc

Re: [PATCH 0/3] hw/sh4: Remove the deprecated SHIX machine

2024-09-06 Thread Philippe Mathieu-Daudé
On 3/9/24 17:39, Philippe Mathieu-Daudé wrote: Remove the deprecated SH4 SHIX machine, along with the TC58128 NAND EEPROM. Philippe Mathieu-Daudé (3): hw/sh4: Remove the deprecated SHIX machine hw/block: Remove TC58128 NAND EEPROM hw/sh4: Remove sh7750_register_io_device() helper

Re: [Question] [Block] Is there a way to control the read caching of a block device?

2024-09-03 Thread Philippe Mathieu-Daudé
Cc'ing the qemu-block@ list On 3/9/24 20:13, DUO Labs wrote: I know that the `cache` parameter for `-drive` controls the caching behavior when writing from the guest to the host, but is there a way to control the reading behavior host->guest? Currently, on HEAD, if I open a file on both the gu

Re: [PATCH 1/2] hw/sd: Remove legacy sd_set_cb()

2024-09-03 Thread Philippe Mathieu-Daudé
(Cc'ing Guenter who asked to keep the SX1 machine) On 3/9/24 22:04, Philippe Mathieu-Daudé wrote: sd_set_cb() was only used by omap2_mmc_init() which got recently removed. Time to remove it. For historical background on the me_no_qdev_me_kill_mammoth_with_rocks kludge, see commit 007d1

[PATCH 1/2] hw/sd: Remove legacy sd_set_cb()

2024-09-03 Thread Philippe Mathieu-Daudé
sd_set_cb() was only used by omap2_mmc_init() which got recently removed. Time to remove it. For historical background on the me_no_qdev_me_kill_mammoth_with_rocks kludge, see commit 007d1dbf72 ("sd: Hide the qdev-but-not-quite thing created by sd_init()"). Signed-off-by: Philippe Mat

[PATCH 2/2] hw/sd: Remove legacy sd_enable()

2024-09-03 Thread Philippe Mathieu-Daudé
sd_enable() was only used by omap_mmc_enable() which got recently removed. Time to remove it. Since the SDState::enable boolean is now always %true, we can remove it and simplify. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sd/sd.h| 1 - include/hw/sd/sdcard_legacy.h | 9

[PATCH 0/2] hw/sd: Remove a pair of legacy methods

2024-09-03 Thread Philippe Mathieu-Daudé
The omap2_mmc device -- deprecated and about to be removed -- was the last user of the legacy sd_set_cb() and sd_enable() methods. Remove them too along with the me_no_qdev_me_kill_mammoth_with_rocks kludge. Based-on: <20240903160751.4100218-1-peter.mayd...@linaro.org> Philippe Mathieu-Da

[PATCH 0/3] hw/sh4: Remove the deprecated SHIX machine

2024-09-03 Thread Philippe Mathieu-Daudé
Remove the deprecated SH4 SHIX machine, along with the TC58128 NAND EEPROM. Philippe Mathieu-Daudé (3): hw/sh4: Remove the deprecated SHIX machine hw/block: Remove TC58128 NAND EEPROM hw/sh4: Remove sh7750_register_io_device() helper MAINTAINERS | 11 -- docs

[PATCH 2/3] hw/block: Remove TC58128 NAND EEPROM

2024-09-03 Thread Philippe Mathieu-Daudé
The TC58128 NAND EEPROM is not user creatable and needs to be instanciated in the code via tc58128_init(). Only the SHIX machine was using it, and it was removed in the previous commit. Since the TC58128 has no more users, remove it too. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS

[PATCH 3/3] hw/sh4: Remove sh7750_register_io_device() helper

2024-09-03 Thread Philippe Mathieu-Daudé
sh7750_register_io_device() was only used by the TC58128 NAND EEPROM which has been removed in the previous commit. Remove it as unused code. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/sh4/sh.h | 16 - hw/sh4/sh7750.c | 57

[PATCH 1/3] hw/sh4: Remove the deprecated SHIX machine

2024-09-03 Thread Philippe Mathieu-Daudé
The SHIX machine is deprecated since v9.0 (commit 322b038c94 "target/sh4: Deprecate the shix machine"). Time to remove it. Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 7 +- docs/about/deprecated.rst | 6 -- docs/about/removed-fe

Re: [PATCH v4 19/34] modules: check arch on qom lookup

2024-08-27 Thread Philippe Mathieu-Daudé
Hi, (old patch) On 24/6/21 12:38, Gerd Hoffmann wrote: With target-specific modules we can have multiple modules implementing the same object. Therefore we have to check the target arch on lookup to find the correct module. "multiple modules implementing the same object." seems a design mist

Re: [PULL for-9.1 1/1] hw/nvme: fix leak of uninitialized memory in io_mgmt_recv

2024-08-20 Thread Philippe Mathieu-Daudé
Hi Klaus, On 20/8/24 06:45, Klaus Jensen wrote: From: Klaus Jensen Yutaro Shimizu from the Cyber Defense Institute discovered a bug in the NVMe emulation that leaks contents of an uninitialized heap buffer if subsystem and FDP emulation are enabled. Was this patch posted on the list for revi

Re: [PATCH] block/blkio: use FUA flag on write zeroes only if supported

2024-08-08 Thread Philippe Mathieu-Daudé
s(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH-for-9.1 v2] hw/ide/pci.c: Remove dead code from bmdma_prepare_buf()

2024-08-06 Thread Philippe Mathieu-Daudé
On 5/8/24 20:24, Philippe Mathieu-Daudé wrote: From: Peter Maydell Coverity notes that the code at the end of the loop in bmdma_prepare_buf() is unreachable. This is because in commit 9fbf0fa81fca8f527 ("ide: remove hardcoded 2GiB transactional limit") we removed the only codepath i

Re: [PATCH 0/7] block: Miscellaneous minor Coverity fixes

2024-08-06 Thread Philippe Mathieu-Daudé
On 31/7/24 16:36, Peter Maydell wrote: hw/block/pflash_cfi01: Don't decrement pfl->counter below 0 hw/ide/atapi: Be explicit that assigning to s->lcyl truncates hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something Patches 3-5 queued, thanks.

Re: [PATCH-for-9.1 0/5] hw/sd: SDcard & SDHCI fixes

2024-08-06 Thread Philippe Mathieu-Daudé
On 30/7/24 11:21, Philippe Mathieu-Daudé wrote: 3 fixes (2 fuzzed). Philippe Mathieu-Daudé (5): hw/sd/sdcard: Explicit dummy byte value hw/sd/sdcard: Do not abort when reading DAT lines on invalid cmd state hw/sd/sdhci: Reset @data_count index on invalid ADMA transfers Patches #1-3

[PATCH-for-9.1 v2] hw/ide/pci.c: Remove dead code from bmdma_prepare_buf()

2024-08-05 Thread Philippe Mathieu-Daudé
t, but didn't notice that this meant we should also remove the code at the end of the loop. Remove the dead code. Resolves: Coverity CID 1547772 Signed-off-by: Peter Maydell Reviewed-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- v2: Bre

Re: [PATCH 0/7] block: Miscellaneous minor Coverity fixes

2024-08-05 Thread Philippe Mathieu-Daudé
On 31/7/24 16:36, Peter Maydell wrote: Peter Maydell (7): hw/block/pflash_cfi01: Don't decrement pfl->counter below 0 hw/ide/atapi: Be explicit that assigning to s->lcyl truncates hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something hw/ide/pci.c: Remove dead

Re: [PATCH 3/7] hw/block/pflash_cfi01: Don't decrement pfl->counter below 0

2024-08-05 Thread Philippe Mathieu-Daudé
: Coverity CID 1547611 Signed-off-by: Peter Maydell --- hw/block/pflash_cfi01.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH-for-9.1? v2 0/4] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-08-05 Thread Philippe Mathieu-Daudé
On 31/7/24 23:24, Philippe Mathieu-Daudé wrote: Since v1: - split patch - do not return MemTxResult from get_adma_description() - single DMA read in SDHC_CTRL_ADMA2_64 case Based-on: <20240730092138.32443-5-phi...@linaro.org> Philippe Mathieu-Daudé (4): hw/sd/sdhci: Reduce variables

Re: [PATCH 2/2] qemu-img: CVE-XXX Sanitize untrusted output from NBD server

2024-08-02 Thread Philippe Mathieu-Daudé
ossible knock-on effects if trace output changes unexpectedly for a tool expecting something unsanitized). I doubt the trace core layer sanitizes, but it feels it is the trace backend responsibility, since core layer might just pass pointer to the backends. --- nbd/client.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 1/2] util: Refactor json-writer's string sanitizer to be public

2024-08-02 Thread Philippe Mathieu-Daudé
clude/qemu/unicode.h | 3 ++ qobject/json-writer.c | 47 +-- util/unicode.c | 84 ++ 3 files changed, 88 insertions(+), 46 deletions(-) Preferably moving the docstring help to the header, Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v3] util: use RETRY_ON_EINTR() on open() more consistently

2024-08-01 Thread Philippe Mathieu-Daudé
Hi Philipp, On 31/7/24 17:17, Philipp Reisner wrote: As with many syscalls, open() might be interrupted by a signal. The call trace img_open_file() blk_new_open() raw_open() raw_open_common() qemu_open() qemu_open_internal() qemu_open_cloexec() E

[PATCH-for-9.1? v2 3/4] hw/sd/sdhci: Read ADMA2_64 descriptor with a single dma_memory_read()

2024-07-31 Thread Philippe Mathieu-Daudé
Instead of 3 consecutive dma_memory_read() calls, use a packed structure to read the descriptor in a single call. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c

[PATCH-for-9.1? v2 2/4] hw/sd/sdhci: Reduce variables scope in get_adma_description()

2024-07-31 Thread Philippe Mathieu-Daudé
e 0xF000 -> ~0xfff to align with our codebase style. No functional change intended. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 87 --- 1 file changed, 48 insertions(+), 39 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c

[PATCH-for-9.1? v2 1/4] hw/sd/sdhci: Reduce variables scope in sdhci_do_adma()

2024-07-31 Thread Philippe Mathieu-Daudé
All variables are only used within the for loop. Declare them within it. In particular this resets 'dscr' on each iteration. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/sd/sdhci.c b/hw/

[PATCH-for-9.1? v2 4/4] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-07-31 Thread Philippe Mathieu-Daudé
Since malicious guest can write invalid addresses to the ADMASYSADDR register, we need to check whether the descriptor could be correctly filled or not. Cc: qemu-sta...@nongnu.org Fixes: d7dfca0807 ("hw/sdhci: introduce standard SD host controller") Signed-off-by: Philippe Mathieu-Daud

[PATCH-for-9.1? v2 0/4] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-07-31 Thread Philippe Mathieu-Daudé
Since v1: - split patch - do not return MemTxResult from get_adma_description() - single DMA read in SDHC_CTRL_ADMA2_64 case Based-on: <20240730092138.32443-5-phi...@linaro.org> Philippe Mathieu-Daudé (4): hw/sd/sdhci: Reduce variables scope in sdhci_do_adma() hw/sd/sdhci: Reduce var

Re: [PATCH 6/7] hw/ide/pci.c: Remove dead code from bmdma_prepare_buf()

2024-07-31 Thread Philippe Mathieu-Daudé
imit) } } -qemu_sglist_destroy(&s->sg); -s->io_buffer_size = 0; -return -1; +return s->sg.size; } --- Either way: Reviewed-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 5/7] hw/block/fdc-isa: Assert that isa_fdc_get_drive_max_chs() found something

2024-07-31 Thread Philippe Mathieu-Daudé
igned-off-by: Peter Maydell --- hw/block/fdc-isa.c | 2 ++ 1 file changed, 2 insertions(+) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 2/7] block/gluster: Use g_autofree for string in qemu_gluster_parse_json()

2024-07-31 Thread Philippe Mathieu-Daudé
never need 'str' outside the loop. Resolves: Coverity CID 1527385 Signed-off-by: Peter Maydell --- block/gluster.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH-for-9.1 5/5] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-07-31 Thread Philippe Mathieu-Daudé
On 30/7/24 11:21, Philippe Mathieu-Daudé wrote: Since malicious guest can write invalid addresses to the ADMASYSADDR register, we need to check whether the descriptor could be correctly filled or not. Cc: qemu-sta...@nongnu.org Fixes: d7dfca0807 ("hw/sdhci: introduce standard SD host contr

Re: [PATCH] iotests/024: exclude 'backing file format' field from the output

2024-07-31 Thread Philippe Mathieu-Daudé
On 30/7/24 11:47, Andrey Drobyshev wrote: Apparently 'qemu-img info' doesn't report the backing file format field for qed (as it does for qcow2): $ qemu-img create -f qed base.qed 1M && qemu-img create -f qed -b base.qed -F qed top.qed 1M $ qemu-img create -f qcow2 base.qcow2 1M && qemu-img cre

[PATCH-for-9.1 0/5] hw/sd: SDcard & SDHCI fixes

2024-07-30 Thread Philippe Mathieu-Daudé
3 fixes (2 fuzzed). Philippe Mathieu-Daudé (5): hw/sd/sdcard: Explicit dummy byte value hw/sd/sdcard: Do not abort when reading DAT lines on invalid cmd state hw/sd/sdhci: Reset @data_count index on invalid ADMA transfers hw/sd/sdhci: Trace ADMA descriptors hw/sd/sdhci: Check ADMA

[PATCH-for-9.1 5/5] hw/sd/sdhci: Check ADMA descriptors can be accessed

2024-07-30 Thread Philippe Mathieu-Daudé
Since malicious guest can write invalid addresses to the ADMASYSADDR register, we need to check whether the descriptor could be correctly filled or not. Cc: qemu-sta...@nongnu.org Fixes: d7dfca0807 ("hw/sdhci: introduce standard SD host controller") Signed-off-by: Philippe Mathieu-Daud

[PATCH-for-9.1 4/5] hw/sd/sdhci: Trace ADMA descriptors

2024-07-30 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 8 hw/sd/trace-events | 1 + 2 files changed, 9 insertions(+) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 8293d83556..66b9364e9e 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -693,6 +693,11 @@ typedef struct

[PATCH-for-9.1 2/5] hw/sd/sdcard: Do not abort when reading DAT lines on invalid cmd state

2024-07-30 Thread Philippe Mathieu-Daudé
b.com/qemu-project/qemu/-/issues/2454 Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index c02f04f1ea..b1e6e36b44 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2540,7 +2540,9 @@ uint8_t sd_read_byte(S

[PATCH-for-9.1 1/5] hw/sd/sdcard: Explicit dummy byte value

2024-07-30 Thread Philippe Mathieu-Daudé
On error the DAT lines are left unmodified to their previous states. QEMU returns 0x00 for convenience. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 07cb97d88c..c02f04f1ea

[PATCH-for-9.1 3/5] hw/sd/sdhci: Reset @data_count index on invalid ADMA transfers

2024-07-30 Thread Philippe Mathieu-Daudé
b.com/qemu-project/qemu/-/issues/2455 Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sdhci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index d02c3e3963..8293d83556 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -846,6 +846,7 @@ static void sdhci_do_adma(SDH

Re: [PATCH v5 05/11] exec/ioport: Add portio_list_set_address()

2024-07-30 Thread Philippe Mathieu-Daudé
On 29/7/24 23:07, Bernhard Beschow wrote: Am 29. Juli 2024 09:26:19 UTC schrieb "Philippe Mathieu-Daudé" : On 14/1/24 13:39, Bernhard Beschow wrote: Some SuperI/O devices such as the VIA south bridges or the PC87312 controller are able to relocate their SuperI/O functions. Add a c

Re: [PATCH v5 11/11] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2024-07-29 Thread Philippe Mathieu-Daudé
On 14/1/24 13:39, Bernhard Beschow wrote: The VIA south bridges are able to relocate and toggle (enable or disable) their SuperI/O functions. So far this is hardcoded such that all functions are always enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy bef

Re: [PATCH v5 05/11] exec/ioport: Add portio_list_set_address()

2024-07-29 Thread Philippe Mathieu-Daudé
On 14/1/24 13:39, Bernhard Beschow wrote: Some SuperI/O devices such as the VIA south bridges or the PC87312 controller are able to relocate their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. This convenience function relies on previous simplific

Re: [PATCH] util/async.c: Forbid negative min/max in aio_context_set_thread_pool_params()

2024-07-23 Thread Philippe Mathieu-Daudé
On 23/7/24 17:51, Peter Maydell wrote: On Tue, 23 Jul 2024 at 16:44, Philippe Mathieu-Daudé wrote: On 23/7/24 17:09, Peter Maydell wrote: aio_context_set_thread_pool_params() takes two int64_t arguments to set the minimum and maximum number of threads in the pool. We do some bounds checking

Re: [PATCH] util/async.c: Forbid negative min/max in aio_context_set_thread_pool_params()

2024-07-23 Thread Philippe Mathieu-Daudé
) { error_setg(errp, "bad thread-pool-min/thread-pool-max values"); return; } Reviewed-by: Philippe Mathieu-Daudé I don't get the point of using signed min/max here...

Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support

2024-07-11 Thread Philippe Mathieu-Daudé
On 11/7/24 13:03, Cédric Le Goater wrote: Hello, On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote: Tag to test Aspeed tree:    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8 I gave this branch a try and the rainier machine boots correctly with a baked emmc image :   Tested-by: Cédric

Re: [PATCH v48 00/12] hw/sd/sdcard: Add eMMC support

2024-07-10 Thread Philippe Mathieu-Daudé
On 10/7/24 17:35, Cédric Le Goater wrote: On 7/10/24 4:13 PM, Philippe Mathieu-Daudé wrote: Tag to test Aspeed tree:    https://gitlab.com/philmd/qemu/-/tags/aspeed_emmc-v8 Since v43: - Reordered and squashed commits (Cédric) Cédric Le Goater (2):    hw/sd/sdcard: Add

[PATCH v48 12/12] hw/sd/sdcard: Support boot area in emmc image

2024-07-10 Thread Philippe Mathieu-Daudé
ter Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 86b857d414..8c68494b8b 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -774,6 +774,40 @@ static uint32_t sd_blk_len(SDState

[PATCH v48 10/12] hw/sd/sdcard: Implement eMMC 'boot-mode'

2024-07-10 Thread Philippe Mathieu-Daudé
t, add the sd_uptime_ns() helper. When the first command is received, check at least 74 clocks are elapsed (during the identification phase, at a 10kHz rate) then enable BOOT_MODE in the Ext_CSD register. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c

[PATCH v48 08/12] hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)

2024-07-10 Thread Philippe Mathieu-Daudé
on the card is working in. These modes can be changed by the host by means of the SWITCH command. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 70 ++ 1 file changed, 70 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index

[PATCH v48 11/12] hw/sd/sdcard: Add mmc SWITCH function support (CMD6)

2024-07-10 Thread Philippe Mathieu-Daudé
. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé [PMD: Convert to SDProto handlers, add trace events] Signed-off-by: Philippe Mathieu-Daudé Tested-by: Andrew Jeffery --- hw/sd/sd.c | 56

[PATCH v48 09/12] hw/sd/sdcard: Add eMMC 'boot-size' property

2024-07-10 Thread Philippe Mathieu-Daudé
Avoid hardcoding 1MiB boot size in EXT_CSD_BOOT_MULT, expose it as QOM property. By default, do not use any size. The board is responsible to set the boot size property. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a

[PATCH v48 01/12] hw/sd/sdcard: Basis for eMMC support

2024-07-10 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Since eMMC are soldered on boards, it is not user-creatable. RCA register is initialized to 0x0001, per spec v4.3, chapter 8.5 "RCA register": The default value of the RCA register is 0x0001. The value 0x is reserved to set all cards into th

[PATCH v48 00/12] hw/sd/sdcard: Add eMMC support

2024-07-10 Thread Philippe Mathieu-Daudé
rd: Implement eMMC sleep state (CMD5) Philippe Mathieu-Daudé (6): hw/sd/sdcard: Basis for eMMC support hw/sd/sdcard: Register generic command handlers hw/sd/sdcard: Register unimplemented command handlers hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26) hw/sd/sdcard: Add eMMC 

[PATCH v48 06/12] hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)

2024-07-10 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Andrew Jeffery --- hw/sd/sd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 550f63418e..3628686832 100644 --- a/hw/sd/sd.c

[PATCH v48 07/12] hw/sd/sdcard: Implement eMMC sleep state (CMD5)

2024-07-10 Thread Philippe Mathieu-Daudé
ff-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater --- hw/sd/sd.c | 47 +-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 3628686832..cf130ad1e3 100644 --- a/hw/sd/sd.c

[PATCH v48 04/12] hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)

2024-07-10 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 0e36b0cc2e..7e17bd0736

[PATCH v48 05/12] hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)

2024-07-10 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater The number of blocks is defined in the lower bits [15:0]. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/sd

[PATCH v48 03/12] hw/sd/sdcard: Register unimplemented command handlers

2024-07-10 Thread Philippe Mathieu-Daudé
Per the spec v4.3 these commands are mandatory, but we don't implement them. Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/sd/sd.c

[PATCH v48 02/12] hw/sd/sdcard: Register generic command handlers

2024-07-10 Thread Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Tested-by: Andrew Jeffery Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index a4b6c7baba..fc78d4e561 100644 --- a/hw/sd/sd.c

Re: [PATCH v47 00/19] hw/sd/sdcard: Add eMMC support

2024-07-09 Thread Philippe Mathieu-Daudé
On 9/7/24 17:58, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: Since v42: - Stick to spec v4.3 (re-simplified EXT_CSD register & migrate) - Fill CID register - Few changes to CSD register - Implement 'boot-mode' reset timing - Add 'boot-size' p

Re: [PATCH v47 12/19] hw/sd/sdcard: Simplify EXT_CSD values for spec v4.3

2024-07-09 Thread Philippe Mathieu-Daudé
On 9/7/24 17:43, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: - Set some keys to not defined / implemented:    . EXT_CSD_HPI_FEATURES    . EXT_CSD_BKOPS_SUPPORT    . EXT_CSD_SEC_FEATURE_SUPPORT    . EXT_CSD_ERASE_TIMEOUT_MULT    . EXT_CSD_PART_SWITCH_TIME

Re: [Aspeed PATCH v47 18/19] hw/sd/sdcard: Add boot config support

2024-07-09 Thread Philippe Mathieu-Daudé
On 9/7/24 17:52, Cédric Le Goater wrote: On 7/9/24 5:25 PM, Philippe Mathieu-Daudé wrote: From: Joel Stanley With this correctly set we can use the enable bit to detect if partition support is enabled. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe

[Aspeed PATCH v47 18/19] hw/sd/sdcard: Add boot config support

2024-07-09 Thread Philippe Mathieu-Daudé
From: Joel Stanley With this correctly set we can use the enable bit to detect if partition support is enabled. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- Also squash? --- hw/sd/sd.c | 6 ++ 1 file changed, 6 insertions(+) diff

[PATCH v47 13/19] hw/sd/sdcard: Migrate ExtCSD 'modes' register

2024-07-09 Thread Philippe Mathieu-Daudé
The lower 192 bytes are the Modes segment, which defines the configuration the card is working in. Only migrate the Modes segment (192 lower bytes). Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --g

[Aspeed PATCH v47 16/19] hw/sd/sdcard: Support boot area in emmc image

2024-07-09 Thread Philippe Mathieu-Daudé
img,if=mtd,format=raw Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- TODO: Update QEMU command in description --- include/hw/sd/sd.h | 1 + hw/sd/sd.c | 33 + 2 files changed, 34 insertions(+) d

[PATCH v47 19/19] hw/sd/sdcard: Enable TYPE_EMMC card model

2024-07-09 Thread Philippe Mathieu-Daudé
Now than the implementation is functional, allow to instantiate it. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 6aa83251f7..4a6e9cc035 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -2941,7 +2941,6 @@ static

[PATCH v47 05/19] hw/sd/sdcard: Implement emmc_set_csd()

2024-07-09 Thread Philippe Mathieu-Daudé
eMMC CSD register is very similar to SD one. Most notable change: the version announced is v4.3. Signed-off-by: Philippe Mathieu-Daudé --- TODO: comment magic values? --- hw/sd/sd.c | 39 +++ 1 file changed, 39 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd

[PATCH v47 10/19] hw/sd/sdcard: Add emmc_cmd_SEND_EXT_CSD handler (CMD8)

2024-07-09 Thread Philippe Mathieu-Daudé
Pavan Boddu Signed-off-by: Edgar E. Iglesias Signed-off-by: Cédric Le Goater [PMD: Remove deprecated EXT_CSD_SEC_ERASE_MULT/EXT_CSD_SEC_TRIM_MULT] Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 59 ++ 1 file changed, 59 insertions

[PATCH v47 15/19] hw/sd/sdcard: Implement eMMC 'boot-mode'

2024-07-09 Thread Philippe Mathieu-Daudé
t, add the sd_uptime_ns() helper. When the first command is received, check at least 74 clocks are elapsed (during the identification phase, at a 10kHz rate) then enable BOOT_MODE in the Ext_CSD register. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c

[PATCH v47 14/19] hw/sd/sdcard: Add mmc SWITCH function support (CMD6)

2024-07-09 Thread Philippe Mathieu-Daudé
. Signed-off-by: Sai Pavan Boddu Signed-off-by: Edgar E. Iglesias Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 56 ++ hw/sd/trace-events | 2 ++ 2 files changed, 58

[PATCH v47 11/19] hw/sd/sdcard: Add eMMC 'boot-size' property

2024-07-09 Thread Philippe Mathieu-Daudé
Avoid hardcoding 1MiB boot size in EXT_CSD_BOOT_MULT, expose it as QOM property. By default, do not use any size. Board is responsible to set the boot size property. Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw

[PATCH v47 07/19] hw/sd/sdcard: Fix SET_BLOCK_COUNT command argument on eMMC (CMD23)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater The number of blocks is defined in the lower bits [15:0]. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-88-phi...@linaro.org> --- hw/sd/sd.c | 3 +++ 1 file chan

[PATCH v47 06/19] hw/sd/sdcard: Add emmc_cmd_SET_RELATIVE_ADDR handler (CMD3)

2024-07-09 Thread Philippe Mathieu-Daudé
From: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-86-phi...@linaro.org> --- hw/sd/sd.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/hw/sd/sd.c b/hw/s

[Aspeed PATCH v47 17/19] hw/sd/sdcard: Subtract bootarea size from blk

2024-07-09 Thread Philippe Mathieu-Daudé
From: Joel Stanley The userdata size is derived from the file the user passes on the command line, but we must take into account the boot areas. Signed-off-by: Joel Stanley Signed-off-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- Squash in previous? --- hw/sd/sd.c | 4

[PATCH v47 12/19] hw/sd/sdcard: Simplify EXT_CSD values for spec v4.3

2024-07-09 Thread Philippe Mathieu-Daudé
roed at reset . EXT_CSD_BOOT_INFO Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 50 ++ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index df0e2345c0..2a687977d1 100644 --- a/hw/sd/sd.c +++ b/h

[PATCH v47 09/19] hw/sd/sdcard: Implement eMMC sleep state (CMD5)

2024-07-09 Thread Philippe Mathieu-Daudé
ff-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Message-Id: <20240628070216.92609-90-phi...@linaro.org> --- hw/sd/sd.c | 47 +-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/hw/sd/sd.c b

[PATCH v47 02/19] hw/sd/sdcard: Register generic command handlers

2024-07-09 Thread Philippe Mathieu-Daudé
Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-84-phi...@linaro.org> --- hw/sd/sd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 91a7

[PATCH v47 04/19] hw/sd/sdcard: Implement emmc_set_cid()

2024-07-09 Thread Philippe Mathieu-Daudé
eMMC CID register is slightly different from SD: - One extra PNM (5 -> 6) - MDT is only 1 byte (2 -> 1). Signed-off-by: Philippe Mathieu-Daudé --- hw/sd/sd.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 097c9cc61f..2d737a836f

[PATCH v47 03/19] hw/sd/sdcard: Register unimplemented command handlers

2024-07-09 Thread Philippe Mathieu-Daudé
Per the spec v4.3 these commands are mandatory, but we don't implement them. Reviewed-by: Cédric Le Goater Tested-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20240628070216.92609-85-phi...@linaro.org> --- hw/sd/sd.c | 9 + 1 file changed, 9

[PATCH v47 08/19] hw/sd/sdcard: Add mmc_cmd_PROGRAM_CID handler (CMD26)

2024-07-09 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Tested-by: Cédric Le Goater Reviewed-by: Cédric Le Goater Message-Id: <20240628070216.92609-89-phi...@linaro.org> --- hw/sd/sd.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 216d

[PATCH v47 01/19] hw/sd/sdcard: Basis for eMMC support

2024-07-09 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Add basis for supporting eMMC. Since eMMC are soldered on boards, it is not user-creatable. Currently TYPE_EMMC is just a stub, so disabled (marked abstract). RCA register is initialized to 1, per spec v4.3, chapter 8.5 "RCA register": The default va

[PATCH v47 00/19] hw/sd/sdcard: Add eMMC support

2024-07-09 Thread Philippe Mathieu-Daudé
el Stanley (3): hw/sd/sdcard: Support boot area in emmc image hw/sd/sdcard: Subtract bootarea size from blk hw/sd/sdcard: Add boot config support Luc Michel (1): hw/sd/sdcard: Implement eMMC sleep state (CMD5) Philippe Mathieu-Daudé (11): hw/sd/sdcard: Basis for eMMC support hw/sd/sdca

Re: [PATCH v2 09/15] memory: Do not create circular reference with subregion

2024-07-08 Thread Philippe Mathieu-Daudé
On 6/7/24 13:59, Akihiko Odaki wrote: On 2024/07/03 2:44, Peter Xu wrote: On Thu, Jun 27, 2024 at 10:37:52PM +0900, Akihiko Odaki wrote: A memory region does not use their own reference counters, but instead piggybacks on another QOM object, "owner" (unless the owner is not the memory region it

Re: [PATCH v46 0/5] hw/sd/sdcard: Cleanups before adding eMMC support

2024-07-05 Thread Philippe Mathieu-Daudé
On 3/7/24 15:43, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (5): hw/sd/sdcard: Use spec v3.01 by default hw/sd/sdcard: Add sd_cmd_GEN_CMD handler (CMD56) hw/sd/sdcard: Rename sd_cmd_SEND_OP_COND handler hw/sd/sdcard: Introduce set_csd/set_cid handlers hw/sd/sdcard

Re: [PATCH 0/4] qtest/npcm7xx_sdhci: Use card-provided address (RCA)

2024-07-05 Thread Philippe Mathieu-Daudé
On 2/7/24 16:08, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (4): hw/sd/npcm7xx_sdhci: Use TYPE_SYSBUS_SDHCI definition hw/sd/sdhci: Log non-sequencial access as GUEST_ERROR tests/qtest/npcm7xx_sdhci: Access the card using its published address hw/sd/sdcard: Generate random

Re: [PATCH v46 0/5] hw/sd/sdcard: Cleanups before adding eMMC support

2024-07-05 Thread Philippe Mathieu-Daudé
On 3/7/24 15:43, Philippe Mathieu-Daudé wrote: (patches from v42 already reviewed not reposted) Since v45: - RAZ/WI on GEN_CMD (Luc & Manos) - Rename sd_cmd_SEND_OP_COND - Introduce TYPE_SDMMC_COMMON Philippe Mathieu-Daudé (5): hw/sd/sdcard: Use spec v3.01 by default hw/sd/sdcard:

Re: [PATCH] system: Enable the device aliases for or1k, too

2024-07-05 Thread Philippe Mathieu-Daudé
On 5/7/24 14:39, Philippe Mathieu-Daudé wrote: On 5/7/24 11:08, Thomas Huth wrote: Now that we've got a "virt" machine for or1k that supports PCI, too, we can also enable the virtio device aliases like we do on other similar platforms. This will e.g. help to run the iotests w

Re: [PATCH] system: Enable the device aliases for or1k, too

2024-07-05 Thread Philippe Mathieu-Daudé
le changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v46 5/5] hw/sd/sdcard: Extract TYPE_SDMMC_COMMON from TYPE_SD_CARD

2024-07-03 Thread Philippe Mathieu-Daudé
On 3/7/24 16:02, Cédric Le Goater wrote: On 7/3/24 3:43 PM, Philippe Mathieu-Daudé wrote: In order to keep eMMC model simpler to maintain, extract common properties and the common code from class_init to the (internal) TYPE_SDMMC_COMMON. Update the corresponding QOM cast macros. Signed-off-by

  1   2   3   4   5   6   7   8   9   10   >