Misc HW patches for 2026-03-08
The following changes since commit 1ae4271ab8dbfbf5dc28b36baa7f3fd5fd2215e1:
Merge tag 'pull-11.0-virtio-gpu-updates-060326-1' of https://gitlab.com/stsquad/qemu into staging (2026-03-07 11:22:16 +0000)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/hw-misc-20260308
for you to fetch changes up to 27c64fa59d1b14c4656908e1dfca49482a96df61:
hw/char: Drop disable property of Diva GSP card (2026-03-08 23:11:14 +0100)
Following checkpatch errors ignored (first spurious, other ones pre-existing):
ERROR: "foo * bar" should be "foo *bar"
#40: FILE: hw/display/ati_2d.c:60:
+ + dst_y * surface_stride(ds),
ERROR: switch and case should be at the same indent #27: FILE: hw/net/xilinx_axienet.c:143:
switch (regnum) {+ case 2:
+ case 3:
ERROR: braces {} are necessary for all arms of this statement #43: FILE: hw/char/serial.c:164:
+ if (s->lcr & UART_LCR_EPS)
[...]
else
[...]
----------------------------------------------------------------
Misc HW patches
- Remove versioned machines released in QEMU 3.0
- Build various stubs and ACPI objects once
- Pair of bug fixes in ATI VGA model
- Cleanups in 16550A UART model
- Clarify PA-RISC CPU models (adding the PA-8500)
- Various memory leaks / overflows fixed
- MAINTAINERS updates
----------------------------------------------------------------
Akihiko Odaki (1):
ui/cocoa: Do not automatically zoom for HiDPI
Anton Johansson (3):
hppa: Introduce HPPACPUDef
hppa: Get physical address space bits from HPPACPUDef
hppa: Use 44 bit physical addresses for PA-8700
BALATON Zoltan (1):
ati-vga: Allow setting EDID parameters directly
Bernhard Beschow (11):
hw/arm/Kconfig: Fix serial selection for NPCM8XX hw/char/{diva-gsp, serial-pci-multi}: Fix deinitialization order hw/arm/aspeed_ast27x0-{ssp, tsp}: Do not access SerialMM internals
directly
util/fifo8: Make all read-only methods const-correct hw/char/serial: Remove explicit cast from void pointer hw/char/serial: Prefer fifo8 methods over open-coding hw/char/serial: Reuse fifo8_num_used()
hw/char/serial: Remove unhelpful comment hw/char/serial: Add constants for Line Control Register hw/char/serial: Remove redundant reset
hw/char/serial: Avoid implicit conversion when tracing
Chad Jablonski (8):
ati-vga: Fix framebuffer mapping by using hardware-correct aperture
sizes
ati-vga: Fix DST_PITCH and SRC_PITCH reads
ati-vga: Read aliased values from DP_GUI_MASTER_CNTL
ati-vga: Latch src and dst pitch and offset on master_cntl default
ati-vga: Implement foreground and background color register writes
ati-vga: Add scissor clipping register support
ati-vga: Remove dst_x/y updates after blit
ati-vga: Consolidate dirty region tracking in ati_2d_blt
Daniel P. Berrangé (1):
hw/i386: drop unused PC_CPU_MODEL_IDS macro
David Hamilton (1):
hw/misc/ivshmem-pci: Handle error from
kvm_irqchip_add_irqfd_notifier_gsi()
Gerd Hoffmann (1):
hw/uefi: add variable digest to vmstate
Helge Deller (2):
hw/hppa: Avoid leaking a diva-gsp device
hw/char: Drop disable property of Diva GSP card
Jim MacArthur (1):
hw/net/xilinx_axienet: Prevent writes to PHY Identification registers
Peter Maydell (2):
hw/net/xilinx_ethlite: Check for oversized TX packets hw/m68k/mcf_intc: Use qdev input gpios for input IRQs
Philippe Mathieu-Daudé (15):
hw/i386/pc: Remove deprecated pc-q35-3.0 and pc-i440fx-3.0 machines hw/i386/pc: Remove pc_compat_3_0[] array
target/i386/kvm: Remove X86CPU::hyperv_synic_kvm_only field hw/core/machine: Remove the hw_compat_3_0[] array
meson: Include various directories providing stubs before libqemuutil hw/acpi: Move acpi_send_event() function out of acpi_interface.c hw/acpi: Move qbus_build_aml() function out of acpi_interface.c hw/acpi: Always link QOM interfaces with system binaries hw/nvram: Build fw_cfg-acpi.c once
hw/acpi: Build stubs once
hw/net: Build stubs once
hw/*: Build stubs once
semihosting: Build stubs once
hw/s390x/s390-pci-vfio: Avoid including CONFIG_DEVICES in hw/ header audio/jack: Fix use of qemu_thread_set_name() on macOS
Thomas Huth (2):
MAINTAINERS: Replace @tuxfamily.org address
MAINTAINERS: Update the maintainer for the CHRP NVRAM section
MAINTAINERS | 10 +-
meson.build | 16 +--
hw/display/ati_int.h | 16 ++-
hw/display/ati_regs.h | 7 +
include/hw/acpi/acpi.h | 1 +
include/hw/acpi/acpi_dev_interface.h | 2 -
include/hw/core/boards.h | 3 -
include/hw/i386/pc.h | 3 -
include/hw/m68k/mcf.h | 5 +-
include/hw/pci-host/astro.h | 2 +
include/hw/s390x/s390-pci-vfio.h | 20 ---
include/qemu/fifo8.h | 10 +-
target/hppa/cpu-qom.h | 8 +-
target/hppa/cpu.h | 35 ++++-
target/i386/cpu.h | 1 -
audio/jackaudio.c | 2 +-
hw/acpi/acpi_interface.c | 19 ---
hw/acpi/aml-build.c | 11 ++
hw/acpi/core.c | 10 ++
hw/arm/aspeed_ast27x0-ssp.c | 7 +-
hw/arm/aspeed_ast27x0-tsp.c | 7 +-
hw/char/diva-gsp.c | 9 +-
hw/char/serial-pci-multi.c | 2 +-
hw/char/serial.c | 47 +++----
hw/core/machine.c | 3 -
hw/display/ati.c | 126 ++++++++++++++++--
hw/display/ati_2d.c | 60 ++++-----
hw/hppa/machine.c | 55 ++++----
hw/i386/pc.c | 16 ---
hw/i386/pc_piix.c | 9 --
hw/i386/pc_q35.c | 9 --
hw/m68k/mcf5208.c | 24 ++--
hw/m68k/mcf_intc.c | 8 +-
hw/misc/ivshmem-pci.c | 13 +-
.../rocker/{qmp-norocker.c => rocker-stubs.c} | 0
hw/net/xilinx_axienet.c | 4 +
hw/net/xilinx_ethlite.c | 12 +-
hw/pci-host/astro.c | 8 +-
hw/s390x/s390-pci-vfio-stubs.c | 32 +++++
hw/uefi/var-service-vars.c | 37 +++++
linux-user/hppa/elfload.c | 2 +-
target/hppa/cpu.c | 55 ++++++--
target/hppa/mem_helper.c | 39 ++----
target/i386/cpu.c | 2 -
target/i386/kvm/kvm.c | 15 +--
tests/qtest/machine-none-test.c | 2 +-
util/fifo8.c | 10 +-
hw/acpi/meson.build | 28 ++--
hw/arm/Kconfig | 2 +-
hw/char/trace-events | 4 +-
hw/cxl/meson.build | 4 +-
hw/i386/kvm/meson.build | 5 +-
hw/mem/meson.build | 4 +-
hw/net/meson.build | 3 +-
hw/net/trace-events | 1 +
hw/nvram/meson.build | 4 +-
hw/pci/meson.build | 2 +-
hw/s390x/meson.build | 1 +
hw/smbios/meson.build | 10 +-
hw/usb/meson.build | 3 +-
hw/virtio/meson.build | 9 +-
semihosting/meson.build | 9 +-
tests/functional/hppa/test_seabios.py | 4 +-
ui/cocoa.m | 9 +-
64 files changed, 538 insertions(+), 358 deletions(-)
rename hw/net/rocker/{qmp-norocker.c => rocker-stubs.c} (100%)
create mode 100644 hw/s390x/s390-pci-vfio-stubs.cSignature · 1 line
2.53.0
[PULL 01/49] hw/i386/pc: Remove deprecated pc-q35-3.0 and pc-i440fx-3.0 machines
These machines has been supported for a period of more than 6 years. According to our versioned machine support policy (see commit ce80c4fa6ff "docs: document special exception for machine type deprecation & removal") they can now be removed.
Message-Id: <[email protected]>
--- hw/i386/pc_piix.c | 9 --------- hw/i386/pc_q35.c | 9 --------- 2 files changed, 18 deletions(-)
hw/i386/pc_piix.c +0 -9
@@ -668,15 +668,6 @@ static void pc_i440fx_machine_3_1_options(MachineClass *m)DEFINE_I440FX_MACHINE (3 ,1 ); -static void pc_i440fx_machine_3_0_options (MachineClass *m) -{ -pc_i440fx_machine_3_1_options (m); -compat_props_add (m->compat_props, hw_compat_3_0, hw_compat_3_0_len); -compat_props_add (m->compat_props, pc_compat_3_0, pc_compat_3_0_len); -} - -DEFINE_I440FX_MACHINE (3 ,0 ); -#ifdef CONFIG_XEN static void xenfv_machine_4_2_options (MachineClass *m) {
hw/i386/pc_q35.c +0 -9
@@ -614,12 +614,3 @@ static void pc_q35_machine_3_1_options(MachineClass *m) }DEFINE_Q35_MACHINE (3 ,1 ); - -static void pc_q35_machine_3_0_options (MachineClass *m) -{ -pc_q35_machine_3_1_options (m); -compat_props_add (m->compat_props, hw_compat_3_0, hw_compat_3_0_len); -compat_props_add (m->compat_props, pc_compat_3_0, pc_compat_3_0_len); -} - -DEFINE_Q35_MACHINE (3 ,0 );
Signature · 1 line
2.53.0
[PULL 03/49] target/i386/kvm: Remove X86CPU::hyperv_synic_kvm_only field
In reply to Philippe Mathieu-DaudéThe X86CPU::hyperv_synic_kvm_only boolean (see commit 9b4cf107b09 "hyperv: only add SynIC in compatible configurations") was only set in the pc_compat_3_0[] array, via the 'x-hv-synic-kvm-only=on' property. We removed all machines using that array, lets remove that property and all the code around it.
Message-Id: <[email protected]>
--- target/i386/cpu.h | 1 - target/i386/cpu.c | 2 -- target/i386/kvm/kvm.c | 15 ++++----------- 3 files changed, 4 insertions(+), 14 deletions(-)
target/i386/cpu.h +0 -1
@@ -2335,7 +2335,6 @@ struct ArchCPU {uint32_t hyperv_spinlock_attempts;char *hyperv_vendor; -bool hyperv_synic_kvm_only;uint64_t hyperv_features;bool hyperv_passthrough;OnOffAuto hyperv_no_nonarch_cs;
target/i386/cpu.c +0 -2
@@ -10589,8 +10589,6 @@ static const Property x86_cpu_properties[] = {* to the specific Windows version being used." */ DEFINE_PROP_INT32 ("x-hv-max-vps" ,X86CPU , hv_max_vps,-1 ), -DEFINE_PROP_BOOL ("x-hv-synic-kvm-only" ,X86CPU , hyperv_synic_kvm_only, - false),DEFINE_PROP_BOOL ("x-intel-pt-auto-level" ,X86CPU , intel_pt_auto_level, true), DEFINE_PROP_BOOL("x-l1-cache-per-thread", X86CPU, l1_cache_per_core, true),
target/i386/kvm/kvm.c +4 -11
@@ -1278,10 +1278,7 @@ static struct kvm_cpuid2 *get_supported_hv_cpuid_legacy(CPUState *cs) }if (has_msr_hv_synic) { -unsigned int cap = cpu->hyperv_synic_kvm_only ? -KVM_CAP_HYPERV_SYNIC :KVM_CAP_HYPERV_SYNIC2 ; - -if (kvm_check_extension (cs->kvm_state, cap) >0 ) { +if (kvm_check_extension (cs->kvm_state,KVM_CAP_HYPERV_SYNIC2 ) >0 ) { entry_feat->eax |=HV_SYNIC_AVAILABLE ; } }
@@ -1543,7 +1540,6 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)/* Additional dependencies not covered by kvm_hyperv_properties[] */ if (hyperv_feat_enabled (cpu,HYPERV_FEAT_SYNIC ) && - !cpu->hyperv_synic_kvm_only && !hyperv_feat_enabled (cpu,HYPERV_FEAT_VPINDEX )) { error_setg(errp, "Hyper-V %s requires Hyper-V %s", kvm_hyperv_properties[HYPERV_FEAT_SYNIC].desc,
@@ -1608,8 +1604,7 @@ static int hyperv_fill_cpuids(CPUState *cs, c->eax |=HV_HYPERCALL_AVAILABLE ;/* SynIC and Vmbus devices require messages/signals hypercalls */ -if (hyperv_feat_enabled (cpu,HYPERV_FEAT_SYNIC ) && - !cpu->hyperv_synic_kvm_only) { +if (hyperv_feat_enabled (cpu,HYPERV_FEAT_SYNIC )) { c->ebx |=HV_POST_MESSAGES |HV_SIGNAL_EVENTS ; }
@@ -1752,16 +1747,14 @@ static int hyperv_init_vcpu(X86CPU *cpu) }if (hyperv_feat_enabled (cpu,HYPERV_FEAT_SYNIC )) { -uint32_t synic_cap = cpu->hyperv_synic_kvm_only ? -KVM_CAP_HYPERV_SYNIC :KVM_CAP_HYPERV_SYNIC2 ; - ret =kvm_vcpu_enable_cap (cs, synic_cap,0 ); + ret =kvm_vcpu_enable_cap (cs,KVM_CAP_HYPERV_SYNIC2 ,0 );if (ret <0 ) {error_report ("failed to turn on HyperV SynIC in KVM: %s" ,strerror (-ret));return ret; } -if (!cpu->hyperv_synic_kvm_only && !hyperv_is_synic_enabled ()) { +if (!hyperv_is_synic_enabled ()) { ret =hyperv_x86_synic_add (cpu);if (ret <0 ) { error_report("failed to create HyperV SynIC: %s",
Signature · 1 line
2.53.0
[PULL 04/49] hw/core/machine: Remove the hw_compat_3_0[] array
In reply to Philippe Mathieu-DaudéThe hw_compat_3_0[] array was only used by the pc-q35-3.0 and pc-i440fx-3.0 machines, which got removed. Remove it.
Message-Id: <[email protected]>
--- include/hw/core/boards.h | 3 --- hw/core/machine.c | 3 --- 2 files changed, 6 deletions(-)
include/hw/core/boards.h +0 -3
@@ -871,7 +871,4 @@ extern const size_t hw_compat_4_0_len;extern GlobalProperty hw_compat_3_1[];extern const size_t hw_compat_3_1_len; -extern GlobalProperty hw_compat_3_0[]; -extern const size_t hw_compat_3_0_len; -#endif
hw/core/machine.c +0 -3
@@ -238,9 +238,6 @@ GlobalProperty hw_compat_3_1[] = { };const size_t hw_compat_3_1_len =G_N_ELEMENTS (hw_compat_3_1); -GlobalProperty hw_compat_3_0[] = {}; -const size_t hw_compat_3_0_len =G_N_ELEMENTS (hw_compat_3_0); -MachineState *current_machine;static char *machine_get_kernel (Object *obj,Error **errp)
Signature · 1 line
2.53.0
[PULL 02/49] hw/i386/pc: Remove pc_compat_3_0[] array
In reply to Philippe Mathieu-DaudéThe pc_compat_3_0[] array was only used by the pc-q35-3.0 and pc-i440fx-3.0 machines, which got removed. Remove it.
Message-Id: <[email protected]>
--- include/hw/i386/pc.h | 3 --- hw/i386/pc.c | 7 ------- 2 files changed, 10 deletions(-)
include/hw/i386/pc.h +0 -3
@@ -277,9 +277,6 @@ extern const size_t pc_compat_4_0_len;extern GlobalProperty pc_compat_3_1[];extern const size_t pc_compat_3_1_len; -extern GlobalProperty pc_compat_3_0[]; -extern const size_t pc_compat_3_0_len; -#define DEFINE_PC_MACHINE (suffix, namestr, initfn, optsfn) \ static void pc_machine_##suffix##_class_init(ObjectClass *oc, \ const void *data) \
hw/i386/pc.c +0 -7
@@ -214,13 +214,6 @@ GlobalProperty pc_compat_3_1[] = { };const size_t pc_compat_3_1_len =G_N_ELEMENTS (pc_compat_3_1); -GlobalProperty pc_compat_3_0[] = { - {TYPE_X86_CPU ,"x-hv-synic-kvm-only" ,"on" }, - {"Skylake-Server" "-" TYPE_X86_CPU ,"pku" ,"off" }, - {"Skylake-Server-IBRS" "-" TYPE_X86_CPU ,"pku" ,"off" }, -}; -const size_t pc_compat_3_0_len =G_N_ELEMENTS (pc_compat_3_0); -/* * @PC_FW_DATA: * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables
Signature · 1 line
2.53.0
[PULL 06/49] hw/acpi: Move acpi_send_event() function out of acpi_interface.c
In reply to Philippe Mathieu-Daudéacpi_interface.c should only register QOM interfaces. Move the acpi_send_event() function to core.c with the other event handlers, and its declaration in 'hw/acpi/acpi.h'.
Message-Id: <[email protected]>
--- include/hw/acpi/acpi.h | 1 + include/hw/acpi/acpi_dev_interface.h | 2 -- hw/acpi/acpi_interface.c | 9 --------- hw/acpi/core.c | 10 ++++++++++ 4 files changed, 11 insertions(+), 11 deletions(-)
include/hw/acpi/acpi.h +1 -0
@@ -182,6 +182,7 @@ void acpi_gpe_reset(ACPIREGS *ar);void acpi_gpe_ioport_writeb (ACPIREGS *ar,uint32_t addr,uint32_t val);uint32_t acpi_gpe_ioport_readb (ACPIREGS *ar,uint32_t addr); +void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event);void acpi_send_gpe_event (ACPIREGS *ar,qemu_irq irq,AcpiEventStatusBits status);
include/hw/acpi/acpi_dev_interface.h +0 -2
@@ -27,8 +27,6 @@ DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,typedef struct AcpiDeviceIf AcpiDeviceIf ; -void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event); -/** * AcpiDeviceIfClass: *
hw/acpi/acpi_interface.c +0 -9
@@ -4,15 +4,6 @@#include "qemu/module.h" #include "qemu/queue.h" -void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event) -{ -AcpiDeviceIfClass *adevc =ACPI_DEVICE_IF_GET_CLASS (dev); -if (adevc->send_event) { -AcpiDeviceIf *adev =ACPI_DEVICE_IF (dev); - adevc->send_event (adev, event); - } -} -void qbus_build_aml (BusState *bus,Aml *scope) {BusChild *kid;
hw/acpi/core.c +10 -0
@@ -22,6 +22,7 @@#include "qemu/osdep.h" #include "hw/core/irq.h" #include "hw/acpi/acpi.h" +#include "hw/acpi/acpi_dev_interface.h" #include "hw/nvram/fw_cfg.h" #include "qemu/config-file.h" #include "qapi/error.h"
@@ -753,3 +754,12 @@ void acpi_update_sci(ACPIREGS *regs, qemu_irq irq) (regs->pm1.evt.en &ACPI_BITMASK_TIMER_ENABLE ) && !(pm1a_sts & ACPI_BITMASK_TIMER_STATUS)); } + +void acpi_send_event (DeviceState *dev,AcpiEventStatusBits event) +{ +AcpiDeviceIfClass *adevc =ACPI_DEVICE_IF_GET_CLASS (dev); +if (adevc->send_event) { +AcpiDeviceIf *adev =ACPI_DEVICE_IF (dev); + adevc->send_event (adev, event); + } +}
Signature · 1 line
2.53.0
[PULL 07/49] hw/acpi: Move qbus_build_aml() function out of acpi_interface.c
In reply to Philippe Mathieu-Daudéacpi_interface.c should only register QOM interfaces. Move the qbus_build_aml() function to aml-build.c with the other AML build-related helpers.
Message-Id: <[email protected]>
--- hw/acpi/acpi_interface.c | 10 ---------- hw/acpi/aml-build.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-)
hw/acpi/acpi_interface.c +0 -10
@@ -2,16 +2,6 @@#include "hw/acpi/acpi_dev_interface.h" #include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" -#include "qemu/queue.h" - -void qbus_build_aml (BusState *bus,Aml *scope) -{ -BusChild *kid; - - QTAILQ_FOREACH(kid, &bus->children, sibling) { -call_dev_aml_func (DEVICE (kid->child), scope); - } -}static void register_types (void ) {
hw/acpi/aml-build.c +11 -0
@@ -25,12 +25,14 @@#include "hw/acpi/acpi.h" #include "qemu/bswap.h" #include "qemu/bitops.h" +#include "qemu/queue.h" #include "system/numa.h" #include "hw/core/boards.h" #include "hw/acpi/tpm.h" #include "hw/pci/pci_host.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" +#include "hw/acpi/acpi_aml_interface.h" #include "qemu/cutils.h" static GArray *build_alloc_array (void )
@@ -2647,3 +2649,12 @@ Aml *aml_error_device(void)return dev; } + +void qbus_build_aml (BusState *bus,Aml *scope) +{ +BusChild *kid; + + QTAILQ_FOREACH(kid, &bus->children, sibling) { +call_dev_aml_func (DEVICE (kid->child), scope); + } +}
Signature · 1 line
2.53.0
[PULL 05/49] meson: Include various directories providing stubs before libqemuutil
In reply to Philippe Mathieu-DaudéStubs are provided by libqemuutil. We want to use the generic meson machinery to provide stubs once, instead of per sub-directories. Move the 'subdir' calls earlier so when these directories are processed they can add units to the global stub_ss[] source set.
Message-Id: <[email protected]>
--- meson.build | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
meson.build +8 -8
@@ -3754,6 +3754,14 @@ subdir('authz') subdir('crypto') subdir('ui') subdir('gdbstub') +subdir('semihosting') +subdir('audio') +subdir('io') +subdir('chardev') +subdir('fsdev') +subdir('dump') +subdir('accel') + if have_system subdir('hw') else
@@ -3799,12 +3807,6 @@ if have_system or have_user subdir('target') endif -subdir('audio') -subdir('io') -subdir('chardev') -subdir('fsdev') -subdir('dump') - if have_block block_ss.add(files( 'block.c',
@@ -3874,11 +3876,9 @@ subdir('migration') subdir('monitor') subdir('net') subdir('replay') -subdir('semihosting') subdir('stats') subdir('tcg') subdir('fpu') -subdir('accel') subdir('plugins') subdir('ebpf')
Signature · 1 line
2.53.0
[PULL 08/49] hw/acpi: Always link QOM interfaces with system binaries
In reply to Philippe Mathieu-DaudéNow that acpi_interface.c only contains QOM interfaces, unconditionally link it with system binaries, regardless of whether CONFIG_ACPI is set or not. It is now easier to deselect hardware models depending on ACPI.
Message-Id: <[email protected]>
--- hw/acpi/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
hw/acpi/meson.build +1 -2
@@ -1,6 +1,5 @@ acpi_ss = ss.source_set() acpi_ss.add(files( - 'acpi_interface.c', 'aml-build.c', 'bios-linker-loader.c', 'core.c',
@@ -36,4 +35,4 @@ system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-stub.c system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c')) -system_ss.add(files('acpi-qmp-cmds.c')) +system_ss.add(files('acpi-qmp-cmds.c', 'acpi_interface.c'))
Signature · 1 line
2.53.0
[PULL 09/49] hw/nvram: Build fw_cfg-acpi.c once
In reply to Philippe Mathieu-DaudéMessage-Id: <[email protected]>
--- hw/nvram/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/nvram/meson.build +2 -2
@@ -18,8 +18,8 @@ system_ss.add(when: 'CONFIG_XLNX_EFUSE_ZYNQMP', if_true: files( system_ss.add(when: 'CONFIG_XLNX_BBRAM', if_true: files('xlnx-bbram.c')) specific_ss.add(when: 'CONFIG_PSERIES', if_true: files('spapr_nvram.c')) -specific_ss.add(when: 'CONFIG_ACPI', if_true: files('fw_cfg-acpi.c')) +system_ss.add(when: 'CONFIG_ACPI', if_true: files('fw_cfg-acpi.c')) system_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files( 'aspeed_otp.c', - )) + ))
Signature · 1 line
2.53.0
[PULL 11/49] hw/net: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
qmp-norocker.c only contains stubs, rename it accordingly.
Message-Id: <[email protected]>
---
hw/net/rocker/{qmp-norocker.c => rocker-stubs.c} | 0
hw/net/meson.build | 3 ++-
2 files changed, 2 insertions(+), 1 deletion(-)
rename hw/net/rocker/{qmp-norocker.c => rocker-stubs.c} (100%)hw/net/rocker/rocker-stubs.c renamed from hw/net/rocker/qmp-norocker.c +0 -0
hw/net/meson.build +2 -1
@@ -66,7 +66,8 @@ system_ss.add(when: 'CONFIG_ROCKER', if_true: files( 'rocker/rocker_fp.c', 'rocker/rocker_of_dpa.c', 'rocker/rocker_world.c', -), if_false: files('rocker/qmp-norocker.c')) +)) +stub_ss.add(files('rocker/rocker-stubs.c')) system_ss.add(files('rocker/rocker-hmp-cmds.c')) subdir('can')
Signature · 1 line
2.53.0
[PULL 12/49] hw/*: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
Message-Id: <[email protected]>
--- hw/cxl/meson.build | 4 ++-- hw/i386/kvm/meson.build | 5 +---- hw/mem/meson.build | 4 ++-- hw/pci/meson.build | 2 +- hw/smbios/meson.build | 10 +++++----- hw/usb/meson.build | 3 ++- hw/virtio/meson.build | 9 +++------ 7 files changed, 16 insertions(+), 21 deletions(-)
hw/cxl/meson.build +2 -2
@@ -7,7 +7,7 @@ system_ss.add(when: 'CONFIG_CXL', 'cxl-cdat.c', 'cxl-events.c', 'switch-mailbox-cci.c', - ), - if_false: files( + )) +stub_ss.add(files( 'cxl-host-stubs.c', ))
hw/i386/kvm/meson.build +1 -4
@@ -15,9 +15,6 @@ i386_kvm_ss.add(when: 'CONFIG_XEN_EMU', if_true: files( i386_ss.add_all(when: 'CONFIG_KVM', if_true: i386_kvm_ss) -xen_stubs_ss = ss.source_set() -xen_stubs_ss.add(when: 'CONFIG_XEN_EMU', if_false: files( +stub_ss.add(files( 'xen-stubs.c', )) - -specific_ss.add_all(when: 'CONFIG_SYSTEM_ONLY', if_true: xen_stubs_ss)
hw/mem/meson.build +2 -2
@@ -4,9 +4,9 @@ mem_ss.add(when: 'CONFIG_DIMM', if_true: files('pc-dimm.c')) mem_ss.add(when: 'CONFIG_NPCM7XX', if_true: files('npcm7xx_mc.c')) mem_ss.add(when: 'CONFIG_NVDIMM', if_true: files('nvdimm.c')) mem_ss.add(when: 'CONFIG_CXL_MEM_DEVICE', if_true: files('cxl_type3.c')) -system_ss.add(when: 'CONFIG_CXL_MEM_DEVICE', if_false: files('cxl_type3_stubs.c')) +stub_ss.add(files('cxl_type3_stubs.c')) -system_ss.add(when: 'CONFIG_MEM_DEVICE', if_false: files('memory-device-stubs.c')) +stub_ss.add(files('memory-device-stubs.c')) system_ss.add_all(when: 'CONFIG_MEM_DEVICE', if_true: mem_ss) system_ss.add(when: 'CONFIG_SPARSE_MEM', if_true: files('sparse-mem.c'))
hw/pci/meson.build +1 -1
@@ -19,4 +19,4 @@ pci_ss.add(files('pcie_doe.c')) system_ss.add(when: 'CONFIG_PCI_EXPRESS', if_true: files('pcie_port.c', 'pcie_host.c')) system_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) -system_ss.add(when: 'CONFIG_PCI', if_false: files('pci-stub.c')) +stub_ss.add(files('pci-stub.c'))
hw/smbios/meson.build +5 -5
@@ -1,12 +1,12 @@ smbios_ss = ss.source_set() smbios_ss.add(files('smbios.c')) smbios_ss.add(when: 'CONFIG_IPMI', - if_true: files('smbios_type_38.c'), - if_false: files('smbios_type_38-stub.c')) + if_true: files('smbios_type_38.c')) +stub_ss.add(files('smbios_type_38-stub.c')) smbios_ss.add(when: 'CONFIG_SMBIOS_LEGACY', - if_true: files('smbios_legacy.c'), - if_false: files('smbios_legacy_stub.c')) + if_true: files('smbios_legacy.c')) +stub_ss.add(files('smbios_legacy_stub.c')) system_ss.add_all(when: 'CONFIG_SMBIOS', if_true: smbios_ss) -system_ss.add(when: 'CONFIG_SMBIOS', if_false: files('smbios-stub.c')) +stub_ss.add(files('smbios-stub.c'))
hw/usb/meson.build +2 -1
@@ -9,7 +9,8 @@ system_ss.add(when: 'CONFIG_USB', if_true: files( 'desc-msos.c', 'libhw.c', 'pcap.c', -), if_false: files('bus-stub.c')) +)) +stub_ss.add(files('bus-stub.c')) # usb host adapters system_ss.add(when: 'CONFIG_USB_UHCI', if_true: files('hcd-uhci.c'))
hw/virtio/meson.build +3 -6
@@ -48,8 +48,6 @@ if have_vhost system_virtio_ss.add(files('vhost-vdpa.c')) system_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif -else - system_virtio_ss.add(files('vhost-stub.c')) endif system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhost-user-vsock.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng.c'))
@@ -92,10 +90,9 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.c')) system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss) -system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) -system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('virtio-stub.c')) -system_ss.add(when: ['CONFIG_VIRTIO_MD', 'CONFIG_VIRTIO_PCI'], - if_false: files('virtio-md-stubs.c')) +stub_ss.add(files('vhost-stub.c')) +stub_ss.add(files('virtio-stub.c')) +stub_ss.add(files('virtio-md-stubs.c')) system_ss.add(files('virtio-hmp-cmds.c'))
Signature · 1 line
2.53.0
[PULL 10/49] hw/acpi: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
Message-Id: <[email protected]>
--- hw/acpi/meson.build | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-)
hw/acpi/meson.build +14 -11
@@ -6,33 +6,36 @@ acpi_ss.add(files( 'utils.c', )) acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_true: files('cpu.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CPU_HOTPLUG', if_false: files('acpi-cpu-hotplug-stub.c')) +stub_ss.add(files('acpi-cpu-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_true: files('memory_hotplug.c')) -acpi_ss.add(when: 'CONFIG_ACPI_MEMORY_HOTPLUG', if_false: files('acpi-mem-hotplug-stub.c')) +stub_ss.add(files('acpi-mem-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_true: files('nvdimm.c')) -acpi_ss.add(when: 'CONFIG_ACPI_NVDIMM', if_false: files('acpi-nvdimm-stub.c')) +stub_ss.add(files('acpi-nvdimm-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI', if_true: files('pci.c')) -acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c'), if_false: files('cxl-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_CXL', if_true: files('cxl.c')) +stub_ss.add(files('cxl-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMGENID', if_true: files('vmgenid.c')) acpi_ss.add(when: 'CONFIG_ACPI_VMCLOCK', if_true: files('vmclock.c')) acpi_ss.add(when: 'CONFIG_ACPI_HW_REDUCED', if_true: files('generic_event_device.c')) acpi_ss.add(when: 'CONFIG_ACPI_HMAT', if_true: files('hmat.c')) -acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c'), if_false: files('ghes-stub.c')) +acpi_ss.add(when: 'CONFIG_ACPI_APEI', if_true: files('ghes.c')) +stub_ss.add(files('ghes-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_PIIX4', if_true: files('piix4.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_true: files('pci-bridge.c')) acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_true: files('pcihp.c')) -acpi_ss.add(when: 'CONFIG_ACPI_PCIHP', if_false: files('acpi-pci-hotplug-stub.c')) +stub_ss.add(files('acpi-pci-hotplug-stub.c')) acpi_ss.add(when: 'CONFIG_ACPI_VIOT', if_true: files('viot.c')) acpi_ss.add(when: 'CONFIG_ACPI_ICH9', if_true: files('ich9.c', 'ich9_tco.c', 'ich9_timer.c')) acpi_ss.add(when: 'CONFIG_ACPI_ERST', if_true: files('erst.c')) -acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c'), if_false: files('ipmi-stub.c')) -acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) +acpi_ss.add(when: 'CONFIG_IPMI', if_true: files('ipmi.c')) +stub_ss.add(files('ipmi-stub.c')) +stub_ss.add(files('acpi-x86-stub.c')) if have_tpm acpi_ss.add(files('tpm.c')) endif -system_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c', 'acpi_interface.c')) -system_ss.add(when: 'CONFIG_ACPI_PCI_BRIDGE', if_false: files('pci-bridge-stub.c')) +stub_ss.add(files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c')) +stub_ss.add(files('pci-bridge-stub.c')) system_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) system_ss.add(when: 'CONFIG_GHES_CPER', if_true: files('ghes_cper.c')) -system_ss.add(when: 'CONFIG_GHES_CPER', if_false: files('ghes_cper_stub.c')) +stub_ss.add(files('ghes_cper_stub.c')) system_ss.add(files('acpi-qmp-cmds.c', 'acpi_interface.c'))
Signature · 1 line
2.53.0
[PULL 13/49] semihosting: Build stubs once
In reply to Philippe Mathieu-DaudéMove stubs to the global stub_ss[] source set. These files are now built once for all binaries, instead of one time per system binary.
Message-Id: <[email protected]>
--- semihosting/meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
semihosting/meson.build +5 -4
@@ -1,4 +1,4 @@ -common_ss.add(when: 'CONFIG_SEMIHOSTING', if_false: files('stubs-all.c')) +stub_ss.add(files('stubs-all.c')) user_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( 'user.c', 'guestfd.c'))
@@ -8,12 +8,13 @@ system_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( 'guestfd.c', 'uaccess.c', 'syscalls.c', -), if_false: files( +)) +stub_ss.add(files( 'stubs-system.c', )) system_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', - if_true: files('arm-compat-semi.c'), - if_false: files('arm-compat-semi-stub.c')) + if_true: files('arm-compat-semi.c')) +stub_ss.add(files('arm-compat-semi-stub.c')) specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_USER_ONLY'], if_true: files('syscalls.c'))
Signature · 1 line
2.53.0
[PULL 14/49] hw/s390x/s390-pci-vfio: Avoid including CONFIG_DEVICES in hw/ header
In reply to Philippe Mathieu-DaudéBy turning the inline functions into stubs we can avoid the use of target-specific CONFIG_DEVICES include in a hw/ header, allowing to build the source files including it as common objects.
Message-Id: <[email protected]>
--- include/hw/s390x/s390-pci-vfio.h | 20 -------------------- hw/s390x/s390-pci-vfio-stubs.c | 32 ++++++++++++++++++++++++++++++++ hw/s390x/meson.build | 1 + 3 files changed, 33 insertions(+), 20 deletions(-) create mode 100644 hw/s390x/s390-pci-vfio-stubs.c
include/hw/s390x/s390-pci-vfio.h +0 -20
@@ -13,32 +13,12 @@#define HW_S390_PCI_VFIO_H #include "hw/s390x/s390-pci-bus.h" -#include CONFIG_DEVICES -#ifdef CONFIG_VFIO bool s390_pci_update_dma_avail (int fd,unsigned int *avail);S390PCIDMACount *s390_pci_start_dma_count (S390pciState *s,S390PCIBusDevice *pbdev);void s390_pci_end_dma_count (S390pciState *s,S390PCIDMACount *cnt);bool s390_pci_get_host_fh (S390PCIBusDevice *pbdev,uint32_t *fh);void s390_pci_get_clp_info (S390PCIBusDevice *pbdev); -#else -static inline bool s390_pci_update_dma_avail (int fd,unsigned int *avail) -{ -return false; -} -static inline S390PCIDMACount *s390_pci_start_dma_count (S390pciState *s, -S390PCIBusDevice *pbdev) -{ -return NULL ; -} -static inline void s390_pci_end_dma_count (S390pciState *s, -S390PCIDMACount *cnt) { } -static inline bool s390_pci_get_host_fh (S390PCIBusDevice *pbdev,uint32_t *fh) -{ -return false; -} -static inline void s390_pci_get_clp_info (S390PCIBusDevice *pbdev) { } -#endif #endif
hw/s390x/s390-pci-vfio-stubs.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* s390 vfio-pci stubs +* +* SPDX-License-Identifier: GPL-2.0-or-later +*/ + +#include "qemu/osdep.h" +#include "hw/s390x/s390-pci-vfio.h" + +bool s390_pci_update_dma_avail (int fd,unsigned int *avail) +{ +return false; +} + +S390PCIDMACount *s390_pci_start_dma_count (S390pciState *s, +S390PCIBusDevice *pbdev) +{ +return NULL ; +} + +void s390_pci_end_dma_count (S390pciState *s,S390PCIDMACount *cnt) +{ +} + +bool s390_pci_get_host_fh (S390PCIBusDevice *pbdev,uint32_t *fh) +{ +return false; +} + +void s390_pci_get_clp_info (S390PCIBusDevice *pbdev) +{ +}
hw/s390x/meson.build +1 -0
@@ -34,6 +34,7 @@ s390x_ss.add(when: 'CONFIG_S390_CCW_VIRTIO', if_true: files( )) s390x_ss.add(when: 'CONFIG_TERMINAL3270', if_true: files('3270-ccw.c')) s390x_ss.add(when: 'CONFIG_VFIO', if_true: files('s390-pci-vfio.c')) +stub_ss.add(files('s390-pci-vfio-stubs.c')) s390x_ss.add(when: 'CONFIG_VFIO_AP', if_false: files('ap-stub.c')) virtio_ss = ss.source_set()
Signature · 1 line
2.53.0
[PULL 15/49] hw/misc/ivshmem-pci: Handle error from kvm_irqchip_add_irqfd_notifier_gsi()
In reply to Philippe Mathieu-DaudéFrom: David Hamilton <[email protected]>
The return value of kvm_irqchip_add_irqfd_notifier_gsi() was being ignored. Propagate the error to the caller via errp.
Also change setup_interrupt() to return bool to follow QEMU error handling conventions, making error checks at call sites simpler.
Resolves the TODO comment at the call site.
Message-ID: <[email protected]>
--- hw/misc/ivshmem-pci.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
hw/misc/ivshmem-pci.c +9 -4
@@ -442,13 +442,14 @@ static void ivshmem_add_kvm_msi_virq(IVShmemState *s, int vector, s->msi_vectors[vector].pdev = pdev; } -static void setup_interrupt (IVShmemState *s,int vector,Error **errp) +static bool setup_interrupt (IVShmemState *s,int vector,Error **errp) {EventNotifier *n = &s->peers[s->vm_id].eventfds[vector];bool with_irqfd =kvm_msi_via_irqfd_enabled () &&ivshmem_has_feature (s,IVSHMEM_MSI );PCIDevice *pdev =PCI_DEVICE (s);Error *err =NULL ; +int ret;IVSHMEM_DPRINTF ("setting up interrupt for vector: %d\n" , vector);
@@ -460,18 +461,22 @@ static void setup_interrupt(IVShmemState *s, int vector, Error **errp)ivshmem_add_kvm_msi_virq (s, vector, &err);if (err) {error_propagate (errp, err); -return ; +return false; }if (!msix_is_masked (pdev, vector)) { -kvm_irqchip_add_irqfd_notifier_gsi (kvm_state, n,NULL , + ret =kvm_irqchip_add_irqfd_notifier_gsi (kvm_state, n,NULL , s->msi_vectors[vector].virq); -/* TODO handle error */ +if (ret <0 ) { +error_setg (errp,"Failed to configure irqfd notifier" ); +return false; + } } }else {/* it will be delayed until msix is enabled, in write_config */ IVSHMEM_DPRINTF ("with irqfd, delayed until msix enabled\n" ); } +return true; }static void process_msg_shmem (IVShmemState *s,int fd,Error **errp)
Signature · 1 line
2.53.0
[PULL 16/49] hw/i386: drop unused PC_CPU_MODEL_IDS macro
In reply to Philippe Mathieu-DaudéFrom: Daniel P. Berrangé <[email protected]>
This is redundant since the 2.4 machine types were dropped.
Message-ID: <[email protected]>
--- hw/i386/pc.c | 9 --------- 1 file changed, 9 deletions(-)
hw/i386/pc.c +0 -9
@@ -73,15 +73,6 @@#include "hw/xen/xen-bus.h" #endif -/* -* Helper for setting model-id for CPU models that changed model-id -* depending on QEMU versions up to QEMU 2.4. -*/ -#define PC_CPU_MODEL_IDS (v) \ - { "qemu32-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ - { "qemu64-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, },\ - { "athlon-" TYPE_X86_CPU, "model-id", "QEMU Virtual CPU version " v, }, -GlobalProperty pc_compat_10_2[] = {};const size_t pc_compat_10_2_len =G_N_ELEMENTS (pc_compat_10_2);
Signature · 1 line
2.53.0
[PULL 20/49] ati-vga: Latch src and dst pitch and offset on master_cntl default
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
Hardware testing on the Rage 128 confirms that (SRC/DST)_OFFSET, and (SRC/DST)_PITCH are latched when (SRC/DST)_PITCH_OFFSET_CNTL bits in DP_GUI_MASTER_CNTL are set to "default".
The earlier approach looked at the state of the (SRC/DST)_PITCH_OFFSET_CNTL bits when offset and pitch registers were used. This meant that when (SRC/DST)_PITCH_OFFSET_CNTL was reset to "leave alone" the old values stored in the registers would return. This is not how the real hardware works.
Message-ID: <[email protected]>
--- hw/display/ati.c | 9 +++++++++ hw/display/ati_2d.c | 13 ++++--------- 2 files changed, 13 insertions(+), 9 deletions(-)
hw/display/ati.c +9 -0
@@ -868,6 +868,15 @@ static void ati_mm_write(void *opaque, hwaddr addr, s->regs.dp_datatype = (data &0x0f00 ) >>8 | (data &0x30f0 ) <<4 | (data &0x4000 ) <<16 ; s->regs.dp_mix = (data &GMC_ROP3_MASK ) | (data &0x7000000 ) >>16 ; + +if (!(data &GMC_SRC_PITCH_OFFSET_CNTL )) { + s->regs.src_offset = s->regs.default_offset; + s->regs.src_pitch = s->regs.default_pitch; + } +if (!(data &GMC_DST_PITCH_OFFSET_CNTL )) { + s->regs.dst_offset = s->regs.default_offset; + s->regs.dst_pitch = s->regs.default_pitch; + }break ;case DST_WIDTH_X : s->regs.dst_x = data &0x3fff ;
hw/display/ati_2d.c +4 -9
@@ -43,8 +43,6 @@ static int ati_bpp_from_datatype(ATIVGAState *s) } } -#define DEFAULT_CNTL (s->regs.dp_gui_master_cntl & GMC_DST_PITCH_OFFSET_CNTL) -void ati_2d_blt (ATIVGAState *s) {/* FIXME it is probably more complex than this and may need to be */
@@ -63,13 +61,12 @@ void ati_2d_blt(ATIVGAState *s)qemu_log_mask (LOG_GUEST_ERROR ,"Invalid bpp\n" );return ; } -int dst_stride =DEFAULT_CNTL ? s->regs.dst_pitch : s->regs.default_pitch; +int dst_stride = s->regs.dst_pitch;if (!dst_stride) {qemu_log_mask (LOG_GUEST_ERROR ,"Zero dest pitch\n" );return ; } -uint8_t *dst_bits = s->vga.vram_ptr + (DEFAULT_CNTL ? - s->regs.dst_offset : s->regs.default_offset); +uint8_t *dst_bits = s->vga.vram_ptr + s->regs.dst_offset;if (s->dev_id ==PCI_DEVICE_ID_ATI_RAGE128_PF ) { dst_bits += s->regs.crtc_offset &0x07ffffff ;
@@ -97,14 +94,12 @@ void ati_2d_blt(ATIVGAState *s) s->regs.src_x : s->regs.src_x + 1 - s->regs.dst_width);unsigned src_y = (s->regs.dp_cntl &DST_Y_TOP_TO_BOTTOM ? s->regs.src_y : s->regs.src_y +1 - s->regs.dst_height); -int src_stride =DEFAULT_CNTL ? - s->regs.src_pitch : s->regs.default_pitch; +int src_stride = s->regs.src_pitch;if (!src_stride) {qemu_log_mask (LOG_GUEST_ERROR ,"Zero source pitch\n" );return ; } -uint8_t *src_bits = s->vga.vram_ptr + (DEFAULT_CNTL ? - s->regs.src_offset : s->regs.default_offset); +uint8_t *src_bits = s->vga.vram_ptr + s->regs.src_offset;if (s->dev_id ==PCI_DEVICE_ID_ATI_RAGE128_PF ) { src_bits += s->regs.crtc_offset &0x07ffffff ;
Signature · 1 line
2.53.0
[PULL 17/49] ati-vga: Fix framebuffer mapping by using hardware-correct aperture sizes
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
Rage 128 cards always request 64MB for their linear (framebuffer) aperture and R100 cards always request 128MB. This is regardless of the amount of physical VRAM on the board. The following are results from real hardware tests:
Card VRAM PCI BAR0 CONFIG_MEMSIZE CONFIG_APER_SIZE AGP_APER_OFFSET ----------------------- ---- -------- -------------- ---------------- --------------- Rage 128 Pro Ultra TF 32MB 64MB 0x02000000 0x02000000 0x02000000 Rage 128 RF/SG AGP 16MB 64MB 0x01000000 0x02000000 0x02000000 Radeon R100 QD [Radeon 7200] 64MB 128MB 0x04000000 0x04000000 N/A Radeon RV100 QY [Radeon 7000/VE] 32MB 128MB 0x02000000 0x04000000 N/A
Previously the linear aperture (BAR0) would match the VRAM size. This discrepancy caused issues with the X.org and XFree86 r128 drivers. These drivers apply a mask of 0xfc000000 (2^26 = 64MB) to the linear aperture address. If that address is not on a 64MB boundary the framebuffer points to an incorrect memory location.
Testing shows that the Radeon R100 also has a BAR0 larger than VRAM (128MB in this case) and the X.org radeon driver also masks to 64MB.
For Rage 128, CONFIG_APER_SIZE also differs from the previous value and the behavior stated in the documentation. The Rage 128 register guide states that it should contain the size of the VRAM + AGP memory. The cards tested above show that this isn't the case. These tests also included enabling/disabling AGP with 8MB of memory. It didn't change the contents of CONFIG_APER_SIZE.
For both Rage 128 and R100 the CONFIG_APER_SIZE is half of the PCI BAR0 size.
Message-ID: <[email protected]>
--- hw/display/ati_int.h | 5 +++++ hw/display/ati.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-)
hw/display/ati_int.h +5 -0
@@ -10,6 +10,7 @@#define ATI_INT_H #include "qemu/timer.h" +#include "qemu/units.h" #include "hw/pci/pci_device.h" #include "hw/i2c/bitbang_i2c.h" #include "vga_int.h"
@@ -29,6 +30,9 @@/* Radeon RV100 (VE) */ #define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159 +#define ATI_RAGE128_LINEAR_APER_SIZE (64 * MiB) +#define ATI_R100_LINEAR_APER_SIZE (128 * MiB) +#define TYPE_ATI_VGA "ati-vga"OBJECT_DECLARE_SIMPLE_TYPE (ATIVGAState,ATI_VGA )
@@ -97,6 +101,7 @@ struct ATIVGAState {QEMUCursor *cursor;QEMUTimer vblank_timer;bitbang_i2c_interface bbi2c; +MemoryRegion linear_aper;MemoryRegion io;MemoryRegion mm;ATIVGARegs regs;
hw/display/ati.c +14 -2
@@ -361,7 +361,7 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) PCI_BASE_ADDRESS_0, size) & 0xfffffff0;break ;case CONFIG_APER_SIZE : - val = s->vga.vram_size /2 ; + val =memory_region_size (&s->linear_aper) /2 ;break ;case CONFIG_REG_1_BASE : val = pci_default_read_config(&s->dev,
@@ -952,6 +952,7 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp) {ATIVGAState *s =ATI_VGA (dev);VGACommonState *vga = &s->vga; +uint64_t aper_size;#ifndef CONFIG_PIXMAN if (s->use_pixman !=0 ) {
@@ -1011,7 +1012,18 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp)/* io space is alias to beginning of mmregs */ memory_region_init_alias (&s->io,OBJECT (s),"ati.io" , &s->mm,0 ,0x100 ); -pci_register_bar (dev,0 ,PCI_BASE_ADDRESS_MEM_PREFETCH , &vga->vram); +/* +* The framebuffer is at the beginning of the linear aperture. For +* Rage128 the upper half of the aperture is reserved for an AGP +* window (which we do not emulate.) +*/ + aper_size = s->dev_id ==PCI_DEVICE_ID_ATI_RAGE128_PF ? +ATI_RAGE128_LINEAR_APER_SIZE :ATI_R100_LINEAR_APER_SIZE ; +memory_region_init (&s->linear_aper,OBJECT (dev),"ati-linear-aperture0" , + aper_size); +memory_region_add_subregion (&s->linear_aper,0 , &vga->vram); + +pci_register_bar (dev,0 ,PCI_BASE_ADDRESS_MEM_PREFETCH , &s->linear_aper);pci_register_bar (dev,1 ,PCI_BASE_ADDRESS_SPACE_IO , &s->io);pci_register_bar (dev,2 ,PCI_BASE_ADDRESS_SPACE_MEMORY , &s->mm);
Signature · 1 line
2.53.0
[PULL 21/49] ati-vga: Implement foreground and background color register writes
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
These are straightforward 32-bit register write handlers. They're necessary for a future patch which will use them for color expansion from monochrome host data transfers.
Message-ID: <[email protected]>
--- hw/display/ati.c | 6 ++++++ 1 file changed, 6 insertions(+)
hw/display/ati.c +6 -0
@@ -924,6 +924,12 @@ static void ati_mm_write(void *opaque, hwaddr addr,case DP_CNTL : s->regs.dp_cntl = data;break ; +case DP_SRC_FRGD_CLR : + s->regs.dp_src_frgd_clr = data; +break ; +case DP_SRC_BKGD_CLR : + s->regs.dp_src_bkgd_clr = data; +break ;case DP_DATATYPE : s->regs.dp_datatype = data &0xe0070f0f ;break ;
Signature · 1 line
2.53.0
[PULL 19/49] ati-vga: Read aliased values from DP_GUI_MASTER_CNTL
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
DP_GUI_MASTER_CNTL aliases several fields from DP_DATATYPE and DP_MIX. These were being written correctly but not returned on a read of DP_GUI_MASTER_CNTL.
Message-ID: <[email protected]>
--- hw/display/ati_regs.h | 5 +++++ hw/display/ati.c | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-)
hw/display/ati_regs.h +5 -0
@@ -386,6 +386,9 @@#define DST_16BPP 0x00000004#define DST_24BPP 0x00000005#define DST_32BPP 0x00000006 +#define DP_DST_DATATYPE 0x0000000f +#define DP_BRUSH_DATATYPE 0x00000f00 +#define DP_SRC_DATATYPE 0x00030000#define BRUSH_SOLIDCOLOR 0x00000d00
@@ -437,6 +440,8 @@#define DP_SRC_RECT 0x00000200#define DP_SRC_HOST 0x00000300#define DP_SRC_HOST_BYTEALIGN 0x00000400 +#define DP_SRC_SOURCE 0x00000700 +#define DP_ROP3 0x00ff0000/* LVDS_GEN_CNTL constants */ #define LVDS_BL_MOD_LEVEL_MASK 0x0000ff00
hw/display/ati.c +7 -1
@@ -460,7 +460,13 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) val = s->regs.dst_y;break ;case DP_GUI_MASTER_CNTL : - val = s->regs.dp_gui_master_cntl; +/* DP_GUI_MASTER_CNTL aliases fields from DP_MIX and DP_DATATYPE */ + val = s->regs.dp_gui_master_cntl | + ((s->regs.dp_datatype &DP_BRUSH_DATATYPE ) >>4 ) | + ((s->regs.dp_datatype &DP_DST_DATATYPE ) <<8 ) | + ((s->regs.dp_datatype &DP_SRC_DATATYPE ) >>4 ) | + (s->regs.dp_mix &DP_ROP3 ) | + ((s->regs.dp_mix &DP_SRC_SOURCE ) <<16 );break ;case SRC_OFFSET : val = s->regs.src_offset;
Signature · 1 line
2.53.0
[PULL 18/49] ati-vga: Fix DST_PITCH and SRC_PITCH reads
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
Reading DST_PITCH and SRC_PITCH on the Rage 128 is broken. The read handlers attempt to construct the value from pitch and tile bits in the register state but mistakenly AND them instead of ORing them. This means the pitch is always zero on read.
Message-ID: <[email protected]>
--- hw/display/ati.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/display/ati.c +2 -2
@@ -438,7 +438,7 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)case DST_PITCH : val = s->regs.dst_pitch;if (s->dev_id ==PCI_DEVICE_ID_ATI_RAGE128_PF ) { - val &= s->regs.dst_tile <<16 ; + val |= s->regs.dst_tile <<16 ; }break ;case DST_WIDTH :
@@ -468,7 +468,7 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size)case SRC_PITCH : val = s->regs.src_pitch;if (s->dev_id ==PCI_DEVICE_ID_ATI_RAGE128_PF ) { - val &= s->regs.src_tile <<16 ; + val |= s->regs.src_tile <<16 ; }break ;case DP_BRUSH_BKGD_CLR :
Signature · 1 line
2.53.0
[PULL 23/49] ati-vga: Remove dst_x/y updates after blit
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
The Mobility M6 register reference (DST_HEIGHT_WIDTH) states that dst_y is updated after a blit but this appears to not be the case.
Hardware testing revealed that both the R128 and R100 do not update dst_x or dst_y after a blit, regardless of the source. This removes the update.
Message-ID: <[email protected]>
--- hw/display/ati_2d.c | 6 ------ 1 file changed, 6 deletions(-)
hw/display/ati_2d.c +0 -6
@@ -174,10 +174,6 @@ void ati_2d_blt(ATIVGAState *s) dst_y *surface_stride (ds), s->regs.dst_height * surface_stride(ds)); } - s->regs.dst_x = (s->regs.dp_cntl &DST_X_LEFT_TO_RIGHT ? - dst_x + s->regs.dst_width : dst_x); - s->regs.dst_y = (s->regs.dp_cntl &DST_Y_TOP_TO_BOTTOM ? - dst_y + s->regs.dst_height : dst_y);break ; }case ROP3_PATCOPY :
@@ -228,8 +224,6 @@ void ati_2d_blt(ATIVGAState *s) dst_y *surface_stride (ds), s->regs.dst_height * surface_stride(ds)); } - s->regs.dst_y = (s->regs.dp_cntl &DST_Y_TOP_TO_BOTTOM ? - dst_y + s->regs.dst_height : dst_y);break ; }default :
Signature · 1 line
2.53.0
[PULL 24/49] ati-vga: Consolidate dirty region tracking in ati_2d_blt
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
Both supported ROPs follow the same memory set dirty logic. This consolidates that logic to remove the duplication.
Message-ID: <[email protected]>
--- hw/display/ati_2d.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-)
hw/display/ati_2d.c +22 -21
@@ -43,15 +43,29 @@ static int ati_bpp_from_datatype(ATIVGAState *s) } } +static void ati_set_dirty (ATIVGAState *s, +const uint8_t *dst_bits,unsigned dst_y) +{ +VGACommonState *vga = &s->vga; +DisplaySurface *ds =qemu_console_surface (vga->con); + +DPRINTF ("%p %u ds: %p %d %d rop: %x\n" , vga->vram_ptr, vga->vbe_start_addr, +surface_data (ds),surface_stride (ds),surface_bits_per_pixel (ds), + (s->regs.dp_mix &GMC_ROP3_MASK ) >>16 ); +if (dst_bits >= vga->vram_ptr + vga->vbe_start_addr && + dst_bits < vga->vram_ptr + vga->vbe_start_addr + + vga->vbe_regs[VBE_DISPI_INDEX_YRES ] * vga->vbe_line_offset) { +memory_region_set_dirty (&vga->vram, + vga->vbe_start_addr + s->regs.dst_offset + + dst_y *surface_stride (ds), + s->regs.dst_height *surface_stride (ds)); + } +} +void ati_2d_blt (ATIVGAState *s) {/* FIXME it is probably more complex than this and may need to be */ /* rewritten but for now as a start just to get some output: */ -DisplaySurface *ds =qemu_console_surface (s->vga.con); -DPRINTF ("%p %u ds: %p %d %d rop: %x\n" , s->vga.vram_ptr, - s->vga.vbe_start_addr,surface_data (ds),surface_stride (ds), -surface_bits_per_pixel (ds), - (s->regs.dp_mix &GMC_ROP3_MASK ) >>16 );unsigned dst_x = (s->regs.dp_cntl &DST_X_LEFT_TO_RIGHT ? s->regs.dst_x : s->regs.dst_x +1 - s->regs.dst_width); unsigned dst_y = (s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM ?
@@ -166,14 +180,6 @@ void ati_2d_blt(ATIVGAState *s)memmove (&dst_bits[i], &src_bits[j], s->regs.dst_width * bypp); } } -if (dst_bits >= s->vga.vram_ptr + s->vga.vbe_start_addr && - dst_bits < s->vga.vram_ptr + s->vga.vbe_start_addr + - s->vga.vbe_regs[VBE_DISPI_INDEX_YRES ] * s->vga.vbe_line_offset) { -memory_region_set_dirty (&s->vga.vram, s->vga.vbe_start_addr + - s->regs.dst_offset + - dst_y *surface_stride (ds), - s->regs.dst_height *surface_stride (ds)); - }break ; }case ROP3_PATCOPY :
@@ -216,18 +222,13 @@ void ati_2d_blt(ATIVGAState *s) } } } -if (dst_bits >= s->vga.vram_ptr + s->vga.vbe_start_addr && - dst_bits < s->vga.vram_ptr + s->vga.vbe_start_addr + - s->vga.vbe_regs[VBE_DISPI_INDEX_YRES ] * s->vga.vbe_line_offset) { -memory_region_set_dirty (&s->vga.vram, s->vga.vbe_start_addr + - s->regs.dst_offset + - dst_y *surface_stride (ds), - s->regs.dst_height *surface_stride (ds)); - }break ; }default :qemu_log_mask (LOG_UNIMP ,"Unimplemented ati_2d blt op %x\n" , (s->regs.dp_mix &GMC_ROP3_MASK ) >>16 ); +return ; } + +ati_set_dirty (s, dst_bits, dst_y); }
Signature · 1 line
2.53.0
[PULL 28/49] hw/uefi: add variable digest to vmstate
In reply to Philippe Mathieu-DaudéFrom: Gerd Hoffmann <[email protected]>
Add digest to vmstate if needed. Clear digest before loading vmstate to make sure it is initialized.
Message-ID: <[email protected]>
--- hw/uefi/var-service-vars.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
hw/uefi/var-service-vars.c +37 -0
@@ -37,8 +37,41 @@ const VMStateDescription vmstate_uefi_time = { }, }; +static int uefi_vars_pre_load (void *opaque) +{ +uefi_variable *var = opaque; + +/* clear digest which is optional in the live migration data stream */ + var->digest =NULL ; + var->digest_size =0 ; +return 0 ; +} + +static bool uefi_vars_digest_is_needed (void *opaque) +{ +uefi_variable *var = opaque; + +if ((var->attributes &EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS ) + && !uefi_vars_is_sb_any (var)) { +return true; + } +return false; +} + +const VMStateDescription vmstate_uefi_variable_digest = { + .name ="uefi-variable-digest" , + .needed = uefi_vars_digest_is_needed, + .fields = (VMStateField []) { +VMSTATE_UINT32 (digest_size, uefi_variable), +VMSTATE_VBUFFER_ALLOC_UINT32 (digest, uefi_variable, +0 ,NULL , digest_size), +VMSTATE_END_OF_LIST () + }, +}; +const VMStateDescription vmstate_uefi_variable = { .name ="uefi-variable" , + .pre_load = uefi_vars_pre_load, .fields = (VMStateField []) {VMSTATE_UINT8_ARRAY_V (guid.data, uefi_variable,sizeof (QemuUUID),0 ),VMSTATE_UINT32 (name_size, uefi_variable),
@@ -49,6 +82,10 @@ const VMStateDescription vmstate_uefi_variable = { VMSTATE_STRUCT(time, uefi_variable, 0, vmstate_uefi_time, efi_time),VMSTATE_END_OF_LIST () }, + .subsections = (const VMStateDescription *const []) { + &vmstate_uefi_variable_digest, +NULL + } }; uefi_variable *uefi_vars_find_variable(uefi_vars_state *uv, QemuUUID guid,
Signature · 1 line
2.53.0
[PULL 22/49] ati-vga: Add scissor clipping register support
In reply to Philippe Mathieu-DaudéFrom: Chad Jablonski <[email protected]>
Implement read and write operations on SC_TOP_LEFT, SC_BOTTOM_RIGHT, and SRC_SC_BOTTOM_RIGHT registers. These registers are also updated when the src and/or dst clipping fields on DP_GUI_MASTER_CNTL are set to default clipping.
Scissor clipping is used when rendering text in X.org. The r128 driver sends host data much wider than is necessary to draw a glyph and cuts it down to size using clipping before rendering. The actual clipping implementation follows in a future patch.
This also includes a very minor refactor of the combined default_sc_bottom_right field in the registers struct to default_sc_bottom and default_sc_right. This was done to stay consistent with the other scissor registers and prevent repeated masking and extraction.
Message-ID: <[email protected]>
--- hw/display/ati_int.h | 9 +++++- hw/display/ati_regs.h | 2 ++ hw/display/ati.c | 70 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 78 insertions(+), 3 deletions(-)
hw/display/ati_int.h +8 -1
@@ -78,14 +78,21 @@ typedef struct ATIVGARegs {uint32_t dp_brush_frgd_clr;uint32_t dp_src_frgd_clr;uint32_t dp_src_bkgd_clr; +uint16_t sc_top; +uint16_t sc_left; +uint16_t sc_bottom; +uint16_t sc_right; +uint16_t src_sc_bottom; +uint16_t src_sc_right;uint32_t dp_cntl;uint32_t dp_datatype;uint32_t dp_mix;uint32_t dp_write_mask;uint32_t default_offset;uint32_t default_pitch; +uint16_t default_sc_bottom; +uint16_t default_sc_right;uint32_t default_tile; -uint32_t default_sc_bottom_right; } ATIVGARegs;struct ATIVGAState {
hw/display/ati_regs.h +2 -0
@@ -397,6 +397,8 @@#define GMC_DST_PITCH_OFFSET_CNTL 0x00000002#define GMC_SRC_CLIP_DEFAULT 0x00000000#define GMC_DST_CLIP_DEFAULT 0x00000000 +#define GMC_SRC_CLIPPING 0x00000004 +#define GMC_DST_CLIPPING 0x00000008#define GMC_BRUSH_SOLIDCOLOR 0x000000d0#define GMC_SRC_DSTCOLOR 0x00003000#define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000
hw/display/ati.c +68 -2
88 lines not on this page · raw message
Signature · 1 line
2.53.0
Re: [PULL 22/49] ati-vga: Add scissor clipping register support
Hi,
Quoted 47 lines · Philippe Mathieu-Daudé
From: Chad Jablonski <[email protected]>
Implement read and write operations on
SC_TOP_LEFT,SC_BOTTOM_RIGHT, andSRC_SC_BOTTOM_RIGHTregisters. These registers are also updated when the src and/or dst clipping fields onDP_GUI_MASTER_CNTLare set to default clipping.Scissor clipping is used when rendering text in X.org. The r128 driver sends host data much wider than is necessary to draw a glyph and cuts it down to size using clipping before rendering. The actual clipping implementation follows in a future patch.
This also includes a very minor refactor of the combined
default_sc_bottom_rightfield in the registers struct todefault_sc_bottomanddefault_sc_right. This was done to stay consistent with the other scissor registers and prevent repeated masking and extraction.Signed-off-by Chad Jablonski <[email protected]>Reviewed-by BALATON Zoltan <[email protected]>Message-ID: <[email protected]>
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/display/ati_int.h | 9 +++++- hw/display/ati_regs.h | 2 ++ hw/display/ati.c | 70 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 78 insertions(+), 3 deletions(-)hw/display/ati_regs.h +2
-0@@ -397,6 +397,8 @@#define GMC_DST_PITCH_OFFSET_CNTL 0x00000002#define GMC_SRC_CLIP_DEFAULT 0x00000000#define GMC_DST_CLIP_DEFAULT 0x00000000 +#define GMC_SRC_CLIPPING 0x00000004 +#define GMC_DST_CLIPPING 0x00000008#define GMC_BRUSH_SOLIDCOLOR 0x000000d0#define GMC_SRC_DSTCOLOR 0x00003000#define GMC_BYTE_ORDER_MSB_TO_LSB 0x00000000hw/display/ati.c +0
-0
hw/display/ati.c static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) · line 518
Quoted 6 lines
hw/display/ati.c +2
-1@@ -514,7 +514,32 @@ static uint64_t ati_mm_read(void *opaque, hwaddr addr, unsigned int size) val |= s->regs.default_tile <<16 ;break ;case DEFAULT_SC_BOTTOM_RIGHT : - val = s->regs.default_sc_bottom_right; + val = (s->regs.default_sc_bottom <<16 ) | + s->regs.default_sc_right;
Coverity is reporting an integer handling issues (SIGN_EXTENSION, CID 1645615):
Quoted 2 lines
hw/display/ati.c +0
-0>> CID 1645615: Integer handling issues (SIGN_EXTENSION)Quoted 1 line
Quoted 1 line
Suspicious implicit sign extension: "s->regs.default_sc_bottom" with type "uint16_t" (16 bits, unsigned) is promoted in "(s->regs.default_sc_bottom << 16) | s->regs.default_sc_right" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned). If "(s->regs.default_sc_bottom << 16) | s->regs.default_sc_right" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
Do you mind posting a fix?
Thanks,
Phil.
[PULL 25/49] hw/net/xilinx_ethlite: Check for oversized TX packets
In reply to Philippe Mathieu-DaudéFrom: Peter Maydell <[email protected]>
The xilinx_ethlite network device wasn't checking that the TX packet size set by the guest was within the size of its dual port RAM, with the effect that the guest could get it to read off the end of the RAM block.
Check the length. There is no provision in this very simple device for reporting errors, so as with various RX errors we just report via tracepoint.
This lack of length check has been present since the device was first introduced, though the code implementing the tx path has changed somewhat since then.
Cc: [email protected]
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3317
Message-ID: <[email protected]>
--- hw/net/xilinx_ethlite.c | 12 +++++++++--- hw/net/trace-events | 1 + 2 files changed, 10 insertions(+), 3 deletions(-)
hw/net/xilinx_ethlite.c +9 -3
@@ -162,9 +162,15 @@ static void port_tx_write(void *opaque, hwaddr addr, uint64_t value,break ;case TX_CTRL :if ((value & (CTRL_P |CTRL_S )) ==CTRL_S ) { -qemu_send_packet (qemu_get_queue (s->nic), -txbuf_ptr (s, port_index), - s->port[port_index].reg.tx_len); +uint32_t tx_size = s->port[port_index].reg.tx_len; + +if (tx_size >=BUFSZ_MAX ) { +trace_ethlite_pkt_tx_size_too_big (tx_size); + }else { +qemu_send_packet (qemu_get_queue (s->nic), +txbuf_ptr (s, port_index), + tx_size); + }if (s->port[port_index].reg.tx_ctrl &CTRL_I ) {eth_pulse_irq (s); }
hw/net/trace-events +1 -0
@@ -527,3 +527,4 @@ xen_netdev_rx(int dev, int idx, int status, int flags) "vif%u idx %d status %d f # xilinx_ethlite.c ethlite_pkt_lost(uint32_t rx_ctrl) "rx_ctrl:0x%" PRIx32 ethlite_pkt_size_too_big(uint64_t size) "size:0x%" PRIx64 +ethlite_pkt_tx_size_too_big(uint64_t size) "size:0x%" PRIx64
Signature · 1 line
2.53.0
[PULL 27/49] ui/cocoa: Do not automatically zoom for HiDPI
In reply to Philippe Mathieu-DaudéFrom: Akihiko Odaki <[email protected]>
Cocoa automatically zooms for a HiDPI display like Retina and makes the display blurry. Revert the automatic zooming.
Message-ID: <[email protected]>
--- ui/cocoa.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
ui/cocoa.m +6 -3
@@ -627,7 +627,10 @@ - (void) resizeWindow [[self window] setContentAspectRatio:NSMakeSize(screen.width, screen.height)]; if (!([[self window] styleMask] & NSWindowStyleMaskResizable)) { - [[self window] setContentSize:NSMakeSize(screen.width, screen.height)]; + CGFloat width = screen.width / [[self window] backingScaleFactor]; + CGFloat height = screen.height / [[self window] backingScaleFactor]; + + [[self window] setContentSize:NSMakeSize(width, height)]; [[self window] center]; } else if ([[self window] styleMask] & NSWindowStyleMaskFullScreen) { [[self window] setContentSize:[self fixAspectRatio:[self screenSafeAreaSize]]];
@@ -685,8 +688,8 @@ - (void) updateUIInfoLocked info.xoff = 0; info.yoff = 0; - info.width = frameSize.width; - info.height = frameSize.height; + info.width = frameSize.width * [[self window] backingScaleFactor]; + info.height = frameSize.height * [[self window] backingScaleFactor]; dpy_set_ui_info(dcl.con, &info, TRUE); }
Signature · 1 line
2.53.0
[PULL 26/49] MAINTAINERS: Replace @tuxfamily.org address
In reply to Philippe Mathieu-DaudéFrom: Thomas Huth <[email protected]>
Tuxfamily.org has had many outages in the recent years and will likely go away in the near future:
https://forum.tuxfamily.org/post/3381/#p3381
Thus replace my @tuxfamily.org address with another one that is more reliable and hopefully will survive longer.
Message-ID: <[email protected]>
--- MAINTAINERS | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
MAINTAINERS +4 -4
@@ -1357,13 +1357,13 @@ F: gdb-xml/loongarch*.xml M68K Machines ------------- an5206 -M: Thomas Huth <[email protected]> +M: Thomas Huth <[email protected]> S: Odd Fixes F: hw/m68k/an5206.c F: hw/m68k/mcf5206.c mcf5208 -M: Thomas Huth <[email protected]> +M: Thomas Huth <[email protected]> S: Odd Fixes F: hw/m68k/mcf5208.c F: hw/m68k/mcf_intc.c
@@ -1373,7 +1373,7 @@ F: include/hw/m68k/mcf*.h F: tests/functional/m68k/test_mcf5208evb.py NeXTcube -M: Thomas Huth <[email protected]> +M: Thomas Huth <[email protected]> S: Odd Fixes F: hw/m68k/next-*.c F: hw/display/next-fb.c
@@ -3088,7 +3088,7 @@ F: audio/paaudio.c SDL Audio backend M: Gerd Hoffmann <[email protected]> -R: Thomas Huth <[email protected]> +R: Thomas Huth <[email protected]> S: Odd Fixes F: audio/sdlaudio.c
Signature · 1 line
2.53.0
[PULL 29/49] hw/net/xilinx_axienet: Prevent writes to PHY Identification registers
In reply to Philippe Mathieu-DaudéFrom: Jim MacArthur <[email protected]>
There are other registers in the PHY model which should be partially or entirely read-only, but this solves the immediate issue.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3297
Message-ID: <[email protected]>
--- hw/net/xilinx_axienet.c | 4 ++++ 1 file changed, 4 insertions(+)
hw/net/xilinx_axienet.c +4 -0
@@ -141,6 +141,10 @@ tdk_write(struct PHY *phy, unsigned int req, unsigned int data) regnum = req &0x1f ;DPHY (qemu_log ("%s reg[%d] = %x\n" , __func__, regnum, data));switch (regnum) { +case 2 : +case 3 : +/* Writes to PHY Identification registers are disallowed */ +break ;default : phy->regs[regnum] = data;break ;
Signature · 1 line
2.53.0
[PULL 30/49] MAINTAINERS: Update the maintainer for the CHRP NVRAM section
In reply to Philippe Mathieu-DaudéFrom: Thomas Huth <[email protected]>
I am not involved in the ppc machines anymore (the pseries machine was the reason why I took over maintainership of the CHRP NVRAM code in the past), so it does not make much sense that I'm still listed here as the maintainer.
The CHRP NVRAM code is used by the mac99 / g3beige ppc machines and some Sparc machines, too, where Mark is the maintainer, so I asked him whether he would be interested in being listed as the maintainer here, and fortunately, he agreed! Thanks, Mark!
Message-ID: <[email protected]>
--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
@@ -2742,7 +2742,7 @@ F: tests/qtest/hexloader-test.c F: tests/data/hex-loader/test.hex CHRP NVRAM -M: Thomas Huth <[email protected]> +M: Mark Cave-Ayland <[email protected]> S: Maintained F: hw/nvram/chrp_nvram.c F: include/hw/nvram/chrp_nvram.h
Signature · 1 line
2.53.0
[PULL 31/49] hw/arm/Kconfig: Fix serial selection for NPCM8XX
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
CONFIG_SERIAL selects the internal TYPE_SERIAL device which is akin to an "IP block" that needs to be integrated with glue logic. In case of NPCM8XX this glue logic is TYPE_SERIAL_MM which the code uses already. Fix Kconfig to select CONFIG_SERIAL_MM which matches TYPE_SERIAL_MM.
Message-ID: <[email protected]>
--- hw/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/Kconfig +1 -1
@@ -482,7 +482,7 @@ config NPCM8XX select SMBUS select PL310 # cache controller select NPCM7XX - select SERIAL + select SERIAL_MM select SSI select UNIMP
Signature · 1 line
2.53.0
[PULL 32/49] hw/char/{diva-gsp, serial-pci-multi}: Fix deinitialization order
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
The memory region is owned by the device being unrealized, so must be removed from the mapping before unrealizing.
Message-ID: <[email protected]>
--- hw/char/diva-gsp.c | 2 +- hw/char/serial-pci-multi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/char/diva-gsp.c +1 -1
@@ -62,8 +62,8 @@ static void diva_pci_exit(PCIDevice *dev)for (i =0 ; i < pci->ports; i++) { s = pci->state + i; -qdev_unrealize (DEVICE (s));memory_region_del_subregion (&pci->membar, &s->io); +qdev_unrealize (DEVICE (s));g_free (pci->name[i]); }qemu_free_irqs (pci->irqs, pci->ports);
hw/char/serial-pci-multi.c +1 -1
@@ -56,8 +56,8 @@ static void multi_serial_pci_exit(PCIDevice *dev)for (i =0 ; i < pci->ports; i++) { s = pci->state + i; -qdev_unrealize (DEVICE (s));memory_region_del_subregion (&pci->iobar, &s->io); +qdev_unrealize (DEVICE (s));g_free (pci->name[i]); } }
Signature · 1 line
2.53.0
[PULL 34/49] util/fifo8: Make all read-only methods const-correct
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
Allows these methods to be used in const contexts, i.e. where the parent of the fifo itself is const. This is in particular useful for Rust code.
Message-ID: <[email protected]>
--- include/qemu/fifo8.h | 10 +++++----- util/fifo8.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-)
include/qemu/fifo8.h +5 -5
@@ -71,7 +71,7 @@ uint8_t fifo8_pop(Fifo8 *fifo);* * Returns: The peeked data byte. */ -uint8_t fifo8_peek (Fifo8 *fifo); +uint8_t fifo8_peek (const Fifo8 *fifo);/** * fifo8_pop_buf:
@@ -181,7 +181,7 @@ void fifo8_reset(Fifo8 *fifo);* * Returns: True if the fifo is empty, false otherwise. */ -bool fifo8_is_empty (Fifo8 *fifo); +bool fifo8_is_empty (const Fifo8 *fifo);/** * fifo8_is_full:
@@ -191,7 +191,7 @@ bool fifo8_is_empty(Fifo8 *fifo);* * Returns: True if the fifo is full, false otherwise. */ -bool fifo8_is_full (Fifo8 *fifo); +bool fifo8_is_full (const Fifo8 *fifo);/** * fifo8_num_free:
@@ -201,7 +201,7 @@ bool fifo8_is_full(Fifo8 *fifo);* * Returns: Number of free bytes. */ -uint32_t fifo8_num_free (Fifo8 *fifo); +uint32_t fifo8_num_free (const Fifo8 *fifo);/** * fifo8_num_used:
@@ -211,7 +211,7 @@ uint32_t fifo8_num_free(Fifo8 *fifo);* * Returns: Number of used bytes. */ -uint32_t fifo8_num_used (Fifo8 *fifo); +uint32_t fifo8_num_used (const Fifo8 *fifo);extern const VMStateDescription vmstate_fifo8;
util/fifo8.c +5 -5
@@ -71,7 +71,7 @@ uint8_t fifo8_pop(Fifo8 *fifo)return ret; } -uint8_t fifo8_peek (Fifo8 *fifo) +uint8_t fifo8_peek (const Fifo8 *fifo) {assert (fifo->num >0 );return fifo->data[fifo->head];
@@ -157,22 +157,22 @@ void fifo8_drop(Fifo8 *fifo, uint32_t len)assert (len ==0 ); } -bool fifo8_is_empty (Fifo8 *fifo) +bool fifo8_is_empty (const Fifo8 *fifo) {return (fifo->num ==0 ); } -bool fifo8_is_full (Fifo8 *fifo) +bool fifo8_is_full (const Fifo8 *fifo) {return (fifo->num == fifo->capacity); } -uint32_t fifo8_num_free (Fifo8 *fifo) +uint32_t fifo8_num_free (const Fifo8 *fifo) {return fifo->capacity - fifo->num; } -uint32_t fifo8_num_used (Fifo8 *fifo) +uint32_t fifo8_num_used (const Fifo8 *fifo) {return fifo->num; }
Signature · 1 line
2.53.0
[PULL 33/49] hw/arm/aspeed_ast27x0-{ssp, tsp}: Do not access SerialMM internals directly
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
SerialMM inherits from SysBusDevice and exposes the memory region by means of sysbus_mmio_get_region(). Use that in order to avoid accessing implementation details of SerialMM.
Message-ID: <[email protected]>
--- hw/arm/aspeed_ast27x0-ssp.c | 7 ++++--- hw/arm/aspeed_ast27x0-tsp.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
hw/arm/aspeed_ast27x0-ssp.c +4 -3
@@ -149,6 +149,7 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)AspeedCoprocessorState *s =ASPEED_COPROCESSOR (dev_soc);AspeedCoprocessorClass *sc =ASPEED_COPROCESSOR_GET_CLASS (s);DeviceState *armv7m; +MemoryRegion *mr; g_autofree char *sdram_name = NULL;int i;
@@ -230,9 +231,9 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp) }/* UART */ -memory_region_init_alias (&s->uart_alias,OBJECT (s),"uart.alias" , - &s->uart->serial.io,0 , -memory_region_size (&s->uart->serial.io)); + mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (s->uart),0 ); +memory_region_init_alias (&s->uart_alias,OBJECT (s),"uart.alias" , mr,0 , +memory_region_size (mr));memory_region_add_subregion (s->memory, sc->memmap[s->uart_dev], &s->uart_alias);/*
hw/arm/aspeed_ast27x0-tsp.c +4 -3
@@ -149,6 +149,7 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)AspeedCoprocessorState *s =ASPEED_COPROCESSOR (dev_soc);AspeedCoprocessorClass *sc =ASPEED_COPROCESSOR_GET_CLASS (s);DeviceState *armv7m; +MemoryRegion *mr; g_autofree char *sdram_name = NULL;int i;
@@ -230,9 +231,9 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp) }/* UART */ -memory_region_init_alias (&s->uart_alias,OBJECT (s),"uart.alias" , - &s->uart->serial.io,0 , -memory_region_size (&s->uart->serial.io)); + mr =sysbus_mmio_get_region (SYS_BUS_DEVICE (s->uart),0 ); +memory_region_init_alias (&s->uart_alias,OBJECT (s),"uart.alias" , mr,0 , +memory_region_size (mr));memory_region_add_subregion (s->memory, sc->memmap[s->uart_dev], &s->uart_alias);/*
Signature · 1 line
2.53.0
[PULL 36/49] hw/char/serial: Prefer fifo8 methods over open-coding
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
Use fifo8_is_empty() and fifo8_is_full() to improve readability of the code.
Message-ID: <[email protected]>
--- hw/char/serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/char/serial.c +4 -4
@@ -239,7 +239,7 @@ static void serial_xmit(SerialState *s)if (s->fcr &UART_FCR_FE ) {assert (!fifo8_is_empty (&s->xmit_fifo)); s->tsr =fifo8_pop (&s->xmit_fifo); -if (!s->xmit_fifo.num) { +if (fifo8_is_empty (&s->xmit_fifo)) { s->lsr |=UART_LSR_THRE ; } }else {
@@ -481,7 +481,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)if (s->fcr &UART_FCR_FE ) { ret =fifo8_is_empty (&s->recv_fifo) ?0 :fifo8_pop (&s->recv_fifo); -if (s->recv_fifo.num ==0 ) { +if (fifo8_is_empty (&s->recv_fifo)) { s->lsr &= ~(UART_LSR_DR |UART_LSR_BI ); }else {timer_mod (s->fifo_timeout_timer,qemu_clock_get_ns (QEMU_CLOCK_VIRTUAL ) + s->char_transmit_time *4 );
@@ -555,7 +555,7 @@ static uint64_t serial_ioport_read(void *opaque, hwaddr addr, unsigned size)static int serial_can_receive (SerialState *s) {if (s->fcr &UART_FCR_FE ) { -if (s->recv_fifo.num <UART_FIFO_LENGTH ) { +if (!fifo8_is_full (&s->recv_fifo)) {/* * Advertise (fifo.itl - fifo.count) bytes when count < ITL, and 1 * if above. If UART_FIFO_LENGTH - fifo.count is advertised the
@@ -585,7 +585,7 @@ static void serial_receive_break(SerialState *s)/* There's data in recv_fifo and s->rbr has not been read for 4 char transmit times */ static void fifo_timeout_int (void *opaque) {SerialState *s = opaque; -if (s->recv_fifo.num) { +if (!fifo8_is_empty (&s->recv_fifo)) { s->timeout_ipending =1 ;serial_update_irq (s); }
Signature · 1 line
2.53.0
[PULL 37/49] hw/char/serial: Reuse fifo8_num_used()
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
Avoids accessing private fields of struct Fifo8. Now, TYPE_SERIAL only accesses struct Fifo8 through its methods.
Message-ID: <[email protected]>
--- hw/char/serial.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/char/serial.c +3 -3
@@ -128,7 +128,7 @@ static void serial_update_irq(SerialState *s) tmp_iir =UART_IIR_CTI ; }else if ((s->ier &UART_IER_RDI ) && (s->lsr &UART_LSR_DR ) && (!(s->fcr &UART_FCR_FE ) || - s->recv_fifo.num >= s->recv_fifo_itl)) { +fifo8_num_used (&s->recv_fifo) >= s->recv_fifo_itl)) { tmp_iir =UART_IIR_RDI ; }else if ((s->ier &UART_IER_THRI ) && s->thr_ipending) { tmp_iir =UART_IIR_THRI ;
@@ -563,8 +563,8 @@ static int serial_can_receive(SerialState *s)* the guest has a chance to respond, effectively overriding the ITL * that the guest has set. */ -return (s->recv_fifo.num <= s->recv_fifo_itl) ? - s->recv_fifo_itl - s->recv_fifo.num :1 ; +return (fifo8_num_used (&s->recv_fifo) <= s->recv_fifo_itl) ? + s->recv_fifo_itl -fifo8_num_used (&s->recv_fifo) :1 ; }else {return 0 ; }
Signature · 1 line
2.53.0
[PULL 35/49] hw/char/serial: Remove explicit cast from void pointer
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
A void pointer asks for being casted, so C allows for omitting the explicit cast. Take advantage of that.
Message-ID: <[email protected]>
--- hw/char/serial.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
hw/char/serial.c +6 -6
@@ -715,7 +715,7 @@ static const VMStateDescription vmstate_serial_thr_ipending = {static bool serial_tsr_needed (void *opaque) { -SerialState *s = (SerialState *)opaque; +SerialState *s = opaque;return s->tsr_retry !=0 ; }
@@ -734,7 +734,7 @@ static const VMStateDescription vmstate_serial_tsr = {static bool serial_recv_fifo_needed (void *opaque) { -SerialState *s = (SerialState *)opaque; +SerialState *s = opaque;return !fifo8_is_empty (&s->recv_fifo); }
@@ -752,7 +752,7 @@ static const VMStateDescription vmstate_serial_recv_fifo = {static bool serial_xmit_fifo_needed (void *opaque) { -SerialState *s = (SerialState *)opaque; +SerialState *s = opaque;return !fifo8_is_empty (&s->xmit_fifo); }
@@ -769,7 +769,7 @@ static const VMStateDescription vmstate_serial_xmit_fifo = {static bool serial_fifo_timeout_timer_needed (void *opaque) { -SerialState *s = (SerialState *)opaque; +SerialState *s = opaque;return timer_pending (s->fifo_timeout_timer); }
@@ -786,7 +786,7 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = {static bool serial_timeout_ipending_needed (void *opaque) { -SerialState *s = (SerialState *)opaque; +SerialState *s = opaque;return s->timeout_ipending !=0 ; }
@@ -803,7 +803,7 @@ static const VMStateDescription vmstate_serial_timeout_ipending = {static bool serial_poll_needed (void *opaque) { -SerialState *s = (SerialState *)opaque; +SerialState *s = opaque;return s->poll_msl >=0 ; }
Signature · 1 line
2.53.0
[PULL 38/49] hw/char/serial: Remove unhelpful comment
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
There is no "is_load" flag and one can tell from the method name what the method does. Remove this unhelpful comment.
Message-ID: <[email protected]>
--- hw/char/serial.c | 3 --- 1 file changed, 3 deletions(-)
hw/char/serial.c +0 -3
@@ -281,9 +281,6 @@ static void serial_xmit(SerialState *s) s->lsr |=UART_LSR_TEMT ; } -/* Setter for FCR. -is_load flag means, that value is set while loading VM state -and interrupt should not be invoked */ static void serial_write_fcr (SerialState *s,uint8_t val) {/* Set fcr - val only has the bits that are supposed to "stick" */
Signature · 1 line
2.53.0
[PULL 39/49] hw/char/serial: Add constants for Line Control Register
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
Substitute some magic numbers by named constants for slightly improved readability.
Message-ID: <[email protected]>
--- hw/char/serial.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
hw/char/serial.c +11 -6
@@ -39,6 +39,11 @@#include "hw/core/qdev-properties-system.h" #define UART_LCR_DLAB 0x80/* Divisor latch access bit */ +#define UART_LCR_SB 0x40/* Set break */ +#define UART_LCR_EPS 0x10/* Even parity select */ +#define UART_LCR_PEN 0x08/* Parity enable */ +#define UART_LCR_NSTB 0x04/* Number of stop bits */ +#define UART_LCR_WLS 0x03/* Word length select */ #define UART_IER_MSI 0x08/* Enable Modem status interrupt */ #define UART_IER_RLSI 0x04/* Enable receiver line status interrupt */
@@ -153,23 +158,23 @@ static void serial_update_parameters(SerialState *s)/* Start bit. */ frame_size =1 ; -if (s->lcr &0x08 ) { +if (s->lcr &UART_LCR_PEN ) {/* Parity bit. */ frame_size++; -if (s->lcr &0x10 ) +if (s->lcr &UART_LCR_EPS ) parity ='E' ;else parity ='O' ; }else { parity ='N' ; } -if (s->lcr &0x04 ) { +if (s->lcr &UART_LCR_NSTB ) { stop_bits =2 ; }else { stop_bits =1 ; } - data_bits = (s->lcr &0x03 ) +5 ; + data_bits = (s->lcr &UART_LCR_WLS ) +5 ; frame_size += data_bits + stop_bits;/* Zero divisor should give about 3500 baud */ speed = (s->divider ==0 ) ?3500 : (float ) s->baudbase / s->divider;
@@ -430,7 +435,7 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val,int break_enable; s->lcr = val;serial_update_parameters (s); - break_enable = (val >>6 ) &1 ; + break_enable = !!(val &UART_LCR_SB );if (break_enable != s->last_break_enable) { s->last_break_enable = break_enable; qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_BREAK,
@@ -676,7 +681,7 @@ static int serial_post_load(void *opaque, int version_id) } } - s->last_break_enable = (s->lcr >>6 ) &1 ; + s->last_break_enable = !!(s->lcr &UART_LCR_SB );/* Initialize fcr via setter to perform essential side-effects */ serial_write_fcr (s, s->fcr_vmstate);serial_update_parameters (s);
Signature · 1 line
2.53.0
[PULL 41/49] hw/char/serial: Avoid implicit conversion when tracing
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
On 64 bit targets, the MemoryRegion API passes an address and a value as uint64_t, so use that for tracing. Keep the uint8_t for reading since this is what the device model produces. On targets with less than 64 bits, uint64_t is wide enough to avoid narrowing.
Message-ID: <[email protected]>
--- hw/char/trace-events | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/char/trace-events +2 -2
@@ -5,8 +5,8 @@ parallel_ioport_read(const char *desc, uint16_t addr, uint8_t value) "read [%s] parallel_ioport_write(const char *desc, uint16_t addr, uint8_t value) "write [%s] addr 0x%02x val 0x%02x" # serial.c -serial_read(uint16_t addr, uint8_t value) "read addr 0x%02x val 0x%02x" -serial_write(uint16_t addr, uint8_t value) "write addr 0x%02x val 0x%02x" +serial_read(uint64_t addr, uint8_t value) "[0x%02" PRIx64 "] -> 0x%02" PRIx8 +serial_write(uint64_t addr, uint64_t value) "[0x%02" PRIx64 "] <- 0x%02" PRIx64 serial_update_parameters(uint64_t baudrate, char parity, int data_bits, int stop_bits) "baudrate=%"PRIu64" parity='%c' data=%d stop=%d" # virtio-serial-bus.c
Signature · 1 line
2.53.0
[PULL 40/49] hw/char/serial: Remove redundant reset
In reply to Philippe Mathieu-DaudéFrom: Bernhard Beschow <[email protected]>
There is no need to invoke the reset method in realize since the reset framework will do so anyway before the machine starts.
Message-ID: <[email protected]>
--- hw/char/serial.c | 1 - 1 file changed, 1 deletion(-)
hw/char/serial.c +0 -1
@@ -934,7 +934,6 @@ static void serial_realize(DeviceState *dev, Error **errp) serial_event, serial_be_change, s, NULL, true);fifo8_create (&s->recv_fifo,UART_FIFO_LENGTH );fifo8_create (&s->xmit_fifo,UART_FIFO_LENGTH ); -serial_reset (s); }static void serial_unrealize (DeviceState *dev)
Signature · 1 line
2.53.0
[PULL 43/49] hppa: Get physical address space bits from HPPACPUDef
In reply to Philippe Mathieu-DaudéFrom: Anton Johansson <[email protected]>
Message-ID: <[email protected]>
--- include/hw/pci-host/astro.h | 2 ++ target/hppa/cpu.h | 11 ++++++++--- hw/hppa/machine.c | 15 +++++++++----- hw/pci-host/astro.c | 8 +++++++- target/hppa/cpu.c | 5 +++++ target/hppa/mem_helper.c | 39 +++++++++++-------------------------- 6 files changed, 43 insertions(+), 37 deletions(-)
include/hw/pci-host/astro.h +2 -0
@@ -82,6 +82,8 @@ struct AstroState {uint64_t tlb_tcnfg;uint64_t tlb_pdir_base; +uint8_t phys_addr_bits; +struct ElroyState *elroy[ELROY_NUM ];MemoryRegion this_mem;
target/hppa/cpu.h +8 -3
@@ -320,6 +320,11 @@ static inline const HPPACPUDef *hppa_def(CPUHPPAState *env)return HPPA_CPU_GET_CLASS (env_cpu (env))->def; } +static inline uint8_t hppa_phys_addr_bits (CPUHPPAState *env) +{ +return hppa_def (env)->phys_addr_bits; +} +static inline bool hppa_is_pa20 (CPUHPPAState *env) {return hppa_def (env)->is_pa20;
@@ -352,9 +357,9 @@ static inline vaddr hppa_form_gva(CPUHPPAState *env, uint64_t spc,return hppa_form_gva_mask (env->gva_offset_mask, spc, off); } -hwaddr hppa_abs_to_phys_pa1x (vaddr addr); -hwaddr hppa_abs_to_phys_pa2_w0 (vaddr addr); -hwaddr hppa_abs_to_phys_pa2_w1 (vaddr addr); +hwaddr hppa_abs_to_phys_pa1x (uint8_t phys_addr_bits,vaddr addr); +hwaddr hppa_abs_to_phys_pa2_w0 (uint8_t phys_addr_bits,vaddr addr); +hwaddr hppa_abs_to_phys_pa2_w1 (uint8_t phys_addr_bits,vaddr addr);/* * Since PSW_{I,CB} will never need to be in tb->flags, reuse them.
hw/hppa/machine.c +10 -5
@@ -179,19 +179,21 @@ static uint64_t linux_kernel_virt_to_phys(void *opaque, uint64_t addr)return addr; } +static HPPACPU *cpu[HPPA_MAX_CPUS ]; +static uint64_t firmware_entry; +static uint64_t translate_pa10 (void *dummy,uint64_t addr) { -return hppa_abs_to_phys_pa1x (addr); +const uint8_t pa_bits =hppa_phys_addr_bits (&cpu[0 ]->env); +return hppa_abs_to_phys_pa1x (pa_bits, addr); }static uint64_t translate_pa20 (void *dummy,uint64_t addr) { -return hppa_abs_to_phys_pa2_w0 (addr); +const uint8_t pa_bits =hppa_phys_addr_bits (&cpu[0 ]->env); +return hppa_abs_to_phys_pa2_w0 (pa_bits, addr); } -static HPPACPU *cpu[HPPA_MAX_CPUS ]; -static uint64_t firmware_entry; -static void fw_cfg_boot_set (void *opaque,const char *boot_device,Error **errp) {
@@ -685,6 +687,9 @@ static AstroState *astro_init(void)DeviceState *dev; dev =qdev_new (TYPE_ASTRO_CHIP ); +object_property_set_int (OBJECT (dev),"phys-addr-bits" , +hppa_phys_addr_bits (&cpu[0 ]->env), + &error_abort);sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);return ASTRO_CHIP (dev);
hw/pci-host/astro.c +7 -1
@@ -303,7 +303,7 @@ static IOMMUTLBEntry astro_translate_iommu(IOMMUMemoryRegion *iommu,* language which not-coincidentally matches the PSW.W=0 mapping. */ if (addr <=UINT32_MAX ) { - entry =hppa_abs_to_phys_pa2_w0 (addr); + entry =hppa_abs_to_phys_pa2_w0 (s->phys_addr_bits, addr); }else { entry = addr; }
@@ -910,6 +910,10 @@ static void astro_realize(DeviceState *obj, Error **errp) } } +static const Property astro_props[] = { +DEFINE_PROP_UINT8 ("phys-addr-bits" , AstroState, phys_addr_bits,32 ), +}; +static void astro_class_init (ObjectClass *klass,const void *data) {DeviceClass *dc =DEVICE_CLASS (klass);
@@ -922,6 +926,8 @@ static void astro_class_init(ObjectClass *klass, const void *data)* be created without that hardware */ dc->user_creatable = false; + +device_class_set_props (dc, astro_props); }static const TypeInfo astro_chip_info = {
target/hppa/cpu.c +5 -0
@@ -283,6 +283,11 @@ static void hppa_cpu_class_base_init(ObjectClass *oc, const void *data)/* Make sure all CPU models define a HPPACPUDef */ g_assert (!object_class_is_abstract (oc) && data !=NULL ); acc->def = data; +/* +* Verify assumptions made in hppa_abs_to_phys_pa2_w1() on the size +* of the physical address space. +*/ +g_assert (acc->def->phys_addr_bits <=54 ); }static void hppa_cpu_class_init (ObjectClass *oc,const void *data)
target/hppa/mem_helper.c +11 -28
@@ -29,29 +29,12 @@#include "hw/core/cpu.h" #include "trace.h" -/* -* 64-bit (PA-RISC 2.0) machines are assumed to run PA-8700, and 32-bit -* machines 7300LC. This should give 44 and 32 bits of physical address -* space respectively. -* -* CPU model Physical address space bits -* PA-7000--7300LC 32 -* PA-8000--8600 40 -* PA-8700--8900 44 -* -* FIXME: However, the SeaBIOS firmware that is that tested against -* uses 40-bit physical addresses, despite supposedly running a C3700 -* with a PA-8700 cpu, so use 40-bits for 64-bit. -*/ -#define HPPA_PHYS_ADDR_SPACE_BITS_PA20 40 -#define HPPA_PHYS_ADDR_SPACE_BITS_PA1X 32 - -hwaddr hppa_abs_to_phys_pa1x (vaddr addr) +hwaddr hppa_abs_to_phys_pa1x (uint8_t phys_addr_bits,vaddr addr) { -return extract64 (addr,0 ,HPPA_PHYS_ADDR_SPACE_BITS_PA1X ); +return extract64 (addr,0 , phys_addr_bits); } -hwaddr hppa_abs_to_phys_pa2_w1 (vaddr addr) +hwaddr hppa_abs_to_phys_pa2_w1 (uint8_t phys_addr_bits,vaddr addr) {/* * Figure H-8 "62-bit Absolute Accesses when PSW W-bit is 1" describes
@@ -64,11 +47,10 @@ hwaddr hppa_abs_to_phys_pa2_w1(vaddr addr)* Since the supported physical address space is below 54 bits, the * H-8 algorithm is moot and all that is left is to truncate. */ -QEMU_BUILD_BUG_ON (HPPA_PHYS_ADDR_SPACE_BITS_PA20 >54 ); -return sextract64 (addr,0 ,HPPA_PHYS_ADDR_SPACE_BITS_PA20 ); +return sextract64 (addr,0 , phys_addr_bits); } -hwaddr hppa_abs_to_phys_pa2_w0 (vaddr addr) +hwaddr hppa_abs_to_phys_pa2_w0 (uint8_t phys_addr_bits,vaddr addr) {/* * See Figure H-10, "Absolute Accesses when PSW W-bit is 0",
@@ -89,7 +71,7 @@ hwaddr hppa_abs_to_phys_pa2_w0(vaddr addr)* is what can be seen on physical machines too. */ addr = (uint32_t )addr; - addr |=-1ull << (HPPA_PHYS_ADDR_SPACE_BITS_PA20 -4 ); + addr |=-1ull << (phys_addr_bits -4 ); }return addr; }
@@ -231,15 +213,16 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,/* Virtual translation disabled. Map absolute to physical. */ if (MMU_IDX_MMU_DISABLED (mmu_idx)) { +const uint8_t phys_addr_bits =hppa_phys_addr_bits (env);switch (mmu_idx) {case MMU_ABS_W_IDX : - phys =hppa_abs_to_phys_pa2_w1 (addr); + phys =hppa_abs_to_phys_pa2_w1 (phys_addr_bits, addr);break ;case MMU_ABS_IDX :if (hppa_is_pa20 (env)) { - phys =hppa_abs_to_phys_pa2_w0 (addr); + phys =hppa_abs_to_phys_pa2_w0 (phys_addr_bits, addr); }else { - phys =hppa_abs_to_phys_pa1x (addr); + phys =hppa_abs_to_phys_pa1x (phys_addr_bits, addr); }break ;default :
@@ -580,7 +563,7 @@ static void itlbt_pa20(CPUHPPAState *env, target_ulong r1,/* Align per the page size. */ ent->pa &=TARGET_PAGE_MASK << mask_shift;/* Ignore the bits beyond physical address space. */ - ent->pa =sextract64 (ent->pa,0 ,HPPA_PHYS_ADDR_SPACE_BITS_PA20 ); + ent->pa =sextract64 (ent->pa,0 ,hppa_phys_addr_bits (env)); ent->t =extract64 (r2,61 ,1 ); ent->d =extract64 (r2,60 ,1 );
Signature · 1 line
2.53.0
[PULL 42/49] hppa: Introduce HPPACPUDef
In reply to Philippe Mathieu-DaudéFrom: Anton Johansson <[email protected]>
Restructures the CPU class heirarchy to clarify model names and allow for per-model configuration options via HPPACPUDef. 32-bit HPPA is assumed to run a PA-7300LC, and 64-bit assumed to run a PA-8700. A new PA-8500 model is added, which will later be used by the A400 machine. All CPU models are made into children of the now abstract TYPE_HPPA_CPU base class.
Two fields are added to HPPACPUDef describing the size of the physical address space, and whether or not the CPU uses the PA-RISC 2.0 architecture. The latter was previously a field in CPUHPPAState.
phys_addr_bits is currently set but unused, and will be used in the following commit. Likewise, PA-8700 is moved to use 44 bit physical addresses in a followup commit to not break bisection.
References to "hppa/hppa64" models in test cases are also updated.
Message-ID: <[email protected]>
--- target/hppa/cpu-qom.h | 8 +++++- target/hppa/cpu.h | 24 +++++++++++++--- hw/hppa/machine.c | 21 ++++++++------ linux-user/hppa/elfload.c | 2 +- target/hppa/cpu.c | 50 +++++++++++++++++++++++++-------- tests/qtest/machine-none-test.c | 2 +- 6 files changed, 80 insertions(+), 27 deletions(-)
target/hppa/cpu-qom.h +7 -1
@@ -23,7 +23,13 @@#include "hw/core/cpu.h" #define TYPE_HPPA_CPU "hppa-cpu" -#define TYPE_HPPA64_CPU "hppa64-cpu" + +#define HPPA_CPU_TYPE_SUFFIX "-" TYPE_HPPA_CPU +#define HPPA_CPU_TYPE_NAME (name) (name HPPA_CPU_TYPE_SUFFIX) + +#define TYPE_HPPA_CPU_PA_7300LC HPPA_CPU_TYPE_NAME("pa-7300lc") +#define TYPE_HPPA_CPU_PA_8500 HPPA_CPU_TYPE_NAME("pa-8500") +#define TYPE_HPPA_CPU_PA_8700 HPPA_CPU_TYPE_NAME("pa-8700")OBJECT_DECLARE_CPU_TYPE (HPPACPU , HPPACPUClass,HPPA_CPU )
target/hppa/cpu.h +20 -4
@@ -270,8 +270,6 @@ typedef struct CPUArchState {/* Fields up to this point are cleared by a CPU reset */ struct {} end_reset_fields; -bool is_pa20; -target_ulong kernel_entry;/* Linux kernel was loaded here */ target_ulong cmdline_or_bootorder;target_ulong initrd_base, initrd_end;
@@ -290,6 +288,18 @@ struct ArchCPU {QEMUTimer *alarm_timer; }; +/** +* HPPACPUDef: +* @phys_addr_bits: Number of bits in the physical address space. +* @is_pa20: Whether the CPU model follows the PA-RISC 2.0 or 1.1 spec. +* +* Configuration options for a HPPA CPU model. +*/ +typedef struct HPPACPUDef { +uint8_t phys_addr_bits; +bool is_pa20; +}HPPACPUDef ; +/** * HPPACPUClass: * @parent_realize: The parent class' realize handler.
@@ -302,11 +312,17 @@ struct HPPACPUClass {DeviceRealize parent_realize;ResettablePhases parent_phases; +const HPPACPUDef *def; }; -static inline bool hppa_is_pa20 (const CPUHPPAState *env) +static inline const HPPACPUDef *hppa_def (CPUHPPAState *env) { -return env->is_pa20; +return HPPA_CPU_GET_CLASS (env_cpu (env))->def; +} + +static inline bool hppa_is_pa20 (CPUHPPAState *env) +{ +return hppa_def (env)->is_pa20; }static inline int HPPA_BTLB_ENTRIES (CPUHPPAState *env)
hw/hppa/machine.c +13 -8
@@ -801,13 +801,13 @@ static void hppa_machine_common_class_init(ObjectClass *oc, const void *data)static void HP_B160L_machine_init_class_init (ObjectClass *oc,const void *data) {static const char *const valid_cpu_types[] = { -TYPE_HPPA_CPU , +TYPE_HPPA_CPU_PA_7300LC ,NULL };MachineClass *mc =MACHINE_CLASS (oc); mc->desc ="HP B160L workstation" ; - mc->default_cpu_type =TYPE_HPPA_CPU ; + mc->default_cpu_type =TYPE_HPPA_CPU_PA_7300LC ; mc->valid_cpu_types = valid_cpu_types; mc->init = machine_HP_B160L_init; mc->is_default = true;
@@ -817,13 +817,13 @@ static void HP_B160L_machine_init_class_init(ObjectClass *oc, const void *data)static void HP_C3700_machine_init_class_init (ObjectClass *oc,const void *data) {static const char *const valid_cpu_types[] = { -TYPE_HPPA64_CPU , +TYPE_HPPA_CPU_PA_8700 ,NULL };MachineClass *mc =MACHINE_CLASS (oc); mc->desc ="HP C3700 workstation" ; - mc->default_cpu_type =TYPE_HPPA64_CPU ; + mc->default_cpu_type =TYPE_HPPA_CPU_PA_8700 ; mc->valid_cpu_types = valid_cpu_types; mc->init = machine_HP_C3700_init; mc->max_cpus =HPPA_MAX_CPUS ;
@@ -833,13 +833,13 @@ static void HP_C3700_machine_init_class_init(ObjectClass *oc, const void *data)static void HP_A400_machine_init_class_init (ObjectClass *oc,const void *data) {static const char *const valid_cpu_types[] = { -TYPE_HPPA64_CPU , +TYPE_HPPA_CPU_PA_8500 ,NULL };MachineClass *mc =MACHINE_CLASS (oc); mc->desc ="HP A400-44 workstation" ; - mc->default_cpu_type =TYPE_HPPA64_CPU ; + mc->default_cpu_type =TYPE_HPPA_CPU_PA_8500 ; mc->valid_cpu_types = valid_cpu_types; mc->init = machine_HP_A400_init; mc->max_cpus =HPPA_MAX_CPUS ;
@@ -849,13 +849,18 @@ static void HP_A400_machine_init_class_init(ObjectClass *oc, const void *data)static void HP_715_machine_init_class_init (ObjectClass *oc,const void *data) {static const char *const valid_cpu_types[] = { -TYPE_HPPA_CPU , +TYPE_HPPA_CPU_PA_7300LC ,NULL };MachineClass *mc =MACHINE_CLASS (oc); mc->desc ="HP 715/64 workstation" ; - mc->default_cpu_type =TYPE_HPPA_CPU ; +/* +* Although the 715 workstation should use a 7100LC, it can be safely +* modeled as a 7300LC as the difference is a moving of the L1 data cache +* to on-chip. +*/ + mc->default_cpu_type =TYPE_HPPA_CPU_PA_7300LC ; mc->valid_cpu_types = valid_cpu_types; mc->init = machine_HP_715_init;/* can only support up to max. 8 CPUs due inventory major numbers */
linux-user/hppa/elfload.c +1 -1
@@ -8,7 +8,7 @@const char *get_elf_cpu_model (uint32_t eflags) { -return "hppa" ; +return "pa-7300lc" ; }const char *get_elf_platform (CPUState *cs)
target/hppa/cpu.c +38 -12
80 lines not on this page · raw message
tests/qtest/machine-none-test.c +1 -1
@@ -47,7 +47,7 @@ static struct arch2cpu cpus_map[] = { { "tricore", "tc1796" }, { "xtensa", "dc233c" }, { "xtensaeb", "fsf" }, - { "hppa", "hppa" }, + { "hppa", "pa-7300lc" }, { "riscv64", "rv64" }, { "riscv32", "rv32" }, { "rx", "rx62n" },
Signature · 1 line
2.53.0
[PULL 44/49] hppa: Use 44 bit physical addresses for PA-8700
In reply to Philippe Mathieu-DaudéFrom: Anton Johansson <[email protected]>
This is in line with the PA-8700 specification which demands 44 bits.
However, this change breaks the SeaBIOS functional tests as the firmware assumes 40 bit physical addresses. Therefore, change the functional tests to instead run on an A400 which has the expected physical address space size.
Message-ID: <[email protected]>
--- target/hppa/cpu.c | 2 +- tests/functional/hppa/test_seabios.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
target/hppa/cpu.c +1 -1
@@ -349,7 +349,7 @@ static const TypeInfo hppa_cpu_type_infos[] = { .name = TYPE_HPPA_CPU_PA_8700, .parent = TYPE_HPPA_CPU, .class_data = &(const HPPACPUDef ) { - .phys_addr_bits =40 , + .phys_addr_bits =44 , .is_pa20 = true, }, },
tests/functional/hppa/test_seabios.py +2 -2
@@ -12,7 +12,7 @@ class HppaSeabios(QemuSystemTest): timeout = 5 - MACH_BITS = {'B160L': 32, 'C3700': 64} + MACH_BITS = {'B160L': 32, 'A400': 64} def boot_seabios(self): mach = self.machine
@@ -28,7 +28,7 @@ def test_hppa_32(self): self.boot_seabios() def test_hppa_64(self): - self.set_machine('C3700') + self.set_machine('A400') self.boot_seabios() if __name__ == '__main__':
Signature · 1 line
2.53.0
[PULL 45/49] ati-vga: Allow setting EDID parameters directly
In reply to Philippe Mathieu-DaudéFrom: BALATON Zoltan <[email protected]>
The EDID generation has some parameters that can be set via properties but since ati-vga uses i2c-ddc it is only accessible with -global option. Expose these properties so users can more easily set it via e.g. -device ati-vga,xres=1024,yres=768.
Message-ID: <[email protected]>
--- hw/display/ati_int.h | 2 ++ hw/display/ati.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-)
hw/display/ati_int.h +2 -0
@@ -13,6 +13,7 @@#include "qemu/units.h" #include "hw/pci/pci_device.h" #include "hw/i2c/bitbang_i2c.h" +#include "hw/display/i2c-ddc.h" #include "vga_int.h" #include "qom/object.h"
@@ -108,6 +109,7 @@ struct ATIVGAState {QEMUCursor *cursor;QEMUTimer vblank_timer;bitbang_i2c_interface bbi2c; +I2CDDCState i2cddc;MemoryRegion linear_aper;MemoryRegion io;MemoryRegion mm;
hw/display/ati.c +8 -5
@@ -28,7 +28,6 @@#include "qemu/error-report.h" #include "qapi/error.h" #include "ui/console.h" -#include "hw/display/i2c-ddc.h" #include "trace.h" #define ATI_DEBUG_HW_CURSOR 0
@@ -1039,6 +1038,7 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp) {ATIVGAState *s =ATI_VGA (dev);VGACommonState *vga = &s->vga; +I2CBus *i2cbus;uint64_t aper_size;#ifndef CONFIG_PIXMAN
@@ -1087,11 +1087,10 @@ static void ati_vga_realize(PCIDevice *dev, Error **errp) }/* ddc, edid */ -I2CBus *i2cbus =i2c_init_bus (DEVICE (s),"ati-vga.ddc" ); + i2cbus =i2c_init_bus (DEVICE (s),"ati-vga.ddc" );bitbang_i2c_init (&s->bbi2c, i2cbus); -I2CSlave *i2cddc =I2C_SLAVE (qdev_new (TYPE_I2CDDC )); -i2c_slave_set_address (i2cddc,0x50 ); -qdev_realize_and_unref (DEVICE (i2cddc),BUS (i2cbus), &error_abort); +i2c_slave_set_address (I2C_SLAVE (&s->i2cddc),0x50 ); +qdev_realize (DEVICE (&s->i2cddc),BUS (i2cbus), &error_abort);/* mmio register space */ memory_region_init_io(&s->mm, OBJECT(s), &ati_mm_ops, s,
@@ -1147,6 +1146,7 @@ static const Property ati_vga_properties[] = {DEFINE_PROP_BOOL ("guest_hwcursor" , ATIVGAState, cursor_guest_mode, false),/* this is a debug option, prefer PROP_UINT over PROP_BIT for simplicity */ DEFINE_PROP_UINT8 ("x-pixman" , ATIVGAState, use_pixman,DEFAULT_X_PIXMAN ), + DEFINE_EDID_PROPERTIES(ATIVGAState, i2cddc.edid_info), };static void ati_vga_class_init (ObjectClass *klass,const void *data)
@@ -1169,6 +1169,9 @@ static void ati_vga_class_init(ObjectClass *klass, const void *data)static void ati_vga_init (Object *o) { +ATIVGAState *s =ATI_VGA (o); + +object_initialize_child (o,"edid" , &s->i2cddc,TYPE_I2CDDC );object_property_set_description (o,"x-pixman" ,"Use pixman for: " "1: fill, 2: blit" ); }
Signature · 1 line
2.53.0
[PULL 47/49] audio/jack: Fix use of qemu_thread_set_name() on macOS
In reply to Philippe Mathieu-DaudéSince commit 8f68a33ad46 we get on macOS:
Audio backends
CoreAudio support : YES
PipeWire support : NO
JACK support : YES 1.9.22 ../audio/jackaudio.c:654:12: error: unused function 'qjack_thread_creator' [-Werror,-Wunused-function]
654 | static int qjack_thread_creator(jack_native_thread_t *thread,
| ^~~~~~~~~~~~~~~~~~~~
This is simply due to a missing #ifdef'ry change. Update so we can use the new qemu_thread_set_name() exposed by commit 46255cc2be9.
Message-Id: <[email protected]>
--- audio/jackaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
audio/jackaudio.c +1 -1
@@ -712,7 +712,7 @@ static const TypeInfo audio_types[] = {static void __attribute__((__constructor__))audio_jack_init (void ) {qemu_mutex_init (&qjack_shutdown_lock); -#if !defined(WIN32 ) && defined(CONFIG_PTHREAD_SETNAME_NP_W_TID ) +#if !defined(WIN32 )jack_set_thread_creator (qjack_thread_creator);#endif jack_set_error_function (qjack_error);
Signature · 1 line
2.53.0
[PULL 48/49] hw/hppa: Avoid leaking a diva-gsp device
In reply to Philippe Mathieu-DaudéFrom: Helge Deller <[email protected]>
Create a Diva-gsp unconditionally on all 64-bit PCI machines. The A400 usually comes with a Diva card. The C3700 has a built-in SUPERIO chip, which we haven't implemented yet, so running with an emulated Diva is the best we can do for now.
Message-ID: <[email protected]>
--- hw/hppa/machine.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
hw/hppa/machine.c +8 -11
@@ -382,18 +382,15 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,if (pci_bus &&hppa_is_pa20 (&cpu[0 ]->env)) {/* BMC board: HP Diva GSP PCI card */ - dev =qdev_new ("diva-gsp" ); -if (dev && !object_property_get_bool (OBJECT (dev),"disable" ,NULL )) { - pci_dev =pci_new_multifunction (PCI_DEVFN (2 ,0 ),"diva-gsp" ); -if (!lasi_dev) { -/* bind default keyboard/serial to Diva card */ -qdev_prop_set_chr (DEVICE (pci_dev),"chardev1" ,serial_hd (0 )); -qdev_prop_set_chr (DEVICE (pci_dev),"chardev2" ,serial_hd (1 )); -qdev_prop_set_chr (DEVICE (pci_dev),"chardev3" ,serial_hd (2 )); -qdev_prop_set_chr (DEVICE (pci_dev),"chardev4" ,serial_hd (3 )); - } -pci_realize_and_unref (pci_dev, pci_bus, &error_fatal); + pci_dev =pci_new_multifunction (PCI_DEVFN (2 ,0 ),"diva-gsp" ); +if (!lasi_dev) { +/* bind default keyboard/serial to Diva card */ +qdev_prop_set_chr (DEVICE (pci_dev),"chardev1" ,serial_hd (0 )); +qdev_prop_set_chr (DEVICE (pci_dev),"chardev2" ,serial_hd (1 )); +qdev_prop_set_chr (DEVICE (pci_dev),"chardev3" ,serial_hd (2 )); +qdev_prop_set_chr (DEVICE (pci_dev),"chardev4" ,serial_hd (3 )); } +pci_realize_and_unref (pci_dev, pci_bus, &error_fatal); }/* create USB OHCI controller for USB keyboard & mouse on Astro machines */
Signature · 1 line
2.53.0
[PULL 46/49] hw/m68k/mcf_intc: Use qdev input gpios for input IRQs
In reply to Philippe Mathieu-DaudéFrom: Peter Maydell <[email protected]>
The m68k mcf_intc interrupt controller currently implements its inbound IRQ lines by calling qemu_allocate_irqs() in mcf_intc_init(). This results in leaks like this:
Direct leak of 2944 byte(s) in 46 object(s) allocated from:
#0 0x5cf95ec15323 in malloc (/home/pm215/qemu/build/san/qemu-system-m68k+0xf9e323) (BuildId: 18d55ef8ea9856e68ee30802078af5050b8b06c5)
#1 0x7637c65c5ac9 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x62ac9) (BuildId: 116e142b9b52c8a4dfd403e759e71ab8f95d8bb3)
#2 0x5cf95f6b2f27 in object_new_with_type /home/pm215/qemu/build/san/../../qom/object.c:767:15
#3 0x5cf95f6aa62e in qemu_allocate_irq /home/pm215/qemu/build/san/../../hw/core/irq.c:91:25
#4 0x5cf95f6aa62e in qemu_extend_irqs /home/pm215/qemu/build/san/../../hw/core/irq.c:79:16
#5 0x5cf95f5f6d99 in mcf5208evb_init /home/pm215/qemu/build/san/../../hw/m68k/mcf5208.c:310:11This isn't an important leak, as it is memory we allocate once at QEMU startup and that has to stay live for the lifetime of the system. However it does point at a code improvement.
Modernise this to have the device itself create inbound GPIOs with qdev_init_gpio_in() that the board can then refer to and wire up individually.
As the device is used in only a single board, we can update device and board in a single patch rather than having to try to figure out some way to change the API more piecemeal.
Message-ID: <[email protected]>
--- include/hw/m68k/mcf.h | 5 ++--- hw/m68k/mcf5208.c | 24 +++++++++++------------- hw/m68k/mcf_intc.c | 8 +++----- 3 files changed, 16 insertions(+), 21 deletions(-)
include/hw/m68k/mcf.h +2 -3
@@ -14,9 +14,8 @@ DeviceState *mcf_uart_create(qemu_irq irq, Chardev *chr);DeviceState *mcf_uart_create_mmap (hwaddr base,qemu_irq irq,Chardev *chr);/* mcf_intc.c */ -qemu_irq *mcf_intc_init (struct MemoryRegion *sysmem, -hwaddr base, -M68kCPU *cpu); +DeviceState *mcf_intc_init (struct MemoryRegion *sysmem, +hwaddr base,M68kCPU *cpu);/* mcf5206.c */ #define TYPE_MCF5206_MBAR "mcf5206-mbar"
hw/m68k/mcf5208.c +11 -13
@@ -227,7 +227,7 @@ static const MemoryRegionOps m5208_rcm_ops = { .endianness = DEVICE_BIG_ENDIAN, }; -static void mcf5208_sys_init (MemoryRegion *address_space,qemu_irq *pic, +static void mcf5208_sys_init (MemoryRegion *address_space,DeviceState *intc,M68kCPU *cpu) {MemoryRegion *iomem =g_new (MemoryRegion,1 );
@@ -250,11 +250,11 @@ static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic, "m5208-timer", 0x00004000);memory_region_add_subregion (address_space,0xfc080000 +0x4000 * i, &s->iomem); - s->irq = pic[4 + i]; + s->irq =qdev_get_gpio_in (intc,4 + i); } } -static void mcf_fec_init (MemoryRegion *sysmem,hwaddr base,qemu_irq *irqs) +static void mcf_fec_init (MemoryRegion *sysmem,hwaddr base,DeviceState *intc) {DeviceState *dev;SysBusDevice *s;
@@ -268,7 +268,7 @@ static void mcf_fec_init(MemoryRegion *sysmem, hwaddr base, qemu_irq *irqs) s =SYS_BUS_DEVICE (dev);sysbus_realize_and_unref (s, &error_fatal);for (i =0 ; i <FEC_NUM_IRQ ; i++) { -sysbus_connect_irq (s, i, irqs[i]); +sysbus_connect_irq (s, i,qdev_get_gpio_in (intc, i +36 )); }memory_region_add_subregion (sysmem, base,sysbus_mmio_get_region (s,0 ));
@@ -283,10 +283,10 @@ static void mcf5208evb_init(MachineState *machine)int kernel_size;uint64_t elf_entry;hwaddr entry; -qemu_irq *pic;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *rom =g_new (MemoryRegion,1 );MemoryRegion *sram =g_new (MemoryRegion,1 ); +DeviceState *intc; cpu =M68K_CPU (cpu_create (machine->cpu_type)); env = &cpu->env;
@@ -307,17 +307,15 @@ static void mcf5208evb_init(MachineState *machine)memory_region_add_subregion (address_space_mem,0x80000000 , sram);/* Internal peripherals. */ - pic =mcf_intc_init (address_space_mem,0xfc048000 , cpu); + intc =mcf_intc_init (address_space_mem,0xfc048000 , cpu); -mcf_uart_create_mmap (0xfc060000 , pic[26 ],serial_hd (0 )); -mcf_uart_create_mmap (0xfc064000 , pic[27 ],serial_hd (1 )); -mcf_uart_create_mmap (0xfc068000 , pic[28 ],serial_hd (2 )); +mcf_uart_create_mmap (0xfc060000 ,qdev_get_gpio_in (intc,26 ),serial_hd (0 )); +mcf_uart_create_mmap (0xfc064000 ,qdev_get_gpio_in (intc,27 ),serial_hd (1 )); +mcf_uart_create_mmap (0xfc068000 ,qdev_get_gpio_in (intc,28 ),serial_hd (2 )); -mcf5208_sys_init (address_space_mem, pic, cpu); +mcf5208_sys_init (address_space_mem, intc, cpu); -mcf_fec_init (address_space_mem,0xfc030000 , pic +36 ); - -g_free (pic); +mcf_fec_init (address_space_mem,0xfc030000 , intc);/* 0xfc000000 SCM. */ /* 0xfc004000 XBS. */
hw/m68k/mcf_intc.c +3 -5
@@ -175,6 +175,7 @@ static void mcf_intc_instance_init(Object *obj)memory_region_init_io (&s->iomem, obj, &mcf_intc_ops, s,"mcf" ,0x100 );sysbus_init_mmio (SYS_BUS_DEVICE (obj), &s->iomem); +qdev_init_gpio_in (DEVICE (s), mcf_intc_set_irq,64 ); }static const Property mcf_intc_properties[] = {
@@ -206,9 +207,7 @@ static void mcf_intc_register_types(void)type_init (mcf_intc_register_types) -qemu_irq *mcf_intc_init(MemoryRegion *sysmem, -hwaddr base, -M68kCPU *cpu) +DeviceState *mcf_intc_init(MemoryRegion *sysmem, hwaddr base, M68kCPU *cpu) {DeviceState *dev;
@@ -218,6 +217,5 @@ qemu_irq *mcf_intc_init(MemoryRegion *sysmem,sysbus_realize_and_unref (SYS_BUS_DEVICE (dev), &error_fatal);memory_region_add_subregion (sysmem, base,sysbus_mmio_get_region (SYS_BUS_DEVICE (dev),0 )); - -return qemu_allocate_irqs (mcf_intc_set_irq, dev,64 ); +return dev; }
Signature · 1 line
2.53.0
[PULL 49/49] hw/char: Drop disable property of Diva GSP card
In reply to Philippe Mathieu-DaudéFrom: Helge Deller <[email protected]>
The "disable" property is not used, so drop it.
Message-ID: <[email protected]>
--- hw/char/diva-gsp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
hw/char/diva-gsp.c +2 -5
@@ -51,7 +51,6 @@ typedef struct PCIDivaSerialState {SerialState state[PCI_SERIAL_MAX_PORTS ];uint32_t level[PCI_SERIAL_MAX_PORTS ];qemu_irq *irqs; -bool disable; } PCIDivaSerialState;static void diva_pci_exit (PCIDevice *dev)
@@ -159,20 +158,18 @@ static void diva_pci_realize(PCIDevice *dev, Error **errp)static const VMStateDescription vmstate_pci_diva = { .name ="pci-diva-serial" , - .version_id =1 , - .minimum_version_id =1 , + .version_id =2 , + .minimum_version_id =2 , .fields = (const VMStateField []) {VMSTATE_PCI_DEVICE (dev, PCIDivaSerialState),VMSTATE_STRUCT_ARRAY (state, PCIDivaSerialState,PCI_SERIAL_MAX_PORTS ,0 , vmstate_serial, SerialState),VMSTATE_UINT32_ARRAY (level, PCIDivaSerialState,PCI_SERIAL_MAX_PORTS ), -VMSTATE_BOOL (disable, PCIDivaSerialState),VMSTATE_END_OF_LIST () } };static const Property diva_serial_properties[] = { -DEFINE_PROP_BOOL ("disable" , PCIDivaSerialState, disable, false),DEFINE_PROP_CHR ("chardev1" , PCIDivaSerialState, state[0 ].chr),DEFINE_PROP_CHR ("chardev2" , PCIDivaSerialState, state[1 ].chr),DEFINE_PROP_CHR ("chardev3" , PCIDivaSerialState, state[2 ].chr),
Signature · 1 line
2.53.0
Peter Maydell
AppliedQuoted 35 lines · Philippe Mathieu-Daudé
The following changes since commit
1ae4271ab8dbfbf5dc28b36baa7f3fd5fd2215e1:Merge tag 'pull-11.0-virtio-gpu-updates-060326-1' of https://gitlab.com/stsquad/qemu into staging (2026-03-07 11:22:16 +0000)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/hw-misc-20260308
for you to fetch changes up to
27c64fa59d1b14c4656908e1dfca49482a96df61:hw/char: Drop disable property of Diva GSP card (2026-03-08 23:11:14 +0100)
Following checkpatch errors ignored (first spurious, other ones pre-existing):
ERROR: "foo * bar" should be "foo *bar"
#40: FILE:hw/display/ati_2d.c:60:
+ +dst_y*surface_stride(ds),ERROR: switch and case should be at the same indent #27: FILE:
hw/net/xilinx_axienet.c:143:switch (regnum) {(quoted diff) +2
-0+ case 2: + case 3:ERROR: braces {} are necessary for all arms of this statement #43: FILE:
hw/char/serial.c:164:
+ if (s->lcr&UART_LCR_EPS)
[...]
else
[...]----------------------------------------------------------------
Misc HW patches
Quoted 8 lines
- Remove versioned machines released in QEMU 3.0
- Build various stubs and ACPI objects once
- Pair of bug fixes in ATI VGA model
- Cleanups in 16550A UART model
- Clarify PA-RISC CPU models (adding the PA-8500)
- Various memory leaks / overflows fixed
-MAINTAINERSupdates
----------------------------------------------------------------
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/11.0
for any user-visible changes.
-- PMM