Skip to content

Commit ed1d873

Browse files
committed
Merge tag 'misc-cpus-20231107' of https://github.com/philmd/qemu into staging
Misc hardware patch queue HW emulation: - PMBus fixes and tests (Titus) - IDE fixes and tests (Fiona) - New ADM1266 sensor (Titus) - Better error propagation in PCI-ISA i82378 (Philippe) - Declare SD model QOM types using DEFINE_TYPES macro (Philippe) Topology: - Fix CPUState::nr_cores calculation (Zhuocheng Ding and Zhao Liu) Monitor: - Synchronize CPU state in 'info lapic' (Dongli Zhang) QOM: - Have 'cpu-qom.h' target-agnostic (Philippe) - Move ArchCPUClass definition to each target's cpu.h (Philippe) - Call object_class_is_abstract once in cpu_class_by_name (Philippe) UI: - Use correct key names in titles on MacOS / SDL2 (Adrian) MIPS: - Fix MSA BZ/BNZ and TX79 LQ/SQ opcodes (Philippe) Nios2: - Create IRQs *after* vCPU is realized (Philippe) PPC: - Restrict KVM objects to system emulation (Philippe) - Move target-specific definitions out of 'cpu-qom.h' (Philippe) S390X: - Make hw/s390x/css.h and hw/s390x/sclp.h headers target agnostic (Philippe) X86: - HVF & KVM cleanups (Philippe) Various targets: - Use env_archcpu() to optimize (Philippe) Misc: - Few global variable shadowing removed (Philippe) - Introduce cpu_exec_reset_hold and factor tcg_cpu_reset_hold out (Philippe) - Remove few more 'softmmu' mentions (Philippe) - Fix and cleanup in vl.c (Akihiko & Marc-André) - Resource leak fix in dump (Zongmin Zhou) - MAINTAINERS updates (Thomas, Daniel) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmVKKmEACgkQ4+MsLN6t # wN4xHQ//X/enH4C7K3VP/tSinDiwmXN2o61L9rjqSDQkBaCtktZx4c8qKSDL7V4S # vwzmvvBn3biMXQwZNVJo9d0oz2qoaF9tI6Ao0XDHAan9ziagfG9YMqWhkCfj077Q # jLdCqkUuMJBvQgXGB1a6UgCme8PQx7h0oqjbCNfB0ZBls24b5DiEjO87LE4OTbTi # zKRhYEpZpGwIVcy+1dAsbaBpGFP06sr1doB9Wz4c06eSx7t0kFSPk6U4CyOPrGXh # ynyCxPwngxIXmarY8gqPs3SBs7oXsH8Q/ZOHr1LbuXhwSuw/0zBQU9aF7Ir8RPan # DB79JjPrtxTAhICKredWT79v9M18D2/1MpONgg4vtx5K2FzGYoAJULCHyfkHMRSM # L6/H0ZQPHvf7w72k9EcSQIhd0wPlMqRmfy37/8xcLiw1h4l/USx48QeKaeFWeSEu # DgwSk+R61HbrKvQz/U0tF98zUEyBaQXNrKmyzht0YE4peAtpbPNBeRHkd0GMae/Z # HOmkt8QlFQ0T14qSK7mSHaSJTUzRvFGD01cbuCDxVsyCWWsesEikXBACZLG5RCRY # Rn1WeX1H9eE3kKi9iueLnhzcF9yM5XqFE3f6RnDzY8nkg91lsTMSQgFcIpv6uGyp # 3WOTNSC9SoFyI3x8pCWiKOGytPUb8xk+PnOA85wYvVmT+7j6wus= # =OVdQ # -----END PGP SIGNATURE----- # gpg: Signature made Tue 07 Nov 2023 20:15:29 HKT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full] # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'misc-cpus-20231107' of https://github.com/philmd/qemu: (75 commits) dump: Add close fd on error return to avoid resource leak ui/sdl2: use correct key names in win title on mac MAINTAINERS: Add more guest-agent related files to the corresponding section MAINTAINERS: Add include/hw/xtensa/mx_pic.h to the XTFPGA machine section MAINTAINERS: update libvirt devel mailing list address MAINTAINERS: Add the CAN documentation file to the CAN section MAINTAINERS: Add include/hw/timer/tmu012.h to the SH4 R2D section hw/sd: Declare QOM types using DEFINE_TYPES() macro hw/i2c: pmbus: reset page register for out of range reads hw/i2c: pmbus: immediately clear faults on request tests/qtest: add tests for ADM1266 hw/sensor: add ADM1266 device model hw/i2c: pmbus: add VCAP register hw/i2c: pmbus: add fan support hw/i2c: pmbus: add vout mode bitfields hw/i2c: pmbus add support for block receive tests/qtest: ahci-test: add test exposing reset issue with pending callback hw/ide: reset: cancel async DMA operation before resetting state hw/cpu: Update the comments of nr_cores and nr_dies system/cpus: Fix CPUState.nr_cores' calculation ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2 parents 462ad01 + 95a40c4 commit ed1d873

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1723
-1086
lines changed

MAINTAINERS

+9-3
Original file line numberDiff line numberDiff line change
@@ -859,8 +859,10 @@ M: Hao Wu <wuhaotsh@google.com>
859859
L: qemu-arm@nongnu.org
860860
S: Supported
861861
F: hw/*/npcm*
862+
F: hw/sensor/adm1266.c
862863
F: include/hw/*/npcm*
863864
F: tests/qtest/npcm*
865+
F: tests/qtest/adm1266-test.c
864866
F: pc-bios/npcm7xx_bootrom.bin
865867
F: roms/vbootrom
866868
F: docs/system/arm/nuvoton.rst
@@ -1615,6 +1617,7 @@ F: hw/intc/sh_intc.c
16151617
F: hw/pci-host/sh_pci.c
16161618
F: hw/timer/sh_timer.c
16171619
F: include/hw/sh4/sh_intc.h
1620+
F: include/hw/timer/tmu012.h
16181621

16191622
Shix
16201623
R: Yoshinori Sato <ysato@users.sourceforge.jp>
@@ -1772,7 +1775,7 @@ F: include/hw/southbridge/ich9.h
17721775
F: include/hw/southbridge/piix.h
17731776
F: hw/isa/apm.c
17741777
F: include/hw/isa/apm.h
1775-
F: tests/unit/test-x86-cpuid.c
1778+
F: tests/unit/test-x86-topo.c
17761779
F: tests/qtest/test-x86-cpuid-compat.c
17771780

17781781
PC Chipset
@@ -1858,6 +1861,7 @@ M: Max Filippov <jcmvbkbc@gmail.com>
18581861
S: Maintained
18591862
F: hw/xtensa/xtfpga.c
18601863
F: hw/net/opencores_eth.c
1864+
F: include/hw/xtensa/mx_pic.h
18611865

18621866
Devices
18631867
-------
@@ -2594,6 +2598,7 @@ W: https://canbus.pages.fel.cvut.cz/
25942598
F: net/can/*
25952599
F: hw/net/can/*
25962600
F: include/net/can_*.h
2601+
F: docs/system/devices/can.rst
25972602

25982603
OpenPIC interrupt controller
25992604
M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
@@ -3149,10 +3154,11 @@ M: Michael Roth <michael.roth@amd.com>
31493154
M: Konstantin Kostiuk <kkostiuk@redhat.com>
31503155
S: Maintained
31513156
F: qga/
3157+
F: contrib/systemd/qemu-guest-agent.service
31523158
F: docs/interop/qemu-ga.rst
31533159
F: docs/interop/qemu-ga-ref.rst
31543160
F: scripts/qemu-guest-agent/
3155-
F: tests/unit/test-qga.c
3161+
F: tests/*/test-qga*
31563162
T: git https://github.com/mdroth/qemu.git qga
31573163

31583164
QEMU Guest Agent Win32
@@ -4062,7 +4068,7 @@ F: gitdm.config
40624068
F: contrib/gitdm/*
40634069

40644070
Incompatible changes
4065-
R: libvir-list@redhat.com
4071+
R: devel@lists.libvirt.org
40664072
F: docs/about/deprecated.rst
40674073

40684074
Build System

accel/stubs/tcg-stub.c

-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ void tlb_set_dirty(CPUState *cpu, vaddr vaddr)
2222
{
2323
}
2424

25-
void tcg_flush_jmp_cache(CPUState *cpu)
26-
{
27-
}
28-
2925
int probe_access_flags(CPUArchState *env, vaddr addr, int size,
3026
MMUAccessType access_type, int mmu_idx,
3127
bool nonfault, void **phost, uintptr_t retaddr)

accel/tcg/cputlb.c

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "exec/memory.h"
2525
#include "exec/cpu_ldst.h"
2626
#include "exec/cputlb.h"
27+
#include "exec/tb-flush.h"
2728
#include "exec/memory-internal.h"
2829
#include "exec/ram_addr.h"
2930
#include "tcg/tcg.h"

accel/tcg/tcg-accel-ops.c

+9
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "qemu/timer.h"
3535
#include "exec/exec-all.h"
3636
#include "exec/hwaddr.h"
37+
#include "exec/tb-flush.h"
3738
#include "exec/gdbstub.h"
3839

3940
#include "tcg-accel-ops.h"
@@ -77,6 +78,13 @@ int tcg_cpus_exec(CPUState *cpu)
7778
return ret;
7879
}
7980

81+
static void tcg_cpu_reset_hold(CPUState *cpu)
82+
{
83+
tcg_flush_jmp_cache(cpu);
84+
85+
tlb_flush(cpu);
86+
}
87+
8088
/* mask must never be zero, except for A20 change call */
8189
void tcg_handle_interrupt(CPUState *cpu, int mask)
8290
{
@@ -205,6 +213,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops)
205213
}
206214
}
207215

216+
ops->cpu_reset_hold = tcg_cpu_reset_hold;
208217
ops->supports_guest_debug = tcg_supports_guest_debug;
209218
ops->insert_breakpoint = tcg_insert_breakpoint;
210219
ops->remove_breakpoint = tcg_remove_breakpoint;

accel/tcg/translate-all.c

-8
Original file line numberDiff line numberDiff line change
@@ -673,11 +673,3 @@ void tcg_flush_jmp_cache(CPUState *cpu)
673673
qatomic_set(&jc->array[i].tb, NULL);
674674
}
675675
}
676-
677-
/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */
678-
void tcg_flush_softmmu_tlb(CPUState *cs)
679-
{
680-
#ifdef CONFIG_SOFTMMU
681-
tlb_flush(cs);
682-
#endif
683-
}

accel/tcg/user-exec-stub.c

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ void qemu_init_vcpu(CPUState *cpu)
1414
{
1515
}
1616

17+
void cpu_exec_reset_hold(CPUState *cpu)
18+
{
19+
}
20+
1721
/* User mode emulation does not support record/replay yet. */
1822

1923
bool replay_exception(void)

bsd-user/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void fork_end(int child)
118118
*/
119119
CPU_FOREACH_SAFE(cpu, next_cpu) {
120120
if (cpu != thread_cpu) {
121-
QTAILQ_REMOVE_RCU(&cpus, cpu, node);
121+
QTAILQ_REMOVE_RCU(&cpus_queue, cpu, node);
122122
}
123123
}
124124
mmap_fork_end(child);

cpu-common.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ static int cpu_get_free_index(void)
7373
return max_cpu_index;
7474
}
7575

76-
CPUTailQ cpus = QTAILQ_HEAD_INITIALIZER(cpus);
76+
CPUTailQ cpus_queue = QTAILQ_HEAD_INITIALIZER(cpus_queue);
7777
static unsigned int cpu_list_generation_id;
7878

7979
unsigned int cpu_list_generation_id_get(void)
@@ -90,7 +90,7 @@ void cpu_list_add(CPUState *cpu)
9090
} else {
9191
assert(!cpu_index_auto_assigned);
9292
}
93-
QTAILQ_INSERT_TAIL_RCU(&cpus, cpu, node);
93+
QTAILQ_INSERT_TAIL_RCU(&cpus_queue, cpu, node);
9494
cpu_list_generation_id++;
9595
}
9696

@@ -102,7 +102,7 @@ void cpu_list_remove(CPUState *cpu)
102102
return;
103103
}
104104

105-
QTAILQ_REMOVE_RCU(&cpus, cpu, node);
105+
QTAILQ_REMOVE_RCU(&cpus_queue, cpu, node);
106106
cpu->cpu_index = UNASSIGNED_CPU_INDEX;
107107
cpu_list_generation_id++;
108108
}

cpu-target.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ const VMStateDescription vmstate_cpu_common = {
131131
};
132132
#endif
133133

134-
void cpu_exec_realizefn(CPUState *cpu, Error **errp)
134+
bool cpu_exec_realizefn(CPUState *cpu, Error **errp)
135135
{
136136
/* cache the cpu class for the hotpath */
137137
cpu->cc = CPU_GET_CLASS(cpu);
138138

139139
if (!accel_cpu_common_realize(cpu, errp)) {
140-
return;
140+
return false;
141141
}
142142

143143
/* Wait until cpu initialization complete before exposing cpu. */
@@ -159,6 +159,8 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp)
159159
vmstate_register(NULL, cpu->cpu_index, cpu->cc->sysemu_ops->legacy_vmsd, cpu);
160160
}
161161
#endif /* CONFIG_USER_ONLY */
162+
163+
return true;
162164
}
163165

164166
void cpu_exec_unrealizefn(CPUState *cpu)

dump/dump.c

+1
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,7 @@ void qmp_dump_guest_memory(bool paging, const char *protocol,
21602160
return;
21612161
}
21622162
if (kdump_raw && lseek(fd, 0, SEEK_CUR) == (off_t) -1) {
2163+
close(fd);
21632164
error_setg(errp, "kdump-raw formats require a seekable file");
21642165
return;
21652166
}

hw/arm/Kconfig

+1
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ config NPCM7XX
491491
default y
492492
depends on TCG && ARM
493493
select A9MPCORE
494+
select ADM1266
494495
select ADM1272
495496
select ARM_GIC
496497
select SMBUS

hw/core/cpu-common.c

+13-8
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ static void cpu_common_reset_hold(Object *obj)
136136
cpu->crash_occurred = false;
137137
cpu->cflags_next_tb = -1;
138138

139-
if (tcg_enabled()) {
140-
tcg_flush_jmp_cache(cpu);
141-
tcg_flush_softmmu_tlb(cpu);
142-
}
139+
cpu_exec_reset_hold(cpu);
143140
}
144141

145142
static bool cpu_common_has_work(CPUState *cs)
@@ -149,10 +146,18 @@ static bool cpu_common_has_work(CPUState *cs)
149146

150147
ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model)
151148
{
152-
CPUClass *cc = CPU_CLASS(object_class_by_name(typename));
153-
154-
assert(cpu_model && cc->class_by_name);
155-
return cc->class_by_name(cpu_model);
149+
ObjectClass *oc;
150+
CPUClass *cc;
151+
152+
oc = object_class_by_name(typename);
153+
cc = CPU_CLASS(oc);
154+
assert(cc->class_by_name);
155+
assert(cpu_model);
156+
oc = cc->class_by_name(cpu_model);
157+
if (oc == NULL || object_class_is_abstract(oc)) {
158+
return NULL;
159+
}
160+
return oc;
156161
}
157162

158163
static void cpu_common_parse_features(const char *typename, char *features,

hw/core/loader.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ static void *rom_set_mr(Rom *rom, Object *owner, const char *name, bool ro)
10701070

10711071
ssize_t rom_add_file(const char *file, const char *fw_dir,
10721072
hwaddr addr, int32_t bootindex,
1073-
bool option_rom, MemoryRegion *mr,
1073+
bool has_option_rom, MemoryRegion *mr,
10741074
AddressSpace *as)
10751075
{
10761076
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
@@ -1139,7 +1139,7 @@ ssize_t rom_add_file(const char *file, const char *fw_dir,
11391139
basename);
11401140
snprintf(devpath, sizeof(devpath), "/rom@%s", fw_file_name);
11411141

1142-
if ((!option_rom || mc->option_rom_has_mr) && mc->rom_file_has_mr) {
1142+
if ((!has_option_rom || mc->option_rom_has_mr) && mc->rom_file_has_mr) {
11431143
data = rom_set_mr(rom, OBJECT(fw_cfg), devpath, true);
11441144
} else {
11451145
data = rom->data;

0 commit comments

Comments
 (0)