Skip to content

Commit 17bac6b

Browse files
Merge commit '6276340310' into merge
Signed-off-by: Francisco Iglesias <francisco.iglesias@amd.com>
2 parents f8d2fa1 + 6276340 commit 17bac6b

File tree

173 files changed

+2183
-1966
lines changed

Some content is hidden

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

173 files changed

+2183
-1966
lines changed

MAINTAINERS

+6-2
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ M: Richard Henderson <richard.henderson@linaro.org>
123123
R: Paolo Bonzini <pbonzini@redhat.com>
124124
S: Maintained
125125
F: softmmu/cpus.c
126+
F: softmmu/watchpoint.c
126127
F: cpus-common.c
127128
F: page-vary.c
128129
F: page-vary-common.c
@@ -1679,6 +1680,7 @@ F: hw/i2c/smbus_ich9.c
16791680
F: hw/acpi/piix4.c
16801681
F: hw/acpi/ich9*.c
16811682
F: include/hw/acpi/ich9*.h
1683+
F: include/hw/southbridge/ich9.h
16821684
F: include/hw/southbridge/piix.h
16831685
F: hw/isa/apm.c
16841686
F: include/hw/isa/apm.h
@@ -1711,6 +1713,7 @@ F: include/hw/char/parallel.h
17111713
F: include/hw/dma/i8257.h
17121714
F: include/hw/i2c/pm_smbus.h
17131715
F: include/hw/input/i8042.h
1716+
F: include/hw/intc/ioapic*
17141717
F: include/hw/isa/i8259_internal.h
17151718
F: include/hw/isa/superio.h
17161719
F: include/hw/timer/hpet.h
@@ -1795,7 +1798,7 @@ F: hw/misc/edu.c
17951798
IDE
17961799
M: John Snow <jsnow@redhat.com>
17971800
L: qemu-block@nongnu.org
1798-
S: Supported
1801+
S: Odd Fixes
17991802
F: include/hw/ide.h
18001803
F: include/hw/ide/
18011804
F: hw/ide/
@@ -1820,7 +1823,7 @@ T: git https://github.com/cminyard/qemu.git master-ipmi-rebase
18201823
Floppy
18211824
M: John Snow <jsnow@redhat.com>
18221825
L: qemu-block@nongnu.org
1823-
S: Supported
1826+
S: Odd Fixes
18241827
F: hw/block/fdc.c
18251828
F: hw/block/fdc-internal.h
18261829
F: hw/block/fdc-isa.c
@@ -3239,6 +3242,7 @@ S: Supported
32393242
F: replay/*
32403243
F: block/blkreplay.c
32413244
F: net/filter-replay.c
3245+
F: include/exec/replay-core.h
32423246
F: include/sysemu/replay.h
32433247
F: docs/devel/replay.rst
32443248
F: docs/system/replay.rst

accel/kvm/kvm-all.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -2361,13 +2361,13 @@ static int kvm_init(MachineState *ms)
23612361
static const char upgrade_note[] =
23622362
"Please upgrade to at least kernel 2.6.29 or recent kvm-kmod\n"
23632363
"(see http://sourceforge.net/projects/kvm).\n";
2364-
struct {
2364+
const struct {
23652365
const char *name;
23662366
int num;
23672367
} num_cpus[] = {
23682368
{ "SMP", ms->smp.cpus },
23692369
{ "hotpluggable", ms->smp.max_cpus },
2370-
{ NULL, }
2370+
{ /* end of list */ }
23712371
}, *nc = num_cpus;
23722372
int soft_vcpus_limit, hard_vcpus_limit;
23732373
KVMState *s;
@@ -3305,7 +3305,7 @@ bool kvm_supports_guest_debug(void)
33053305
return kvm_has_guest_debug;
33063306
}
33073307

3308-
int kvm_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len)
3308+
int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
33093309
{
33103310
struct kvm_sw_breakpoint *bp;
33113311
int err;
@@ -3343,7 +3343,7 @@ int kvm_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len)
33433343
return 0;
33443344
}
33453345

3346-
int kvm_remove_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len)
3346+
int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len)
33473347
{
33483348
struct kvm_sw_breakpoint *bp;
33493349
int err;

accel/kvm/kvm-cpus.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ void kvm_cpu_synchronize_post_reset(CPUState *cpu);
1919
void kvm_cpu_synchronize_post_init(CPUState *cpu);
2020
void kvm_cpu_synchronize_pre_loadvm(CPUState *cpu);
2121
bool kvm_supports_guest_debug(void);
22-
int kvm_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len);
23-
int kvm_remove_breakpoint(CPUState *cpu, int type, hwaddr addr, hwaddr len);
22+
int kvm_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
23+
int kvm_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vaddr len);
2424
void kvm_remove_all_breakpoints(CPUState *cpu);
2525

2626
#endif /* KVM_CPUS_H */

accel/tcg/cpu-exec.c

+3-88
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@
2020
#include "qemu/osdep.h"
2121
#include "qemu/qemu-print.h"
2222
#include "qapi/error.h"
23-
#include "qapi/qapi-commands-machine.h"
2423
#include "qapi/type-helpers.h"
2524
#include "hw/core/tcg-cpu-ops.h"
2625
#include "trace.h"
2726
#include "disas/disas.h"
2827
#include "exec/exec-all.h"
2928
#include "tcg/tcg.h"
3029
#include "qemu/atomic.h"
31-
#include "qemu/timer.h"
3230
#include "qemu/rcu.h"
3331
#include "exec/log.h"
3432
#include "qemu/main-loop.h"
@@ -38,7 +36,7 @@
3836
#include "sysemu/cpus.h"
3937
#include "exec/cpu-all.h"
4038
#include "sysemu/cpu-timers.h"
41-
#include "sysemu/replay.h"
39+
#include "exec/replay-core.h"
4240
#include "sysemu/tcg.h"
4341
#include "qemu/etrace.h"
4442
#include "exec/helper-proto.h"
@@ -65,8 +63,8 @@ typedef struct SyncClocks {
6563
#define MAX_DELAY_PRINT_RATE 2000000000LL
6664
#define MAX_NB_PRINTS 100
6765

68-
static int64_t max_delay;
69-
static int64_t max_advance;
66+
int64_t max_delay;
67+
int64_t max_advance;
7068

7169
static void align_clocks(SyncClocks *sc, CPUState *cpu)
7270
{
@@ -1123,86 +1121,3 @@ void tcg_exec_unrealizefn(CPUState *cpu)
11231121
tlb_destroy(cpu);
11241122
g_free_rcu(cpu->tb_jmp_cache, rcu);
11251123
}
1126-
1127-
#ifndef CONFIG_USER_ONLY
1128-
1129-
static void dump_drift_info(GString *buf)
1130-
{
1131-
if (!icount_enabled()) {
1132-
return;
1133-
}
1134-
1135-
g_string_append_printf(buf, "Host - Guest clock %"PRIi64" ms\n",
1136-
(cpu_get_clock() - icount_get()) / SCALE_MS);
1137-
if (icount_align_option) {
1138-
g_string_append_printf(buf, "Max guest delay %"PRIi64" ms\n",
1139-
-max_delay / SCALE_MS);
1140-
g_string_append_printf(buf, "Max guest advance %"PRIi64" ms\n",
1141-
max_advance / SCALE_MS);
1142-
} else {
1143-
g_string_append_printf(buf, "Max guest delay NA\n");
1144-
g_string_append_printf(buf, "Max guest advance NA\n");
1145-
}
1146-
}
1147-
1148-
HumanReadableText *qmp_x_query_jit(Error **errp)
1149-
{
1150-
g_autoptr(GString) buf = g_string_new("");
1151-
1152-
if (!tcg_enabled()) {
1153-
error_setg(errp, "JIT information is only available with accel=tcg");
1154-
return NULL;
1155-
}
1156-
1157-
dump_exec_info(buf);
1158-
dump_drift_info(buf);
1159-
1160-
return human_readable_text_from_str(buf);
1161-
}
1162-
1163-
HumanReadableText *qmp_x_query_opcount(Error **errp)
1164-
{
1165-
g_autoptr(GString) buf = g_string_new("");
1166-
1167-
if (!tcg_enabled()) {
1168-
error_setg(errp, "Opcode count information is only available with accel=tcg");
1169-
return NULL;
1170-
}
1171-
1172-
tcg_dump_op_count(buf);
1173-
1174-
return human_readable_text_from_str(buf);
1175-
}
1176-
1177-
#ifdef CONFIG_PROFILER
1178-
1179-
int64_t dev_time;
1180-
1181-
HumanReadableText *qmp_x_query_profile(Error **errp)
1182-
{
1183-
g_autoptr(GString) buf = g_string_new("");
1184-
static int64_t last_cpu_exec_time;
1185-
int64_t cpu_exec_time;
1186-
int64_t delta;
1187-
1188-
cpu_exec_time = tcg_cpu_exec_time();
1189-
delta = cpu_exec_time - last_cpu_exec_time;
1190-
1191-
g_string_append_printf(buf, "async time %" PRId64 " (%0.3f)\n",
1192-
dev_time, dev_time / (double)NANOSECONDS_PER_SECOND);
1193-
g_string_append_printf(buf, "qemu time %" PRId64 " (%0.3f)\n",
1194-
delta, delta / (double)NANOSECONDS_PER_SECOND);
1195-
last_cpu_exec_time = cpu_exec_time;
1196-
dev_time = 0;
1197-
1198-
return human_readable_text_from_str(buf);
1199-
}
1200-
#else
1201-
HumanReadableText *qmp_x_query_profile(Error **errp)
1202-
{
1203-
error_setg(errp, "Internal profiler not compiled");
1204-
return NULL;
1205-
}
1206-
#endif
1207-
1208-
#endif /* !CONFIG_USER_ONLY */

accel/tcg/hmp.c

-14
This file was deleted.

accel/tcg/internal.h

+3
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ static inline target_ulong log_pc(CPUState *cpu, const TranslationBlock *tb)
6464
#endif
6565
}
6666

67+
extern int64_t max_delay;
68+
extern int64_t max_advance;
69+
6770
#endif /* ACCEL_TCG_INTERNAL_H */

accel/tcg/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss)
1818

1919
specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(
2020
'cputlb.c',
21-
'hmp.c',
21+
'monitor.c',
2222
))
2323

2424
tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files(

accel/tcg/monitor.c

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
/*
2+
* SPDX-License-Identifier: LGPL-2.1-or-later
3+
*
4+
* QEMU TCG monitor
5+
*
6+
* Copyright (c) 2003-2005 Fabrice Bellard
7+
*/
8+
9+
#include "qemu/osdep.h"
10+
#include "qapi/error.h"
11+
#include "qapi/type-helpers.h"
12+
#include "qapi/qapi-commands-machine.h"
13+
#include "monitor/monitor.h"
14+
#include "sysemu/cpus.h"
15+
#include "sysemu/cpu-timers.h"
16+
#include "sysemu/tcg.h"
17+
#include "internal.h"
18+
19+
20+
static void dump_drift_info(GString *buf)
21+
{
22+
if (!icount_enabled()) {
23+
return;
24+
}
25+
26+
g_string_append_printf(buf, "Host - Guest clock %"PRIi64" ms\n",
27+
(cpu_get_clock() - icount_get()) / SCALE_MS);
28+
if (icount_align_option) {
29+
g_string_append_printf(buf, "Max guest delay %"PRIi64" ms\n",
30+
-max_delay / SCALE_MS);
31+
g_string_append_printf(buf, "Max guest advance %"PRIi64" ms\n",
32+
max_advance / SCALE_MS);
33+
} else {
34+
g_string_append_printf(buf, "Max guest delay NA\n");
35+
g_string_append_printf(buf, "Max guest advance NA\n");
36+
}
37+
}
38+
39+
HumanReadableText *qmp_x_query_jit(Error **errp)
40+
{
41+
g_autoptr(GString) buf = g_string_new("");
42+
43+
if (!tcg_enabled()) {
44+
error_setg(errp, "JIT information is only available with accel=tcg");
45+
return NULL;
46+
}
47+
48+
dump_exec_info(buf);
49+
dump_drift_info(buf);
50+
51+
return human_readable_text_from_str(buf);
52+
}
53+
54+
HumanReadableText *qmp_x_query_opcount(Error **errp)
55+
{
56+
g_autoptr(GString) buf = g_string_new("");
57+
58+
if (!tcg_enabled()) {
59+
error_setg(errp,
60+
"Opcode count information is only available with accel=tcg");
61+
return NULL;
62+
}
63+
64+
tcg_dump_op_count(buf);
65+
66+
return human_readable_text_from_str(buf);
67+
}
68+
69+
#ifdef CONFIG_PROFILER
70+
71+
int64_t dev_time;
72+
73+
HumanReadableText *qmp_x_query_profile(Error **errp)
74+
{
75+
g_autoptr(GString) buf = g_string_new("");
76+
static int64_t last_cpu_exec_time;
77+
int64_t cpu_exec_time;
78+
int64_t delta;
79+
80+
cpu_exec_time = tcg_cpu_exec_time();
81+
delta = cpu_exec_time - last_cpu_exec_time;
82+
83+
g_string_append_printf(buf, "async time %" PRId64 " (%0.3f)\n",
84+
dev_time, dev_time / (double)NANOSECONDS_PER_SECOND);
85+
g_string_append_printf(buf, "qemu time %" PRId64 " (%0.3f)\n",
86+
delta, delta / (double)NANOSECONDS_PER_SECOND);
87+
last_cpu_exec_time = cpu_exec_time;
88+
dev_time = 0;
89+
90+
return human_readable_text_from_str(buf);
91+
}
92+
#else
93+
HumanReadableText *qmp_x_query_profile(Error **errp)
94+
{
95+
error_setg(errp, "Internal profiler not compiled");
96+
return NULL;
97+
}
98+
#endif
99+
100+
static void hmp_tcg_register(void)
101+
{
102+
monitor_register_hmp_info_hrt("jit", qmp_x_query_jit);
103+
monitor_register_hmp_info_hrt("opcount", qmp_x_query_opcount);
104+
}
105+
106+
type_init(hmp_tcg_register);

accel/tcg/tcg-accel-ops.c

+14-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,18 @@
4444

4545
void tcg_cpu_init_cflags(CPUState *cpu, bool parallel)
4646
{
47-
uint32_t cflags = cpu->cluster_index << CF_CLUSTER_SHIFT;
47+
uint32_t cflags;
48+
49+
/*
50+
* Include the cluster number in the hash we use to look up TBs.
51+
* This is important because a TB that is valid for one cluster at
52+
* a given physical address and set of CPU flags is not necessarily
53+
* valid for another:
54+
* the two clusters may have different views of physical memory, or
55+
* may have different CPU features (eg FPU present or absent).
56+
*/
57+
cflags = cpu->cluster_index << CF_CLUSTER_SHIFT;
58+
4859
cflags |= parallel ? CF_PARALLEL : 0;
4960
cflags |= icount_enabled() ? CF_USE_ICOUNT : 0;
5061
cpu->tcg_cflags = cflags;
@@ -116,7 +127,7 @@ static inline int xlat_gdb_type(CPUState *cpu, int gdbtype)
116127
return cputype;
117128
}
118129

119-
static int tcg_insert_breakpoint(CPUState *cs, int type, hwaddr addr, hwaddr len)
130+
static int tcg_insert_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
120131
{
121132
CPUState *cpu;
122133
int err = 0;
@@ -147,7 +158,7 @@ static int tcg_insert_breakpoint(CPUState *cs, int type, hwaddr addr, hwaddr len
147158
}
148159
}
149160

150-
static int tcg_remove_breakpoint(CPUState *cs, int type, hwaddr addr, hwaddr len)
161+
static int tcg_remove_breakpoint(CPUState *cs, int type, vaddr addr, vaddr len)
151162
{
152163
CPUState *cpu;
153164
int err = 0;

0 commit comments

Comments
 (0)