Skip to content

Commit c8da489

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents 79efcf8 + 1214d55 commit c8da489

File tree

499 files changed

+11599
-4372
lines changed

Some content is hidden

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

499 files changed

+11599
-4372
lines changed

MAINTAINERS

+18-2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ F: include/exec/helper*.h
129129
F: include/exec/tb-hash.h
130130
F: include/sysemu/cpus.h
131131
F: include/sysemu/tcg.h
132+
F: include/hw/core/tcg-cpu-ops.h
132133

133134
FPU emulation
134135
M: Aurelien Jarno <[email protected]>
@@ -280,6 +281,7 @@ F: target/ppc/
280281
F: hw/ppc/
281282
F: include/hw/ppc/
282283
F: disas/ppc.c
284+
F: tests/acceptance/machine_ppc.py
283285

284286
RISC-V TCG CPUs
285287
M: Palmer Dabbelt <[email protected]>
@@ -437,8 +439,10 @@ Overall
437439
M: Richard Henderson <[email protected]>
438440
R: Paolo Bonzini <[email protected]>
439441
S: Maintained
440-
F: include/sysemu/accel.h
441-
F: accel/accel.c
442+
F: include/qemu/accel.h
443+
F: include/sysemu/accel-ops.h
444+
F: include/hw/core/accel-cpu.h
445+
F: accel/accel-*.c
442446
F: accel/Makefile.objs
443447
F: accel/stubs/Makefile.objs
444448

@@ -1115,6 +1119,7 @@ M: Edgar E. Iglesias <[email protected]>
11151119
S: Maintained
11161120
F: hw/microblaze/petalogix_s3adsp1800_mmu.c
11171121
F: include/hw/char/xilinx_uartlite.h
1122+
F: tests/acceptance/machine_microblaze.py
11181123

11191124
petalogix_ml605
11201125
M: Edgar E. Iglesias <[email protected]>
@@ -2210,6 +2215,7 @@ F: scsi/*
22102215

22112216
Block Jobs
22122217
M: John Snow <[email protected]>
2218+
M: Vladimir Sementsov-Ogievskiy <[email protected]>
22132219
22142220
S: Supported
22152221
F: blockjob.c
@@ -2222,7 +2228,16 @@ F: block/commit.c
22222228
F: block/stream.c
22232229
F: block/mirror.c
22242230
F: qapi/job.json
2231+
F: block/block-copy.c
2232+
F: include/block/block-copy.c
2233+
F: block/backup-top.h
2234+
F: block/backup-top.c
2235+
F: include/block/aio_task.h
2236+
F: block/aio_task.c
2237+
F: util/qemu-co-shared-resource.c
2238+
F: include/qemu/co-shared-resource.h
22252239
T: git https://gitlab.com/jsnow/qemu.git jobs
2240+
T: git https://src.openvz.org/scm/~vsementsov/qemu.git jobs
22262241

22272242
Block QAPI, monitor, command line
22282243
M: Markus Armbruster <[email protected]>
@@ -2526,6 +2541,7 @@ F: qapi/qom.json
25262541
F: qapi/qdev.json
25272542
F: scripts/coccinelle/qom-parent-type.cocci
25282543
F: softmmu/qdev-monitor.c
2544+
F: stubs/qdev.c
25292545
F: qom/
25302546
F: tests/check-qom-interface.c
25312547
F: tests/check-qom-proplist.c

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ endif
305305
@echo 'Test targets:'
306306
$(call print-help,check,Run all tests (check-help for details))
307307
$(call print-help,bench,Run all benchmarks)
308-
$(call print-help,docker,Help about targets running tests inside containers)
308+
$(call print-help,docker-help,Help about targets running tests inside containers)
309309
$(call print-help,vm-help,Help about targets running tests inside VM)
310310
@echo ''
311311
@echo 'Documentation targets:'

accel/accel-common.c

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
* QEMU accel class, components common to system emulation and user mode
3+
*
4+
* Copyright (c) 2003-2008 Fabrice Bellard
5+
* Copyright (c) 2014 Red Hat Inc.
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
26+
#include "qemu/osdep.h"
27+
#include "qemu/accel.h"
28+
29+
#include "cpu.h"
30+
#include "hw/core/accel-cpu.h"
31+
32+
#ifndef CONFIG_USER_ONLY
33+
#include "accel-softmmu.h"
34+
#endif /* !CONFIG_USER_ONLY */
35+
36+
static const TypeInfo accel_type = {
37+
.name = TYPE_ACCEL,
38+
.parent = TYPE_OBJECT,
39+
.class_size = sizeof(AccelClass),
40+
.instance_size = sizeof(AccelState),
41+
};
42+
43+
/* Lookup AccelClass from opt_name. Returns NULL if not found */
44+
AccelClass *accel_find(const char *opt_name)
45+
{
46+
char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name);
47+
AccelClass *ac = ACCEL_CLASS(object_class_by_name(class_name));
48+
g_free(class_name);
49+
return ac;
50+
}
51+
52+
static void accel_init_cpu_int_aux(ObjectClass *klass, void *opaque)
53+
{
54+
CPUClass *cc = CPU_CLASS(klass);
55+
AccelCPUClass *accel_cpu = opaque;
56+
57+
cc->accel_cpu = accel_cpu;
58+
if (accel_cpu->cpu_class_init) {
59+
accel_cpu->cpu_class_init(cc);
60+
}
61+
}
62+
63+
/* initialize the arch-specific accel CpuClass interfaces */
64+
static void accel_init_cpu_interfaces(AccelClass *ac)
65+
{
66+
const char *ac_name; /* AccelClass name */
67+
char *acc_name; /* AccelCPUClass name */
68+
ObjectClass *acc; /* AccelCPUClass */
69+
70+
ac_name = object_class_get_name(OBJECT_CLASS(ac));
71+
g_assert(ac_name != NULL);
72+
73+
acc_name = g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE);
74+
acc = object_class_by_name(acc_name);
75+
g_free(acc_name);
76+
77+
if (acc) {
78+
object_class_foreach(accel_init_cpu_int_aux,
79+
CPU_RESOLVING_TYPE, false, acc);
80+
}
81+
}
82+
83+
void accel_init_interfaces(AccelClass *ac)
84+
{
85+
#ifndef CONFIG_USER_ONLY
86+
accel_init_ops_interfaces(ac);
87+
#endif /* !CONFIG_USER_ONLY */
88+
89+
accel_init_cpu_interfaces(ac);
90+
}
91+
92+
static const TypeInfo accel_cpu_type = {
93+
.name = TYPE_ACCEL_CPU,
94+
.parent = TYPE_OBJECT,
95+
.abstract = true,
96+
.class_size = sizeof(AccelCPUClass),
97+
};
98+
99+
static void register_accel_types(void)
100+
{
101+
type_register_static(&accel_type);
102+
type_register_static(&accel_cpu_type);
103+
}
104+
105+
type_init(register_accel_types);

accel/accel.c renamed to accel/accel-softmmu.c

+38-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* QEMU System Emulator, accelerator interfaces
2+
* QEMU accel class, system emulation components
33
*
44
* Copyright (c) 2003-2008 Fabrice Bellard
55
* Copyright (c) 2014 Red Hat Inc.
@@ -24,27 +24,11 @@
2424
*/
2525

2626
#include "qemu/osdep.h"
27-
#include "sysemu/accel.h"
27+
#include "qemu/accel.h"
2828
#include "hw/boards.h"
29-
#include "sysemu/arch_init.h"
30-
#include "sysemu/sysemu.h"
31-
#include "qom/object.h"
29+
#include "sysemu/cpus.h"
3230

33-
static const TypeInfo accel_type = {
34-
.name = TYPE_ACCEL,
35-
.parent = TYPE_OBJECT,
36-
.class_size = sizeof(AccelClass),
37-
.instance_size = sizeof(AccelState),
38-
};
39-
40-
/* Lookup AccelClass from opt_name. Returns NULL if not found */
41-
AccelClass *accel_find(const char *opt_name)
42-
{
43-
char *class_name = g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name);
44-
AccelClass *ac = ACCEL_CLASS(object_class_by_name(class_name));
45-
g_free(class_name);
46-
return ac;
47-
}
31+
#include "accel-softmmu.h"
4832

4933
int accel_init_machine(AccelState *accel, MachineState *ms)
5034
{
@@ -77,9 +61,40 @@ void accel_setup_post(MachineState *ms)
7761
}
7862
}
7963

80-
static void register_accel_types(void)
64+
/* initialize the arch-independent accel operation interfaces */
65+
void accel_init_ops_interfaces(AccelClass *ac)
8166
{
82-
type_register_static(&accel_type);
67+
const char *ac_name;
68+
char *ops_name;
69+
AccelOpsClass *ops;
70+
71+
ac_name = object_class_get_name(OBJECT_CLASS(ac));
72+
g_assert(ac_name != NULL);
73+
74+
ops_name = g_strdup_printf("%s" ACCEL_OPS_SUFFIX, ac_name);
75+
ops = ACCEL_OPS_CLASS(object_class_by_name(ops_name));
76+
g_free(ops_name);
77+
78+
/*
79+
* all accelerators need to define ops, providing at least a mandatory
80+
* non-NULL create_vcpu_thread operation.
81+
*/
82+
g_assert(ops != NULL);
83+
if (ops->ops_init) {
84+
ops->ops_init(ops);
85+
}
86+
cpus_register_accel(ops);
8387
}
8488

85-
type_init(register_accel_types);
89+
static const TypeInfo accel_ops_type_info = {
90+
.name = TYPE_ACCEL_OPS,
91+
.parent = TYPE_OBJECT,
92+
.abstract = true,
93+
.class_size = sizeof(AccelOpsClass),
94+
};
95+
96+
static void accel_softmmu_register_types(void)
97+
{
98+
type_register_static(&accel_ops_type_info);
99+
}
100+
type_init(accel_softmmu_register_types);

accel/accel-softmmu.h

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* QEMU System Emulation accel internal functions
3+
*
4+
* Copyright 2021 SUSE LLC
5+
*
6+
* This work is licensed under the terms of the GNU GPL, version 2 or later.
7+
* See the COPYING file in the top-level directory.
8+
*/
9+
10+
#ifndef ACCEL_SOFTMMU_H
11+
#define ACCEL_SOFTMMU_H
12+
13+
void accel_init_ops_interfaces(AccelClass *ac);
14+
15+
#endif /* ACCEL_SOFTMMU_H */

accel/accel-user.c

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* QEMU accel class, user-mode components
3+
*
4+
* Copyright 2021 SUSE LLC
5+
*
6+
* This work is licensed under the terms of the GNU GPL, version 2 or later.
7+
* See the COPYING file in the top-level directory.
8+
*/
9+
10+
#include "qemu/osdep.h"
11+
#include "qemu/accel.h"
12+
13+
AccelState *current_accel(void)
14+
{
15+
static AccelState *accel;
16+
17+
if (!accel) {
18+
AccelClass *ac = accel_find("tcg");
19+
20+
g_assert(ac != NULL);
21+
accel = ACCEL(object_new_with_class(OBJECT_CLASS(ac)));
22+
}
23+
return accel;
24+
}

accel/kvm/kvm-cpus.c renamed to accel/kvm/kvm-accel-ops.c

+22-6
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,27 @@ static void kvm_start_vcpu_thread(CPUState *cpu)
7474
cpu, QEMU_THREAD_JOINABLE);
7575
}
7676

77-
const CpusAccel kvm_cpus = {
78-
.create_vcpu_thread = kvm_start_vcpu_thread,
77+
static void kvm_accel_ops_class_init(ObjectClass *oc, void *data)
78+
{
79+
AccelOpsClass *ops = ACCEL_OPS_CLASS(oc);
80+
81+
ops->create_vcpu_thread = kvm_start_vcpu_thread;
82+
ops->synchronize_post_reset = kvm_cpu_synchronize_post_reset;
83+
ops->synchronize_post_init = kvm_cpu_synchronize_post_init;
84+
ops->synchronize_state = kvm_cpu_synchronize_state;
85+
ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm;
86+
}
87+
88+
static const TypeInfo kvm_accel_ops_type = {
89+
.name = ACCEL_OPS_NAME("kvm"),
7990

80-
.synchronize_post_reset = kvm_cpu_synchronize_post_reset,
81-
.synchronize_post_init = kvm_cpu_synchronize_post_init,
82-
.synchronize_state = kvm_cpu_synchronize_state,
83-
.synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm,
91+
.parent = TYPE_ACCEL_OPS,
92+
.class_init = kvm_accel_ops_class_init,
93+
.abstract = true,
8494
};
95+
96+
static void kvm_accel_ops_register_types(void)
97+
{
98+
type_register_static(&kvm_accel_ops_type);
99+
}
100+
type_init(kvm_accel_ops_register_types);

0 commit comments

Comments
 (0)