aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-04-21 12:31:46 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-04-21 12:31:46 +0100
commit1093893f07debd06a4f2aaf677b6e90997c9245f (patch)
tree6056d068eab1b0a0fb6bb516ae6616b3a33b02d3 /softmmu
parent29c343a463450f1aa15609014fb87a0472403d70 (diff)
parentec6fb1c8cd8d55c3d2a34cacfea6df0fe6c76057 (diff)
downloadqemu-1093893f07debd06a4f2aaf677b6e90997c9245f.zip
qemu-1093893f07debd06a4f2aaf677b6e90997c9245f.tar.gz
qemu-1093893f07debd06a4f2aaf677b6e90997c9245f.tar.bz2
Merge tag 'pull-request-2023-04-20' of https://gitlab.com/thuth/qemu into staging
* Compat machines for version 8.1 * Allow setting a chardev input file on the command line * Fix .travis.yml to work with non-public Travis instances, too * Move a lot of code from specifc_ss into softmmu_ss * Add a test case for TPM TIS I2C connected to Aspeed I2C controller * Update tests/vm/freebsd to version 13 * Some more misc minor fixes here and there # -----BEGIN PGP SIGNATURE----- # # iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmRBDtMRHHRodXRoQHJl # ZGhhdC5jb20ACgkQLtnXdP5wLbXfjw//UYytlyZsDOLAMfFNGQViMmVf29KbrDRe # doDh4Nl1oZLNKm9C5XlQExhsRbLm6Hi9nyQvSCJs4CvZ1jBY6U7GfgMNIaozXWb3 # 4gQyJb9ACe/z8bQmPUVF2sdW1QZ9zpf8LWpCOTGUZiI2Tevzkz7b/F5ZxiQiseG6 # dXe8UIwdZhG4jz2+6viqjHiGlKoBkegGYoJthcwnR07aRz2woiNr7rKRiJEiv2G7 # UfMVB96uLkpEhaDoohz440/rjviazO1nt6HDvgEajXT1X5P/8phT9IvT7olAZXZH # R2Qm6YyYcSWavoPms3AryAWG8FjomcyBjuebfAVW5/x+fl/401sn9quBMoZrYPEX # dfzF64vVokdXNQEH6+qc95PdB6/+d0CZPY8ilMRtAttf2sMw7IgqhG3zDLbj9t6R # dns2/DY9zu2pp07IEAXn/iVbW4rl2HADUQncr6B/cPy++lYiFvv7LX8OE+YWOsk0 # gvxzYx6rRhr5j7xT1sP30pLwsG3mX7qRDfba1Bt19CzSbu7UGN+w+S1xclgZDoqE # 0AZIeVUuqqNTEoBLoa2xHUDGs9NjeI2+qIh0R5csS/bqDscLXj0cOluvJO48n4Rt # +SGQSCSmU/lxn6EbBz4tw3orlp0clBH9fEaSg9lYxuUTYvQOpdYS7u4d63VQFvzp # dwQ9LRDFNsA= # =8ZFL # -----END PGP SIGNATURE----- # gpg: Signature made Thu 20 Apr 2023 11:07:15 AM BST # gpg: using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5 # gpg: issuer "thuth@redhat.com" # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined] # gpg: aka "Thomas Huth <thuth@redhat.com>" [undefined] # gpg: aka "Thomas Huth <th.huth@posteo.de>" [unknown] # gpg: aka "Thomas Huth <huth@tuxfamily.org>" [undefined] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * tag 'pull-request-2023-04-20' of https://gitlab.com/thuth/qemu: (23 commits) tests/vm/freebsd: Update to FreeBSD 13.2 qtest: Add a test case for TPM TIS I2C connected to Aspeed I2C controller qtest: Move tpm_util_tis_transmit() into tpm-tis-utils.c and rename it qtest: Add functions for accessing devices on Aspeed I2C controller MAINTAINERS: Add Juan Quintela to developer guides review cpu: Remove parameter of list_cpus() hw/core: Move numa.c into the target independent source set softmmu: Move dirtylimit.c into the target independent source set hw/display: Compile vga.c as target-independent code softmmu: Make qtest.c target independent include/exec: Provide the tswap() functions for target independent code, too softmmu/qtest: Move the target-specific pseries RTAS code out of qtest.c hw/char: Move two more files from specific_ss to softmmu_ss target/i386: Set family/model/stepping of the "max" CPU according to LM bit tests/migration: Only run auto_converge in slow mode travis.yml: Add missing 'flex', 'bison' packages to 'GCC (user)' job travis.yml: Add missing clang-10 package to the 'Clang (disable-tcg)' job chardev: Allow setting file chardev input file on the command line qtest: Don't assert on "-qtest chardev:myid" test: Fix test-crypto-secret when compiling without keyring support ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'softmmu')
-rw-r--r--softmmu/dirtylimit.c3
-rw-r--r--softmmu/meson.build4
-rw-r--r--softmmu/qtest.c53
-rw-r--r--softmmu/vl.c2
4 files changed, 25 insertions, 37 deletions
diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.c
index c56f0f5..82986c1 100644
--- a/softmmu/dirtylimit.c
+++ b/softmmu/dirtylimit.c
@@ -20,6 +20,7 @@
#include "monitor/hmp.h"
#include "monitor/monitor.h"
#include "exec/memory.h"
+#include "exec/target_page.h"
#include "hw/boards.h"
#include "sysemu/kvm.h"
#include "trace.h"
@@ -236,7 +237,7 @@ static inline int64_t dirtylimit_dirty_ring_full_time(uint64_t dirtyrate)
static uint64_t max_dirtyrate;
uint32_t dirty_ring_size = kvm_dirty_ring_size();
uint64_t dirty_ring_size_meory_MB =
- dirty_ring_size * TARGET_PAGE_SIZE >> 20;
+ dirty_ring_size * qemu_target_page_size() >> 20;
if (max_dirtyrate < dirtyrate) {
max_dirtyrate = dirtyrate;
diff --git a/softmmu/meson.build b/softmmu/meson.build
index 1a7c7ac..974732b 100644
--- a/softmmu/meson.build
+++ b/softmmu/meson.build
@@ -3,8 +3,6 @@ specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files(
'ioport.c',
'memory.c',
'physmem.c',
- 'qtest.c',
- 'dirtylimit.c',
'watchpoint.c',
)])
@@ -19,10 +17,12 @@ softmmu_ss.add(files(
'cpu-throttle.c',
'cpu-timers.c',
'datadir.c',
+ 'dirtylimit.c',
'dma-helpers.c',
'globals.c',
'memory_mapping.c',
'qdev-monitor.c',
+ 'qtest.c',
'rtc.c',
'runstate-action.c',
'runstate-hmp-cmds.c',
diff --git a/softmmu/qtest.c b/softmmu/qtest.c
index 34bd2a3..f8d764b 100644
--- a/softmmu/qtest.c
+++ b/softmmu/qtest.c
@@ -13,12 +13,12 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
-#include "cpu.h"
#include "sysemu/qtest.h"
#include "sysemu/runstate.h"
#include "chardev/char-fe.h"
#include "exec/ioport.h"
#include "exec/memory.h"
+#include "exec/tswap.h"
#include "hw/qdev-core.h"
#include "hw/irq.h"
#include "qemu/accel.h"
@@ -29,10 +29,6 @@
#include "qemu/module.h"
#include "qemu/cutils.h"
#include "qom/object_interfaces.h"
-#include CONFIG_DEVICES
-#ifdef CONFIG_PSERIES
-#include "hw/ppc/spapr_rtas.h"
-#endif
#define MAX_IRQ 256
@@ -263,7 +259,7 @@ static int hex2nib(char ch)
}
}
-static void qtest_send_prefix(CharBackend *chr)
+void qtest_send_prefix(CharBackend *chr)
{
if (!qtest_log_fp || !qtest_opened) {
return;
@@ -302,8 +298,7 @@ static void qtest_send(CharBackend *chr, const char *str)
qtest_server_send(qtest_server_send_opaque, str);
}
-static void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr,
- const char *fmt, ...)
+void qtest_sendf(CharBackend *chr, const char *fmt, ...)
{
va_list ap;
gchar *buffer;
@@ -361,6 +356,15 @@ static void qtest_clock_warp(int64_t dest)
qemu_clock_notify(QEMU_CLOCK_VIRTUAL);
}
+static bool (*process_command_cb)(CharBackend *chr, gchar **words);
+
+void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words))
+{
+ assert(!process_command_cb); /* Switch to a list if we need more than one */
+
+ process_command_cb = pc_cb;
+}
+
static void qtest_process_command(CharBackend *chr, gchar **words)
{
const gchar *command;
@@ -713,30 +717,11 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
qtest_send(chr, "OK\n");
} else if (strcmp(words[0], "endianness") == 0) {
qtest_send_prefix(chr);
-#if TARGET_BIG_ENDIAN
- qtest_sendf(chr, "OK big\n");
-#else
- qtest_sendf(chr, "OK little\n");
-#endif
-#ifdef CONFIG_PSERIES
- } else if (strcmp(words[0], "rtas") == 0) {
- uint64_t res, args, ret;
- unsigned long nargs, nret;
- int rc;
-
- rc = qemu_strtoul(words[2], NULL, 0, &nargs);
- g_assert(rc == 0);
- rc = qemu_strtou64(words[3], NULL, 0, &args);
- g_assert(rc == 0);
- rc = qemu_strtoul(words[4], NULL, 0, &nret);
- g_assert(rc == 0);
- rc = qemu_strtou64(words[5], NULL, 0, &ret);
- g_assert(rc == 0);
- res = qtest_rtas_call(words[1], nargs, args, nret, ret);
-
- qtest_send_prefix(chr);
- qtest_sendf(chr, "OK %"PRIu64"\n", res);
-#endif
+ if (target_words_bigendian()) {
+ qtest_sendf(chr, "OK big\n");
+ } else {
+ qtest_sendf(chr, "OK little\n");
+ }
} else if (qtest_enabled() && strcmp(words[0], "clock_step") == 0) {
int64_t ns;
@@ -777,6 +762,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
qtest_send_prefix(chr);
qtest_sendf(chr, "OK %"PRIi64"\n",
(int64_t)qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
+ } else if (process_command_cb && process_command_cb(chr, words)) {
+ /* Command got consumed by the callback handler */
} else {
qtest_send_prefix(chr);
qtest_sendf(chr, "FAIL Unknown command '%s'\n", words[0]);
@@ -867,7 +854,7 @@ void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **
}
qtest = object_new(TYPE_QTEST);
- object_property_set_str(qtest, "chardev", "qtest", &error_abort);
+ object_property_set_str(qtest, "chardev", chr->label, &error_abort);
if (qtest_log) {
object_property_set_str(qtest, "log", qtest_log, &error_abort);
}
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ea20b23..5cb72a5 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2432,7 +2432,7 @@ static void qemu_process_help_options(void)
* to say '-cpu help -machine something'.
*/
if (cpu_option && is_help_option(cpu_option)) {
- list_cpus(cpu_option);
+ list_cpus();
exit(0);
}