qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org,
	 Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Subject: [RFC PATCH 4/4] tests/tcg/aarch64: add system test for FEAT_XS
Date: Mon, 14 Oct 2024 13:48:58 +0300	[thread overview]
Message-ID: <20241014-arm-feat-xs-v1-4-42bb714d6b11@linaro.org> (raw)
In-Reply-To: <20241014-arm-feat-xs-v1-0-42bb714d6b11@linaro.org>

Add system test to make sure FEAT_XS is enabled for max cpu emulation
and that QEMU doesn't crash when encountering an NXS instruction
variant.

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
 tests/tcg/aarch64/system/feat-xs.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/tcg/aarch64/system/feat-xs.c b/tests/tcg/aarch64/system/feat-xs.c
new file mode 100644
index 0000000000000000000000000000000000000000..52a481c577f9420fa2f6d6a794c1f26772cb4bff
--- /dev/null
+++ b/tests/tcg/aarch64/system/feat-xs.c
@@ -0,0 +1,27 @@
+/*
+ * FEAT_XS Test
+ *
+ * Copyright (c) 2024 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include <minilib.h>
+#include <stdint.h>
+
+int main(void)
+{
+    uint64_t isar1;
+
+    asm volatile ("mrs %0, id_aa64isar1_el1" : "=r"(isar1));
+    if (((isar1 >> 56) & (0xff)) != 1) {
+        ml_printf("FEAT_XS not supported by CPU");
+        return 1;
+    }
+    /* VMALLE1NXS */
+    asm volatile (".inst 0xd508971f");
+    /* VMALLE1OSNXS */
+    asm volatile (".inst 0xd508911f");
+
+    return 0;
+}

-- 
2.45.2



  parent reply	other threads:[~2024-10-14 10:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 10:48 [RFC PATCH 0/4] No-op support for Arm FEAT_XS, feedback needed Manos Pitsidianakis
2024-10-14 10:48 ` [RFC PATCH 1/4] arm: Add FEAT_XS's TLBI NXS variants Manos Pitsidianakis
2024-10-14 16:21   ` Richard Henderson
2024-10-14 10:48 ` [RFC PATCH 2/4] arm/tcg: add decodetree entry for DSB nXS variant Manos Pitsidianakis
2024-10-14 16:30   ` Richard Henderson
2024-10-14 10:48 ` [RFC PATCH 3/4] arm/tcg/cpu64: add FEAT_XS feat in max cpu Manos Pitsidianakis
2024-10-14 16:31   ` Richard Henderson
2024-10-14 16:32   ` Richard Henderson
2024-10-14 10:48 ` Manos Pitsidianakis [this message]
2024-10-14 16:33   ` [RFC PATCH 4/4] tests/tcg/aarch64: add system test for FEAT_XS Richard Henderson
2024-10-14 17:35   ` Gustavo Romero
2024-10-14 16:41 ` [RFC PATCH 0/4] No-op support for Arm FEAT_XS, feedback needed Peter Maydell
2024-10-14 17:32 ` Gustavo Romero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241014-arm-feat-xs-v1-4-42bb714d6b11@linaro.org \
    --to=manos.pitsidianakis@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).