summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJanis Schoetterl-Glausch <scgl@linux.ibm.com>2023-02-06 17:45:52 +0100
committerJanosch Frank <frankja@linux.ibm.com>2023-02-07 18:05:59 +0100
commit06e5da81c66cd688d12c0c38ef35dd7c1c1845e5 (patch)
treeb0936f8d72f61d996b8210a70fd812d072e985b8 /tools
parentKVM: s390: selftest: memop: Move testlist into main (diff)
downloadlinux-06e5da81c66cd688d12c0c38ef35dd7c1c1845e5.tar.xz
linux-06e5da81c66cd688d12c0c38ef35dd7c1c1845e5.zip
KVM: s390: selftest: memop: Add bad address test
Add a test that tries a real write to a bad address. The existing CHECK_ONLY test doesn't cover all paths. Signed-off-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20230206164602.138068-5-scgl@linux.ibm.com Message-Id: <20230206164602.138068-5-scgl@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/kvm/s390x/memop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c
index bbc191a13760..00737cceacda 100644
--- a/tools/testing/selftests/kvm/s390x/memop.c
+++ b/tools/testing/selftests/kvm/s390x/memop.c
@@ -641,7 +641,9 @@ static void _test_errors_common(struct test_info info, enum mop_target target, i
/* Bad guest address: */
rv = ERR_MOP(info, target, WRITE, mem1, size, GADDR((void *)~0xfffUL), CHECK_ONLY);
- TEST_ASSERT(rv > 0, "ioctl does not report bad guest memory access");
+ TEST_ASSERT(rv > 0, "ioctl does not report bad guest memory address with CHECK_ONLY");
+ rv = ERR_MOP(info, target, WRITE, mem1, size, GADDR((void *)~0xfffUL));
+ TEST_ASSERT(rv > 0, "ioctl does not report bad guest memory address on write");
/* Bad host address: */
rv = ERR_MOP(info, target, WRITE, 0, size, GADDR_V(mem1));