summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>2023-02-06 17:45:55 +0100
committerJanosch Frank <frankja@linux.ibm.com>2023-02-07 18:05:59 +0100
commitdc55ceaef616bdac73810d6588c23a5b50d24911 (patch)
tree3b7ce7974429ffdc5d2d6d398844d9e2be210c90
parentKVM: s390: selftest: memop: Fix wrong address being used in test (diff)
downloadlinux-dc55ceaef616bdac73810d6588c23a5b50d24911.tar.xz
linux-dc55ceaef616bdac73810d6588c23a5b50d24911.zip
KVM: s390: selftest: memop: Fix integer literal
The address is a 64 bit value, specifying a 32 bit value can crash the guest. In this case things worked out with -O2 but not -O0. Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Fixes: 1bb873495a9e ("KVM: s390: selftests: Add more copy memop tests") Reviewed-by: Thomas Huth <thuth@redhat.com> Link: https://lore.kernel.org/r/20230206164602.138068-8-scgl@linux.ibm.com Message-Id: <20230206164602.138068-8-scgl@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
-rw-r--r--tools/testing/selftests/kvm/s390x/memop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c
index 1ae5c01f9904..c5fec84ef3c2 100644
--- a/tools/testing/selftests/kvm/s390x/memop.c
+++ b/tools/testing/selftests/kvm/s390x/memop.c
@@ -514,7 +514,7 @@ static void guest_copy_key_fetch_prot_override(void)
GUEST_SYNC(STAGE_INITED);
set_storage_key_range(0, PAGE_SIZE, 0x18);
set_storage_key_range((void *)last_page_addr, PAGE_SIZE, 0x0);
- asm volatile ("sske %[key],%[addr]\n" :: [addr] "r"(0), [key] "r"(0x18) : "cc");
+ asm volatile ("sske %[key],%[addr]\n" :: [addr] "r"(0L), [key] "r"(0x18) : "cc");
GUEST_SYNC(STAGE_SKEYS_SET);
for (;;) {