From: Thomas Huth <thuth@redhat.com>
To: David Hildenbrand <david@redhat.com>, kvm@vger.kernel.org
Cc: "Christian Borntraeger" <borntraeger@de.ibm.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [kvm-unit-tests PATCH] s390x: Interception tests
Date: Mon, 29 May 2017 13:14:36 +0200 [thread overview]
Message-ID: <eb0dba98-85e9-0129-b9e8-4bffe03473b4@redhat.com> (raw)
In-Reply-To: <08cd72d0-0d1a-8e06-e74d-51f52cde86e9@redhat.com>
On 29.05.2017 12:17, David Hildenbrand wrote:
> On 29.05.2017 12:06, Thomas Huth wrote:
[...]
>> s390x/Makefile | 1 +
>> s390x/intercept.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> 2 files changed, 100 insertions(+)
>> create mode 100644 s390x/intercept.c
>
> I think you should add that to s390x/unittests.cfg as well. (running all
> tests)
Ooops, right, forgot to add that :-/
>> diff --git a/s390x/intercept.c b/s390x/intercept.c
>> new file mode 100644
>> index 0000000..b0057e3
>> --- /dev/null
>> +++ b/s390x/intercept.c
>> @@ -0,0 +1,99 @@
>> +/*
>> + * Interception tests - for s390x CPU instruction that cause a VM exit
>> + *
>> + * Copyright (c) 2017 Red Hat Inc
>> + *
>> + * Authors:
>> + * Thomas Huth <thuth@redhat.com>
>> + *
>> + * This code is free software; you can redistribute it and/or modify it
>> + * under the terms of the GNU Library General Public License version 2.
>> + */
>> +#include <libcflat.h>
>> +#include <asm/page.h>
>> +
>> +static uint8_t pagebuf[PAGE_SIZE * 2] __attribute__((aligned(PAGE_SIZE)));
>> +
>> +/* Test the SET PREFIX and STORE PREFIX instructions */
>> +static void test_prefix(void)
>> +{
>> + uint32_t old_prefix;
>> + uint32_t new_prefix = (uint32_t)(intptr_t)pagebuf;
>> +
>> + memset(pagebuf, 0, PAGE_SIZE * 2);
>> +
>> + /*
>> + * Temporarily change the prefix page to our buffer, and store
>> + * some facility bits there ... at least some of them should be
>> + * set in our buffer afterwards.
>> + */
>> + asm volatile (
>> + " stpx %0\n"
>> + " spx %1\n"
>> + " stfl 0\n"
>
> you could add another stpx to tmp_prefix here and test below if stpx
> actually return the correct value (e.g. not simply always 0).
Good idea, will do that!
>> + " spx %0\n"
>> + : "=m"(old_prefix) : "m"(new_prefix) : "memory");
>> + report("spx + stfl", pagebuf[200] != 0);
>
> I have a patch that introduced the struct lowcore and generates
> asm-offsets, will post that soon.
OK, I just saw your "generate asm offsets for the lowcore" on the list
... will have a look at that...
Thomas
next prev parent reply other threads:[~2017-05-29 11:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-29 10:06 [kvm-unit-tests PATCH] s390x: Interception tests Thomas Huth
2017-05-29 10:17 ` David Hildenbrand
2017-05-29 11:14 ` Thomas Huth [this message]
2017-05-29 11:01 ` Paolo Bonzini
2017-05-29 13:13 ` Thomas Huth
2017-05-29 13:15 ` Paolo Bonzini
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=eb0dba98-85e9-0129-b9e8-4bffe03473b4@redhat.com \
--to=thuth@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@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