From: Janosch Frank <frankja@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
kvm@vger.kernel.org,
Christian Borntraeger <borntraeger@de.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
"David Hildenbrand" <david@redhat.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH v2] KVM: selftests: Add a test for the KVM_S390_MEM_OP ioctl
Date: Thu, 29 Aug 2019 14:21:29 +0200 [thread overview]
Message-ID: <1d3eb743-464f-58d6-9a0e-3bb2515f1744@linux.ibm.com> (raw)
In-Reply-To: <20190829121412.30194-1-thuth@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1322 bytes --]
On 8/29/19 2:14 PM, Thomas Huth wrote:
> Check that we can write and read the guest memory with this s390x
> ioctl, and that some error cases are handled correctly.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> v2: Check the ioctl also with "size" set to 0
>
[...]
> +
> + /* Zero size: */
> + ksmo.gaddr = (uintptr_t)mem1;
> + ksmo.flags = 0;
> + ksmo.size = 0;
> + ksmo.op = KVM_S390_MEMOP_LOGICAL_WRITE;
> + ksmo.buf = (uintptr_t)mem1;
> + ksmo.ar = 0;
> + rv = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_MEM_OP, &ksmo);
> + TEST_ASSERT(rv == -1, "ioctl allows 0 as size");
Test for errno == -EINVAL?
> +
> + /* Bad flags: */
> + ksmo.gaddr = (uintptr_t)mem1;
> + ksmo.flags = -1;
> + ksmo.size = maxsize;
> + ksmo.op = KVM_S390_MEMOP_LOGICAL_WRITE;
> + ksmo.buf = (uintptr_t)mem1;
> + ksmo.ar = 0;
> + rv = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_MEM_OP, &ksmo);
> + TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows all flags?");
> +
> + /* Bad operation: */
> + ksmo.gaddr = (uintptr_t)mem1;
> + ksmo.flags = 0;
> + ksmo.size = maxsize;
> + ksmo.op = -1;
> + ksmo.buf = (uintptr_t)mem1;
> + ksmo.ar = 0;
> + rv = _vcpu_ioctl(vm, VCPU_ID, KVM_S390_MEM_OP, &ksmo);
> + TEST_ASSERT(rv == -1 && errno == EINVAL, "ioctl allows all flags?");
Wrong report string
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-08-29 12:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-29 12:14 [PATCH v2] KVM: selftests: Add a test for the KVM_S390_MEM_OP ioctl Thomas Huth
2019-08-29 12:21 ` Janosch Frank [this message]
2019-08-29 12:27 ` Thomas Huth
2019-08-30 9:45 ` David Hildenbrand
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=1d3eb743-464f-58d6-9a0e-3bb2515f1744@linux.ibm.com \
--to=frankja@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=thuth@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 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).