aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-05-02 16:38:29 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-05-02 16:38:29 +0100
commitc586691e676214eb7edf6a468e84e7ce3b314d43 (patch)
treeff65640b4837c602f8a174c4da895801e1e177e6 /tests/qtest
parentb5f47ba73b7c1457d2f18d71c00e1a91a76fe60b (diff)
parenta4ae17e5ec512862bf73e40dfbb1e7db71f2c1e7 (diff)
downloadqemu-c586691e676214eb7edf6a468e84e7ce3b314d43.zip
qemu-c586691e676214eb7edf6a468e84e7ce3b314d43.tar.gz
qemu-c586691e676214eb7edf6a468e84e7ce3b314d43.tar.bz2
Merge tag 'pull-target-arm-20230502-2' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
target-arm queue: * Support building Arm targets with CONFIG_TCG=no (ie KVM only) * hw/net: npcm7xx_emc: set MAC in register space * hw/arm/bcm2835_property: Implement "get command line" message * Deprecate the '-singlestep' command line option in favour of '-one-insn-per-tb' and '-accel one-insn-per-tb=on' * Deprecate 'singlestep' member of QMP StatusInfo struct * docs/about/deprecated.rst: Add "since 7.1" tag to dtb-kaslr-seed deprecation * hw/net/msf2-emac: Don't modify descriptor in-place in emac_store_desc() * raspi, aspeed: Write bootloader code correctly on big-endian hosts * hw/intc/allwinner-a10-pic: Fix bug on big-endian hosts * Fix bug in A32 ERET on big-endian hosts that caused guest crash * hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields * hw/net/allwinner-sun8i-emac: Correctly byteswap descriptor fields # -----BEGIN PGP SIGNATURE----- # # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmRRIqoZHHBldGVyLm1h # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3uHxEACkO5NYXhah9KnztwhEjAUH # CnM6N9IHa4iEF7doWuiS39ZP4bXxCHnX4A1GqGRhsoub5PeiXxucTXlvkwWpOfct # pX78wHW18pVNJ2jlaly0c9cEI71ojT4zbXC3kjD9f/qHx2qI3rs3Sgb6BYC8QNnx # P/EHeefrnjwgGhBvzAJ8ATO/jpMYXukuxzjbIP0/7lqB5UxcNxv5rMTTansMO46r # JN5NdOEM8M8DoJHrHR9K3+Y2Vr1XjOowDPSF8+4rRkJB2v/3415V9bInEsTAvhQu # Ftua72vjVhTRfvgLXPc9C9S5sx6KHi+NdHfl/D7eL8B4aGHtBaUXv7pJrXUZYyLy # XNztXUx5EuzxXVN2mg8PYyasnEGjNbTUckAD40iow+DSgemB+MVJRp8f7Rb2yRHh # YuajDs77NUb9rVzozM+TTJkHfgLDkWCqX2Jm2kAea/gwowzdFCVosAs0cI+cDiBb # xQUMpERGBE2QJk/+KKc5xmIHUnXZCFTC/ieY2mpr8G6upDspzP254EjNGUCgIZmW # gYI/UTSX+f7M/+fYRgtSCdJ4LYkqdxUuGfyKccc4S2F2cCuQDGURRp4jHuI1cLyt # lkrgD1Hj3d9d8ZiMwmXDtiEsJhxDmuVmikmviigfhjLZ0QBd7FdpNz7gQR3lfDwl # YEGeFrhW2MHutjWSwxQWwQ== # =ua3Q # -----END PGP SIGNATURE----- # gpg: Signature made Tue 02 May 2023 03:48:10 PM BST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [full] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full] * tag 'pull-target-arm-20230502-2' of https://git.linaro.org/people/pmaydell/qemu-arm: (34 commits) hw/net/allwinner-sun8i-emac: Correctly byteswap descriptor fields hw/sd/allwinner-sdhost: Correctly byteswap descriptor fields target/arm: Add compile time asserts to load/store_cpu_field macros target/arm: Define and use new load_cpu_field_low32() hw/intc/allwinner-a10-pic: Don't use set_bit()/clear_bit() hw/arm/raspi: Use arm_write_bootloader() to write boot code hw/arm/aspeed: Use arm_write_bootloader() to write the bootloader hw/arm/boot: Make write_bootloader() public as arm_write_bootloader() hw/net/msf2-emac: Don't modify descriptor in-place in emac_store_desc() docs/about/deprecated.rst: Add "since 7.1" tag to dtb-kaslr-seed deprecation qmp: Deprecate 'singlestep' member of StatusInfo qapi/run-state.json: Fix missing newline at end of file hmp: Add 'one-insn-per-tb' command equivalent to 'singlestep' accel/tcg: Report one-insn-per-tb in 'info jit', not 'info status' Document that -singlestep command line option is deprecated bsd-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' linux-user: Add '-one-insn-per-tb' option equivalent to '-singlestep' accel/tcg: Use one_insn_per_tb global instead of old singlestep global softmmu: Don't use 'singlestep' global in QMP and HMP commands make one-insn-per-tb an accel option ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/arm-cpu-features.c20
-rw-r--r--tests/qtest/bios-tables-test.c11
-rw-r--r--tests/qtest/boot-serial-test.c5
-rw-r--r--tests/qtest/migration-test.c9
-rw-r--r--tests/qtest/pxe-test.c8
-rw-r--r--tests/qtest/test-hmp.c1
-rw-r--r--tests/qtest/vmgenid-test.c9
7 files changed, 54 insertions, 9 deletions
diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
index 1cb0813..3fc33fc 100644
--- a/tests/qtest/arm-cpu-features.c
+++ b/tests/qtest/arm-cpu-features.c
@@ -506,9 +506,23 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
QDict *resp;
char *error;
- assert_error(qts, "cortex-a15",
- "We cannot guarantee the CPU type 'cortex-a15' works "
- "with KVM on this host", NULL);
+ /*
+ * When using KVM, only the 'host' and 'max' CPU models are
+ * supported. Test that we're emitting a suitable error for
+ * unsupported CPU models.
+ */
+ if (qtest_has_accel("tcg")) {
+ assert_error(qts, "cortex-a7",
+ "We cannot guarantee the CPU type 'cortex-a7' works "
+ "with KVM on this host", NULL);
+ } else {
+ /*
+ * With a KVM-only build the 32-bit CPUs are not present.
+ */
+ assert_error(qts, "cortex-a7",
+ "The CPU type 'cortex-a7' is not a "
+ "recognized ARM CPU type", NULL);
+ }
assert_has_feature_enabled(qts, "host", "aarch64");
diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
index 464f873..7fd88b0 100644
--- a/tests/qtest/bios-tables-test.c
+++ b/tests/qtest/bios-tables-test.c
@@ -2045,8 +2045,7 @@ static void test_acpi_virt_oem_fields(void)
int main(int argc, char *argv[])
{
const char *arch = qtest_get_arch();
- const bool has_kvm = qtest_has_accel("kvm");
- const bool has_tcg = qtest_has_accel("tcg");
+ bool has_kvm, has_tcg;
char *v_env = getenv("V");
int ret;
@@ -2056,6 +2055,14 @@ int main(int argc, char *argv[])
g_test_init(&argc, &argv, NULL);
+ has_kvm = qtest_has_accel("kvm");
+ has_tcg = qtest_has_accel("tcg");
+
+ if (!has_tcg && !has_kvm) {
+ g_test_skip("No KVM or TCG accelerator available");
+ return 0;
+ }
+
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
ret = boot_sector_init(disk);
if (ret) {
diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c
index 3aef3a9..6dd06ae 100644
--- a/tests/qtest/boot-serial-test.c
+++ b/tests/qtest/boot-serial-test.c
@@ -287,6 +287,11 @@ int main(int argc, char *argv[])
g_test_init(&argc, &argv, NULL);
+ if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
+ g_test_skip("No KVM or TCG accelerator available");
+ return 0;
+ }
+
for (i = 0; tests[i].arch != NULL; i++) {
if (g_str_equal(arch, tests[i].arch) &&
qtest_has_machine(tests[i].machine)) {
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index 60dd53d..be73ec3 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -2477,7 +2477,7 @@ static bool kvm_dirty_ring_supported(void)
int main(int argc, char **argv)
{
- bool has_kvm;
+ bool has_kvm, has_tcg;
bool has_uffd;
const char *arch;
g_autoptr(GError) err = NULL;
@@ -2486,6 +2486,13 @@ int main(int argc, char **argv)
g_test_init(&argc, &argv, NULL);
has_kvm = qtest_has_accel("kvm");
+ has_tcg = qtest_has_accel("tcg");
+
+ if (!has_tcg && !has_kvm) {
+ g_test_skip("No KVM or TCG accelerator available");
+ return 0;
+ }
+
has_uffd = ufd_version_check();
arch = qtest_get_arch();
diff --git a/tests/qtest/pxe-test.c b/tests/qtest/pxe-test.c
index 62b6eef..e4b4822 100644
--- a/tests/qtest/pxe-test.c
+++ b/tests/qtest/pxe-test.c
@@ -131,11 +131,17 @@ int main(int argc, char *argv[])
int ret;
const char *arch = qtest_get_arch();
+ g_test_init(&argc, &argv, NULL);
+
+ if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
+ g_test_skip("No KVM or TCG accelerator available");
+ return 0;
+ }
+
ret = boot_sector_init(disk);
if(ret)
return ret;
- g_test_init(&argc, &argv, NULL);
if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
test_batch(x86_tests, false);
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index b4a920d..6704be2 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -56,6 +56,7 @@ static const char *hmp_cmds[] = {
"o /w 0 0x1234",
"object_add memory-backend-ram,id=mem1,size=256M",
"object_del mem1",
+ "one-insn-per-tb on",
"pmemsave 0 4096 \"/dev/null\"",
"p $pc + 8",
"qom-list /",
diff --git a/tests/qtest/vmgenid-test.c b/tests/qtest/vmgenid-test.c
index efba76e..324db08 100644
--- a/tests/qtest/vmgenid-test.c
+++ b/tests/qtest/vmgenid-test.c
@@ -165,13 +165,18 @@ int main(int argc, char **argv)
{
int ret;
+ g_test_init(&argc, &argv, NULL);
+
+ if (!qtest_has_accel("tcg") && !qtest_has_accel("kvm")) {
+ g_test_skip("No KVM or TCG accelerator available");
+ return 0;
+ }
+
ret = boot_sector_init(disk);
if (ret) {
return ret;
}
- g_test_init(&argc, &argv, NULL);
-
qtest_add_func("/vmgenid/vmgenid/set-guid",
vmgenid_set_guid_test);
qtest_add_func("/vmgenid/vmgenid/set-guid-auto",