Skip to content

Commit 3f2a357

Browse files
committed
Merge tag 'hw-cpus-20240119' of https://github.com/philmd/qemu into staging
HW core patch queue . Deprecate unmaintained SH-4 models (Samuel) . HPET: Convert DPRINTF calls to trace events (Daniel) . Implement buffered block writes in Intel PFlash (Gerd) . Ignore ELF loadable segments with zero size (Bin) . ESP/NCR53C9x: PCI DMA fixes (Mark) . PIIX: Simplify Xen PCI IRQ routing (Bernhard) . Restrict CPU 'start-powered-off' property to sysemu (Phil) . target/alpha: Only build sys_helper.c on system emulation (Phil) . target/xtensa: Use generic instruction breakpoint API & add test (Max) . Restrict icount to system emulation (Phil) . Do not set CPUState TCG-specific flags in non-TCG accels (Phil) . Cleanup TCG tb_invalidate API (Phil) . Correct LoongArch/KVM include path (Bibo) . Do not ignore throttle errors in crypto backends (Phil) . MAINTAINERS updates (Raphael, Zhao) # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmWqXbkACgkQ4+MsLN6t # wN6VVBAAkP/Bs2JfQYobPZVV868wceM97KeUJMXP2YWf6dSLpHRCQN5KtuJcACM9 # y3k3R7nMeVJSGmzl/1gF1G9JhjoCLoVLX/ejeBppv4Wq//9sEdggaQfdCwkhWw2o # IK/gPjTZpimE7Er4hPlxmuhSRuM1MX4duKFRRfuZpE7XY14Y7/Hk12VIG7LooO0x # 2Sl8CaU0DN7CWmRVDoUkwVx7JBy28UVarRDsgpBim7oKmjjBFnCJkH6B6NJXEiYr # z1BmIcHa87S09kG1ek+y8aZpG9iPC7nUWjPIQyJGhnfrnBuO7hQHwCLIjHHp5QBR # BoMr8YQNTI34/M/D8pBfg96LrGDjkQOfwRyRddkMP/jJcNPMAPMNGbfVaIrfij1e # T+jFF4gQenOvy1XKCY3Uk/a11P3tIRFBEeOlzzQg4Aje9W2MhUNwK2HTlRfBbrRr # V30R764FDmHlsyOu6/E3jqp4GVCgryF1bglPOBjVEU5uytbQTP8jshIpGVnxBbF+ # OpFwtsoDbsousNKVcO5+B0mlHcB9Ru9h11M5/YD/jfLMk95Ga90JGdgYpqQ5tO5Y # aqQhKfCKbfgKuKhysxpsdWAwHZzVrlSf+UrObF0rl2lMXXfcppjCqNaw4QJ0oedc # DNBxTPcCE2vWhUzP3A60VH7jLh4nLaqSTrxxQKkbx+Je1ERGrxs= # =KmQh # -----END PGP SIGNATURE----- # gpg: Signature made Fri 19 Jan 2024 11:32:09 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-cpus-20240119' of https://github.com/philmd/qemu: (36 commits) configure: Add linux header compile support for LoongArch MAINTAINERS: Update hw/core/cpu.c entry MAINTAINERS: Update Raphael Norwitz email hw/elf_ops: Ignore loadable segments with zero size hw/scsi/esp-pci: set DMA_STAT_BCMBLT when BLAST command issued hw/scsi/esp-pci: synchronise setting of DMA_STAT_DONE with ESP completion interrupt hw/scsi/esp-pci: generate PCI interrupt from separate ESP and PCI sources hw/scsi/esp-pci: use correct address register for PCI DMA transfers target/riscv: Rename tcg_cpu_FOO() to include 'riscv' target/i386: Rename tcg_cpu_FOO() to include 'x86' hw/s390x: Rename cpu_class_init() to include 'sclp' hw/core/cpu: Rename cpu_class_init() to include 'common' accel: Rename accel_init_ops_interfaces() to include 'system' cpus: Restrict 'start-powered-off' property to system emulation system/watchpoint: Move TCG specific code to accel/tcg/ system/replay: Restrict icount to system emulation hw/pflash: implement update buffer for block writes hw/pflash: use ldn_{be,le}_p and stn_{be,le}_p hw/pflash: refactor pflash_data_write() hw/i386/pc_piix: Make piix_intx_routing_notifier_xen() more device independent ... Signed-off-by: Peter Maydell <[email protected]>
2 parents e566fb8 + 7ec5d7d commit 3f2a357

Some content is hidden

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

50 files changed

+605
-522
lines changed

MAINTAINERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,8 @@ M: Marcel Apfelbaum <[email protected]>
18671867
R: Philippe Mathieu-Daudé <[email protected]>
18681868
R: Yanan Wang <[email protected]>
18691869
S: Supported
1870-
F: hw/core/cpu.c
1870+
F: hw/core/cpu-common.c
1871+
F: hw/core/cpu-sysemu.c
18711872
F: hw/core/machine-qmp-cmds.c
18721873
F: hw/core/machine.c
18731874
F: hw/core/machine-smp.c
@@ -2555,7 +2556,7 @@ F: include/hw/virtio/virtio-gpu.h
25552556
F: docs/system/devices/virtio-gpu.rst
25562557

25572558
vhost-user-blk
2558-
M: Raphael Norwitz <raphael.norwitz@nutanix.com>
2559+
M: Raphael Norwitz <raphael.s.norwitz@gmail.com>
25592560
S: Maintained
25602561
F: contrib/vhost-user-blk/
25612562
F: contrib/vhost-user-scsi/

accel/accel-system.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void accel_setup_post(MachineState *ms)
6262
}
6363

6464
/* initialize the arch-independent accel operation interfaces */
65-
void accel_init_ops_interfaces(AccelClass *ac)
65+
void accel_system_init_ops_interfaces(AccelClass *ac)
6666
{
6767
const char *ac_name;
6868
char *ops_name;

accel/accel-system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
#ifndef ACCEL_SYSTEM_H
1111
#define ACCEL_SYSTEM_H
1212

13-
void accel_init_ops_interfaces(AccelClass *ac);
13+
void accel_system_init_ops_interfaces(AccelClass *ac);
1414

1515
#endif /* ACCEL_SYSTEM_H */

accel/accel-target.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ static void accel_init_cpu_interfaces(AccelClass *ac)
104104
void accel_init_interfaces(AccelClass *ac)
105105
{
106106
#ifndef CONFIG_USER_ONLY
107-
accel_init_ops_interfaces(ac);
107+
accel_system_init_ops_interfaces(ac);
108108
#endif /* !CONFIG_USER_ONLY */
109109

110110
accel_init_cpu_interfaces(ac);

accel/dummy-cpus.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ static void *dummy_cpu_thread_fn(void *arg)
2727
bql_lock();
2828
qemu_thread_get_self(cpu->thread);
2929
cpu->thread_id = qemu_get_thread_id();
30-
cpu->neg.can_do_io = true;
3130
current_cpu = cpu;
3231

3332
#ifndef _WIN32

accel/hvf/hvf-accel-ops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ static void *hvf_cpu_thread_fn(void *arg)
428428
qemu_thread_get_self(cpu->thread);
429429

430430
cpu->thread_id = qemu_get_thread_id();
431-
cpu->neg.can_do_io = true;
432431
current_cpu = cpu;
433432

434433
hvf_init_vcpu(cpu);

accel/kvm/kvm-accel-ops.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ static void *kvm_vcpu_thread_fn(void *arg)
3636
bql_lock();
3737
qemu_thread_get_self(cpu->thread);
3838
cpu->thread_id = qemu_get_thread_id();
39-
cpu->neg.can_do_io = true;
4039
current_cpu = cpu;
4140

4241
r = kvm_init_vcpu(cpu, &error_fatal);

accel/tcg/icount-common.c

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,19 @@ static bool icount_sleep = true;
4949
/* Arbitrarily pick 1MIPS as the minimum allowable speed. */
5050
#define MAX_ICOUNT_SHIFT 10
5151

52-
/*
53-
* 0 = Do not count executed instructions.
54-
* 1 = Fixed conversion of insn to ns via "shift" option
55-
* 2 = Runtime adaptive algorithm to compute shift
56-
*/
57-
int use_icount;
52+
/* Do not count executed instructions */
53+
ICountMode use_icount = ICOUNT_DISABLED;
5854

5955
static void icount_enable_precise(void)
6056
{
61-
use_icount = 1;
57+
/* Fixed conversion of insn to ns via "shift" option */
58+
use_icount = ICOUNT_PRECISE;
6259
}
6360

6461
static void icount_enable_adaptive(void)
6562
{
66-
use_icount = 2;
63+
/* Runtime adaptive algorithm to compute shift */
64+
use_icount = ICOUNT_ADAPTATIVE;
6765
}
6866

6967
/*
@@ -256,7 +254,7 @@ static void icount_warp_rt(void)
256254
int64_t warp_delta;
257255

258256
warp_delta = clock - timers_state.vm_clock_warp_start;
259-
if (icount_enabled() == 2) {
257+
if (icount_enabled() == ICOUNT_ADAPTATIVE) {
260258
/*
261259
* In adaptive mode, do not let QEMU_CLOCK_VIRTUAL run too far
262260
* ahead of real time (it might already be ahead so careful not
@@ -419,7 +417,7 @@ void icount_account_warp_timer(void)
419417
icount_warp_rt();
420418
}
421419

422-
void icount_configure(QemuOpts *opts, Error **errp)
420+
bool icount_configure(QemuOpts *opts, Error **errp)
423421
{
424422
const char *option = qemu_opt_get(opts, "shift");
425423
bool sleep = qemu_opt_get_bool(opts, "sleep", true);
@@ -429,27 +427,28 @@ void icount_configure(QemuOpts *opts, Error **errp)
429427
if (!option) {
430428
if (qemu_opt_get(opts, "align") != NULL) {
431429
error_setg(errp, "Please specify shift option when using align");
430+
return false;
432431
}
433-
return;
432+
return true;
434433
}
435434

436435
if (align && !sleep) {
437436
error_setg(errp, "align=on and sleep=off are incompatible");
438-
return;
437+
return false;
439438
}
440439

441440
if (strcmp(option, "auto") != 0) {
442441
if (qemu_strtol(option, NULL, 0, &time_shift) < 0
443442
|| time_shift < 0 || time_shift > MAX_ICOUNT_SHIFT) {
444443
error_setg(errp, "icount: Invalid shift value");
445-
return;
444+
return false;
446445
}
447446
} else if (icount_align_option) {
448447
error_setg(errp, "shift=auto and align=on are incompatible");
449-
return;
448+
return false;
450449
} else if (!icount_sleep) {
451450
error_setg(errp, "shift=auto and sleep=off are incompatible");
452-
return;
451+
return false;
453452
}
454453

455454
icount_sleep = sleep;
@@ -463,7 +462,7 @@ void icount_configure(QemuOpts *opts, Error **errp)
463462
if (time_shift >= 0) {
464463
timers_state.icount_time_shift = time_shift;
465464
icount_enable_precise();
466-
return;
465+
return true;
467466
}
468467

469468
icount_enable_adaptive();
@@ -491,11 +490,14 @@ void icount_configure(QemuOpts *opts, Error **errp)
491490
timer_mod(timers_state.icount_vm_timer,
492491
qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
493492
NANOSECONDS_PER_SECOND / 10);
493+
return true;
494494
}
495495

496496
void icount_notify_exit(void)
497497
{
498-
if (icount_enabled() && current_cpu) {
498+
assert(icount_enabled());
499+
500+
if (current_cpu) {
499501
qemu_cpu_kick(current_cpu);
500502
qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
501503
}

accel/tcg/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
2424

2525
specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files(
2626
'cputlb.c',
27+
'watchpoint.c',
2728
))
2829

2930
system_ss.add(when: ['CONFIG_TCG'], if_true: files(

accel/tcg/tb-maint.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t last)
10211021
* Called with mmap_lock held for user-mode emulation
10221022
* NOTE: this function must not be called while a TB is running.
10231023
*/
1024-
void tb_invalidate_phys_page(tb_page_addr_t addr)
1024+
static void tb_invalidate_phys_page(tb_page_addr_t addr)
10251025
{
10261026
tb_page_addr_t start, last;
10271027

@@ -1160,28 +1160,6 @@ tb_invalidate_phys_page_range__locked(struct page_collection *pages,
11601160
#endif
11611161
}
11621162

1163-
/*
1164-
* Invalidate all TBs which intersect with the target physical
1165-
* address page @addr.
1166-
*/
1167-
void tb_invalidate_phys_page(tb_page_addr_t addr)
1168-
{
1169-
struct page_collection *pages;
1170-
tb_page_addr_t start, last;
1171-
PageDesc *p;
1172-
1173-
p = page_find(addr >> TARGET_PAGE_BITS);
1174-
if (p == NULL) {
1175-
return;
1176-
}
1177-
1178-
start = addr & TARGET_PAGE_MASK;
1179-
last = addr | ~TARGET_PAGE_MASK;
1180-
pages = page_collection_lock(start, last);
1181-
tb_invalidate_phys_page_range__locked(pages, p, start, last, 0);
1182-
page_collection_unlock(pages);
1183-
}
1184-
11851163
/*
11861164
* Invalidate all TBs which intersect with the target physical address range
11871165
* [start;last]. NOTE: start and end may refer to *different* physical pages.

0 commit comments

Comments
 (0)