Misc HW patches for 2025-12-30
Subsystems (7)
The following changes since commit 942b0d378a1de9649085ad6db5306d5b8cef3591:
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2025-12-29 09:10:40 +1100)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/hw-misc-20251230
for you to fetch changes up to 4bd2b65e524836fef274fd169db804a2efce8836:
MAINTAINERS: Change email and status of TriCore (2025-12-30 20:38:41 +0100)
----------------------------------------------------------------
Misc HW patches
- Remove few target_ulong uses
- Make human monitor non-target specific
- Better name for TrustZone Peripheral Protection Controller memory regions
- Do not expose DEVICE_NATIVE_ENDIAN on Rust
- Remove address_space_stl_notdirty() and stl_phys_notdirty()
- Allow to restrict targets to legacy ldst_phys() API
- Fix MinGW-w64 link failure due to ConvertStringToBSTR()
- Header cleanups
- MAINTAINERS updates
----------------------------------------------------------------
Alano Song (1):
hw/i2c/imx: Fix trace func name error
Alex Bennée (1):
hw/misc: make the tz-ppc-port names more useful
Anton Johansson (1):
hw/riscv: Treat kernel_start_addr as vaddr
Bastian Koppelmann (1):
MAINTAINERS: Change email and status of TriCore
Bin Guo (1):
meson: Optimize summary_info about directories
Bin Meng (1):
hw/sd: Remove unused header includes in ssi-sd.c
Nguyen Dinh Phi (2):
qga/vss-win32: Fix ConvertStringToBSTR redefinition with newer MinGW
util: Move qemu_ftruncate64 from block/file-win32.c to oslib-win32.c
Osama Abdelkader (1):
hw/core: remove duplicate include
Philippe Mathieu-Daudé (24):
monitor/hmp: Replace target_ulong -> vaddr in hmp_gva2gpa() monitor/hmp: Make memory_dump() @is_physical argument a boolean monitor/hmp: Use plain uint64_t @addr argument in memory_dump() monitor/hmp: Remove target_long uses in memory_dump() monitor/hmp: Inline ld[uw,l,q]_p() calls in memory_dump() monitor/hmp: Fix coding style in hmp-cmds-target.c monitor/hmp: Merge hmp-cmds-target.c within hmp-cmds.c hw/arm/Kconfig: Have FSL_IMX6UL SoC select IMX_USBPHY hw/net/opencores: Clarify MMIO read/write handlers expect 32-bit access hw/char/serial: Let compiler pick serial_mm_ops[] array length hw/misc/pvpanic: Expose MMIO interface as little-endian hw/timer/hpet: Mark implementation as being little-endian hw/char/pl011: Mark implementation as being little-endian rust/system: Stop exposing bogus DEVICE_NATIVE_ENDIAN symbol target/hexagon: Include missing 'cpu.h' header in 'internal.h' target/i386: Remove x86_stl_phys_notdirty() leftover target/sparc: Update MMU page table using stl_phys() hw/arm: Avoid address_space_stl_notdirty() when generating bootloader system/memory: Remove address_space_stl_notdirty and stl_phys_notdirty system/memory: Allow restricting legacy ldst_phys() API usage configs/targets: Mark targets not using legacy ldst_phys() API hw/virtio: Remove unused ldst_phys() helpers
hw/virtio: Reduce virtio_lduw/stw_phys_cached() scope configs/targets: Mark targets not using legacy ldst_phys() API
Stefan Hajnoczi (1):
MAINTAINERS: remove old email for Bandan Das
MAINTAINERS | 5 +- configs/targets/avr-softmmu.mak | 1 + configs/targets/microblaze-softmmu.mak | 1 + configs/targets/microblazeel-softmmu.mak | 1 + configs/targets/mips-softmmu.mak | 1 + configs/targets/mips64-softmmu.mak | 1 + configs/targets/mips64el-softmmu.mak | 1 + configs/targets/mipsel-softmmu.mak | 1 + configs/targets/or1k-softmmu.mak | 1 + configs/targets/riscv32-softmmu.mak | 1 + configs/targets/riscv64-softmmu.mak | 1 + configs/targets/rx-softmmu.mak | 1 + configs/targets/sh4-softmmu.mak | 1 + configs/targets/sh4eb-softmmu.mak | 1 + configs/targets/sparc64-softmmu.mak | 1 + configs/targets/tricore-softmmu.mak | 1 + configs/targets/xtensa-softmmu.mak | 1 + configs/targets/xtensaeb-softmmu.mak | 1 + meson.build | 13 + include/hw/riscv/boot.h | 6 +- include/hw/virtio/virtio-access.h | 106 ------- include/system/memory.h | 8 +- target/hexagon/internal.h | 2 +- target/i386/cpu.h | 1 - include/system/memory_ldst.h.inc | 2 - block/file-win32.c | 32 -- hw/arm/aspeed.c | 4 +- hw/arm/boot.c | 8 +- hw/char/pl011.c | 2 +- hw/char/serial-mm.c | 2 +- hw/i2c/imx_i2c.c | 4 +- hw/misc/pvpanic.c | 1 + hw/misc/tz-ppc.c | 4 +- hw/net/opencores_eth.c | 15 +- hw/riscv/boot.c | 6 +- hw/riscv/microchip_pfsoc.c | 3 +- hw/riscv/sifive_u.c | 3 +- hw/riscv/spike.c | 2 +- hw/riscv/virt.c | 3 +- hw/sd/ssi-sd.c | 4 - hw/timer/hpet.c | 2 +- hw/virtio/virtio.c | 21 ++ monitor/hmp-cmds-target.c | 381 ----------------------- monitor/hmp-cmds.c | 354 +++++++++++++++++++++ system/vl.c | 1 - target/i386/helper.c | 10 - target/sparc/mmu_helper.c | 2 +- util/oslib-win32.c | 33 ++ system/memory_ldst.c.inc | 39 --- hw/arm/Kconfig | 1 + hw/usb/Kconfig | 1 - monitor/meson.build | 2 +- qga/vss-win32/install.cpp | 2 + rust/hw/char/pl011/src/device.rs | 2 +- rust/hw/timer/hpet/src/device.rs | 2 +- rust/system/src/memory.rs | 6 - scripts/make-config-poison.sh | 1 + 57 files changed, 487 insertions(+), 626 deletions(-) delete mode 100644 monitor/hmp-cmds-target.c
Signature · 1 line
2.52.0
[PULL 04/34] hw/misc: make the tz-ppc-port names more useful
From: Alex Bennée <[email protected]>
The TrustZone peripheral protection controller (tz-ppc) sits between peripherals and the main system. However this results in "info mtree" looking at bit confusing, especially as the sequence numbers can overlap and miss steps:
0000000000000000-ffffffffffffffff (prio -2, i/o): system
0000000000000000-00000000003fffff (prio 0, i/o): tz-mpc-upstream
0000000000400000-00000000007fffff (prio 0, i/o): alias ssram-0-alias @tz-mpc-upstream 0000000000000000-00000000003fffff
0000000028000000-00000000281fffff (prio 0, i/o): tz-mpc-upstream
0000000028200000-00000000283fffff (prio 0, i/o): tz-mpc-upstream
0000000040080000-0000000040080fff (prio 0, i/o): iotkit-secctl-ns-regs
0000000040100000-0000000040100fff (prio 0, i/o): tz-ppc-port[1]
0000000040101000-0000000040101fff (prio 0, i/o): tz-ppc-port[2]
0000000040102000-0000000040102fff (prio 0, i/o): tz-ppc-port[3]
0000000040103000-0000000040103fff (prio 0, i/o): tz-ppc-port[4]
0000000040110000-0000000040110fff (prio 0, i/o): tz-ppc-port[0]
0000000040111000-0000000040111fff (prio 0, i/o): tz-ppc-port[1]
0000000040112000-0000000040112fff (prio 0, i/o): tz-ppc-port[2]
0000000040113000-0000000040113fff (prio 0, i/o): tz-ppc-port[3]
0000000040200000-0000000040200fff (prio 0, i/o): tz-ppc-port[5]
0000000040201000-0000000040201fff (prio 0, i/o): tz-ppc-port[6]
0000000040202000-0000000040202fff (prio 0, i/o): tz-ppc-port[7]
0000000040203000-0000000040203fff (prio 0, i/o): tz-ppc-port[8]
0000000040204000-0000000040204fff (prio 0, i/o): tz-ppc-port[9]
0000000040205000-0000000040205fff (prio 0, i/o): tz-ppc-port[0]
0000000040206000-0000000040206fff (prio 0, i/o): tz-ppc-port[1]
0000000040207000-0000000040207fff (prio 0, i/o): tz-ppc-port[10]
0000000040208000-0000000040208fff (prio 0, i/o): tz-ppc-port[11]
0000000040209000-0000000040209fff (prio 0, i/o): tz-ppc-port[2]
000000004020a000-000000004020afff (prio 0, i/o): tz-ppc-port[3]
000000004020b000-000000004020bfff (prio 0, i/o): tz-ppc-port[4]
000000004020c000-000000004020cfff (prio 0, i/o): tz-ppc-port[12]
000000004020d000-000000004020dfff (prio 0, i/o): tz-ppc-port[13]
0000000040300000-0000000040300fff (prio 0, i/o): tz-ppc-port[0]
0000000040301000-0000000040301fff (prio 0, i/o): tz-ppc-port[1]
0000000040302000-0000000040302fff (prio 0, i/o): tz-ppc-port[2]
0000000041000000-000000004113ffff (prio 0, i/o): tz-ppc-port[0]
0000000042000000-00000000420000ff (prio 0, i/o): tz-ppc-port[5]
0000000048007000-0000000048007fff (prio -1000, i/o): FPGA NS PC
0000000050080000-0000000050080fff (prio 0, i/o): iotkit-secctl-s-regs
0000000058007000-0000000058007fff (prio 0, i/o): tz-ppc-port[0]
0000000058008000-0000000058008fff (prio 0, i/o): tz-ppc-port[1]
0000000058009000-0000000058009fff (prio 0, i/o): tz-ppc-port[2]
0000000080000000-0000000080ffffff (prio 0, ram): mps.ramSo as a quality of life feature lets expose the name of the underlying region so we get something more useful:
0000000000000000-ffffffffffffffff (prio -2, i/o): system
0000000000000000-00000000003fffff (prio 0, i/o): tz-mpc-upstream
0000000000400000-00000000007fffff (prio 0, i/o): alias ssram-0-alias @tz-mpc-upstream 0000000000000000-00000000003fffff
0000000028000000-00000000281fffff (prio 0, i/o): tz-mpc-upstream
0000000028200000-00000000283fffff (prio 0, i/o): tz-mpc-upstream
0000000040080000-0000000040080fff (prio 0, i/o): iotkit-secctl-ns-regs
0000000040100000-0000000040100fff (prio 0, i/o): tz-ppc-port[gpio0]
0000000040101000-0000000040101fff (prio 0, i/o): tz-ppc-port[gpio1]
0000000040102000-0000000040102fff (prio 0, i/o): tz-ppc-port[gpio2]
0000000040103000-0000000040103fff (prio 0, i/o): tz-ppc-port[gpio3]
0000000040110000-0000000040110fff (prio 0, i/o): tz-ppc-port[pl080]
0000000040111000-0000000040111fff (prio 0, i/o): tz-ppc-port[pl080]
0000000040112000-0000000040112fff (prio 0, i/o): tz-ppc-port[pl080]
0000000040113000-0000000040113fff (prio 0, i/o): tz-ppc-port[pl080]
0000000040200000-0000000040200fff (prio 0, i/o): tz-ppc-port[uart]
0000000040201000-0000000040201fff (prio 0, i/o): tz-ppc-port[uart]
0000000040202000-0000000040202fff (prio 0, i/o): tz-ppc-port[uart]
0000000040203000-0000000040203fff (prio 0, i/o): tz-ppc-port[uart]
0000000040204000-0000000040204fff (prio 0, i/o): tz-ppc-port[uart]
0000000040205000-0000000040205fff (prio 0, i/o): tz-ppc-port[pl022]
0000000040206000-0000000040206fff (prio 0, i/o): tz-ppc-port[pl022]
0000000040207000-0000000040207fff (prio 0, i/o): tz-ppc-port[arm_sbcon_i2c]
0000000040208000-0000000040208fff (prio 0, i/o): tz-ppc-port[arm_sbcon_i2c]
0000000040209000-0000000040209fff (prio 0, i/o): tz-ppc-port[pl022]
000000004020a000-000000004020afff (prio 0, i/o): tz-ppc-port[pl022]
000000004020b000-000000004020bfff (prio 0, i/o): tz-ppc-port[pl022]
000000004020c000-000000004020cfff (prio 0, i/o): tz-ppc-port[arm_sbcon_i2c]
000000004020d000-000000004020dfff (prio 0, i/o): tz-ppc-port[arm_sbcon_i2c]
0000000040300000-0000000040300fff (prio 0, i/o): tz-ppc-port[mps2-scc]
0000000040301000-0000000040301fff (prio 0, i/o): tz-ppc-port[i2s-audio]
0000000040302000-0000000040302fff (prio 0, i/o): tz-ppc-port[mps2-fpgaio]
0000000041000000-000000004113ffff (prio 0, i/o): tz-ppc-port[gfx]
0000000042000000-00000000420000ff (prio 0, i/o): tz-ppc-port[lan9118-mmio]
0000000048007000-0000000048007fff (prio -1000, i/o): FPGA NS PC
0000000050080000-0000000050080fff (prio 0, i/o): iotkit-secctl-s-regs
0000000058007000-0000000058007fff (prio 0, i/o): tz-ppc-port[tz-mpc-regs]
0000000058008000-0000000058008fff (prio 0, i/o): tz-ppc-port[tz-mpc-regs]
0000000058009000-0000000058009fff (prio 0, i/o): tz-ppc-port[tz-mpc-regs]
0000000080000000-0000000080ffffff (prio 0, ram): mps.ramMessage-ID: <[email protected]>
--- hw/misc/tz-ppc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/misc/tz-ppc.c +2 -2
@@ -273,8 +273,8 @@ static void tz_ppc_realize(DeviceState *dev, Error **errp)continue ; } - name =g_strdup_printf ("tz-ppc-port[%d]" , i); - + name =g_strdup_printf ("tz-ppc-port[%s]" , +memory_region_name (port->downstream)); port->ppc = s;address_space_init (&port->downstream_as, port->downstream, name);
Signature · 1 line
2.52.0
[PULL 07/34] monitor/hmp: Use plain uint64_t @addr argument in memory_dump()
In reply to Philippe Mathieu-Daudémemory_dump() takes either hwaddr or vaddr type, depending on the @is_physical argument. Simply use uint64_t type which is common to both.
Pad address using field width formatting, removing the need for the target_ulong type.
Message-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
monitor/hmp-cmds-target.c +3 -6
@@ -122,12 +122,13 @@ void hmp_info_registers(Monitor *mon, const QDict *qdict) }static void memory_dump (Monitor *mon,int count,int format,int wsize, -hwaddr addr,bool is_physical) +uint64_t addr,bool is_physical) {int l, line_size, i, max_digits, len;uint8_t buf[16 ];uint64_t v;CPUState *cs =mon_get_cpu (mon); +const unsigned int addr_width = is_physical ?8 : (target_long_bits () *2 );if (!cs && (format =='i' || !is_physical)) {monitor_printf (mon,"Can not dump without CPU\n" );
@@ -165,11 +166,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, }while (len >0 ) { -if (is_physical) { -monitor_printf (mon, HWADDR_FMT_plx":" , addr); - }else { -monitor_printf (mon, TARGET_FMT_lx":" , (target_ulong )addr); - } +monitor_printf (mon,"%0*" PRIx64":" , addr_width, addr); l = len;if (l > line_size) l = line_size;
Signature · 1 line
2.52.0
[PULL 01/34] hw/sd: Remove unused header includes in ssi-sd.c
In reply to Philippe Mathieu-DaudéFrom: Bin Meng <[email protected]>
Remove these header files which are not used by ssi-sd.c
Message-ID: <[email protected]>
--- hw/sd/ssi-sd.c | 4 ---- 1 file changed, 4 deletions(-)
hw/sd/ssi-sd.c +0 -4
@@ -16,14 +16,10 @@*/ #include "qemu/osdep.h" -#include "system/blockdev.h" #include "hw/ssi/ssi.h" #include "migration/vmstate.h" -#include "hw/core/qdev-properties.h" #include "hw/sd/sd.h" -#include "qapi/error.h" #include "qemu/crc-ccitt.h" -#include "qemu/module.h" #include "qom/object.h" //#define DEBUG_SSI_SD 1
Signature · 1 line
2.52.0
[PULL 02/34] hw/core: remove duplicate include
In reply to Philippe Mathieu-DaudéFrom: Osama Abdelkader <[email protected]>
qemu/target-info.h is included twice.
Message-ID: <[email protected]>
--- system/vl.c | 1 - 1 file changed, 1 deletion(-)
system/vl.c +0 -1
@@ -41,7 +41,6 @@#include "qemu/help_option.h" #include "qemu/hw-version.h" #include "qemu/uuid.h" -#include "qemu/target-info.h" #include "system/reset.h" #include "system/runstate.h" #include "system/runstate-action.h"
Signature · 1 line
2.52.0
[PULL 09/34] monitor/hmp: Inline ld[uw, l, q]_p() calls in memory_dump()
In reply to Philippe Mathieu-DaudéRemove the last target-specificity in this file.
Message-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
monitor/hmp-cmds-target.c +4 -3
@@ -129,6 +129,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,uint64_t v;CPUState *cs =mon_get_cpu (mon);const unsigned int addr_width = is_physical ?8 : (target_long_bits () *2 ); +const bool big_endian =target_big_endian ();if (!cs && (format =='i' || !is_physical)) {monitor_printf (mon,"Can not dump without CPU\n" );
@@ -192,13 +193,13 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, v =ldub_p (buf + i);break ;case 2 : - v =lduw_p (buf + i); + v = (big_endian ? lduw_be_p : lduw_le_p)(buf + i);break ;case 4 : - v = (uint32_t )ldl_p (buf + i); + v = (uint32_t )(big_endian ? ldl_be_p : ldl_le_p)(buf + i);break ;case 8 : - v =ldq_p (buf + i); + v = (big_endian ? ldq_be_p : ldq_le_p)(buf + i);break ; }monitor_printf (mon," " );
Signature · 1 line
2.52.0
[PULL 10/34] monitor/hmp: Fix coding style in hmp-cmds-target.c
In reply to Philippe Mathieu-DaudéPrevious to moving code contained in hmp-cmds-target.c, fix the coding style. Otherwise the checkpatch.pl script would report:
ERROR: space required before the open parenthesis '(' #134: FILE: monitor/hmp-cmds-target.c:152:
+ switch(format) {
ERROR: braces {} are necessary for all arms of this statement #154: FILE: monitor/hmp-cmds-target.c:172:
+ if (l > line_size)
[...]
ERROR: space required before the open parenthesis '(' #172: FILE: monitor/hmp-cmds-target.c:190:
+ switch(wsize) {
ERROR: space required before the open parenthesis '(' #188: FILE: monitor/hmp-cmds-target.c:206:
+ switch(format) {
ERROR: Don't use '#' flag of printf format ('%#') in format strings, use '0x' prefix instead #190: FILE: monitor/hmp-cmds-target.c:208:
+ monitor_printf(mon, "%#*" PRIo64, max_digits, v);
WARNING: line over 80 characters
#240: FILE: monitor/hmp-cmds-target.c:258:
+ error_setg(errp, "No memory is mapped at address 0x%" HWADDR_PRIx, addr);
WARNING: line over 80 characters
#245: FILE: monitor/hmp-cmds-target.c:263:
+ error_setg(errp, "Memory at address 0x%" HWADDR_PRIx " is not RAM", addr);
ERROR: Don't use '#' flag of printf format ('%#') in format strings, use '0x' prefix instead #297: FILE: monitor/hmp-cmds-target.c:315:
+ monitor_printf(mon, "gpa: %#" HWADDR_PRIx "\n",
WARNING: line over 80 characters
#329: FILE: monitor/hmp-cmds-target.c:347:
+ ret = ((pinfo & 0x007fffffffffffffull) * pagesize) | (addr & (pagesize - 1));
Message-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
monitor/hmp-cmds-target.c +13 -9
@@ -149,7 +149,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, } max_digits =0 ; -switch (format) { +switch (format) {case 'o' : max_digits =DIV_ROUND_UP (wsize *8 ,3 );break ;
@@ -169,8 +169,9 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,while (len >0 ) {monitor_printf (mon,"%0*" PRIx64":" , addr_width, addr); l = len; -if (l > line_size) +if (l > line_size) { l = line_size; + }if (is_physical) {AddressSpace *as = cs ? cs->as : &address_space_memory; MemTxResult r = address_space_read(as, addr,
@@ -187,7 +188,7 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, } i =0 ;while (i < l) { -switch (wsize) { +switch (wsize) {default :case 1 : v =ldub_p (buf + i);
@@ -203,9 +204,9 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize,break ; }monitor_printf (mon," " ); -switch (format) { +switch (format) {case 'o' : -monitor_printf (mon,"%#*" PRIo64, max_digits, v); +monitor_printf (mon,"0%*" PRIo64, max_digits, v);break ;case 'x' :monitor_printf (mon,"0x%0*" PRIx64, max_digits, v);
@@ -255,12 +256,14 @@ void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, uint64_t size, Error **errp) addr, size);if (!mrs.mr) { -error_setg (errp,"No memory is mapped at address 0x%" HWADDR_PRIx, addr); +error_setg (errp, +"No memory is mapped at address 0x%" HWADDR_PRIx, addr);return NULL ; }if (!memory_region_is_ram (mrs.mr) && !memory_region_is_romd (mrs.mr)) { -error_setg (errp,"Memory at address 0x%" HWADDR_PRIx" is not RAM" , addr); +error_setg (errp, +"Memory at address 0x%" HWADDR_PRIx" is not RAM" , addr);memory_region_unref (mrs.mr);return NULL ; }
@@ -312,7 +315,7 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict)if (gpa ==-1 ) {monitor_printf (mon,"Unmapped\n" ); }else { -monitor_printf (mon,"gpa: %#" HWADDR_PRIx"\n" , +monitor_printf (mon,"gpa: 0x%" HWADDR_PRIx"\n" , gpa + (addr & ~TARGET_PAGE_MASK )); } }
@@ -344,7 +347,8 @@ static uint64_t vtop(void *ptr, Error **errp)error_setg (errp,"Page not present" ); goto out; } - ret = ((pinfo &0x007fffffffffffffull ) * pagesize) | (addr & (pagesize -1 )); + ret = (pinfo &0x007fffffffffffffull ) * pagesize; + ret |= addr & (pagesize -1 ); out:close (fd);
Signature · 1 line
2.52.0
[PULL 03/34] hw/riscv: Treat kernel_start_addr as vaddr
In reply to Philippe Mathieu-DaudéFrom: Anton Johansson <[email protected]>
Changes kernel_start_addr from target_ulong to vaddr. Logically, the argument represents a virtual address at which to load the kernel image, which gets treated as a hwaddr as a fallback if elf and uimage loading fails.
Message-ID: <[email protected]>
--- include/hw/riscv/boot.h | 6 +++--- hw/riscv/boot.c | 6 +++--- hw/riscv/microchip_pfsoc.c | 3 ++- hw/riscv/sifive_u.c | 3 ++- hw/riscv/spike.c | 2 +- hw/riscv/virt.c | 3 ++- 6 files changed, 13 insertions(+), 10 deletions(-)
include/hw/riscv/boot.h +3 -3
@@ -43,8 +43,8 @@ bool riscv_is_32bit(RISCVHartArrayState *harts);char *riscv_plic_hart_config_string (int hart_count);void riscv_boot_info_init (RISCVBootInfo *info,RISCVHartArrayState *harts); -hwaddr riscv_calc_kernel_start_addr (RISCVBootInfo *info, -hwaddr firmware_end_addr); +vaddr riscv_calc_kernel_start_addr (RISCVBootInfo *info, +hwaddr firmware_end_addr); hwaddr riscv_find_and_load_firmware(MachineState *machine, const char *default_machine_firmware, hwaddr *firmware_load_addr,
@@ -57,7 +57,7 @@ hwaddr riscv_load_firmware(const char *firmware_filename, symbol_fn_t sym_cb);void riscv_load_kernel (MachineState *machine,RISCVBootInfo *info, -target_ulong kernel_start_addr, +vaddr kernel_start_addr,bool load_initrd,symbol_fn_t sym_cb); uint64_t riscv_compute_fdt_addr(hwaddr dram_base, hwaddr dram_size,
hw/riscv/boot.c +3 -3
@@ -74,8 +74,8 @@ void riscv_boot_info_init(RISCVBootInfo *info, RISCVHartArrayState *harts) info->is_32bit =riscv_is_32bit (harts); } -hwaddr riscv_calc_kernel_start_addr (RISCVBootInfo *info, -hwaddr firmware_end_addr) { +vaddr riscv_calc_kernel_start_addr (RISCVBootInfo *info, +hwaddr firmware_end_addr) {if (info->is_32bit) {return QEMU_ALIGN_UP (firmware_end_addr,4 * MiB); }else {
@@ -228,7 +228,7 @@ static void riscv_load_initrd(MachineState *machine, RISCVBootInfo *info)void riscv_load_kernel (MachineState *machine,RISCVBootInfo *info, -target_ulong kernel_start_addr, +vaddr kernel_start_addr,bool load_initrd,symbol_fn_t sym_cb) {
hw/riscv/microchip_pfsoc.c +2 -1
@@ -521,7 +521,8 @@ static void microchip_icicle_kit_machine_init(MachineState *machine)uint64_t mem_low_size, mem_high_size;hwaddr firmware_load_addr;const char *firmware_name; -hwaddr firmware_end_addr, kernel_start_addr; +hwaddr firmware_end_addr; +vaddr kernel_start_addr;uint64_t kernel_entry;uint64_t fdt_load_addr;DriveInfo *dinfo =drive_get (IF_SD ,0 ,0 );
hw/riscv/sifive_u.c +2 -1
@@ -515,7 +515,8 @@ static void sifive_u_machine_init(MachineState *machine)MemoryRegion *system_memory =get_system_memory ();MemoryRegion *flash0 =g_new (MemoryRegion,1 );hwaddr start_addr = memmap[SIFIVE_U_DEV_DRAM ].base; -hwaddr firmware_end_addr, kernel_start_addr; +hwaddr firmware_end_addr; +vaddr kernel_start_addr;const char *firmware_name;uint32_t start_addr_hi32 =0x00000000 ;uint32_t fdt_load_addr_hi32 =0x00000000 ;
hw/riscv/spike.c +1 -1
@@ -199,7 +199,7 @@ static void spike_board_init(MachineState *machine)MemoryRegion *mask_rom =g_new (MemoryRegion,1 );hwaddr firmware_end_addr = memmap[SPIKE_DRAM ].base;hwaddr firmware_load_addr = memmap[SPIKE_DRAM ].base; -hwaddr kernel_start_addr; +vaddr kernel_start_addr;char *firmware_name;uint64_t fdt_load_addr;uint64_t kernel_entry;
hw/riscv/virt.c +2 -1
@@ -1434,7 +1434,8 @@ static void virt_machine_done(Notifier *notifier, void *data) machine_done);MachineState *machine =MACHINE (s);hwaddr start_addr = s->memmap[VIRT_DRAM ].base; -hwaddr firmware_end_addr, kernel_start_addr; +hwaddr firmware_end_addr; +vaddr kernel_start_addr;const char *firmware_name =riscv_default_firmware_name (&s->soc[0 ]);uint64_t fdt_load_addr;uint64_t kernel_entry =0 ;
Signature · 1 line
2.52.0
[PULL 06/34] monitor/hmp: Make memory_dump() @is_physical argument a boolean
In reply to Philippe Mathieu-DaudéMessage-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
monitor/hmp-cmds-target.c +3 -3
@@ -122,7 +122,7 @@ void hmp_info_registers(Monitor *mon, const QDict *qdict) }static void memory_dump (Monitor *mon,int count,int format,int wsize, -hwaddr addr,int is_physical) +hwaddr addr,bool is_physical) {int l, line_size, i, max_digits, len;uint8_t buf[16 ];
@@ -237,7 +237,7 @@ void hmp_memory_dump(Monitor *mon, const QDict *qdict)int size =qdict_get_int (qdict,"size" );target_long addr =qdict_get_int (qdict,"addr" ); -memory_dump (mon, count, format, size, addr,0 ); +memory_dump (mon, count, format, size, addr, false); }void hmp_physical_memory_dump (Monitor *mon,const QDict *qdict)
@@ -247,7 +247,7 @@ void hmp_physical_memory_dump(Monitor *mon, const QDict *qdict)int size =qdict_get_int (qdict,"size" );hwaddr addr =qdict_get_int (qdict,"addr" ); -memory_dump (mon, count, format, size, addr,1 ); +memory_dump (mon, count, format, size, addr, true); }void *gpa2hva (MemoryRegion **p_mr,hwaddr addr,uint64_t size,Error **errp)
Signature · 1 line
2.52.0
[PULL 08/34] monitor/hmp: Remove target_long uses in memory_dump()
In reply to Philippe Mathieu-DaudéPass a plain vaddr type to express virtual address.
Message-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
monitor/hmp-cmds-target.c +1 -1
@@ -232,7 +232,7 @@ void hmp_memory_dump(Monitor *mon, const QDict *qdict)int count =qdict_get_int (qdict,"count" );int format =qdict_get_int (qdict,"format" );int size =qdict_get_int (qdict,"size" ); -target_long addr =qdict_get_int (qdict,"addr" ); +vaddr addr =qdict_get_int (qdict,"addr" );memory_dump (mon, count, format, size, addr, false); }
Signature · 1 line
2.52.0
[PULL 11/34] monitor/hmp: Merge hmp-cmds-target.c within hmp-cmds.c
In reply to Philippe Mathieu-Daudéhmp-cmds-target.c is no more target specific, move its code in hmp-cmds.c, which is built once for all system binaries.
Message-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 383 -------------------------------------- monitor/hmp-cmds.c | 354 +++++++++++++++++++++++++++++++++++ monitor/meson.build | 2 +- 3 files changed, 355 insertions(+), 384 deletions(-) delete mode 100644 monitor/hmp-cmds-target.c
monitor/hmp-cmds-target.c deleted +0 -383
@@ -1,383 +0,0 @@ -/* -* Miscellaneous target-dependent HMP commands -* -* Copyright (c) 2003-2004 Fabrice Bellard -* -* Permission is hereby granted, free of charge, to any person obtaining a copy -* of this software and associated documentation files (the "Software"), to deal -* in the Software without restriction, including without limitation the rights -* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -* copies of the Software, and to permit persons to whom the Software is -* furnished to do so, subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in -* all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -* THE SOFTWARE. -*/ - -#include "qemu/osdep.h" -#include "disas/disas.h" -#include "system/address-spaces.h" -#include "system/memory.h" -#include "monitor/hmp-target.h" -#include "monitor/monitor-internal.h" -#include "qapi/error.h" -#include "qobject/qdict.h" -#include "system/hw_accel.h" -#include "exec/target_page.h" - -/* Set the current CPU defined by the user. Callers must hold BQL. */ -int monitor_set_cpu (Monitor *mon,int cpu_index) -{ -CPUState *cpu; - - cpu =qemu_get_cpu (cpu_index); -if (cpu ==NULL ) { -return -1 ; - } -g_free (mon->mon_cpu_path); - mon->mon_cpu_path =object_get_canonical_path (OBJECT (cpu)); -return 0 ; -} - -/* Callers must hold BQL. */ -static CPUState *mon_get_cpu_sync (Monitor *mon,bool synchronize) -{ -CPUState *cpu =NULL ; - -if (mon->mon_cpu_path) { - cpu = (CPUState *)object_resolve_path_type (mon->mon_cpu_path, -TYPE_CPU ,NULL ); -if (!cpu) { -g_free (mon->mon_cpu_path); - mon->mon_cpu_path =NULL ; - } - } -if (!mon->mon_cpu_path) { -if (!first_cpu) { -return NULL ; - } -monitor_set_cpu (mon, first_cpu->cpu_index); - cpu = first_cpu; - } -assert (cpu !=NULL ); -if (synchronize) { -cpu_synchronize_state (cpu); - } -return cpu; -} - -CPUState *mon_get_cpu (Monitor *mon) -{ -return mon_get_cpu_sync (mon, true); -} - -CPUArchState *mon_get_cpu_env (Monitor *mon) -{ -CPUState *cs =mon_get_cpu (mon); - -return cs ?cpu_env (cs) :NULL ; -} - -int monitor_get_cpu_index (Monitor *mon) -{ -CPUState *cs =mon_get_cpu_sync (mon, false); - -return cs ? cs->cpu_index :UNASSIGNED_CPU_INDEX ; -} - -void hmp_info_registers (Monitor *mon,const QDict *qdict) -{ -bool all_cpus =qdict_get_try_bool (qdict,"cpustate_all" , false); -int vcpu =qdict_get_try_int (qdict,"vcpu" ,-1 ); -CPUState *cs; - -if (all_cpus) { -CPU_FOREACH (cs) { -monitor_printf (mon,"\nCPU#%d\n" , cs->cpu_index); -cpu_dump_state (cs,NULL ,CPU_DUMP_FPU |CPU_DUMP_VPU ); - } - }else { - cs = vcpu >=0 ?qemu_get_cpu (vcpu) :mon_get_cpu (mon); - -if (!cs) { -if (vcpu >=0 ) { -monitor_printf (mon,"CPU#%d not available\n" , vcpu); - }else { -monitor_printf (mon,"No CPU available\n" ); - } -return ; - } - -monitor_printf (mon,"\nCPU#%d\n" , cs->cpu_index); -cpu_dump_state (cs,NULL ,CPU_DUMP_FPU |CPU_DUMP_VPU ); - } -} - -static void memory_dump (Monitor *mon,int count,int format,int wsize, -uint64_t addr,bool is_physical) -{ -int l, line_size, i, max_digits, len; -uint8_t buf[16 ]; -uint64_t v; -CPUState *cs =mon_get_cpu (mon); -const unsigned int addr_width = is_physical ?8 : (target_long_bits () *2 ); -const bool big_endian =target_big_endian (); - -if (!cs && (format =='i' || !is_physical)) { -monitor_printf (mon,"Can not dump without CPU\n" ); -return ; - } - -if (format =='i' ) { -monitor_disas (mon, cs, addr, count, is_physical); -return ; - } - - len = wsize * count; -if (wsize ==1 ) { - line_size =8 ; - }else { - line_size =16 ; - } - max_digits =0 ; - -switch (format) { -case 'o' : - max_digits =DIV_ROUND_UP (wsize *8 ,3 ); -break ; -default : -case 'x' : - max_digits = (wsize *8 ) /4 ; -break ; -case 'u' : -case 'd' : - max_digits =DIV_ROUND_UP (wsize *8 *10 ,33 ); -break ; -case 'c' : - wsize =1 ; -break ; - } - -while (len >0 ) { -monitor_printf (mon,"%0*" PRIx64":" , addr_width, addr); - l = len; -if (l > line_size) { - l = line_size; - } -if (is_physical) { -AddressSpace *as = cs ? cs->as : &address_space_memory; -MemTxResult r =address_space_read (as, addr, -MEMTXATTRS_UNSPECIFIED , buf, l); -if (r !=MEMTX_OK ) { -monitor_printf (mon," Cannot access memory\n" ); -break ; - } - }else { -if (cpu_memory_rw_debug (cs, addr, buf, l,0 ) <0 ) { -monitor_printf (mon," Cannot access memory\n" ); -break ; - } - } - i =0 ; -while (i < l) { -switch (wsize) { -default : -case 1 : - v =ldub_p (buf + i); -break ; -case 2 : - v = (big_endian ? lduw_be_p : lduw_le_p)(buf + i); -break ; -case 4 : - v = (uint32_t )(big_endian ? ldl_be_p : ldl_le_p)(buf + i); -break ; -case 8 : - v = (big_endian ? ldq_be_p : ldq_le_p)(buf + i); -break ; - } -monitor_printf (mon," " ); -switch (format) { -case 'o' : -monitor_printf (mon,"0%*" PRIo64, max_digits, v); -break ; -case 'x' : -monitor_printf (mon,"0x%0*" PRIx64, max_digits, v); -break ; -case 'u' : -monitor_printf (mon,"%*" PRIu64, max_digits, v); -break ; -case 'd' : -monitor_printf (mon,"%*" PRId64, max_digits, v); -break ; -case 'c' : -monitor_printc (mon, v); -break ; - } - i += wsize; - } -monitor_printf (mon,"\n" ); - addr += l; - len -= l; - } -} - -void hmp_memory_dump (Monitor *mon,const QDict *qdict) -{ -int count =qdict_get_int (qdict,"count" ); -int format =qdict_get_int (qdict,"format" ); -int size =qdict_get_int (qdict,"size" ); -vaddr addr =qdict_get_int (qdict,"addr" ); - -memory_dump (mon, count, format, size, addr, false); -} - -void hmp_physical_memory_dump (Monitor *mon,const QDict *qdict) -{ -int count =qdict_get_int (qdict,"count" ); -int format =qdict_get_int (qdict,"format" ); -int size =qdict_get_int (qdict,"size" ); -hwaddr addr =qdict_get_int (qdict,"addr" ); - -memory_dump (mon, count, format, size, addr, true); -} - -void *gpa2hva (MemoryRegion **p_mr,hwaddr addr,uint64_t size,Error **errp) -{ -Int128 gpa_region_size; -MemoryRegionSection mrs =memory_region_find (get_system_memory (), - addr, size); - -if (!mrs.mr) { -error_setg (errp, -"No memory is mapped at address 0x%" HWADDR_PRIx, addr); -return NULL ; - } - -if (!memory_region_is_ram (mrs.mr) && !memory_region_is_romd (mrs.mr)) { -error_setg (errp, -"Memory at address 0x%" HWADDR_PRIx" is not RAM" , addr); -memory_region_unref (mrs.mr); -return NULL ; - } - - gpa_region_size =int128_make64 (size); -if (int128_lt (mrs.size, gpa_region_size)) { -error_setg (errp,"Size of memory region at 0x%" HWADDR_PRIx -" exceeded." , addr); -memory_region_unref (mrs.mr); -return NULL ; - } - - *p_mr = mrs.mr; -return qemu_map_ram_ptr (mrs.mr->ram_block, mrs.offset_within_region); -} - -void hmp_gpa2hva (Monitor *mon,const QDict *qdict) -{ -hwaddr addr =qdict_get_int (qdict,"addr" ); -Error *local_err =NULL ; -MemoryRegion *mr =NULL ; -void *ptr; - - ptr =gpa2hva (&mr, addr,1 , &local_err); -if (local_err) { -error_report_err (local_err); -return ; - } - -monitor_printf (mon,"Host virtual address for 0x%" HWADDR_PRIx -" (%s) is %p\n" , - addr, mr->name, ptr); - -memory_region_unref (mr); -} - -void hmp_gva2gpa (Monitor *mon,const QDict *qdict) -{ -vaddr addr =qdict_get_int (qdict,"addr" ); -CPUState *cs =mon_get_cpu (mon); -hwaddr gpa; - -if (!cs) { -monitor_printf (mon,"No cpu\n" ); -return ; - } - - gpa =cpu_get_phys_page_debug (cs, addr &TARGET_PAGE_MASK ); -if (gpa ==-1 ) { -monitor_printf (mon,"Unmapped\n" ); - }else { -monitor_printf (mon,"gpa: 0x%" HWADDR_PRIx"\n" , - gpa + (addr & ~TARGET_PAGE_MASK )); - } -} - -#ifdef CONFIG_LINUX -static uint64_t vtop (void *ptr,Error **errp) -{ -uint64_t pinfo; -uint64_t ret =-1 ; -uintptr_t addr = (uintptr_t ) ptr; -uintptr_t pagesize =qemu_real_host_page_size (); -off_t offset = addr / pagesize *sizeof (pinfo); -int fd; - - fd =open ("/proc/self/pagemap" ,O_RDONLY ); -if (fd ==-1 ) { -error_setg_errno (errp, errno,"Cannot open /proc/self/pagemap" ); -return -1 ; - } - -/* Force copy-on-write if necessary. */ -qatomic_add ((uint8_t *)ptr,0 ); - -if (pread (fd, &pinfo,sizeof (pinfo), offset) !=sizeof (pinfo)) { -error_setg_errno (errp, errno,"Cannot read pagemap" ); - goto out; - } -if ((pinfo & (1ull <<63 )) ==0 ) { -error_setg (errp,"Page not present" ); - goto out; - } - ret = (pinfo &0x007fffffffffffffull ) * pagesize; - ret |= addr & (pagesize -1 ); - -out: -close (fd); -return ret; -} - -void hmp_gpa2hpa (Monitor *mon,const QDict *qdict) -{ -hwaddr addr =qdict_get_int (qdict,"addr" ); -Error *local_err =NULL ; -MemoryRegion *mr =NULL ; -void *ptr; -uint64_t physaddr; - - ptr =gpa2hva (&mr, addr,1 , &local_err); -if (local_err) { -error_report_err (local_err); -return ; - } - - physaddr =vtop (ptr, &local_err); -if (local_err) { -error_report_err (local_err); - }else { -monitor_printf (mon,"Host physical address for 0x%" HWADDR_PRIx -" (%s) is 0x%" PRIx64"\n" , - addr, mr->name, (uint64_t ) physaddr); - } - -memory_region_unref (mr); -} -#endif
monitor/hmp-cmds.c +354 -0
373 lines not on this page · raw message
monitor/meson.build +1 -1
@@ -9,4 +9,4 @@ system_ss.add(files( system_ss.add([spice_headers, files('qmp-cmds.c')]) specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', - if_true: [files( 'hmp-cmds-target.c', 'hmp-target.c'), spice]) + if_true: [files('hmp-target.c'), spice])
Signature · 1 line
2.52.0
[PULL 05/34] monitor/hmp: Replace target_ulong -> vaddr in hmp_gva2gpa()
In reply to Philippe Mathieu-Daudécpu_get_phys_page_debug() takes a vaddr type since commit 00b941e581b ("cpu: Turn cpu_get_phys_page_debug() into a CPUClass hook").
Message-Id: <[email protected]>
--- monitor/hmp-cmds-target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
monitor/hmp-cmds-target.c +1 -1
@@ -301,7 +301,7 @@ void hmp_gpa2hva(Monitor *mon, const QDict *qdict)void hmp_gva2gpa (Monitor *mon,const QDict *qdict) { -target_ulong addr =qdict_get_int (qdict,"addr" ); +vaddr addr =qdict_get_int (qdict,"addr" );CPUState *cs =mon_get_cpu (mon);hwaddr gpa;
Signature · 1 line
2.52.0
[PULL 13/34] hw/net/opencores: Clarify MMIO read/write handlers expect 32-bit access
In reply to Philippe Mathieu-DaudéThe read/write handlers access array of 32-bit register by index:
277 struct OpenEthState {
..
287 uint32_t regs[REG_MAX];
..
291 };
546 static uint64_t open_eth_reg_read(void *opaque,
547 hwaddr addr, unsigned int size)
548 {
..
551 OpenEthState *s = opaque;
552 unsigned idx = addr / 4;
..
559 v = s->regs[idx];
..
563 return v;
564 }
This is a 32-bit implementation. Make that explicit in the MemoryRegionOps structure (this doesn't change the maximum access size, which -- being unset -- is 64-bit).
Move the structure just after the handlers to ease code review.
Message-Id: <[email protected]>
--- hw/net/opencores_eth.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
hw/net/opencores_eth.c +9 -6
@@ -683,6 +683,15 @@ static void open_eth_reg_write(void *opaque, } } +static const MemoryRegionOps open_eth_reg_ops = { + .read = open_eth_reg_read, + .write = open_eth_reg_write, + .impl = { + .min_access_size =4 , + .max_access_size =4 , + }, +}; +static uint64_t open_eth_desc_read (void *opaque,hwaddr addr,unsigned int size) {
@@ -706,12 +715,6 @@ static void open_eth_desc_write(void *opaque,open_eth_check_start_xmit (s); } - -static const MemoryRegionOps open_eth_reg_ops = { - .read = open_eth_reg_read, - .write = open_eth_reg_write, -}; -static const MemoryRegionOps open_eth_desc_ops = { .read = open_eth_desc_read, .write = open_eth_desc_write,
Signature · 1 line
2.52.0
[PULL 17/34] hw/char/pl011: Mark implementation as being little-endian
In reply to Philippe Mathieu-DaudéThe PL011 component is only built / used by ARM targets, which are only built in little endianness. Thus we only ever built as little endian, never testing the big-endian possibility of the DEVICE_NATIVE_ENDIAN definition. Simplify by only keeping the little endian variant.
Message-Id: <[email protected]>
--- hw/char/pl011.c | 2 +- rust/hw/char/pl011/src/device.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/char/pl011.c +1 -1
@@ -538,7 +538,7 @@ static void pl011_clock_update(void *opaque, ClockEvent event)static const MemoryRegionOps pl011_ops = { .read = pl011_read, .write = pl011_write, - .endianness =DEVICE_NATIVE_ENDIAN , + .endianness =DEVICE_LITTLE_ENDIAN , .impl.min_access_size =4 , .impl.max_access_size =4 , };
rust/hw/char/pl011/src/device.rs +1 -1
@@ -489,7 +489,7 @@ unsafe fn init(mut this: ParentInit<Self>) {static PL011_OPS :MemoryRegionOps <PL011State > =MemoryRegionOpsBuilder ::<PL011State >::new () .read (&PL011State ::read) .write (&PL011State ::write) - .native_endian () + .little_endian () .impl_sizes (4 ,4 ) .build ();
Signature · 1 line
2.52.0
[PULL 18/34] rust/system: Stop exposing bogus DEVICE_NATIVE_ENDIAN symbol
In reply to Philippe Mathieu-DaudéWe want to remove the bogus DEVICE_NATIVE_ENDIAN definition (by only having it explicit, either big or little one). Stop exposing it to rust devices to avoid it spreading further.
Message-Id: <[email protected]>
--- rust/system/src/memory.rs | 6 ------ 1 file changed, 6 deletions(-)
rust/system/src/memory.rs +0 -6
@@ -78,12 +78,6 @@ pub const fn little_endian(mut self) -> Self { self } -#[must_use] -pub const fn native_endian (mut self) ->Self { - self.0 .endianness = device_endian::DEVICE_NATIVE_ENDIAN ; - self - } -#[must_use] pub const fn valid_sizes (mut self, min:u32 , max:u32 ) ->Self { self.0 .valid.min_access_size = min;
Signature · 1 line
2.52.0
[PULL 16/34] hw/timer/hpet: Mark implementation as being little-endian
In reply to Philippe Mathieu-DaudéThe HPET component is only built / used by X86 targets, which are only built in little endianness. Thus we only ever built as little endian, never testing the big-endian possibility of the DEVICE_NATIVE_ENDIAN definition. Simplify by only keeping the little endian variant.
Message-Id: <[email protected]>
--- hw/timer/hpet.c | 2 +- rust/hw/timer/hpet/src/device.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/timer/hpet.c +1 -1
@@ -648,7 +648,7 @@ static const MemoryRegionOps hpet_ram_ops = { .min_access_size = 4, .max_access_size = 8, }, - .endianness = DEVICE_NATIVE_ENDIAN, + .endianness = DEVICE_LITTLE_ENDIAN, };static void hpet_reset (DeviceState *d)
rust/hw/timer/hpet/src/device.rs +1 -1
@@ -763,7 +763,7 @@ unsafe fn init(mut this: ParentInit<Self>) {MemoryRegionOpsBuilder ::<HPETState >::new () .read (&HPETState ::read) .write (&HPETState ::write) - .native_endian () + .little_endian () .valid_sizes (4 ,8 ) .impl_sizes (4 ,8 ) .build ();
Signature · 1 line
2.52.0
[PULL 15/34] hw/misc/pvpanic: Expose MMIO interface as little-endian
In reply to Philippe Mathieu-DaudéMake the PVPanic MMIO interface behave like the ISA and PCI
variants: access it using little endianness.
Message-Id: <[email protected]>
--- hw/misc/pvpanic.c | 1 + 1 file changed, 1 insertion(+)
hw/misc/pvpanic.c +1 -0
@@ -62,6 +62,7 @@ static void pvpanic_write(void *opaque, hwaddr addr, uint64_t val, }static const MemoryRegionOps pvpanic_ops = { + .endianness =DEVICE_LITTLE_ENDIAN , .read = pvpanic_read, .write = pvpanic_write, .impl = {
Signature · 1 line
2.52.0
[PULL 14/34] hw/char/serial: Let compiler pick serial_mm_ops[] array length
In reply to Philippe Mathieu-DaudéNo need to enforce the MemoryRegionOps array length. We index by device_endian enum, the compiler will easily pick the correct length. Besides, this allow further adjustments in the device_endian enum itself.
Message-Id: <[email protected]>
--- hw/char/serial-mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/char/serial-mm.c +1 -1
@@ -44,7 +44,7 @@ static void serial_mm_write(void *opaque, hwaddr addr, serial_io_ops.write (&s->serial, addr >> s->regshift, value,1 ); } -static const MemoryRegionOps serial_mm_ops[3 ] = { +static const MemoryRegionOps serial_mm_ops[] = { [DEVICE_NATIVE_ENDIAN ] = { .read = serial_mm_read, .write = serial_mm_write,
Signature · 1 line
2.52.0
[PULL 19/34] target/hexagon: Include missing 'cpu.h' header in 'internal.h'
In reply to Philippe Mathieu-DaudéBoth CPUHexagonState and TOTAL_PER_THREAD_REGS are defined in "cpu.h" which is luckily indirectly included. However when refactoring unrelated files we get:
In file included from target/hexagon/helper.h:18,
from include/exec/helper-proto.h.inc:56,
from include/exec/helper-proto.h:13,
from target/hexagon/op_helper.c:22:
target/hexagon/internal.h: At top level:
target/hexagon/internal.h:29:25: error: unknown type name ‘CPUHexagonState’; did you mean ‘CPUPluginState’?
29 | void hexagon_debug_vreg(CPUHexagonState *env, int regnum);
| ^~~~~~~~~~~~~~~
| CPUPluginState
target/hexagon/internal.h:30:25: error: unknown type name ‘CPUHexagonState’; did you mean ‘CPUPluginState’?
30 | void hexagon_debug_qreg(CPUHexagonState *env, int regnum);
| ^~~~~~~~~~~~~~~
| CPUPluginState
target/hexagon/internal.h:31:20: error: unknown type name ‘CPUHexagonState’; did you mean ‘CPUPluginState’?
31 | void hexagon_debug(CPUHexagonState *env);
| ^~~~~~~~~~~~~~~
| CPUPluginState
target/hexagon/internal.h:33:44: error: ‘TOTAL_PER_THREAD_REGS’ undeclared here (not in a function)
33 | extern const char * const hexagon_regnames[TOTAL_PER_THREAD_REGS];
| ^~~~~~~~~~~~~~~~~~~~~Fix that by including the missing header.
We don't need the "qemu/log.h" since commit 0cb73cb5a02 ("target/hexagon:
Remove HEX_DEBUG/HEX_DEBUG_LOG"): remove it.
Message-Id: <[email protected]>
--- target/hexagon/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/internal.h +1 -1
@@ -18,7 +18,7 @@#ifndef HEXAGON_INTERNAL_H #define HEXAGON_INTERNAL_H -#include "qemu/log.h" +#include "target/hexagon/cpu.h" int hexagon_gdb_read_register (CPUState *cpu,GByteArray *buf,int reg);int hexagon_gdb_write_register (CPUState *cpu,uint8_t *buf,int reg);
Signature · 1 line
2.52.0
[PULL 21/34] target/sparc: Update MMU page table using stl_phys()
In reply to Philippe Mathieu-Daudéstl_phys_notdirty() is supposed to do an optimized CODE path store. Here we update the page table via the DATA path, so can use the normal stl_phys() helper.
Message-Id: <[email protected]>
--- target/sparc/mmu_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/sparc/mmu_helper.c +1 -1
@@ -189,7 +189,7 @@ static int get_physical_address(CPUSPARCState *env, CPUTLBEntryFull *full,if (is_dirty) { pde |=PG_MODIFIED_MASK ; } -stl_phys_notdirty (cs->as, pde_ptr, pde); +stl_phys (cs->as, pde_ptr, pde); }/* the page can be put in the TLB */
Signature · 1 line
2.52.0
[PULL 12/34] hw/arm/Kconfig: Have FSL_IMX6UL SoC select IMX_USBPHY
In reply to Philippe Mathieu-DaudéSince commit 17372bd812d, the SoC used by the mcimx6ul-evk machine requires the IMX USB PHY component.
As this component is only used by 2 machines, do not select it by default (it will be automatically selected when necessary).
Message-Id: <[email protected]>
--- hw/arm/Kconfig | 1 + hw/usb/Kconfig | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
hw/arm/Kconfig +1 -0
@@ -638,6 +638,7 @@ config FSL_IMX6UL select IMX select IMX_FEC select IMX_I2C + select IMX_USBPHY select WDT_IMX2 select SDHCI select USB_CHIPIDEA
hw/usb/Kconfig +0 -1
@@ -132,7 +132,6 @@ config USB_CANOKEY config IMX_USBPHY bool - default y depends on USB config USB_DWC3
Signature · 1 line
2.52.0
[PULL 22/34] hw/arm: Avoid address_space_stl_notdirty() when generating bootloader
In reply to Philippe Mathieu-DaudéWhen using the '-kernel' command line option, a bootloader is emitted, calling address_space_stl_notdirty().
The _notdirty() variant is supposed to /not/ mark the updated CODE page as dirty, to not re-translate it. However this code is only used with the '-kernel' CLI option after the machine is created and /before/ the vCPUs run, and *only* during the first (cold) reset; not during following (hot) resets. The optimisation is totally not justified, since we haven't translated any guest code yet.
Replace by the normal address_space_stl() helper.
Message-Id: <[email protected]>
--- hw/arm/aspeed.c | 4 ++-- hw/arm/boot.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
hw/arm/aspeed.c +2 -2
@@ -77,8 +77,8 @@ static void aspeed_reset_secondary(ARMCPU *cpu,CPUState *cs =CPU (cpu);/* info->smp_bootreg_addr */ -address_space_stl_notdirty (as,AST_SMP_MBOX_FIELD_GOSIGN ,0 , -MEMTXATTRS_UNSPECIFIED ,NULL ); +address_space_stl (as,AST_SMP_MBOX_FIELD_GOSIGN ,0 , +MEMTXATTRS_UNSPECIFIED ,NULL );cpu_set_pc (cs, info->smp_loader_start); }
hw/arm/boot.c +4 -4
@@ -266,8 +266,8 @@ static void default_reset_secondary(ARMCPU *cpu,AddressSpace *as =arm_boot_address_space (cpu, info);CPUState *cs =CPU (cpu); -address_space_stl_notdirty (as, info->smp_bootreg_addr, -0 ,MEMTXATTRS_UNSPECIFIED ,NULL ); +address_space_stl (as, info->smp_bootreg_addr, +0 ,MEMTXATTRS_UNSPECIFIED ,NULL );cpu_set_pc (cs, info->smp_loader_start); }
@@ -277,8 +277,8 @@ static inline bool have_dtb(const struct arm_boot_info *info) }#define WRITE_WORD (p, value) do { \ - address_space_stl_notdirty(as, p, value, \ - MEMTXATTRS_UNSPECIFIED, NULL); \ + address_space_stl(as, p, value, \ + MEMTXATTRS_UNSPECIFIED, NULL); \ p += 4; \ } while (0)
Signature · 1 line
2.52.0
[PULL 20/34] target/i386: Remove x86_stl_phys_notdirty() leftover
In reply to Philippe Mathieu-DaudéLast use of x86_stl_phys_notdirty() was removed in commit 4a1e9d4d11c ("target/i386: Use atomic operations for pte updates"), let's remove.
Message-Id: <[email protected]>
--- target/i386/cpu.h | 1 - target/i386/helper.c | 10 ---------- 2 files changed, 11 deletions(-)
target/i386/cpu.h +0 -1
@@ -2756,7 +2756,6 @@ uint32_t x86_lduw_phys(CPUState *cs, hwaddr addr);uint32_t x86_ldl_phys (CPUState *cs,hwaddr addr);uint64_t x86_ldq_phys (CPUState *cs,hwaddr addr);void x86_stb_phys (CPUState *cs,hwaddr addr,uint8_t val); -void x86_stl_phys_notdirty (CPUState *cs,hwaddr addr,uint32_t val);void x86_stw_phys (CPUState *cs,hwaddr addr,uint32_t val);void x86_stl_phys (CPUState *cs,hwaddr addr,uint32_t val);void x86_stq_phys (CPUState *cs,hwaddr addr,uint64_t val);
target/i386/helper.c +0 -10
@@ -702,16 +702,6 @@ void x86_stb_phys(CPUState *cs, hwaddr addr, uint8_t val)address_space_stb (as, addr, val, attrs,NULL ); } -void x86_stl_phys_notdirty (CPUState *cs,hwaddr addr,uint32_t val) -{ -X86CPU *cpu =X86_CPU (cs); -CPUX86State *env = &cpu->env; -MemTxAttrs attrs =cpu_get_mem_attrs (env); -AddressSpace *as =cpu_addressspace (cs, attrs); - -address_space_stl_notdirty (as, addr, val, attrs,NULL ); -} -void x86_stw_phys (CPUState *cs,hwaddr addr,uint32_t val) {X86CPU *cpu =X86_CPU (cs);
Signature · 1 line
2.52.0
[PULL 27/34] hw/virtio: Reduce virtio_lduw/stw_phys_cached() scope
In reply to Philippe Mathieu-Daudévirtio_lduw_phys_cached() and virtio_stw_phys_cached() are only used within hw/virtio/virtio.c: reduce their scope by moving their definitions there.
Message-Id: <[email protected]>
--- include/hw/virtio/virtio-access.h | 21 --------------------- hw/virtio/virtio.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-)
include/hw/virtio/virtio-access.h +0 -21
@@ -102,27 +102,6 @@ static inline uint16_t virtio_tswap16(VirtIODevice *vdev, uint16_t s)#endif } -static inline uint16_t virtio_lduw_phys_cached (VirtIODevice *vdev, -MemoryRegionCache *cache, -hwaddr pa) -{ -if (virtio_access_is_big_endian (vdev)) { -return lduw_be_phys_cached (cache, pa); - } -return lduw_le_phys_cached (cache, pa); -} - -static inline void virtio_stw_phys_cached (VirtIODevice *vdev, -MemoryRegionCache *cache, -hwaddr pa,uint16_t value) -{ -if (virtio_access_is_big_endian (vdev)) { -stw_be_phys_cached (cache, pa, value); - }else { -stw_le_phys_cached (cache, pa, value); - } -} -static inline void virtio_tswap16s (VirtIODevice *vdev,uint16_t *s) { *s =virtio_tswap16 (vdev, *s);
hw/virtio/virtio.c +21 -0
@@ -216,6 +216,27 @@ static void virtio_check_indirect_feature(VirtIODevice *vdev) } } +static inline uint16_t virtio_lduw_phys_cached (VirtIODevice *vdev, +MemoryRegionCache *cache, +hwaddr pa) +{ +if (virtio_access_is_big_endian (vdev)) { +return lduw_be_phys_cached (cache, pa); + } +return lduw_le_phys_cached (cache, pa); +} + +static inline void virtio_stw_phys_cached (VirtIODevice *vdev, +MemoryRegionCache *cache, +hwaddr pa,uint16_t value) +{ +if (virtio_access_is_big_endian (vdev)) { +stw_be_phys_cached (cache, pa, value); + }else { +stw_le_phys_cached (cache, pa, value); + } +} +/* Called within call_rcu(). */ static void virtio_free_region_cache (VRingMemoryRegionCaches *caches) {
Signature · 1 line
2.52.0
[PULL 24/34] system/memory: Allow restricting legacy ldst_phys() API usage
In reply to Philippe Mathieu-DaudéCommit 500131154d6 ("exec.c: Add new address_space_ld*/st* functions") added a new API to fix a shortcoming of the ld/st*_phys() API, which does blind bus access, not reporting failure (and it also allow to provide transaction attributes).
Later commit 42874d3a8c6 ("Switch non-CPU callers from ld/st*_phys to address_space_ld/st*") automatically converted the legacy uses to the new API, not precising transaction attributes (MEMTXATTRS_UNSPECIFIED) and ignoring the transation result (passing NULL pointer as MemTxResult).
While this is a faithful replacement, without any logical change, we later realized better is to not use MEMTXATTRS_UNSPECIFIED or NULL MemTxResult, and adapt each call site on a pair basis, looking at the device model datasheet to do the correct behavior (which is unlikely to ignore transaction failures).
Since this is quite some work, we defer that to device model maintainers. Meanwhile we introduce a definition, to allow a target which removed all legacy API call to prohibit further legacy API uses, named "TARGET_NOT_USING_LEGACY_LDST_PHYS_API".
Since all targets should be able to check this definition, we take care to not poison it.
Message-Id: <[email protected]>
--- include/system/memory.h | 2 ++ scripts/make-config-poison.sh | 1 + 2 files changed, 3 insertions(+)
include/system/memory.h +2 -0
@@ -2855,10 +2855,12 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr,#define ARG1_DECL AddressSpace *as#include "system/memory_ldst.h.inc" +#ifndef TARGET_NOT_USING_LEGACY_LDST_PHYS_API #define SUFFIX #define ARG1 as#define ARG1_DECL AddressSpace *as#include "system/memory_ldst_phys.h.inc" +#endif struct MemoryRegionCache {uint8_t *ptr;
scripts/make-config-poison.sh +1 -0
@@ -10,6 +10,7 @@ exec sed -n \ -e' /CONFIG_TCG/d' \ -e '/CONFIG_USER_ONLY/d' \ -e '/CONFIG_SOFTMMU/d' \ + -e '/TARGET_NOT_USING_LEGACY_LDST_PHYS_API/d' \ -e '/^#define / {' \ -e 's///' \ -e 's/ .*//' \
Signature · 1 line
2.52.0
[PULL 26/34] hw/virtio: Remove unused ldst_phys() helpers
In reply to Philippe Mathieu-DaudéNone of the following virtio ldst_phys() inlined helpers are used:
- virtio_lduw_phys()
- virtio_ldl_phys[_cached]()
- virtio_ldq_phys[_cached]()
- virtio_stw_phys()
- virtio_stl_phys[_cached]()
Just remove them.
Message-Id: <[email protected]>
--- include/hw/virtio/virtio-access.h | 85 ------------------------------- 1 file changed, 85 deletions(-)
include/hw/virtio/virtio-access.h +0 -85
@@ -39,60 +39,6 @@ static inline bool virtio_access_is_big_endian(VirtIODevice *vdev)#endif } -static inline uint16_t virtio_lduw_phys (VirtIODevice *vdev,hwaddr pa) -{ -AddressSpace *dma_as = vdev->dma_as; - -if (virtio_access_is_big_endian (vdev)) { -return lduw_be_phys (dma_as, pa); - } -return lduw_le_phys (dma_as, pa); -} - -static inline uint32_t virtio_ldl_phys (VirtIODevice *vdev,hwaddr pa) -{ -AddressSpace *dma_as = vdev->dma_as; - -if (virtio_access_is_big_endian (vdev)) { -return ldl_be_phys (dma_as, pa); - } -return ldl_le_phys (dma_as, pa); -} - -static inline uint64_t virtio_ldq_phys (VirtIODevice *vdev,hwaddr pa) -{ -AddressSpace *dma_as = vdev->dma_as; - -if (virtio_access_is_big_endian (vdev)) { -return ldq_be_phys (dma_as, pa); - } -return ldq_le_phys (dma_as, pa); -} - -static inline void virtio_stw_phys (VirtIODevice *vdev,hwaddr pa, -uint16_t value) -{ -AddressSpace *dma_as = vdev->dma_as; - -if (virtio_access_is_big_endian (vdev)) { -stw_be_phys (dma_as, pa, value); - }else { -stw_le_phys (dma_as, pa, value); - } -} - -static inline void virtio_stl_phys (VirtIODevice *vdev,hwaddr pa, -uint32_t value) -{ -AddressSpace *dma_as = vdev->dma_as; - -if (virtio_access_is_big_endian (vdev)) { -stl_be_phys (dma_as, pa, value); - }else { -stl_le_phys (dma_as, pa, value); - } -} -static inline void virtio_stw_p (VirtIODevice *vdev,void *ptr,uint16_t v) {if (virtio_access_is_big_endian (vdev)) {
@@ -166,26 +112,6 @@ static inline uint16_t virtio_lduw_phys_cached(VirtIODevice *vdev,return lduw_le_phys_cached (cache, pa); } -static inline uint32_t virtio_ldl_phys_cached (VirtIODevice *vdev, -MemoryRegionCache *cache, -hwaddr pa) -{ -if (virtio_access_is_big_endian (vdev)) { -return ldl_be_phys_cached (cache, pa); - } -return ldl_le_phys_cached (cache, pa); -} - -static inline uint64_t virtio_ldq_phys_cached (VirtIODevice *vdev, -MemoryRegionCache *cache, -hwaddr pa) -{ -if (virtio_access_is_big_endian (vdev)) { -return ldq_be_phys_cached (cache, pa); - } -return ldq_le_phys_cached (cache, pa); -} -static inline void virtio_stw_phys_cached (VirtIODevice *vdev,MemoryRegionCache *cache,hwaddr pa,uint16_t value)
@@ -197,17 +123,6 @@ static inline void virtio_stw_phys_cached(VirtIODevice *vdev, } } -static inline void virtio_stl_phys_cached (VirtIODevice *vdev, -MemoryRegionCache *cache, -hwaddr pa,uint32_t value) -{ -if (virtio_access_is_big_endian (vdev)) { -stl_be_phys_cached (cache, pa, value); - }else { -stl_le_phys_cached (cache, pa, value); - } -} -static inline void virtio_tswap16s (VirtIODevice *vdev,uint16_t *s) { *s =virtio_tswap16 (vdev, *s);
Signature · 1 line
2.52.0
[PULL 23/34] system/memory: Remove address_space_stl_notdirty and stl_phys_notdirty
In reply to Philippe Mathieu-Daudéstl_phys_notdirty() was added in commit 8df1cd076cc ("physical memory access functions") as a (premature?) optimisation for the CODE path. Meanwhile 20 years passed, we might never have understood / used it properly; the code evolved and now the recommended way to access the CODE path is via the cpu_ld/st_mmu*() API.
Remove both address_space_stl_notdirty() and stl_phys_notdirty() leftovers.
Message-Id: <[email protected]>
--- include/system/memory.h | 6 ----- include/system/memory_ldst.h.inc | 2 -- system/memory_ldst.c.inc | 39 -------------------------------- 3 files changed, 47 deletions(-)
include/system/memory.h +0 -6
@@ -2855,12 +2855,6 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr,#define ARG1_DECL AddressSpace *as#include "system/memory_ldst.h.inc" -static inline void stl_phys_notdirty (AddressSpace *as,hwaddr addr,uint32_t val) -{ -address_space_stl_notdirty (as, addr, val, -MEMTXATTRS_UNSPECIFIED ,NULL ); -} -#define SUFFIX #define ARG1 as#define ARG1_DECL AddressSpace *as
include/system/memory_ldst.h.inc +0 -2
@@ -25,8 +25,6 @@ uint32_t glue(address_space_ldl, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); uint64_t glue(address_space_ldq, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); -void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); void glue(address_space_stw, SUFFIX)(ARG1_DECL, hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result); void glue(address_space_stl, SUFFIX)(ARG1_DECL,
system/memory_ldst.c.inc +0 -39
@@ -261,45 +261,6 @@ uint16_t glue(address_space_lduw_be, SUFFIX)(ARG1_DECL, DEVICE_BIG_ENDIAN); } -/* warning: addr must be aligned. The ram page is not masked as dirty - and the code inside is not invalidated. It is useful if the dirty - bits are used to track modified PTEs */ -void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) -{ - uint8_t *ptr; - MemoryRegion *mr; - hwaddr l = 4; - hwaddr addr1; - MemTxResult r; - uint8_t dirty_log_mask; - bool release_lock = false; - - RCU_READ_LOCK(); - mr = TRANSLATE(addr, &addr1, &l, true, attrs); - if (l < 4 || !memory_access_is_direct(mr, true, attrs)) { - release_lock |= prepare_mmio_access(mr); - - r = memory_region_dispatch_write(mr, addr1, val, MO_32, attrs); - } else { - ptr = qemu_map_ram_ptr(mr->ram_block, addr1); - stl_p(ptr, val); - - dirty_log_mask = memory_region_get_dirty_log_mask(mr); - dirty_log_mask &= ~(1 << DIRTY_MEMORY_CODE); - physical_memory_set_dirty_range(memory_region_get_ram_addr(mr) + addr, - 4, dirty_log_mask); - r = MEMTX_OK; - } - if (result) { - *result = r; - } - if (release_lock) { - bql_unlock(); - } - RCU_READ_UNLOCK(); -} - /* warning: addr must be aligned */ static inline void glue(address_space_stl_internal, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val, MemTxAttrs attrs,
Signature · 1 line
2.52.0
[PULL 25/34] configs/targets: Mark targets not using legacy ldst_phys() API
In reply to Philippe Mathieu-DaudéLuckily these targets don't use the legacy ldst_phys() API at all. Set the TARGET_NOT_USING_LEGACY_LDST_PHYS_API variable to hide the API to them, avoiding further API uses to creep in.
Message-Id: <[email protected]>
--- configs/targets/avr-softmmu.mak | 1 + configs/targets/microblaze-softmmu.mak | 1 + configs/targets/microblazeel-softmmu.mak | 1 + configs/targets/rx-softmmu.mak | 1 + configs/targets/tricore-softmmu.mak | 1 + 5 files changed, 5 insertions(+)
configs/targets/avr-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ TARGET_ARCH=avr TARGET_XML_FILES= gdb-xml/avr-cpu.xml TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/microblaze-softmmu.mak +1 -0
@@ -4,3 +4,4 @@ TARGET_BIG_ENDIAN=y TARGET_NEED_FDT=y TARGET_XML_FILES=gdb-xml/microblaze-core.xml gdb-xml/microblaze-stack-protect.xml TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/microblazeel-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ TARGET_ARCH=microblaze TARGET_NEED_FDT=y TARGET_XML_FILES=gdb-xml/microblaze-core.xml gdb-xml/microblaze-stack-protect.xml TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/rx-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ TARGET_XML_FILES= gdb-xml/rx-core.xml # all boards require libfdt TARGET_NEED_FDT=y TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/tricore-softmmu.mak +1 -0
@@ -1,2 +1,3 @@ TARGET_ARCH=tricore TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
Signature · 1 line
2.52.0
[PULL 28/34] configs/targets: Mark targets not using legacy ldst_phys() API
In reply to Philippe Mathieu-DaudéThese targets were only using the legacy ldst_phys() API via the virtio load/store helpers, which got cleaned up.
Mark them not using the legacy ldst_phys() API to avoid further use, allowing to eventually remove it.
Message-Id: <[email protected]>
--- configs/targets/mips-softmmu.mak | 1 + configs/targets/mips64-softmmu.mak | 1 + configs/targets/mips64el-softmmu.mak | 1 + configs/targets/mipsel-softmmu.mak | 1 + configs/targets/or1k-softmmu.mak | 1 + configs/targets/riscv32-softmmu.mak | 1 + configs/targets/riscv64-softmmu.mak | 1 + configs/targets/sh4-softmmu.mak | 1 + configs/targets/sh4eb-softmmu.mak | 1 + configs/targets/sparc64-softmmu.mak | 1 + configs/targets/xtensa-softmmu.mak | 1 + configs/targets/xtensaeb-softmmu.mak | 1 + 12 files changed, 12 insertions(+)
configs/targets/mips-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ TARGET_ARCH=mips TARGET_BIG_ENDIAN=y TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/mips64-softmmu.mak +1 -0
@@ -2,3 +2,4 @@ TARGET_ARCH=mips64 TARGET_BASE_ARCH=mips TARGET_BIG_ENDIAN=y TARGET_LONG_BITS=64 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/mips64el-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ TARGET_ARCH=mips64 TARGET_BASE_ARCH=mips TARGET_LONG_BITS=64 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/mipsel-softmmu.mak +1 -0
@@ -1,2 +1,3 @@ TARGET_ARCH=mips TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/or1k-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ TARGET_BIG_ENDIAN=y # needed by boot.c and all boards TARGET_NEED_FDT=y TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/riscv32-softmmu.mak +1 -0
@@ -4,3 +4,4 @@ TARGET_XML_FILES= gdb-xml/riscv-32bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xm # needed by boot.c TARGET_NEED_FDT=y TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/riscv64-softmmu.mak +1 -0
@@ -5,3 +5,4 @@ TARGET_XML_FILES= gdb-xml/riscv-64bit-cpu.xml gdb-xml/riscv-32bit-fpu.xml gdb-xm # needed by boot.c TARGET_NEED_FDT=y TARGET_LONG_BITS=64 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/sh4-softmmu.mak +1 -0
@@ -1,2 +1,3 @@ TARGET_ARCH=sh4 TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/sh4eb-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ TARGET_ARCH=sh4 TARGET_BIG_ENDIAN=y TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/sparc64-softmmu.mak +1 -0
@@ -3,3 +3,4 @@ TARGET_BASE_ARCH=sparc TARGET_BIG_ENDIAN=y TARGET_XML_FILES=gdb-xml/sparc64-core.xml TARGET_LONG_BITS=64 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/xtensa-softmmu.mak +1 -0
@@ -1,2 +1,3 @@ TARGET_ARCH=xtensa TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
configs/targets/xtensaeb-softmmu.mak +1 -0
@@ -1,3 +1,4 @@ TARGET_ARCH=xtensa TARGET_BIG_ENDIAN=y TARGET_LONG_BITS=32 +TARGET_NOT_USING_LEGACY_LDST_PHYS_API=y
Signature · 1 line
2.52.0
[PULL 30/34] util: Move qemu_ftruncate64 from block/file-win32.c to oslib-win32.c
In reply to Philippe Mathieu-DaudéFrom: Nguyen Dinh Phi <[email protected]>
qemu_ftruncate64() is a general-purpose utility function that may be used outside of the block layer. Move it to util/oslib-win32.c where other Windows-specific utility functions reside.
Message-ID: <[email protected]>
--- block/file-win32.c | 32 -------------------------------- util/oslib-win32.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 32 deletions(-)
block/file-win32.c +0 -32
@@ -170,38 +170,6 @@ static BlockAIOCB *paio_submit(BlockDriverState *bs, HANDLE hfile,return thread_pool_submit_aio (aio_worker, acb, cb, opaque); } -int qemu_ftruncate64 (int fd,int64_t length) -{ -LARGE_INTEGER li; -DWORD dw; -LONG high; -HANDLE h; -BOOL res; - -if ((GetVersion () &0x80000000UL ) && (length >>32 ) !=0 ) -return -1 ; - - h = (HANDLE )_get_osfhandle (fd); - -/* get current position, ftruncate do not change position */ - li.HighPart =0 ; - li.LowPart =SetFilePointer (h,0 , &li.HighPart,FILE_CURRENT ); -if (li.LowPart ==INVALID_SET_FILE_POINTER &&GetLastError () !=NO_ERROR ) { -return -1 ; - } - - high = length >>32 ; - dw =SetFilePointer (h, (DWORD ) length, &high,FILE_BEGIN ); -if (dw ==INVALID_SET_FILE_POINTER &&GetLastError () !=NO_ERROR ) { -return -1 ; - } - res =SetEndOfFile (h); - -/* back to old position */ -SetFilePointer (h, li.LowPart, &li.HighPart,FILE_BEGIN ); -return res ?0 :-1 ; -} -static int set_sparse (int fd) {DWORD returned;
util/oslib-win32.c +33 -0
@@ -899,3 +899,36 @@ int qemu_shm_alloc(size_t size, Error **errp)error_setg (errp,"Shared memory is not supported." );return -1 ; } + +int qemu_ftruncate64 (int fd,int64_t length) +{ +LARGE_INTEGER li; +DWORD dw; +LONG high; +HANDLE h; +BOOL res; + +if ((GetVersion ()&0x80000000UL ) && (length >>32 ) !=0 ) { +return -1 ; + } + + h = (HANDLE )_get_osfhandle (fd); + +/* get current position, ftruncate do not change position */ + li.HighPart =0 ; + li.LowPart =SetFilePointer (h,0 , &li.HighPart,FILE_CURRENT ); +if (li.LowPart ==INVALID_SET_FILE_POINTER &&GetLastError () !=NO_ERROR ) { +return -1 ; + } + + high = length >>32 ; + dw =SetFilePointer (h, (DWORD ) length, &high,FILE_BEGIN ); +if (dw ==INVALID_SET_FILE_POINTER &&GetLastError () !=NO_ERROR ) { +return -1 ; + } + res =SetEndOfFile (h); + +/* back to old position */ +SetFilePointer (h, li.LowPart, &li.HighPart,FILE_BEGIN ); +return res ?0 :-1 ; +}
Signature · 1 line
2.52.0
[PULL 31/34] hw/i2c/imx: Fix trace func name error
In reply to Philippe Mathieu-DaudéFrom: Alano Song <[email protected]>
Message-ID: <[email protected]>
--- hw/i2c/imx_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/i2c/imx_i2c.c +2 -2
@@ -151,8 +151,8 @@ static void imx_i2c_write(void *opaque, hwaddr offset, {IMXI2CState *s =IMX_I2C (opaque); -trace_imx_i2c_read (DEVICE (s)->canonical_path,imx_i2c_get_regname (offset), - offset, value); +trace_imx_i2c_write (DEVICE (s)->canonical_path,imx_i2c_get_regname (offset), + offset, value); value &=0xff ;
Signature · 1 line
2.52.0
[PULL 29/34] qga/vss-win32: Fix ConvertStringToBSTR redefinition with newer MinGW
In reply to Philippe Mathieu-DaudéFrom: Nguyen Dinh Phi <[email protected]>
Newer versions of MinGW-w64 provide ConvertStringToBSTR() in the _com_util namespace via <comutil.h>. This causes a redefinition error when building qemu-ga on Windows with these toolchains.
Add a meson check to detect whether ConvertStringToBSTR is already available, and conditionally compile our fallback implementation only when the system does not provide one.
Message-ID: <[email protected]>
--- meson.build | 12 ++++++++++++ qga/vss-win32/install.cpp | 2 ++ 2 files changed, 14 insertions(+)
meson.build +12 -0
@@ -3241,6 +3241,18 @@ endif # Detect host pointer size for the target configuration loop. host_long_bits = cc.sizeof('void *') * 8 +# Detect if ConvertStringToBSTR has been defined in _com_util namespace +if host_os == 'windows' + has_convert_string_to_bstr = cxx.links(''' + #include <comutil.h> + int main() { + BSTR b = _com_util::ConvertStringToBSTR("test"); + return b ? 0 : 1; + } + ''') + config_host_data.set('CONFIG_CONVERT_STRING_TO_BSTR', has_convert_string_to_bstr) +endif + ######################## # Target configuration # ########################
qga/vss-win32/install.cpp +2 -0
@@ -549,6 +549,7 @@ STDAPI DllUnregisterServer(void) /* Support function to convert ASCII string into BSTR (used in _bstr_t) */ +#ifndef CONFIG_CONVERT_STRING_TO_BSTR namespace _com_util { BSTR WINAPI ConvertStringToBSTR(const char *ascii) {
@@ -566,6 +567,7 @@ namespace _com_util return bstr; } } +#endif /* Stop QGA VSS provider service using Winsvc API */ STDAPI StopService(void)
Signature · 1 line
2.52.0
[PULL 33/34] MAINTAINERS: remove old email for Bandan Das
In reply to Philippe Mathieu-DaudéFrom: Stefan Hajnoczi <[email protected]>
Bandan recently left Red Hat and emails to his old address now result in bounce messages. I contacted Bandan and he asked me to remove his old address on his behalf.
Message-ID: <[email protected]>
--- MAINTAINERS | 1 - 1 file changed, 1 deletion(-)
MAINTAINERS +0 -1
@@ -3543,7 +3543,6 @@ X: tests/qtest/migration-* Device Fuzzing M: Alexander Bulekov <[email protected]> R: Paolo Bonzini <[email protected]> -R: Bandan Das <[email protected]> R: Stefan Hajnoczi <[email protected]> R: Fabiano Rosas <[email protected]> R: Darren Kenny <[email protected]>
Signature · 1 line
2.52.0
[PULL 32/34] meson: Optimize summary_info about directories
In reply to Philippe Mathieu-DaudéFrom: Bin Guo <[email protected]>
Clear summary_info first, otherwise there will be redundant output about build environment.
Message-ID: <[email protected]>
--- meson.build | 1 + 1 file changed, 1 insertion(+)
meson.build +1 -0
@@ -4650,6 +4650,7 @@ summary_info += {'Download dependencies': get_option('wrap_mode') != 'nodownload summary(summary_info, bool_yn: true, section: 'Build environment') # Directories +summary_info = {} summary_info += {'Install prefix': get_option('prefix')} summary_info += {'BIOS directory': qemu_datadir} pathsep = host_os == 'windows' ? ';' : ':'
Signature · 1 line
2.52.0
[PULL 34/34] MAINTAINERS: Change email and status of TriCore
In reply to Philippe Mathieu-DaudéFrom: Bastian Koppelmann <[email protected]>
I'm no longer employed at the university of Paderborn. This also means my time available for QEMU has reduced significantly. Thus, I'm dropping the status to odd fixes.
Message-ID: <[email protected]>
--- MAINTAINERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
MAINTAINERS +2 -2
@@ -419,8 +419,8 @@ F: include/hw/xtensa/xtensa-isa.h F: configs/devices/xtensa*/default.mak TriCore TCG CPUs -M: Bastian Koppelmann <[email protected]> -S: Maintained +M: Bastian Koppelmann <[email protected]> +S: Odd Fixes F: target/tricore/ F: hw/tricore/ F: include/hw/tricore/
Signature · 1 line
2.52.0
Richard Henderson
AppliedQuoted 15 lines · Philippe Mathieu-Daudé
The following changes since commit
942b0d378a1de9649085ad6db5306d5b8cef3591:Merge tag 'for-upstream' ofhttps://gitlab.com/bonzini/qemu into staging (2025-12-29 09:10:40 +1100)are available in the Git repository at:
https://github.com/philmd/qemu.git tags/hw-misc-20251230for you to fetch changes up to
4bd2b65e524836fef274fd169db804a2efce8836:
MAINTAINERS: Change email and status of TriCore (2025-12-30 20:38:41 +0100)----------------------------------------------------------------
Misc HW patches
Quoted 10 lines
- Remove few
target_ulonguses
- Make human monitor non-target specific
- Better name for TrustZone Peripheral Protection Controller memory regions
- Do not exposeDEVICE_NATIVE_ENDIANon Rust
- Removeaddress_space_stl_notdirty()andstl_phys_notdirty()
- Allow to restrict targets to legacyldst_phys()API
- Fix MinGW-w64 link failure due toConvertStringToBSTR()
- Header cleanups
-MAINTAINERSupdates
----------------------------------------------------------------
Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/11.0 as appropriate.
r~