* [PULL v2 00/41] Misc HW patches for 2026-05-12
@ 2026-05-12 20:38 Philippe Mathieu-Daudé
2026-05-12 20:38 ` [PULL v2 06/41] hw/sd/sd: Allow multi-byte read/write for generic paths Philippe Mathieu-Daudé
2026-05-14 16:27 ` [PULL v2 00/41] Misc HW patches for 2026-05-12 Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-05-12 20:38 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 5e61afe211e82a9af15a8794a0bd29bb574e953b:
Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2026-05-11 10:49:53 -0400)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/hw-misc-20260512
for you to fetch changes up to 23af8ed3c4633f965bc47c6a84971301a07a8d55:
scripts: strip leading './' when searching MAINTAINERS file (2026-05-12 22:35:54 +0200)
----------------------------------------------------------------
Misc HW patches
- More ATI VGA fixes
- Add support for pre-setting RPMB authentication key on eMMC cards
- Fix VDPA on big-endian hosts
- Handle sub-page granularity in cpu_memory_rw_debug()
- Fix leak in pca955x_set_led()
- Mark IPv6 header structure as packed
- MAINTAINERS updates
----------------------------------------------------------------
Chad Jablonski (1):
ati-vga: fix ati_set_dirty address calculation
Christian Speich (3):
hw/sd: Switch read/write primitive to buf+len
hw/sd/sd: Allow multi-byte read/write for generic paths
hw/sd: Update trace events for buf+len data
Daniel P. Berrangé (1):
scripts: strip leading './' when searching MAINTAINERS file
Jan Kiszka (2):
scripts: mkemmc.sh: Fix output pollution on missing images
hw/sd/sdcard: Add support for pre-setting the authentication key
Konstantin Shkolnyy (1):
vdpa: Allow VDPA to work on big-endian machine
Magnus Kulke (1):
MAINTAINERS: Add Doru Blânzeanu as MSHV reviewer
Marc-André Lureau (1):
hw/gpio/pca9552: fix state_str leak in pca955x_set_led
Mauro Carvalho Chehab (1):
MAINTAINERS: update HEST maintainership entries
Peter Maydell (29):
hw/display/cirrus_vga: Fix packed-24 color-expansion transparent
pattern fills
hw/display/cirrus_vga: Fix packed-24 color-expansion transparent
copies
hw/i386/vapic: Cope with non-page-aligned return from
cpu_get_phys_page_debug()
target/riscv: Make get_phys_page_debug handle non-page-aligned addrs
target/alpha: Make get_phys_page_debug handle non-page-aligned addrs
target/microblaze: Make get_phys_page_attrs_debug handle
non-page-aligned addrs
target/sparc: Make get_phys_page_debug handle non-page-aligned addrs
target/x86: Make get_phys_page_attrs_debug handle non-page-aligned
addrs
target/s390x: Make get_phys_page_debug handle non-page-aligned addrs
target/ppc: Make get_phys_page_debug handle non-page-aligned addrs
target: Rename get_phys_page_debug to get_phys_addr_debug
target: Rename cpu_get_phys_page_{,attrs_}debug
hw/core: Update docs for get_phys_addr_{attrs_, }debug
target/arm: Rename arm_cpu_get_phys_page()
monitor: hmp_gva2gpa: Don't page-align cpu_get_phys_addr_debug() arg
and return
plugins/api.c: Trust cpu_get_phys_addr_debug() return address
hw/core: Implement new cpu_translate_for_debug()
hw/core: Implement cpu_get_phys_addr_attrs_debug() with
cpu_translate_for_debug()
target/arm: Implement translate_for_debug
system/physmem: Use translate_for_debug() in cpu_memory_rw_debug()
hw/i386/vapic.c: Use cpu_translate_for_debug()
target/sparc: Use cpu_translate_for_debug()
hw/xtensa: Use cpu_translate_for_debug()
target/xtensa/xtensa-semi: Use cpu_translate_for_debug()
monitor/hmp-cmds: Use cpu_translate_for_debug()
plugins/api.c: Use cpu_translate_for_debug()
Remove cpu_get_phys_addr_debug() and cpu_get_phys_addr_attrs_debug()
hw/i2c/microbit_i2c: Don't index off end of twi_read_sequence[]
net: mark struct ip6_header as QEMU_PACKED
Philippe Mathieu-Daudé (1):
MAINTAINERS: Step up to maintain core machine code
MAINTAINERS | 13 +++-
docs/system/devices/emmc.rst | 23 ++++++
hw/display/cirrus_vga_rop2.h | 52 +++++++++++--
include/hw/core/cpu.h | 40 +++++-----
include/hw/core/sysemu-cpu-ops.h | 39 ++++++++--
include/hw/sd/sd.h | 22 ++++--
include/net/eth.h | 2 +-
target/alpha/cpu.h | 2 +-
target/arm/cpu.h | 3 -
target/arm/internals.h | 4 +
target/avr/cpu.h | 2 +-
target/hppa/cpu.h | 2 +-
target/i386/cpu.h | 2 +-
target/loongarch/cpu-mmu.h | 2 +-
target/m68k/cpu.h | 2 +-
target/microblaze/cpu.h | 2 +-
target/mips/internal.h | 2 +-
target/or1k/cpu.h | 2 +-
target/ppc/cpu.h | 2 +-
target/riscv/cpu.h | 2 +-
target/rx/cpu.h | 2 +-
target/s390x/s390x-internal.h | 1 -
target/sh4/cpu.h | 2 +-
target/sparc/cpu.h | 2 +-
target/tricore/cpu.h | 2 +-
target/xtensa/cpu.h | 2 +-
hw/core/cpu-system.c | 47 +++++++-----
hw/display/ati_2d.c | 24 ++++--
hw/gpio/pca9552.c | 2 +-
hw/i2c/microbit_i2c.c | 7 +-
hw/i386/vapic.c | 13 ++--
hw/sd/core.c | 53 ++++++++++---
hw/sd/sd.c | 125 +++++++++++++++++++++++--------
hw/xtensa/sim.c | 6 +-
hw/xtensa/xtfpga.c | 6 +-
monitor/hmp-cmds.c | 8 +-
net/vhost-vdpa.c | 5 +-
plugins/api.c | 8 +-
system/physmem.c | 38 ++++++----
target/alpha/cpu.c | 2 +-
target/alpha/helper.c | 3 +-
target/arm/cpu.c | 2 +-
target/arm/ptw.c | 39 ++++++----
target/avr/cpu.c | 2 +-
target/avr/helper.c | 2 +-
target/hppa/cpu.c | 2 +-
target/hppa/mem_helper.c | 2 +-
target/i386/cpu.c | 2 +-
target/i386/helper.c | 4 +-
target/i386/whpx/whpx-all.c | 2 +-
target/loongarch/cpu.c | 2 +-
target/loongarch/cpu_helper.c | 2 +-
target/m68k/cpu.c | 2 +-
target/m68k/helper.c | 2 +-
target/microblaze/cpu.c | 2 +-
target/microblaze/helper.c | 11 ++-
target/mips/cpu.c | 2 +-
target/mips/system/physaddr.c | 2 +-
target/or1k/cpu.c | 2 +-
target/or1k/mmu.c | 2 +-
target/ppc/cpu_init.c | 2 +-
target/ppc/mmu-hash32.c | 2 +-
target/ppc/mmu_common.c | 4 +-
target/riscv/cpu.c | 2 +-
target/riscv/cpu_helper.c | 4 +-
target/rx/cpu.c | 2 +-
target/rx/helper.c | 2 +-
target/s390x/cpu-system.c | 2 +-
target/s390x/helper.c | 20 ++---
target/sh4/cpu.c | 2 +-
target/sh4/helper.c | 2 +-
target/sparc/cpu.c | 2 +-
target/sparc/mmu_helper.c | 23 ++++--
target/tricore/cpu.c | 2 +-
target/tricore/helper.c | 2 +-
target/xtensa/cpu.c | 2 +-
target/xtensa/mmu_helper.c | 2 +-
target/xtensa/xtensa-semi.c | 9 ++-
hw/sd/trace-events | 6 +-
scripts/get_maintainer.pl | 1 +
scripts/mkemmc.sh | 4 +-
81 files changed, 508 insertions(+), 253 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread* [PULL v2 06/41] hw/sd/sd: Allow multi-byte read/write for generic paths 2026-05-12 20:38 [PULL v2 00/41] Misc HW patches for 2026-05-12 Philippe Mathieu-Daudé @ 2026-05-12 20:38 ` Philippe Mathieu-Daudé 2026-05-14 16:27 ` [PULL v2 00/41] Misc HW patches for 2026-05-12 Stefan Hajnoczi 1 sibling, 0 replies; 3+ messages in thread From: Philippe Mathieu-Daudé @ 2026-05-12 20:38 UTC (permalink / raw) To: qemu-devel From: Christian Speich <c.speich@avm.de> Paths that use sd_generic_write/read_data can now write/read multiple bytes with one call. Signed-off-by: Christian Speich <c.speich@avm.de> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260417-sdcard-performance-b4-v4-2-119e66be10c2@avm.de> [PMD: Access &sd->data[sd->data_offset] in sd_generic_read/write_data] Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/sd/sd.c | 62 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index c0b89735f69..11f6b91576a 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1610,7 +1610,7 @@ static sd_rsp_type_t sd_cmd_optional(SDState *sd, SDRequest req) return sd_illegal; } -/* Configure fields for following sd_generic_write_byte() calls */ +/* Configure fields for following sd_generic_write_data() calls */ static sd_rsp_type_t sd_cmd_to_receivingdata(SDState *sd, SDRequest req, uint64_t start, size_t size) { @@ -1625,7 +1625,7 @@ static sd_rsp_type_t sd_cmd_to_receivingdata(SDState *sd, SDRequest req, return sd_r1; } -/* Configure fields for following sd_generic_read_byte() calls */ +/* Configure fields for following sd_generic_read_data() calls */ static sd_rsp_type_t sd_cmd_to_sendingdata(SDState *sd, SDRequest req, uint64_t start, const void *data, size_t size) @@ -2615,11 +2615,15 @@ send_response: } /* Return true if buffer is consumed. Configured by sd_cmd_to_receivingdata() */ -static bool sd_generic_write_byte(SDState *sd, uint8_t value) +static bool sd_generic_write_data(SDState *sd, const void *buf, size_t *len) { - sd->data[sd->data_offset] = value; + size_t to_write = MIN(sd->data_size - sd->data_offset, *len); - if (++sd->data_offset >= sd->data_size) { + memcpy(&sd->data[sd->data_offset], buf, to_write); + sd->data_offset += to_write; + *len = to_write; + + if (sd->data_offset >= sd->data_size) { sd->state = sd_transfer_state; return true; } @@ -2627,11 +2631,15 @@ static bool sd_generic_write_byte(SDState *sd, uint8_t value) } /* Return true when buffer is consumed. Configured by sd_cmd_to_sendingdata() */ -static bool sd_generic_read_byte(SDState *sd, uint8_t *value) +static bool sd_generic_read_data(SDState *sd, void *buf, size_t *len) { - *value = sd->data[sd->data_offset]; + size_t to_read = MIN(sd->data_size - sd->data_offset, *len); - if (++sd->data_offset >= sd->data_size) { + memcpy(buf, &sd->data[sd->data_offset], to_read); + sd->data_offset += to_read; + *len = to_read; + + if (sd->data_offset >= sd->data_size) { sd->state = sd_transfer_state; return true; } @@ -2658,18 +2666,12 @@ static size_t sd_write_data(SDState *sd, const void *buf, size_t length) if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) return length; - /* - * Only read one byte at a time. We will be called again with the - * remaining. - */ - length = 1; - trace_sdcard_write_data(sd->proto->name, sd->last_cmd_name, sd->current_cmd, sd->data_offset, value[0]); switch (sd->current_cmd) { case 24: /* CMD24: WRITE_SINGLE_BLOCK */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state = sd_programming_state; sd_blk_write(sd, sd->data_start, sd->data_offset); @@ -2681,6 +2683,12 @@ static size_t sd_write_data(SDState *sd, const void *buf, size_t length) break; case 25: /* CMD25: WRITE_MULTIPLE_BLOCK */ + /* + * Only read one byte at a time. We will be called again with the + * remaining. + */ + length = 1; + if (sd->data_offset == 0) { /* Start of the block - let's check the address is valid */ if (!address_in_range(sd, "WRITE_MULTIPLE_BLOCK", @@ -2724,7 +2732,7 @@ static size_t sd_write_data(SDState *sd, const void *buf, size_t length) break; case 26: /* CMD26: PROGRAM_CID */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state = sd_programming_state; for (i = 0; i < sizeof(sd->cid); i ++) @@ -2742,7 +2750,7 @@ static size_t sd_write_data(SDState *sd, const void *buf, size_t length) break; case 27: /* CMD27: PROGRAM_CSD */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state = sd_programming_state; for (i = 0; i < sizeof(sd->csd); i ++) @@ -2765,7 +2773,7 @@ static size_t sd_write_data(SDState *sd, const void *buf, size_t length) break; case 42: /* CMD42: LOCK_UNLOCK */ - if (sd_generic_write_byte(sd, value[0])) { + if (sd_generic_write_data(sd, buf, &length)) { /* TODO: Check CRC before committing */ sd->state = sd_programming_state; sd_lock_command(sd); @@ -2775,7 +2783,7 @@ static size_t sd_write_data(SDState *sd, const void *buf, size_t length) break; case 56: /* CMD56: GEN_CMD */ - sd_generic_write_byte(sd, value[0]); + sd_generic_write_data(sd, buf, &length); break; default: @@ -2810,12 +2818,6 @@ static size_t sd_read_data(SDState *sd, void *buf, size_t length) return length; } - /* - * We will only read one byte at a time. We will be called again with the - * remaining buffer. - */ - length = 1; - io_len = sd_blk_len(sd); trace_sdcard_read_data(sd->proto->name, @@ -2833,10 +2835,16 @@ static size_t sd_read_data(SDState *sd, void *buf, size_t length) case 30: /* CMD30: SEND_WRITE_PROT */ case 51: /* ACMD51: SEND_SCR */ case 56: /* CMD56: GEN_CMD */ - sd_generic_read_byte(sd, value); + sd_generic_read_data(sd, buf, &length); break; case 18: /* CMD18: READ_MULTIPLE_BLOCK */ + /* + * We will only read one byte at a time. We will be called again with + * the remaining buffer. + */ + length = 1; + if (sd->data_offset == 0) { if (!address_in_range(sd, "READ_MULTIPLE_BLOCK", sd->data_start, io_len)) { @@ -2869,7 +2877,7 @@ static size_t sd_read_data(SDState *sd, void *buf, size_t length) default: qemu_log_mask(LOG_GUEST_ERROR, "%s: DAT read illegal for command %s\n", __func__, sd->last_cmd_name); - *value = dummy_byte; + memset(buf, dummy_byte, length); } return length; -- 2.53.0 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PULL v2 00/41] Misc HW patches for 2026-05-12 2026-05-12 20:38 [PULL v2 00/41] Misc HW patches for 2026-05-12 Philippe Mathieu-Daudé 2026-05-12 20:38 ` [PULL v2 06/41] hw/sd/sd: Allow multi-byte read/write for generic paths Philippe Mathieu-Daudé @ 2026-05-14 16:27 ` Stefan Hajnoczi 1 sibling, 0 replies; 3+ messages in thread From: Stefan Hajnoczi @ 2026-05-14 16:27 UTC (permalink / raw) To: Philippe Mathieu-Daudé; +Cc: qemu-devel [-- Attachment #1: Type: text/plain, Size: 116 bytes --] Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/11.1 for any user-visible changes. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-05-14 18:23 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-12 20:38 [PULL v2 00/41] Misc HW patches for 2026-05-12 Philippe Mathieu-Daudé 2026-05-12 20:38 ` [PULL v2 06/41] hw/sd/sd: Allow multi-byte read/write for generic paths Philippe Mathieu-Daudé 2026-05-14 16:27 ` [PULL v2 00/41] Misc HW patches for 2026-05-12 Stefan Hajnoczi
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.