Skip to content

Commit 712f715

Browse files
committed
Merge tag 'hw-misc-20241203' of https://github.com/philmd/qemu into staging
Misc fixes for QEMU v9.2.0 # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmdO66kACgkQ4+MsLN6t # wN4dGw//ZSVZO/cdOc1izC44mCPjnHkhSjX5i12E09QnDfNQ9cef2pG50lsndm3N # xJwunST+Hqfoh07YT4zuGSO+60BiiPsPse+ytnuHK0E4wLbIfrWzPcf1CMRDk3wf # O4IniCv8O7BRYccK1iPkFI8ZVqK84m3Bn1tQ51LOy09b6om7jIqNwlxWxGYqkWCR # l+9RxW/IKWD3OrveBATEhD1lwoUBIYPPzdm6NayEdOJXGOgnvbNbtmuRCR8dCxCS # RUH3GZu0vvRTpOYjFzeR9Xy+CE1vcOeKsZf35QwV4eX8+UKv30HgF6J8fInkS60m # EqPA+AU7fi+DN3Ua1Jx38wXHPr8mPTQoVGV6q0UB8b3B22kPQn+Mu8jHLyMOp4rK # 6JEX5cAOZuwBEk0I8VjwqeDGVYgFwnMHhVuss0N4kCvP0qQcC2JMGMW0Rk4Lxw16 # q0kwbQ0c56+qET57EOf9VW40Yb1q3Zu9t39XfNO/m3KGLkVSPfFZEu5voWD14mZW # RutPlG/ww3n878Xz06YsqYF0ED/0SiW8U1tmEzg+X9vA/7Z7/0MH0rleNb36a0Fs # 0aDq/mZBcnFLKy+9rlpy18OolY/N6LZnebCpdQe5wSRn/ioWDc4/GyIaLO9lSE5o # TFHmGtIIQ2FoeRgtwCSfVNwaA6ILgPRsgXFDOqxCUplgKv6GX2Q= # =GZ/H # -----END PGP SIGNATURE----- # gpg: Signature made Tue 03 Dec 2024 11:29:45 GMT # gpg: using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE # gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <[email protected]>" [full] # Primary key fingerprint: FAAB E75E 1291 7221 DCFD 6BB2 E3E3 2C2C DEAD C0DE * tag 'hw-misc-20241203' of https://github.com/philmd/qemu: system: Select HVF by default when no other accelerator is available tests/qtest: add test for querying balloon guest stats tests/qtest: drop 'fuzz-' prefix from virtio-balloon test hw/virtio: fix crash in processing balloon stats hw/display/vga: Do not reset 'big_endian_fb' in vga_common_reset() target/riscv: Avoid bad shift in riscv_cpu_do_interrupt() hw/core/machine: diagnose wrapping of maxmem MAINTAINERS: update email addr for Brian Cain meson: Add missing SDL dependency to system/main.c MAINTAINERS: add myself as the maintainer for LoongArch VirtMachine ui/cocoa: Temporarily ignore annoying deprecated declaration warnings hw/openrisc/openrisc_sim: keep serial@90000000 as default hw/openrisc: Fixed undercounting of TTCR in continuous mode Signed-off-by: Peter Maydell <[email protected]>
2 parents b733701 + 964d2a0 commit 712f715

File tree

12 files changed

+102
-48
lines changed

12 files changed

+102
-48
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Aleksandar Rikalo <[email protected]> <[email protected]>
7575
7676
7777
Anthony Liguori <[email protected]> Anthony Liguori <[email protected]>
78+
79+
7880
Christian Borntraeger <[email protected]> <[email protected]>
7981
8082

MAINTAINERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ F: target/avr/
226226
F: tests/functional/test_avr_mega2560.py
227227

228228
Hexagon TCG CPUs
229-
M: Brian Cain <bcain@quicinc.com>
229+
M: Brian Cain <bcain@oss.qualcomm.com>
230230
S: Supported
231231
F: target/hexagon/
232232
X: target/hexagon/idef-parser/
@@ -1199,6 +1199,7 @@ LoongArch Machines
11991199
------------------
12001200
Virt
12011201
M: Song Gao <[email protected]>
1202+
M: Bibo Mao <[email protected]>
12021203
R: Jiaxun Yang <[email protected]>
12031204
S: Maintained
12041205
F: docs/system/loongarch/virt.rst
@@ -2227,6 +2228,7 @@ F: hw/virtio/virtio-balloon*.c
22272228
F: include/hw/virtio/virtio-balloon.h
22282229
F: system/balloon.c
22292230
F: include/sysemu/balloon.h
2231+
F: tests/qtest/virtio-balloon-test.c
22302232

22312233
virtio-9p
22322234
M: Greg Kurz <[email protected]>

hw/core/machine.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,19 @@ static void machine_set_mem(Object *obj, Visitor *v, const char *name,
598598
mem->size = mc->fixup_ram_size(mem->size);
599599
}
600600
if ((ram_addr_t)mem->size != mem->size) {
601-
error_setg(errp, "ram size too large");
601+
error_setg(errp, "ram size %llu exceeds permitted maximum %llu",
602+
(unsigned long long)mem->size,
603+
(unsigned long long)RAM_ADDR_MAX);
602604
goto out_free;
603605
}
604606

605607
if (mem->has_max_size) {
608+
if ((ram_addr_t)mem->max_size != mem->max_size) {
609+
error_setg(errp, "ram size %llu exceeds permitted maximum %llu",
610+
(unsigned long long)mem->max_size,
611+
(unsigned long long)RAM_ADDR_MAX);
612+
goto out_free;
613+
}
606614
if (mem->max_size < mem->size) {
607615
error_setg(errp, "invalid value of maxmem: "
608616
"maximum memory size (0x%" PRIx64 ") must be at least "

hw/display/vga.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,6 @@ void vga_common_reset(VGACommonState *s)
18731873
s->cursor_start = 0;
18741874
s->cursor_end = 0;
18751875
s->cursor_offset = 0;
1876-
s->big_endian_fb = s->default_endian_fb;
18771876
memset(s->invalidated_y_table, '\0', sizeof(s->invalidated_y_table));
18781877
memset(s->last_palette, '\0', sizeof(s->last_palette));
18791878
memset(s->last_ch_attr, '\0', sizeof(s->last_ch_attr));
@@ -2266,6 +2265,7 @@ bool vga_common_init(VGACommonState *s, Object *obj, Error **errp)
22662265
* all target endian dependencies from this file.
22672266
*/
22682267
s->default_endian_fb = target_words_bigendian();
2268+
s->big_endian_fb = s->default_endian_fb;
22692269

22702270
vga_dirty_log_start(s);
22712271

hw/virtio/virtio-balloon.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,33 @@ static void balloon_deflate_page(VirtIOBalloon *balloon,
167167
}
168168
}
169169

170+
/*
171+
* All stats upto VIRTIO_BALLOON_S_NR /must/ have a
172+
* non-NULL name declared here, since these are used
173+
* as keys for populating the QDict with stats
174+
*/
170175
static const char *balloon_stat_names[] = {
171176
[VIRTIO_BALLOON_S_SWAP_IN] = "stat-swap-in",
172177
[VIRTIO_BALLOON_S_SWAP_OUT] = "stat-swap-out",
173178
[VIRTIO_BALLOON_S_MAJFLT] = "stat-major-faults",
174179
[VIRTIO_BALLOON_S_MINFLT] = "stat-minor-faults",
175180
[VIRTIO_BALLOON_S_MEMFREE] = "stat-free-memory",
181+
176182
[VIRTIO_BALLOON_S_MEMTOT] = "stat-total-memory",
177183
[VIRTIO_BALLOON_S_AVAIL] = "stat-available-memory",
178184
[VIRTIO_BALLOON_S_CACHES] = "stat-disk-caches",
179185
[VIRTIO_BALLOON_S_HTLB_PGALLOC] = "stat-htlb-pgalloc",
180186
[VIRTIO_BALLOON_S_HTLB_PGFAIL] = "stat-htlb-pgfail",
181-
[VIRTIO_BALLOON_S_NR] = NULL
187+
188+
[VIRTIO_BALLOON_S_OOM_KILL] = "stat-oom-kills",
189+
[VIRTIO_BALLOON_S_ALLOC_STALL] = "stat-alloc-stalls",
190+
[VIRTIO_BALLOON_S_ASYNC_SCAN] = "stat-async-scans",
191+
[VIRTIO_BALLOON_S_DIRECT_SCAN] = "stat-direct-scans",
192+
[VIRTIO_BALLOON_S_ASYNC_RECLAIM] = "stat-async-reclaims",
193+
194+
[VIRTIO_BALLOON_S_DIRECT_RECLAIM] = "stat-direct-reclaims",
182195
};
196+
G_STATIC_ASSERT(G_N_ELEMENTS(balloon_stat_names) == VIRTIO_BALLOON_S_NR);
183197

184198
/*
185199
* reset_stats - Mark all items in the stats array as unset

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4235,14 +4235,14 @@ foreach target : target_dirs
42354235
'name': 'qemu-system-' + target_name,
42364236
'win_subsystem': 'console',
42374237
'sources': files('system/main.c'),
4238-
'dependencies': []
4238+
'dependencies': [sdl]
42394239
}]
42404240
if host_os == 'windows' and (sdl.found() or gtk.found())
42414241
execs += [{
42424242
'name': 'qemu-system-' + target_name + 'w',
42434243
'win_subsystem': 'windows',
42444244
'sources': files('system/main.c'),
4245-
'dependencies': []
4245+
'dependencies': [sdl]
42464246
}]
42474247
endif
42484248
if get_option('fuzzing')

system/vl.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,7 @@ static void configure_accelerators(const char *progname)
23622362
/* Select the default accelerator */
23632363
bool have_tcg = accel_find("tcg");
23642364
bool have_kvm = accel_find("kvm");
2365+
bool have_hvf = accel_find("hvf");
23652366

23662367
if (have_tcg && have_kvm) {
23672368
if (g_str_has_suffix(progname, "kvm")) {
@@ -2374,6 +2375,8 @@ static void configure_accelerators(const char *progname)
23742375
accelerators = "kvm";
23752376
} else if (have_tcg) {
23762377
accelerators = "tcg";
2378+
} else if (have_hvf) {
2379+
accelerators = "hvf";
23772380
} else {
23782381
error_report("No accelerator selected and"
23792382
" no default accelerator available");

target/riscv/cpu_helper.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,10 +1802,10 @@ void riscv_cpu_do_interrupt(CPUState *cs)
18021802
bool async = !!(cs->exception_index & RISCV_EXCP_INT_FLAG);
18031803
target_ulong cause = cs->exception_index & RISCV_EXCP_INT_MASK;
18041804
uint64_t deleg = async ? env->mideleg : env->medeleg;
1805-
bool s_injected = env->mvip & (1 << cause) & env->mvien &&
1806-
!(env->mip & (1 << cause));
1807-
bool vs_injected = env->hvip & (1 << cause) & env->hvien &&
1808-
!(env->mip & (1 << cause));
1805+
bool s_injected = env->mvip & (1ULL << cause) & env->mvien &&
1806+
!(env->mip & (1ULL << cause));
1807+
bool vs_injected = env->hvip & (1ULL << cause) & env->hvien &&
1808+
!(env->mip & (1ULL << cause));
18091809
target_ulong tval = 0;
18101810
target_ulong tinst = 0;
18111811
target_ulong htval = 0;

tests/qtest/fuzz-virtio-balloon-test.c

Lines changed: 0 additions & 37 deletions
This file was deleted.

tests/qtest/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ qtests_i386 = \
8888
(config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
8989
(config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
9090
(config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
91-
(config_all_devices.has_key('CONFIG_VIRTIO_BALLOON') ? ['fuzz-virtio-balloon-test'] : []) + \
91+
(config_all_devices.has_key('CONFIG_VIRTIO_BALLOON') ? ['virtio-balloon-test'] : []) + \
9292
(config_all_devices.has_key('CONFIG_Q35') ? ['q35-test'] : []) + \
9393
(config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
9494
(config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \

0 commit comments

Comments
 (0)