* [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting)
@ 2024-07-22 11:03 Alex Bennée
2024-07-22 11:03 ` [PULL 01/16] testing: bump to latest libvirt-ci Alex Bennée
` (16 more replies)
0 siblings, 17 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:03 UTC (permalink / raw)
To: qemu-devel; +Cc: Alex Bennée
warn: No match for commit c135d5eaafe7aa2533da663d8e5a34a424b71eb9 found at https://gitlab.com/stsquad/qemu.git
warn: Are you sure you pushed 'pull-target-arm-20240711-209-gc135d5eaaf' there?
The following changes since commit a7ddb48bd1363c8bcdf42776d320289c42191f01:
Merge tag 'pull-aspeed-20240721' of https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000)
are available in the Git repository at:
https://gitlab.com/stsquad/qemu.git pull-target-arm-20240711-209-gc135d5eaaf
for you to fetch changes up to c135d5eaafe7aa2533da663d8e5a34a424b71eb9:
tests/tcg/aarch64: Fix test-mte.py (2024-07-22 09:38:17 +0100)
----------------------------------------------------------------
Alex Bennée (3):
testing: bump to latest libvirt-ci
gdbstub: Re-factor gdb command extensions
tests/plugins: use qemu_plugin_outs for inline stats
Frédéric Pétrot (1):
plugins/execlog.c: correct dump of registers values
Philippe Mathieu-Daudé (8):
semihosting: Include missing 'gdbstub/syscalls.h' header
target/m68k: Add semihosting stub
target/mips: Add semihosting stub
target/m68k: Restrict semihosting to TCG
target/mips: Restrict semihosting to TCG
target/riscv: Restrict semihosting to TCG
target/xtensa: Restrict semihosting to TCG
semihosting: Restrict to TCG
Pierrick Bouvier (1):
plugins: fix mem callback array size
Richard Henderson (1):
tests/tcg/aarch64: Fix test-mte.py
Simon Hamelin (1):
plugins/stoptrigger: TCG plugin to stop execution under conditions
Thomas Huth (1):
tests/avocado: Remove non-working sparc leon3 test
MAINTAINERS | 1 -
docs/devel/tcg-plugins.rst | 22 +++++
include/gdbstub/commands.h | 19 ++--
include/semihosting/syscalls.h | 2 +
target/arm/internals.h | 4 +-
accel/tcg/plugin-gen.c | 3 +-
contrib/plugins/execlog.c | 2 +-
contrib/plugins/stoptrigger.c | 151 ++++++++++++++++++++++++++++++
gdbstub/gdbstub.c | 141 ++++++++++++++++------------
target/arm/gdbstub.c | 16 +---
target/arm/gdbstub64.c | 11 +--
target/m68k/semihosting-stub.c | 15 +++
target/mips/tcg/sysemu/semihosting-stub.c | 15 +++
tests/plugin/inline.c | 58 +++++++-----
.gitlab-ci.d/cirrus/freebsd-13.vars | 2 +-
contrib/plugins/Makefile | 1 +
semihosting/Kconfig | 1 +
target/m68k/Kconfig | 2 +-
target/m68k/meson.build | 5 +-
target/mips/Kconfig | 2 +-
target/mips/tcg/sysemu/meson.build | 6 +-
target/riscv/Kconfig | 4 +-
target/xtensa/Kconfig | 2 +-
tests/avocado/machine_sparc_leon3.py | 37 --------
tests/lcitool/libvirt-ci | 2 +-
tests/tcg/aarch64/gdbstub/test-mte.py | 2 +-
tests/vm/generated/freebsd.json | 14 +--
27 files changed, 370 insertions(+), 170 deletions(-)
create mode 100644 contrib/plugins/stoptrigger.c
create mode 100644 target/m68k/semihosting-stub.c
create mode 100644 target/mips/tcg/sysemu/semihosting-stub.c
delete mode 100644 tests/avocado/machine_sparc_leon3.py
--
2.39.2
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PULL 01/16] testing: bump to latest libvirt-ci
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
@ 2024-07-22 11:03 ` Alex Bennée
2024-07-22 11:03 ` [PULL 02/16] tests/avocado: Remove non-working sparc leon3 test Alex Bennée
` (15 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:03 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Philippe Mathieu-Daudé, Ed Maste,
Li-Wen Hsu, Thomas Huth, Wainer dos Santos Moschetta,
Beraldo Leal
This brings in the latest python mappings for the BSD updates.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-2-alex.bennee@linaro.org>
diff --git a/.gitlab-ci.d/cirrus/freebsd-13.vars b/.gitlab-ci.d/cirrus/freebsd-13.vars
index 3785afca36..29ab9645f9 100644
--- a/.gitlab-ci.d/cirrus/freebsd-13.vars
+++ b/.gitlab-ci.d/cirrus/freebsd-13.vars
@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
-PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson mtools ncurses nettle ninja opencv pixman pkgconf png py39-numpy py39-pillow py39-pip py39-sphinx py39-sphinx_rtd_theme py39-tomli py39-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio socat spice-protocol tesseract usbredir virglrenderer vte3 xorriso zstd'
+PKGS='alsa-lib bash bison bzip2 ca_root_nss capstone4 ccache cmocka ctags curl cyrus-sasl dbus diffutils dtc flex fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 json-c libepoxy libffi libgcrypt libjpeg-turbo libnfs libslirp libspice-server libssh libtasn1 llvm lzo2 meson mtools ncurses nettle ninja opencv pixman pkgconf png py311-numpy py311-pillow py311-pip py311-sphinx py311-sphinx_rtd_theme py311-tomli py311-yaml python3 rpm2cpio sdl2 sdl2_image snappy sndio socat spice-protocol tesseract usbredir virglrenderer vte3 xorriso zstd'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'
diff --git a/tests/lcitool/libvirt-ci b/tests/lcitool/libvirt-ci
index 0e9490cebc..789b4601bc 160000
--- a/tests/lcitool/libvirt-ci
+++ b/tests/lcitool/libvirt-ci
@@ -1 +1 @@
-Subproject commit 0e9490cebc726ef772b6c9e27dac32e7ae99f9b2
+Subproject commit 789b4601bce4e01f43fdb6ad4ce5ab4e46674440
diff --git a/tests/vm/generated/freebsd.json b/tests/vm/generated/freebsd.json
index 2d5895ebed..2a361cecd0 100644
--- a/tests/vm/generated/freebsd.json
+++ b/tests/vm/generated/freebsd.json
@@ -51,13 +51,13 @@
"pixman",
"pkgconf",
"png",
- "py39-numpy",
- "py39-pillow",
- "py39-pip",
- "py39-sphinx",
- "py39-sphinx_rtd_theme",
- "py39-tomli",
- "py39-yaml",
+ "py311-numpy",
+ "py311-pillow",
+ "py311-pip",
+ "py311-sphinx",
+ "py311-sphinx_rtd_theme",
+ "py311-tomli",
+ "py311-yaml",
"python3",
"rpm2cpio",
"sdl2",
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 02/16] tests/avocado: Remove non-working sparc leon3 test
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
2024-07-22 11:03 ` [PULL 01/16] testing: bump to latest libvirt-ci Alex Bennée
@ 2024-07-22 11:03 ` Alex Bennée
2024-07-22 11:04 ` [PULL 03/16] gdbstub: Re-factor gdb command extensions Alex Bennée
` (14 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:03 UTC (permalink / raw)
To: qemu-devel; +Cc: Thomas Huth, Clément Chigot, Alex Bennée
From: Thomas Huth <thuth@redhat.com>
The test has been marked as broken more than 4 years ago, and
so far nobody ever cared to fix it. Thus let's simply remove it
now ... if somebody ever needs it again, they can restore the
file from an older version of QEMU.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Clément Chigot <chigot@adacore.com>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240710111755.60584-1-thuth@redhat.com>
[AJB: fix MAINTAINERS]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-3-alex.bennee@linaro.org>
diff --git a/MAINTAINERS b/MAINTAINERS
index 7d9811458c..d5ff6c2498 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1727,7 +1727,6 @@ S: Maintained
F: hw/sparc/leon3.c
F: hw/*/grlib*
F: include/hw/*/grlib*
-F: tests/avocado/machine_sparc_leon3.py
S390 Machines
-------------
diff --git a/tests/avocado/machine_sparc_leon3.py b/tests/avocado/machine_sparc_leon3.py
deleted file mode 100644
index e61b223185..0000000000
--- a/tests/avocado/machine_sparc_leon3.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# Functional test that boots a Leon3 machine and checks its serial console.
-#
-# Copyright (c) Philippe Mathieu-Daudé <f4bug@amsat.org>
-#
-# This work is licensed under the terms of the GNU GPL, version 2 or
-# later. See the COPYING file in the top-level directory.
-
-from avocado_qemu import QemuSystemTest
-from avocado_qemu import wait_for_console_pattern
-from avocado import skip
-
-
-class Leon3Machine(QemuSystemTest):
-
- timeout = 60
-
- @skip("Test currently broken")
- # A Window Underflow exception occurs before booting the kernel,
- # and QEMU exit calling cpu_abort(), which makes this test to fail.
- def test_leon3_helenos_uimage(self):
- """
- :avocado: tags=arch:sparc
- :avocado: tags=machine:leon3_generic
- :avocado: tags=binfmt:uimage
- """
- kernel_url = ('http://www.helenos.org/releases/'
- 'HelenOS-0.6.0-sparc32-leon3.bin')
- kernel_hash = 'a88c9cfdb8430c66650e5290a08765f9bf049a30'
- kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
-
- self.vm.set_console()
- self.vm.add_args('-kernel', kernel_path)
-
- self.vm.launch()
-
- wait_for_console_pattern(self, 'Copyright (c) 2001-2014 HelenOS project')
- wait_for_console_pattern(self, 'Booting the kernel ...')
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 03/16] gdbstub: Re-factor gdb command extensions
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
2024-07-22 11:03 ` [PULL 01/16] testing: bump to latest libvirt-ci Alex Bennée
2024-07-22 11:03 ` [PULL 02/16] tests/avocado: Remove non-working sparc leon3 test Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 04/16] plugins/stoptrigger: TCG plugin to stop execution under conditions Alex Bennée
` (13 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Akihiko Odaki, Gustavo Bueno Romero,
Peter Maydell, Philippe Mathieu-Daudé,
open list:ARM TCG CPUs
Coverity reported a memory leak (CID 1549757) in this code and its
admittedly rather clumsy handling of extending the command table.
Instead of handing over a full array of the commands lets use the
lighter weight GPtrArray and simply test for the presence of each
entry as we go. This avoids complications of transferring ownership of
arrays and keeps the final command entries as static entries in the
target code.
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: Gustavo Bueno Romero <gustavo.romero@linaro.org>
Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Gustavo Romero <gustavo.romero@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-4-alex.bennee@linaro.org>
diff --git a/include/gdbstub/commands.h b/include/gdbstub/commands.h
index f3058f9dda..40f0514fe9 100644
--- a/include/gdbstub/commands.h
+++ b/include/gdbstub/commands.h
@@ -74,23 +74,28 @@ int gdb_put_packet(const char *buf);
/**
* gdb_extend_query_table() - Extend query table.
- * @table: The table with the additional query packet handlers.
- * @size: The number of handlers to be added.
+ * @table: GPtrArray of GdbCmdParseEntry entries.
+ *
+ * The caller should free @table afterwards
*/
-void gdb_extend_query_table(GdbCmdParseEntry *table, int size);
+void gdb_extend_query_table(GPtrArray *table);
/**
* gdb_extend_set_table() - Extend set table.
- * @table: The table with the additional set packet handlers.
- * @size: The number of handlers to be added.
+ * @table: GPtrArray of GdbCmdParseEntry entries.
+ *
+ * The caller should free @table afterwards
*/
-void gdb_extend_set_table(GdbCmdParseEntry *table, int size);
+void gdb_extend_set_table(GPtrArray *table);
/**
* gdb_extend_qsupported_features() - Extend the qSupported features string.
* @qsupported_features: The additional qSupported feature(s) string. The string
* should start with a semicolon and, if there are more than one feature, the
- * features should be separate by a semiocolon.
+ * features should be separate by a semicolon.
+ *
+ * The caller should free @qsupported_features afterwards if
+ * dynamically allocated.
*/
void gdb_extend_qsupported_features(char *qsupported_features);
diff --git a/target/arm/internals.h b/target/arm/internals.h
index da22d04121..757b1fae92 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -359,8 +359,8 @@ void arm_cpu_register_gdb_regs_for_features(ARMCPU *cpu);
void arm_translate_init(void);
void arm_cpu_register_gdb_commands(ARMCPU *cpu);
-void aarch64_cpu_register_gdb_commands(ARMCPU *cpu, GString *, GArray *,
- GArray *);
+void aarch64_cpu_register_gdb_commands(ARMCPU *cpu, GString *,
+ GPtrArray *, GPtrArray *);
void arm_restore_state_to_opc(CPUState *cs,
const TranslationBlock *tb,
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index b9ad0a063e..b7be8e5a44 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -1614,18 +1614,21 @@ static void handle_query_thread_extra(GArray *params, void *user_ctx)
gdb_put_strbuf();
}
-static char *extended_qsupported_features;
-void gdb_extend_qsupported_features(char *qsupported_features)
-{
- /*
- * We don't support different sets of CPU gdb features on different CPUs yet
- * so assert the feature strings are the same on all CPUs, or is set only
- * once (1 CPU).
- */
- g_assert(extended_qsupported_features == NULL ||
- g_strcmp0(extended_qsupported_features, qsupported_features) == 0);
- extended_qsupported_features = qsupported_features;
+static char **extra_query_flags;
+
+void gdb_extend_qsupported_features(char *qflags)
+{
+ if (!extra_query_flags) {
+ extra_query_flags = g_new0(char *, 2);
+ extra_query_flags[0] = g_strdup(qflags);
+ } else if (!g_strv_contains((const gchar * const *) extra_query_flags,
+ qflags)) {
+ int len = g_strv_length(extra_query_flags);
+ extra_query_flags = g_realloc_n(extra_query_flags, len + 2,
+ sizeof(char *));
+ extra_query_flags[len] = g_strdup(qflags);
+ }
}
static void handle_query_supported(GArray *params, void *user_ctx)
@@ -1668,8 +1671,11 @@ static void handle_query_supported(GArray *params, void *user_ctx)
g_string_append(gdbserver_state.str_buf, ";vContSupported+;multiprocess+");
- if (extended_qsupported_features) {
- g_string_append(gdbserver_state.str_buf, extended_qsupported_features);
+ if (extra_query_flags) {
+ int extras = g_strv_length(extra_query_flags);
+ for (int i = 0; i < extras; i++) {
+ g_string_append(gdbserver_state.str_buf, extra_query_flags[i]);
+ }
}
gdb_put_strbuf();
@@ -1753,39 +1759,58 @@ static const GdbCmdParseEntry gdb_gen_query_set_common_table[] = {
},
};
-/* Compares if a set of command parsers is equal to another set of parsers. */
-static bool cmp_cmds(GdbCmdParseEntry *c, GdbCmdParseEntry *d, int size)
+/**
+ * extend_table() - extend one of the command tables
+ * @table: the command table to extend (or NULL)
+ * @extensions: a list of GdbCmdParseEntry pointers
+ *
+ * The entries themselves should be pointers to static const
+ * GdbCmdParseEntry entries. If the entry is already in the table we
+ * skip adding it again.
+ *
+ * Returns (a potentially freshly allocated) GPtrArray of GdbCmdParseEntry
+ */
+static GPtrArray *extend_table(GPtrArray *table, GPtrArray *extensions)
{
- for (int i = 0; i < size; i++) {
- if (!(c[i].handler == d[i].handler &&
- g_strcmp0(c[i].cmd, d[i].cmd) == 0 &&
- c[i].cmd_startswith == d[i].cmd_startswith &&
- g_strcmp0(c[i].schema, d[i].schema) == 0)) {
+ if (!table) {
+ table = g_ptr_array_new();
+ }
- /* Sets are different. */
- return false;
+ for (int i = 0; i < extensions->len; i++) {
+ gpointer entry = g_ptr_array_index(extensions, i);
+ if (!g_ptr_array_find(table, entry, NULL)) {
+ g_ptr_array_add(table, entry);
}
}
- /* Sets are equal, i.e. contain the same command parsers. */
- return true;
+ return table;
}
-static GdbCmdParseEntry *extended_query_table;
-static int extended_query_table_size;
-void gdb_extend_query_table(GdbCmdParseEntry *table, int size)
+/**
+ * process_extended_table() - run through an extended command table
+ * @table: the command table to check
+ * @data: parameters
+ *
+ * returns true if the command was found and executed
+ */
+static bool process_extended_table(GPtrArray *table, const char *data)
{
- /*
- * We don't support different sets of CPU gdb features on different CPUs yet
- * so assert query table is the same on all CPUs, or is set only once
- * (1 CPU).
- */
- g_assert(extended_query_table == NULL ||
- (extended_query_table_size == size &&
- cmp_cmds(extended_query_table, table, size)));
+ for (int i = 0; i < table->len; i++) {
+ const GdbCmdParseEntry *entry = g_ptr_array_index(table, i);
+ if (process_string_cmd(data, entry, 1)) {
+ return true;
+ }
+ }
+ return false;
+}
+
- extended_query_table = table;
- extended_query_table_size = size;
+/* Ptr to GdbCmdParseEntry */
+static GPtrArray *extended_query_table;
+
+void gdb_extend_query_table(GPtrArray *new_queries)
+{
+ extended_query_table = extend_table(extended_query_table, new_queries);
}
static const GdbCmdParseEntry gdb_gen_query_table[] = {
@@ -1880,20 +1905,12 @@ static const GdbCmdParseEntry gdb_gen_query_table[] = {
#endif
};
-static GdbCmdParseEntry *extended_set_table;
-static int extended_set_table_size;
-void gdb_extend_set_table(GdbCmdParseEntry *table, int size)
-{
- /*
- * We don't support different sets of CPU gdb features on different CPUs yet
- * so assert set table is the same on all CPUs, or is set only once (1 CPU).
- */
- g_assert(extended_set_table == NULL ||
- (extended_set_table_size == size &&
- cmp_cmds(extended_set_table, table, size)));
+/* Ptr to GdbCmdParseEntry */
+static GPtrArray *extended_set_table;
- extended_set_table = table;
- extended_set_table_size = size;
+void gdb_extend_set_table(GPtrArray *new_set)
+{
+ extended_set_table = extend_table(extended_set_table, new_set);
}
static const GdbCmdParseEntry gdb_gen_set_table[] = {
@@ -1924,26 +1941,28 @@ static const GdbCmdParseEntry gdb_gen_set_table[] = {
static void handle_gen_query(GArray *params, void *user_ctx)
{
+ const char *data;
+
if (!params->len) {
return;
}
- if (process_string_cmd(gdb_get_cmd_param(params, 0)->data,
+ data = gdb_get_cmd_param(params, 0)->data;
+
+ if (process_string_cmd(data,
gdb_gen_query_set_common_table,
ARRAY_SIZE(gdb_gen_query_set_common_table))) {
return;
}
- if (process_string_cmd(gdb_get_cmd_param(params, 0)->data,
+ if (process_string_cmd(data,
gdb_gen_query_table,
ARRAY_SIZE(gdb_gen_query_table))) {
return;
}
if (extended_query_table &&
- process_string_cmd(gdb_get_cmd_param(params, 0)->data,
- extended_query_table,
- extended_query_table_size)) {
+ process_extended_table(extended_query_table, data)) {
return;
}
@@ -1953,26 +1972,28 @@ static void handle_gen_query(GArray *params, void *user_ctx)
static void handle_gen_set(GArray *params, void *user_ctx)
{
+ const char *data;
+
if (!params->len) {
return;
}
- if (process_string_cmd(gdb_get_cmd_param(params, 0)->data,
+ data = gdb_get_cmd_param(params, 0)->data;
+
+ if (process_string_cmd(data,
gdb_gen_query_set_common_table,
ARRAY_SIZE(gdb_gen_query_set_common_table))) {
return;
}
- if (process_string_cmd(gdb_get_cmd_param(params, 0)->data,
+ if (process_string_cmd(data,
gdb_gen_set_table,
ARRAY_SIZE(gdb_gen_set_table))) {
return;
}
if (extended_set_table &&
- process_string_cmd(gdb_get_cmd_param(params, 0)->data,
- extended_set_table,
- extended_set_table_size)) {
+ process_extended_table(extended_set_table, data)) {
return;
}
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c
index c3a9b5eb1e..554b8736bb 100644
--- a/target/arm/gdbstub.c
+++ b/target/arm/gdbstub.c
@@ -477,11 +477,9 @@ static GDBFeature *arm_gen_dynamic_m_secextreg_feature(CPUState *cs,
void arm_cpu_register_gdb_commands(ARMCPU *cpu)
{
- GArray *query_table =
- g_array_new(FALSE, FALSE, sizeof(GdbCmdParseEntry));
- GArray *set_table =
- g_array_new(FALSE, FALSE, sizeof(GdbCmdParseEntry));
- GString *qsupported_features = g_string_new(NULL);
+ g_autoptr(GPtrArray) query_table = g_ptr_array_new();
+ g_autoptr(GPtrArray) set_table = g_ptr_array_new();
+ g_autoptr(GString) qsupported_features = g_string_new(NULL);
if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) {
#ifdef TARGET_AARCH64
@@ -492,16 +490,12 @@ void arm_cpu_register_gdb_commands(ARMCPU *cpu)
/* Set arch-specific handlers for 'q' commands. */
if (query_table->len) {
- gdb_extend_query_table(&g_array_index(query_table,
- GdbCmdParseEntry, 0),
- query_table->len);
+ gdb_extend_query_table(query_table);
}
/* Set arch-specific handlers for 'Q' commands. */
if (set_table->len) {
- gdb_extend_set_table(&g_array_index(set_table,
- GdbCmdParseEntry, 0),
- set_table->len);
+ gdb_extend_set_table(set_table);
}
/* Set arch-specific qSupported feature. */
diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c
index 2e2bc2700b..c8cef8cbc0 100644
--- a/target/arm/gdbstub64.c
+++ b/target/arm/gdbstub64.c
@@ -564,7 +564,7 @@ enum Command {
NUM_CMDS
};
-static GdbCmdParseEntry cmd_handler_table[NUM_CMDS] = {
+static const GdbCmdParseEntry cmd_handler_table[NUM_CMDS] = {
[qMemTags] = {
.handler = handle_q_memtag,
.cmd_startswith = true,
@@ -590,17 +590,16 @@ static GdbCmdParseEntry cmd_handler_table[NUM_CMDS] = {
#endif /* CONFIG_USER_ONLY */
void aarch64_cpu_register_gdb_commands(ARMCPU *cpu, GString *qsupported,
- GArray *qtable, GArray *stable)
+ GPtrArray *qtable, GPtrArray *stable)
{
#ifdef CONFIG_USER_ONLY
/* MTE */
if (cpu_isar_feature(aa64_mte, cpu)) {
g_string_append(qsupported, ";memory-tagging+");
- g_array_append_val(qtable, cmd_handler_table[qMemTags]);
- g_array_append_val(qtable, cmd_handler_table[qIsAddressTagged]);
-
- g_array_append_val(stable, cmd_handler_table[QMemTags]);
+ g_ptr_array_add(qtable, (gpointer) &cmd_handler_table[qMemTags]);
+ g_ptr_array_add(qtable, (gpointer) &cmd_handler_table[qIsAddressTagged]);
+ g_ptr_array_add(stable, (gpointer) &cmd_handler_table[QMemTags]);
}
#endif
}
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 04/16] plugins/stoptrigger: TCG plugin to stop execution under conditions
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (2 preceding siblings ...)
2024-07-22 11:04 ` [PULL 03/16] gdbstub: Re-factor gdb command extensions Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 05/16] plugins: fix mem callback array size Alex Bennée
` (12 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Simon Hamelin, Alexandre Iooss, Pierrick Bouvier,
Alex Bennée, Mahmoud Mandour, Richard Henderson,
Paolo Bonzini
From: Simon Hamelin <simon.hamelin@grenoble-inp.org>
This new plugin allows to stop emulation using conditions on the
emulation state. By setting this plugin arguments, it is possible
to set an instruction count limit and/or trigger address(es) to stop at.
The code returned at emulation exit can be customized.
This plugin demonstrates how someone could stop QEMU execution.
It could be used for research purposes to launch some code and
deterministically stop it and understand where its execution flow went.
Co-authored-by: Alexandre Iooss <erdnaxe@crans.org>
Signed-off-by: Simon Hamelin <simon.hamelin@grenoble-inp.org>
Signed-off-by: Alexandre Iooss <erdnaxe@crans.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20240715081521.19122-2-simon.hamelin@grenoble-inp.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-5-alex.bennee@linaro.org>
diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst
index f7d7b9e3a4..954623f9bf 100644
--- a/docs/devel/tcg-plugins.rst
+++ b/docs/devel/tcg-plugins.rst
@@ -642,6 +642,28 @@ The plugin has a number of arguments, all of them are optional:
configuration arguments implies ``l2=on``.
(default: N = 2097152 (2MB), B = 64, A = 16)
+- contrib/plugins/stoptrigger.c
+
+The stoptrigger plugin allows to setup triggers to stop emulation.
+It can be used for research purposes to launch some code and precisely stop it
+and understand where its execution flow went.
+
+Two types of triggers can be configured: a count of instructions to stop at,
+or an address to stop at. Multiple triggers can be set at once.
+
+By default, QEMU will exit with return code 0. A custom return code can be
+configured for each trigger using ``:CODE`` syntax.
+
+For example, to stop at the 20-th instruction with return code 41, at address
+0xd4 with return code 0 or at address 0xd8 with return code 42::
+
+ $ qemu-system-aarch64 $(QEMU_ARGS) \
+ -plugin ./contrib/plugins/libstoptrigger.so,icount=20:41,addr=0xd4,addr=0xd8:42 -d plugin
+
+The plugin will log the reason of exit, for example::
+
+ 0xd4 reached, exiting
+
Plugin API
==========
diff --git a/contrib/plugins/stoptrigger.c b/contrib/plugins/stoptrigger.c
new file mode 100644
index 0000000000..03ee22f4c6
--- /dev/null
+++ b/contrib/plugins/stoptrigger.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2024, Simon Hamelin <simon.hamelin@grenoble-inp.org>
+ *
+ * Stop execution once a given address is reached or if the
+ * count of executed instructions reached a specified limit
+ *
+ * License: GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#include <assert.h>
+#include <glib.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <qemu-plugin.h>
+
+QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION;
+
+/* Scoreboard to track executed instructions count */
+typedef struct {
+ uint64_t insn_count;
+} InstructionsCount;
+static struct qemu_plugin_scoreboard *insn_count_sb;
+static qemu_plugin_u64 insn_count;
+
+static uint64_t icount;
+static int icount_exit_code;
+
+static bool exit_on_icount;
+static bool exit_on_address;
+
+/* Map trigger addresses to exit code */
+static GHashTable *addrs_ht;
+
+static void exit_emulation(int return_code, char *message)
+{
+ qemu_plugin_outs(message);
+ g_free(message);
+ exit(return_code);
+}
+
+static void exit_icount_reached(unsigned int cpu_index, void *udata)
+{
+ uint64_t insn_vaddr = GPOINTER_TO_UINT(udata);
+ char *msg = g_strdup_printf("icount reached at 0x%" PRIx64 ", exiting\n",
+ insn_vaddr);
+
+ exit_emulation(icount_exit_code, msg);
+}
+
+static void exit_address_reached(unsigned int cpu_index, void *udata)
+{
+ uint64_t insn_vaddr = GPOINTER_TO_UINT(udata);
+ char *msg = g_strdup_printf("0x%" PRIx64 " reached, exiting\n", insn_vaddr);
+ int exit_code;
+
+ exit_code = GPOINTER_TO_INT(
+ g_hash_table_lookup(addrs_ht, GUINT_TO_POINTER(insn_vaddr)));
+
+ exit_emulation(exit_code, msg);
+}
+
+static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
+{
+ size_t tb_n = qemu_plugin_tb_n_insns(tb);
+ for (size_t i = 0; i < tb_n; i++) {
+ struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i);
+ gpointer insn_vaddr = GUINT_TO_POINTER(qemu_plugin_insn_vaddr(insn));
+
+ if (exit_on_icount) {
+ /* Increment and check scoreboard for each instruction */
+ qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu(
+ insn, QEMU_PLUGIN_INLINE_ADD_U64, insn_count, 1);
+ qemu_plugin_register_vcpu_insn_exec_cond_cb(
+ insn, exit_icount_reached, QEMU_PLUGIN_CB_NO_REGS,
+ QEMU_PLUGIN_COND_EQ, insn_count, icount + 1, insn_vaddr);
+ }
+
+ if (exit_on_address) {
+ if (g_hash_table_contains(addrs_ht, insn_vaddr)) {
+ /* Exit triggered by address */
+ qemu_plugin_register_vcpu_insn_exec_cb(
+ insn, exit_address_reached, QEMU_PLUGIN_CB_NO_REGS,
+ insn_vaddr);
+ }
+ }
+ }
+}
+
+static void plugin_exit(qemu_plugin_id_t id, void *p)
+{
+ g_hash_table_destroy(addrs_ht);
+ qemu_plugin_scoreboard_free(insn_count_sb);
+}
+
+QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id,
+ const qemu_info_t *info, int argc,
+ char **argv)
+{
+ addrs_ht = g_hash_table_new(NULL, g_direct_equal);
+
+ insn_count_sb = qemu_plugin_scoreboard_new(sizeof(InstructionsCount));
+ insn_count = qemu_plugin_scoreboard_u64_in_struct(
+ insn_count_sb, InstructionsCount, insn_count);
+
+ for (int i = 0; i < argc; i++) {
+ char *opt = argv[i];
+ g_auto(GStrv) tokens = g_strsplit(opt, "=", 2);
+ if (g_strcmp0(tokens[0], "icount") == 0) {
+ g_auto(GStrv) icount_tokens = g_strsplit(tokens[1], ":", 2);
+ icount = g_ascii_strtoull(icount_tokens[0], NULL, 0);
+ if (icount < 1 || g_strrstr(icount_tokens[0], "-") != NULL) {
+ fprintf(stderr,
+ "icount parsing failed: '%s' must be a positive "
+ "integer\n",
+ icount_tokens[0]);
+ return -1;
+ }
+ if (icount_tokens[1]) {
+ icount_exit_code = g_ascii_strtoull(icount_tokens[1], NULL, 0);
+ }
+ exit_on_icount = true;
+ } else if (g_strcmp0(tokens[0], "addr") == 0) {
+ g_auto(GStrv) addr_tokens = g_strsplit(tokens[1], ":", 2);
+ uint64_t exit_addr = g_ascii_strtoull(addr_tokens[0], NULL, 0);
+ int exit_code = 0;
+ if (addr_tokens[1]) {
+ exit_code = g_ascii_strtoull(addr_tokens[1], NULL, 0);
+ }
+ g_hash_table_insert(addrs_ht, GUINT_TO_POINTER(exit_addr),
+ GINT_TO_POINTER(exit_code));
+ exit_on_address = true;
+ } else {
+ fprintf(stderr, "option parsing failed: %s\n", opt);
+ return -1;
+ }
+ }
+
+ if (!exit_on_icount && !exit_on_address) {
+ fprintf(stderr, "'icount' or 'addr' argument missing\n");
+ return -1;
+ }
+
+ /* Register translation block and exit callbacks */
+ qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans);
+ qemu_plugin_register_atexit_cb(id, plugin_exit, NULL);
+
+ return 0;
+}
diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile
index 449ead1130..98a89d5c40 100644
--- a/contrib/plugins/Makefile
+++ b/contrib/plugins/Makefile
@@ -28,6 +28,7 @@ NAMES += hwprofile
NAMES += cache
NAMES += drcov
NAMES += ips
+NAMES += stoptrigger
ifeq ($(CONFIG_WIN32),y)
SO_SUFFIX := .dll
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 05/16] plugins: fix mem callback array size
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (3 preceding siblings ...)
2024-07-22 11:04 ` [PULL 04/16] plugins/stoptrigger: TCG plugin to stop execution under conditions Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 06/16] tests/plugins: use qemu_plugin_outs for inline stats Alex Bennée
` (11 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Pierrick Bouvier, Xingtao Yao, Richard Henderson,
Alex Bennée, Paolo Bonzini
From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
data was correctly copied, but size of array was not set
(g_array_sized_new only reserves memory, but does not set size).
As a result, callbacks were not called for code path relying on
plugin_register_vcpu_mem_cb().
Found when trying to trigger mem access callbacks for atomic
instructions.
Reviewed-by: Xingtao Yao <yaoxt.fnst@fujitsu.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240706191335.878142-2-pierrick.bouvier@linaro.org>
Message-Id: <20240718094523.1198645-6-alex.bennee@linaro.org>
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index b6bae32b99..ec89a085b4 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -85,8 +85,7 @@ static void gen_enable_mem_helper(struct qemu_plugin_tb *ptb,
len = insn->mem_cbs->len;
arr = g_array_sized_new(false, false,
sizeof(struct qemu_plugin_dyn_cb), len);
- memcpy(arr->data, insn->mem_cbs->data,
- len * sizeof(struct qemu_plugin_dyn_cb));
+ g_array_append_vals(arr, insn->mem_cbs->data, len);
qemu_plugin_add_dyn_cb_arr(arr);
tcg_gen_st_ptr(tcg_constant_ptr((intptr_t)arr), tcg_env,
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 06/16] tests/plugins: use qemu_plugin_outs for inline stats
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (4 preceding siblings ...)
2024-07-22 11:04 ` [PULL 05/16] plugins: fix mem callback array size Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 07/16] plugins/execlog.c: correct dump of registers values Alex Bennée
` (10 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Pierrick Bouvier, Philippe Mathieu-Daudé,
Alexandre Iooss, Mahmoud Mandour
Using bare printf's in plugins is perfectly acceptable but they do
rather mess up the output of "make check-tcg". Convert the printfs to
use g_string and then output with the plugin output helper which will
already be captured to .pout files by the test harness.
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-7-alex.bennee@linaro.org>
diff --git a/tests/plugin/inline.c b/tests/plugin/inline.c
index cd63827b7d..73dde99578 100644
--- a/tests/plugin/inline.c
+++ b/tests/plugin/inline.c
@@ -71,10 +71,12 @@ static void stats_insn(void)
const uint64_t cond_track_left = qemu_plugin_u64_sum(insn_cond_track_count);
const uint64_t conditional =
cond_num_trigger * cond_trigger_limit + cond_track_left;
- printf("insn: %" PRIu64 "\n", expected);
- printf("insn: %" PRIu64 " (per vcpu)\n", per_vcpu);
- printf("insn: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu);
- printf("insn: %" PRIu64 " (cond cb)\n", conditional);
+ g_autoptr(GString) stats = g_string_new("");
+ g_string_append_printf(stats, "insn: %" PRIu64 "\n", expected);
+ g_string_append_printf(stats, "insn: %" PRIu64 " (per vcpu)\n", per_vcpu);
+ g_string_append_printf(stats, "insn: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu);
+ g_string_append_printf(stats, "insn: %" PRIu64 " (cond cb)\n", conditional);
+ qemu_plugin_outs(stats->str);
g_assert(expected > 0);
g_assert(per_vcpu == expected);
g_assert(inl_per_vcpu == expected);
@@ -91,10 +93,12 @@ static void stats_tb(void)
const uint64_t cond_track_left = qemu_plugin_u64_sum(tb_cond_track_count);
const uint64_t conditional =
cond_num_trigger * cond_trigger_limit + cond_track_left;
- printf("tb: %" PRIu64 "\n", expected);
- printf("tb: %" PRIu64 " (per vcpu)\n", per_vcpu);
- printf("tb: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu);
- printf("tb: %" PRIu64 " (conditional cb)\n", conditional);
+ g_autoptr(GString) stats = g_string_new("");
+ g_string_append_printf(stats, "tb: %" PRIu64 "\n", expected);
+ g_string_append_printf(stats, "tb: %" PRIu64 " (per vcpu)\n", per_vcpu);
+ g_string_append_printf(stats, "tb: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu);
+ g_string_append_printf(stats, "tb: %" PRIu64 " (conditional cb)\n", conditional);
+ qemu_plugin_outs(stats->str);
g_assert(expected > 0);
g_assert(per_vcpu == expected);
g_assert(inl_per_vcpu == expected);
@@ -107,9 +111,11 @@ static void stats_mem(void)
const uint64_t per_vcpu = qemu_plugin_u64_sum(count_mem);
const uint64_t inl_per_vcpu =
qemu_plugin_u64_sum(count_mem_inline);
- printf("mem: %" PRIu64 "\n", expected);
- printf("mem: %" PRIu64 " (per vcpu)\n", per_vcpu);
- printf("mem: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu);
+ g_autoptr(GString) stats = g_string_new("");
+ g_string_append_printf(stats, "mem: %" PRIu64 "\n", expected);
+ g_string_append_printf(stats, "mem: %" PRIu64 " (per vcpu)\n", per_vcpu);
+ g_string_append_printf(stats, "mem: %" PRIu64 " (per vcpu inline)\n", inl_per_vcpu);
+ qemu_plugin_outs(stats->str);
g_assert(expected > 0);
g_assert(per_vcpu == expected);
g_assert(inl_per_vcpu == expected);
@@ -118,6 +124,7 @@ static void stats_mem(void)
static void plugin_exit(qemu_plugin_id_t id, void *udata)
{
const unsigned int num_cpus = qemu_plugin_num_vcpus();
+ g_autoptr(GString) stats = g_string_new("");
g_assert(num_cpus == max_cpu_index + 1);
for (int i = 0; i < num_cpus ; ++i) {
@@ -135,20 +142,21 @@ static void plugin_exit(qemu_plugin_id_t id, void *udata)
qemu_plugin_u64_get(insn_cond_num_trigger, i);
const uint64_t insn_cond_left =
qemu_plugin_u64_get(insn_cond_track_count, i);
- printf("cpu %d: tb (%" PRIu64 ", %" PRIu64
- ", %" PRIu64 " * %" PRIu64 " + %" PRIu64
- ") | "
- "insn (%" PRIu64 ", %" PRIu64
- ", %" PRIu64 " * %" PRIu64 " + %" PRIu64
- ") | "
- "mem (%" PRIu64 ", %" PRIu64 ")"
- "\n",
- i,
- tb, tb_inline,
- tb_cond_trigger, cond_trigger_limit, tb_cond_left,
- insn, insn_inline,
- insn_cond_trigger, cond_trigger_limit, insn_cond_left,
- mem, mem_inline);
+ g_string_printf(stats, "cpu %d: tb (%" PRIu64 ", %" PRIu64
+ ", %" PRIu64 " * %" PRIu64 " + %" PRIu64
+ ") | "
+ "insn (%" PRIu64 ", %" PRIu64
+ ", %" PRIu64 " * %" PRIu64 " + %" PRIu64
+ ") | "
+ "mem (%" PRIu64 ", %" PRIu64 ")"
+ "\n",
+ i,
+ tb, tb_inline,
+ tb_cond_trigger, cond_trigger_limit, tb_cond_left,
+ insn, insn_inline,
+ insn_cond_trigger, cond_trigger_limit, insn_cond_left,
+ mem, mem_inline);
+ qemu_plugin_outs(stats->str);
g_assert(tb == tb_inline);
g_assert(insn == insn_inline);
g_assert(mem == mem_inline);
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 07/16] plugins/execlog.c: correct dump of registers values
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (5 preceding siblings ...)
2024-07-22 11:04 ` [PULL 06/16] tests/plugins: use qemu_plugin_outs for inline stats Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 08/16] semihosting: Include missing 'gdbstub/syscalls.h' header Alex Bennée
` (9 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Frédéric Pétrot, Pierrick Bouvier,
Alex Bennée, Alexandre Iooss, Mahmoud Mandour
From: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Register values are dumped as 'sz' chunks of two nibbles in the execlog
plugin, sz was 1 too big.
Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20240620083805.73603-1-frederic.petrot@univ-grenoble-alpes.fr>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-8-alex.bennee@linaro.org>
diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
index 371db97eb1..1c1601cc0b 100644
--- a/contrib/plugins/execlog.c
+++ b/contrib/plugins/execlog.c
@@ -101,7 +101,7 @@ static void insn_check_regs(CPU *cpu)
GByteArray *temp = reg->last;
g_string_append_printf(cpu->last_exec, ", %s -> 0x", reg->name);
/* TODO: handle BE properly */
- for (int i = sz; i >= 0; i--) {
+ for (int i = sz - 1; i >= 0; i--) {
g_string_append_printf(cpu->last_exec, "%02x",
reg->new->data[i]);
}
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 08/16] semihosting: Include missing 'gdbstub/syscalls.h' header
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (6 preceding siblings ...)
2024-07-22 11:04 ` [PULL 07/16] plugins/execlog.c: correct dump of registers values Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 09/16] target/m68k: Add semihosting stub Alex Bennée
` (8 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel; +Cc: Philippe Mathieu-Daudé, Alex Bennée
From: Philippe Mathieu-Daudé <philmd@linaro.org>
"semihosting/syscalls.h" requires definitions from
"gdbstub/syscalls.h", include it in order to avoid:
include/semihosting/syscalls.h:23:38: error: unknown type name 'gdb_syscall_complete_cb'
void semihost_sys_open(CPUState *cs, gdb_syscall_complete_cb complete,
^
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240717105723.58965-2-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-9-alex.bennee@linaro.org>
diff --git a/include/semihosting/syscalls.h b/include/semihosting/syscalls.h
index 3a5ec229eb..b5937c619a 100644
--- a/include/semihosting/syscalls.h
+++ b/include/semihosting/syscalls.h
@@ -9,6 +9,8 @@
#ifndef SEMIHOSTING_SYSCALLS_H
#define SEMIHOSTING_SYSCALLS_H
+#include "gdbstub/syscalls.h"
+
/*
* Argument loading from the guest is performed by the caller;
* results are returned via the 'complete' callback.
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 09/16] target/m68k: Add semihosting stub
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (7 preceding siblings ...)
2024-07-22 11:04 ` [PULL 08/16] semihosting: Include missing 'gdbstub/syscalls.h' header Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 10/16] target/mips: " Alex Bennée
` (7 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Paolo Bonzini, Alex Bennée,
Laurent Vivier
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Since the SEMIHOSTING feature is optional, we need
a stub to link when it is disabled.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240717105723.58965-3-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-10-alex.bennee@linaro.org>
diff --git a/target/m68k/semihosting-stub.c b/target/m68k/semihosting-stub.c
new file mode 100644
index 0000000000..d6a5965e29
--- /dev/null
+++ b/target/m68k/semihosting-stub.c
@@ -0,0 +1,15 @@
+/*
+ * m68k/ColdFire semihosting stub
+ *
+ * SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
+ * SPDX-FileCopyrightText: 2024 Linaro Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "cpu.h"
+
+void do_m68k_semihosting(CPUM68KState *env, int nr)
+{
+ g_assert_not_reached();
+}
diff --git a/target/m68k/meson.build b/target/m68k/meson.build
index 8d3f9ce288..4d213daaf6 100644
--- a/target/m68k/meson.build
+++ b/target/m68k/meson.build
@@ -11,9 +11,12 @@ m68k_ss.add(files(
m68k_system_ss = ss.source_set()
m68k_system_ss.add(files(
- 'm68k-semi.c',
'monitor.c'
))
+m68k_system_ss.add(when: ['CONFIG_SEMIHOSTING'],
+ if_true: files('m68k-semi.c'),
+ if_false: files('semihosting-stub.c')
+)
target_arch += {'m68k': m68k_ss}
target_system_arch += {'m68k': m68k_system_ss}
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 10/16] target/mips: Add semihosting stub
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (8 preceding siblings ...)
2024-07-22 11:04 ` [PULL 09/16] target/m68k: Add semihosting stub Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 11/16] target/m68k: Restrict semihosting to TCG Alex Bennée
` (6 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Alex Bennée, Aurelien Jarno,
Jiaxun Yang, Aleksandar Rikalo
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Since the SEMIHOSTING feature is optional, we need
a stub to link when it is disabled.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240717105723.58965-4-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-11-alex.bennee@linaro.org>
diff --git a/target/mips/tcg/sysemu/semihosting-stub.c b/target/mips/tcg/sysemu/semihosting-stub.c
new file mode 100644
index 0000000000..7ae27d746f
--- /dev/null
+++ b/target/mips/tcg/sysemu/semihosting-stub.c
@@ -0,0 +1,15 @@
+/*
+ * MIPS semihosting stub
+ *
+ * SPDX-FileContributor: Philippe Mathieu-Daudé <philmd@linaro.org>
+ * SPDX-FileCopyrightText: 2024 Linaro Ltd.
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "internal.h"
+
+void mips_semihosting(CPUMIPSState *env)
+{
+ g_assert_not_reached();
+}
diff --git a/target/mips/tcg/sysemu/meson.build b/target/mips/tcg/sysemu/meson.build
index ec665a4b1e..911341ac37 100644
--- a/target/mips/tcg/sysemu/meson.build
+++ b/target/mips/tcg/sysemu/meson.build
@@ -1,10 +1,12 @@
mips_system_ss.add(files(
'cp0_helper.c',
- 'mips-semi.c',
'special_helper.c',
'tlb_helper.c',
))
-
+mips_system_ss.add(when: ['CONFIG_SEMIHOSTING'],
+ if_true: files('mips-semi.c'),
+ if_false: files('semihosting-stub.c')
+)
mips_system_ss.add(when: 'TARGET_MIPS64', if_true: files(
'lcsr_helper.c',
))
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 11/16] target/m68k: Restrict semihosting to TCG
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (9 preceding siblings ...)
2024-07-22 11:04 ` [PULL 10/16] target/mips: " Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 12/16] target/mips: " Alex Bennée
` (5 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Anton Johansson, Alex Bennée,
Paolo Bonzini, Laurent Vivier
From: Philippe Mathieu-Daudé <philmd@linaro.org>
The semihosting feature depends on TCG (due to the probe_access
API access). Although TCG is the single accelerator currently
available for the m68k target, use the Kconfig "imply" directive
which is more correct (if we were to support a different accel).
Reported-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240717105723.58965-5-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-12-alex.bennee@linaro.org>
diff --git a/target/m68k/Kconfig b/target/m68k/Kconfig
index 9eae71486f..23aae24ebe 100644
--- a/target/m68k/Kconfig
+++ b/target/m68k/Kconfig
@@ -1,3 +1,3 @@
config M68K
bool
- select SEMIHOSTING
+ imply SEMIHOSTING if TCG
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 12/16] target/mips: Restrict semihosting to TCG
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (10 preceding siblings ...)
2024-07-22 11:04 ` [PULL 11/16] target/m68k: Restrict semihosting to TCG Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 13/16] target/riscv: " Alex Bennée
` (4 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Paolo Bonzini, Anton Johansson,
Alex Bennée, Aurelien Jarno, Jiaxun Yang, Aleksandar Rikalo
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Semihosting currently uses the TCG probe_access API. To prepare for
encoding the TCG dependency in Kconfig, do not enable it unless TCG
is available.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20240717105723.58965-6-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-13-alex.bennee@linaro.org>
diff --git a/target/mips/Kconfig b/target/mips/Kconfig
index eb19c94c7d..876048b150 100644
--- a/target/mips/Kconfig
+++ b/target/mips/Kconfig
@@ -1,6 +1,6 @@
config MIPS
bool
- select SEMIHOSTING
+ imply SEMIHOSTING if TCG
config MIPS64
bool
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 13/16] target/riscv: Restrict semihosting to TCG
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (11 preceding siblings ...)
2024-07-22 11:04 ` [PULL 12/16] target/mips: " Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-09-05 17:08 ` Thomas Huth
2024-07-22 11:04 ` [PULL 14/16] target/xtensa: " Alex Bennée
` (3 subsequent siblings)
16 siblings, 1 reply; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Paolo Bonzini, Anton Johansson,
Alex Bennée, Palmer Dabbelt, Alistair Francis, Bin Meng,
Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
open list:RISC-V TCG CPUs
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Semihosting currently uses the TCG probe_access API. To prepare for
encoding the TCG dependency in Kconfig, do not enable it unless TCG
is available.
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Anton Johansson <anjo@rev.ng>
Message-Id: <20240717105723.58965-7-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-14-alex.bennee@linaro.org>
diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig
index 5f30df22f2..c332616d36 100644
--- a/target/riscv/Kconfig
+++ b/target/riscv/Kconfig
@@ -1,9 +1,9 @@
config RISCV32
bool
- select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+ imply ARM_COMPATIBLE_SEMIHOSTING if TCG
select DEVICE_TREE # needed by boot.c
config RISCV64
bool
- select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
+ imply ARM_COMPATIBLE_SEMIHOSTING if TCG
select DEVICE_TREE # needed by boot.c
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 14/16] target/xtensa: Restrict semihosting to TCG
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (12 preceding siblings ...)
2024-07-22 11:04 ` [PULL 13/16] target/riscv: " Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 15/16] semihosting: Restrict " Alex Bennée
` (2 subsequent siblings)
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Anton Johansson, Alex Bennée,
Paolo Bonzini, Max Filippov
From: Philippe Mathieu-Daudé <philmd@linaro.org>
The semihosting feature depends on TCG (due to the probe_access
API access). Although TCG is the single accelerator currently
available for the xtensa target, use the Kconfig "imply" directive
which is more correct (if we were to support a different accel).
Reported-by: Anton Johansson <anjo@rev.ng>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240717105723.58965-8-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-15-alex.bennee@linaro.org>
diff --git a/target/xtensa/Kconfig b/target/xtensa/Kconfig
index 5e46049262..e8c2598c4d 100644
--- a/target/xtensa/Kconfig
+++ b/target/xtensa/Kconfig
@@ -1,3 +1,3 @@
config XTENSA
bool
- select SEMIHOSTING
+ imply SEMIHOSTING if TCG
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 15/16] semihosting: Restrict to TCG
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (13 preceding siblings ...)
2024-07-22 11:04 ` [PULL 14/16] target/xtensa: " Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 11:04 ` [PULL 16/16] tests/tcg/aarch64: Fix test-mte.py Alex Bennée
2024-07-22 21:07 ` [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Philippe Mathieu-Daudé
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Philippe Mathieu-Daudé, Richard Henderson, Alex Bennée,
Paolo Bonzini
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Semihosting currently uses the TCG probe_access API.
It is pointless to have it in the binary when TCG isn't.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240717105723.58965-9-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240718094523.1198645-16-alex.bennee@linaro.org>
diff --git a/semihosting/Kconfig b/semihosting/Kconfig
index eaf3a20ef5..fbe6ac87f9 100644
--- a/semihosting/Kconfig
+++ b/semihosting/Kconfig
@@ -1,6 +1,7 @@
config SEMIHOSTING
bool
+ depends on TCG
config ARM_COMPATIBLE_SEMIHOSTING
bool
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PULL 16/16] tests/tcg/aarch64: Fix test-mte.py
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (14 preceding siblings ...)
2024-07-22 11:04 ` [PULL 15/16] semihosting: Restrict " Alex Bennée
@ 2024-07-22 11:04 ` Alex Bennée
2024-07-22 21:07 ` [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Philippe Mathieu-Daudé
16 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 11:04 UTC (permalink / raw)
To: qemu-devel
Cc: Richard Henderson, Philippe Mathieu-Daudé, Pierrick Bouvier,
Alex Bennée, Peter Maydell, open list:ARM TCG CPUs
From: Richard Henderson <richard.henderson@linaro.org>
Python 3.12 warns:
TEST gdbstub MTE support on aarch64
/home/rth/qemu/src/tests/tcg/aarch64/gdbstub/test-mte.py:21: SyntaxWarning: invalid escape sequence '\('
PATTERN_0 = "Memory tags for address 0x[0-9a-f]+ match \(0x[0-9a-f]+\)."
Double up the \ to pass one through to the pattern.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20240719004143.1319260-1-richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
diff --git a/tests/tcg/aarch64/gdbstub/test-mte.py b/tests/tcg/aarch64/gdbstub/test-mte.py
index 2db0663c1a..66f9c25f8a 100644
--- a/tests/tcg/aarch64/gdbstub/test-mte.py
+++ b/tests/tcg/aarch64/gdbstub/test-mte.py
@@ -18,7 +18,7 @@
from test_gdbstub import main, report
-PATTERN_0 = "Memory tags for address 0x[0-9a-f]+ match \(0x[0-9a-f]+\)."
+PATTERN_0 = "Memory tags for address 0x[0-9a-f]+ match \\(0x[0-9a-f]+\\)."
PATTERN_1 = ".*(0x[0-9a-f]+)"
--
2.39.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting)
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
` (15 preceding siblings ...)
2024-07-22 11:04 ` [PULL 16/16] tests/tcg/aarch64: Fix test-mte.py Alex Bennée
@ 2024-07-22 21:07 ` Philippe Mathieu-Daudé
2024-07-22 21:09 ` Philippe Mathieu-Daudé
16 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-22 21:07 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Hi Alex,
On 22/7/24 13:03, Alex Bennée wrote:
> warn: No match for commit c135d5eaafe7aa2533da663d8e5a34a424b71eb9 found at https://gitlab.com/stsquad/qemu.git
> warn: Are you sure you pushed 'pull-target-arm-20240711-209-gc135d5eaaf' there?
Is this warning expected?
> The following changes since commit a7ddb48bd1363c8bcdf42776d320289c42191f01:
>
> Merge tag 'pull-aspeed-20240721' of https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000)
>
> are available in the Git repository at:
>
> https://gitlab.com/stsquad/qemu.git pull-target-arm-20240711-209-gc135d5eaaf
>
> for you to fetch changes up to c135d5eaafe7aa2533da663d8e5a34a424b71eb9:
>
> tests/tcg/aarch64: Fix test-mte.py (2024-07-22 09:38:17 +0100)
>
> ----------------------------------------------------------------
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting)
2024-07-22 21:07 ` [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Philippe Mathieu-Daudé
@ 2024-07-22 21:09 ` Philippe Mathieu-Daudé
2024-07-22 23:00 ` Alex Bennée
0 siblings, 1 reply; 22+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-07-22 21:09 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
On 22/7/24 23:07, Philippe Mathieu-Daudé wrote:
> Hi Alex,
>
> On 22/7/24 13:03, Alex Bennée wrote:
>> warn: No match for commit c135d5eaafe7aa2533da663d8e5a34a424b71eb9
>> found at https://gitlab.com/stsquad/qemu.git
>> warn: Are you sure you pushed
>> 'pull-target-arm-20240711-209-gc135d5eaaf' there?
>
> Is this warning expected?
Apparently the tag you pushed is pull-maintainer-9.1-rc0-220724-1.
>
>> The following changes since commit
>> a7ddb48bd1363c8bcdf42776d320289c42191f01:
>>
>> Merge tag 'pull-aspeed-20240721' of
>> https://github.com/legoater/qemu into staging (2024-07-22 07:52:05 +1000)
>>
>> are available in the Git repository at:
>>
>> https://gitlab.com/stsquad/qemu.git
>> pull-target-arm-20240711-209-gc135d5eaaf
>>
>> for you to fetch changes up to c135d5eaafe7aa2533da663d8e5a34a424b71eb9:
>>
>> tests/tcg/aarch64: Fix test-mte.py (2024-07-22 09:38:17 +0100)
>>
>> ----------------------------------------------------------------
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting)
2024-07-22 21:09 ` Philippe Mathieu-Daudé
@ 2024-07-22 23:00 ` Alex Bennée
0 siblings, 0 replies; 22+ messages in thread
From: Alex Bennée @ 2024-07-22 23:00 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> On 22/7/24 23:07, Philippe Mathieu-Daudé wrote:
>> Hi Alex,
>> On 22/7/24 13:03, Alex Bennée wrote:
>>> warn: No match for commit c135d5eaafe7aa2533da663d8e5a34a424b71eb9
>>> found at https://gitlab.com/stsquad/qemu.git
>>> warn: Are you sure you pushed
>>> 'pull-target-arm-20240711-209-gc135d5eaaf' there?
>> Is this warning expected?
>
> Apparently the tag you pushed is pull-maintainer-9.1-rc0-220724-1.
doh - I fixed up a checkpatch warning and forgot to push the new tag,
let me send v2.
>
>>
>>> The following changes since commit
>>> a7ddb48bd1363c8bcdf42776d320289c42191f01:
>>>
>>> Merge tag 'pull-aspeed-20240721' of
>>> https://github.com/legoater/qemu into staging (2024-07-22 07:52:05
>>> +1000)
>>>
>>> are available in the Git repository at:
>>>
>>> https://gitlab.com/stsquad/qemu.git
>>> pull-target-arm-20240711-209-gc135d5eaaf
>>>
>>> for you to fetch changes up to c135d5eaafe7aa2533da663d8e5a34a424b71eb9:
>>>
>>> tests/tcg/aarch64: Fix test-mte.py (2024-07-22 09:38:17 +0100)
>>>
>>> ----------------------------------------------------------------
>>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PULL 13/16] target/riscv: Restrict semihosting to TCG
2024-07-22 11:04 ` [PULL 13/16] target/riscv: " Alex Bennée
@ 2024-09-05 17:08 ` Thomas Huth
2024-09-06 8:20 ` Thomas Huth
0 siblings, 1 reply; 22+ messages in thread
From: Thomas Huth @ 2024-09-05 17:08 UTC (permalink / raw)
To: Alex Bennée, qemu-devel, Paolo Bonzini,
Philippe Mathieu-Daudé
Cc: Anton Johansson, Palmer Dabbelt, Alistair Francis, Bin Meng,
Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
open list:RISC-V TCG CPUs
On 22/07/2024 13.04, Alex Bennée wrote:
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> Semihosting currently uses the TCG probe_access API. To prepare for
> encoding the TCG dependency in Kconfig, do not enable it unless TCG
> is available.
>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Anton Johansson <anjo@rev.ng>
> Message-Id: <20240717105723.58965-7-philmd@linaro.org>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Message-Id: <20240718094523.1198645-14-alex.bennee@linaro.org>
>
> diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig
> index 5f30df22f2..c332616d36 100644
> --- a/target/riscv/Kconfig
> +++ b/target/riscv/Kconfig
> @@ -1,9 +1,9 @@
> config RISCV32
> bool
> - select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
> + imply ARM_COMPATIBLE_SEMIHOSTING if TCG
> select DEVICE_TREE # needed by boot.c
>
> config RISCV64
> bool
> - select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
> + imply ARM_COMPATIBLE_SEMIHOSTING if TCG
> select DEVICE_TREE # needed by boot.c
Hi,
this patch broke compilation with "--without-default-devices":
/usr/bin/ld: libqemu-riscv64-softmmu.a.p/target_riscv_cpu_helper.c.o: in
function `riscv_cpu_do_interrupt':
.../qemu/target/riscv/cpu_helper.c:1678:(.text+0x283c): undefined reference
to `do_common_semihosting'
Could you please have a look? I think we either have to revert to "select"
instead of "imply", or you might need to put some "#if
CONFIG_ARM_COMPATIBLE_SEMIHOSTING" into the code that calls
do_common_semihosting() ...?
Thomas
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PULL 13/16] target/riscv: Restrict semihosting to TCG
2024-09-05 17:08 ` Thomas Huth
@ 2024-09-06 8:20 ` Thomas Huth
0 siblings, 0 replies; 22+ messages in thread
From: Thomas Huth @ 2024-09-06 8:20 UTC (permalink / raw)
To: Alex Bennée, qemu-devel, Paolo Bonzini,
Philippe Mathieu-Daudé
Cc: Anton Johansson, Palmer Dabbelt, Alistair Francis, Bin Meng,
Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
open list:RISC-V TCG CPUs
On 05/09/2024 19.08, Thomas Huth wrote:
> On 22/07/2024 13.04, Alex Bennée wrote:
>> From: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>> Semihosting currently uses the TCG probe_access API. To prepare for
>> encoding the TCG dependency in Kconfig, do not enable it unless TCG
>> is available.
>>
>> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Anton Johansson <anjo@rev.ng>
>> Message-Id: <20240717105723.58965-7-philmd@linaro.org>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> Message-Id: <20240718094523.1198645-14-alex.bennee@linaro.org>
>>
>> diff --git a/target/riscv/Kconfig b/target/riscv/Kconfig
>> index 5f30df22f2..c332616d36 100644
>> --- a/target/riscv/Kconfig
>> +++ b/target/riscv/Kconfig
>> @@ -1,9 +1,9 @@
>> config RISCV32
>> bool
>> - select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
>> + imply ARM_COMPATIBLE_SEMIHOSTING if TCG
>> select DEVICE_TREE # needed by boot.c
>> config RISCV64
>> bool
>> - select ARM_COMPATIBLE_SEMIHOSTING # for do_common_semihosting()
>> + imply ARM_COMPATIBLE_SEMIHOSTING if TCG
>> select DEVICE_TREE # needed by boot.c
>
> Hi,
>
> this patch broke compilation with "--without-default-devices":
>
> /usr/bin/ld: libqemu-riscv64-softmmu.a.p/target_riscv_cpu_helper.c.o: in
> function `riscv_cpu_do_interrupt':
> .../qemu/target/riscv/cpu_helper.c:1678:(.text+0x283c): undefined reference
> to `do_common_semihosting'
>
> Could you please have a look? I think we either have to revert to "select"
> instead of "imply", or you might need to put some "#if
> CONFIG_ARM_COMPATIBLE_SEMIHOSTING" into the code that calls
> do_common_semihosting() ...?
Suggested a patch here now:
https://lore.kernel.org/qemu-devel/20240906080928.710051-1-thuth@redhat.com/
Thomas
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2024-09-06 8:21 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-22 11:03 [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Alex Bennée
2024-07-22 11:03 ` [PULL 01/16] testing: bump to latest libvirt-ci Alex Bennée
2024-07-22 11:03 ` [PULL 02/16] tests/avocado: Remove non-working sparc leon3 test Alex Bennée
2024-07-22 11:04 ` [PULL 03/16] gdbstub: Re-factor gdb command extensions Alex Bennée
2024-07-22 11:04 ` [PULL 04/16] plugins/stoptrigger: TCG plugin to stop execution under conditions Alex Bennée
2024-07-22 11:04 ` [PULL 05/16] plugins: fix mem callback array size Alex Bennée
2024-07-22 11:04 ` [PULL 06/16] tests/plugins: use qemu_plugin_outs for inline stats Alex Bennée
2024-07-22 11:04 ` [PULL 07/16] plugins/execlog.c: correct dump of registers values Alex Bennée
2024-07-22 11:04 ` [PULL 08/16] semihosting: Include missing 'gdbstub/syscalls.h' header Alex Bennée
2024-07-22 11:04 ` [PULL 09/16] target/m68k: Add semihosting stub Alex Bennée
2024-07-22 11:04 ` [PULL 10/16] target/mips: " Alex Bennée
2024-07-22 11:04 ` [PULL 11/16] target/m68k: Restrict semihosting to TCG Alex Bennée
2024-07-22 11:04 ` [PULL 12/16] target/mips: " Alex Bennée
2024-07-22 11:04 ` [PULL 13/16] target/riscv: " Alex Bennée
2024-09-05 17:08 ` Thomas Huth
2024-09-06 8:20 ` Thomas Huth
2024-07-22 11:04 ` [PULL 14/16] target/xtensa: " Alex Bennée
2024-07-22 11:04 ` [PULL 15/16] semihosting: Restrict " Alex Bennée
2024-07-22 11:04 ` [PULL 16/16] tests/tcg/aarch64: Fix test-mte.py Alex Bennée
2024-07-22 21:07 ` [PULL 00/16] Final bits for 9.1-rc0 (docker, plugins, gdbstub, semihosting) Philippe Mathieu-Daudé
2024-07-22 21:09 ` Philippe Mathieu-Daudé
2024-07-22 23:00 ` Alex Bennée
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).