All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Koller <ricarkol@google.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: pbonzini@redhat.com, maz@kernel.org, drjones@redhat.com,
	alexandru.elisei@arm.com, eric.auger@redhat.com,
	Ricardo Koller <ricarkol@google.com>
Subject: [PATCH v2 3/5] KVM: selftests: Move GUEST_ASSERT_EQ to utils header
Date: Fri, 30 Apr 2021 16:24:05 -0700	[thread overview]
Message-ID: <20210430232408.2707420-4-ricarkol@google.com> (raw)
In-Reply-To: <20210430232408.2707420-1-ricarkol@google.com>

Move GUEST_ASSERT_EQ to a common header, kvm_util.h, for other
architectures and tests to use.

Signed-off-by: Ricardo Koller <ricarkol@google.com>
---
 tools/testing/selftests/kvm/include/kvm_util.h     | 9 +++++++++
 tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
index 7880929ea548..bd26dd93ab56 100644
--- a/tools/testing/selftests/kvm/include/kvm_util.h
+++ b/tools/testing/selftests/kvm/include/kvm_util.h
@@ -388,4 +388,13 @@ uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc);
 #define GUEST_ASSERT_4(_condition, arg1, arg2, arg3, arg4) \
 	__GUEST_ASSERT((_condition), 4, (arg1), (arg2), (arg3), (arg4))
 
+#define GUEST_ASSERT_EQ(a, b) do {				\
+	__typeof(a) _a = (a);					\
+	__typeof(b) _b = (b);					\
+	if (_a != _b)						\
+		ucall(UCALL_ABORT, 4,				\
+			"Failed guest assert: "			\
+			#a " == " #b, __LINE__, _a, _b);	\
+} while(0)
+
 #endif /* SELFTEST_KVM_UTIL_H */
diff --git a/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c b/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
index e357d8e222d4..5a6a662f2e59 100644
--- a/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
+++ b/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
@@ -18,15 +18,6 @@
 #define rounded_rdmsr(x)       ROUND(rdmsr(x))
 #define rounded_host_rdmsr(x)  ROUND(vcpu_get_msr(vm, 0, x))
 
-#define GUEST_ASSERT_EQ(a, b) do {				\
-	__typeof(a) _a = (a);					\
-	__typeof(b) _b = (b);					\
-	if (_a != _b)						\
-                ucall(UCALL_ABORT, 4,				\
-                        "Failed guest assert: "			\
-                        #a " == " #b, __LINE__, _a, _b);	\
-  } while(0)
-
 static void guest_code(void)
 {
 	u64 val = 0;
-- 
2.31.1.527.g47e6f16901-goog


WARNING: multiple messages have this Message-ID (diff)
From: Ricardo Koller <ricarkol@google.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: maz@kernel.org, pbonzini@redhat.com
Subject: [PATCH v2 3/5] KVM: selftests: Move GUEST_ASSERT_EQ to utils header
Date: Fri, 30 Apr 2021 16:24:05 -0700	[thread overview]
Message-ID: <20210430232408.2707420-4-ricarkol@google.com> (raw)
In-Reply-To: <20210430232408.2707420-1-ricarkol@google.com>

Move GUEST_ASSERT_EQ to a common header, kvm_util.h, for other
architectures and tests to use.

Signed-off-by: Ricardo Koller <ricarkol@google.com>
---
 tools/testing/selftests/kvm/include/kvm_util.h     | 9 +++++++++
 tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c | 9 ---------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing/selftests/kvm/include/kvm_util.h
index 7880929ea548..bd26dd93ab56 100644
--- a/tools/testing/selftests/kvm/include/kvm_util.h
+++ b/tools/testing/selftests/kvm/include/kvm_util.h
@@ -388,4 +388,13 @@ uint64_t get_ucall(struct kvm_vm *vm, uint32_t vcpu_id, struct ucall *uc);
 #define GUEST_ASSERT_4(_condition, arg1, arg2, arg3, arg4) \
 	__GUEST_ASSERT((_condition), 4, (arg1), (arg2), (arg3), (arg4))
 
+#define GUEST_ASSERT_EQ(a, b) do {				\
+	__typeof(a) _a = (a);					\
+	__typeof(b) _b = (b);					\
+	if (_a != _b)						\
+		ucall(UCALL_ABORT, 4,				\
+			"Failed guest assert: "			\
+			#a " == " #b, __LINE__, _a, _b);	\
+} while(0)
+
 #endif /* SELFTEST_KVM_UTIL_H */
diff --git a/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c b/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
index e357d8e222d4..5a6a662f2e59 100644
--- a/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
+++ b/tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c
@@ -18,15 +18,6 @@
 #define rounded_rdmsr(x)       ROUND(rdmsr(x))
 #define rounded_host_rdmsr(x)  ROUND(vcpu_get_msr(vm, 0, x))
 
-#define GUEST_ASSERT_EQ(a, b) do {				\
-	__typeof(a) _a = (a);					\
-	__typeof(b) _b = (b);					\
-	if (_a != _b)						\
-                ucall(UCALL_ABORT, 4,				\
-                        "Failed guest assert: "			\
-                        #a " == " #b, __LINE__, _a, _b);	\
-  } while(0)
-
 static void guest_code(void)
 {
 	u64 val = 0;
-- 
2.31.1.527.g47e6f16901-goog

_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  parent reply	other threads:[~2021-04-30 23:24 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 23:24 [PATCH v2 0/5] KVM: selftests: arm64 exception handling and debug test Ricardo Koller
2021-04-30 23:24 ` Ricardo Koller
2021-04-30 23:24 ` [PATCH v2 1/5] KVM: selftests: Rename vm_handle_exception Ricardo Koller
2021-04-30 23:24   ` Ricardo Koller
2021-05-03 11:02   ` Andrew Jones
2021-05-03 11:02     ` Andrew Jones
2021-05-06 12:27   ` Auger Eric
2021-05-06 12:27     ` Auger Eric
2021-04-30 23:24 ` [PATCH v2 2/5] KVM: selftests: Introduce UCALL_UNHANDLED for unhandled vector reporting Ricardo Koller
2021-04-30 23:24   ` Ricardo Koller
2021-05-03 11:09   ` Andrew Jones
2021-05-03 11:09     ` Andrew Jones
2021-05-06 12:27     ` Auger Eric
2021-05-06 12:27       ` Auger Eric
2021-04-30 23:24 ` Ricardo Koller [this message]
2021-04-30 23:24   ` [PATCH v2 3/5] KVM: selftests: Move GUEST_ASSERT_EQ to utils header Ricardo Koller
2021-05-03 11:31   ` Andrew Jones
2021-05-03 11:31     ` Andrew Jones
2021-04-30 23:24 ` [PATCH v2 4/5] KVM: selftests: Add exception handling support for aarch64 Ricardo Koller
2021-04-30 23:24   ` Ricardo Koller
2021-05-03 10:32   ` Marc Zyngier
2021-05-03 10:32     ` Marc Zyngier
2021-05-03 19:12     ` Ricardo Koller
2021-05-03 19:12       ` Ricardo Koller
2021-05-06 12:30       ` Auger Eric
2021-05-06 12:30         ` Auger Eric
2021-05-06 19:14         ` Ricardo Koller
2021-05-06 19:14           ` Ricardo Koller
2021-05-07 14:08           ` Auger Eric
2021-05-07 14:08             ` Auger Eric
2021-05-07 17:54             ` Ricardo Koller
2021-05-07 17:54               ` Ricardo Koller
2021-05-12  7:27             ` Ricardo Koller
2021-05-12  7:27               ` Ricardo Koller
2021-05-12  8:19               ` Auger Eric
2021-05-12  8:19                 ` Auger Eric
2021-05-12  8:33                 ` Marc Zyngier
2021-05-12  8:33                   ` Marc Zyngier
2021-05-12  8:52                   ` Auger Eric
2021-05-12  8:52                     ` Auger Eric
2021-05-12 16:06                     ` Ricardo Koller
2021-05-12 16:06                       ` Ricardo Koller
2021-05-12 12:59         ` Zenghui Yu
2021-05-12 12:59           ` Zenghui Yu
2021-05-12 13:43           ` Marc Zyngier
2021-05-12 13:43             ` Marc Zyngier
2021-05-12 16:03             ` Ricardo Koller
2021-05-12 16:03               ` Ricardo Koller
2021-05-12 16:18               ` Marc Zyngier
2021-05-12 16:18                 ` Marc Zyngier
2021-05-12 21:39                 ` Ricardo Koller
2021-05-12 21:39                   ` Ricardo Koller
2021-05-07 14:31       ` Marc Zyngier
2021-05-07 14:31         ` Marc Zyngier
2021-05-07 18:02         ` Ricardo Koller
2021-05-07 18:02           ` Ricardo Koller
2021-05-03 12:39   ` Andrew Jones
2021-05-03 12:39     ` Andrew Jones
2021-04-30 23:24 ` [PATCH v2 5/5] KVM: selftests: Add aarch64/debug-exceptions test Ricardo Koller
2021-04-30 23:24   ` Ricardo Koller
2021-05-03 12:49   ` Andrew Jones
2021-05-03 12:49     ` Andrew Jones
2021-05-24 12:14 ` [PATCH v2 0/5] KVM: selftests: arm64 exception handling and debug test Paolo Bonzini
2021-05-24 12:14   ` Paolo Bonzini
2021-05-24 12:59   ` Marc Zyngier
2021-05-24 12:59     ` Marc Zyngier

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=20210430232408.2707420-4-ricarkol@google.com \
    --to=ricarkol@google.com \
    --cc=alexandru.elisei@arm.com \
    --cc=drjones@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.