All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Janosch Frank <frankja@linux.vnet.ibm.com>
Cc: KVM <kvm@vger.kernel.org>, "Cornelia Huck" <cohuck@redhat.com>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Collin Walling" <walling@linux.ibm.com>,
	"Jason J . Herne" <jjherne@linux.ibm.com>
Subject: [PATCH 5/7] KVM: s390: provide query function for instructions returning 32 byte
Date: Wed, 17 Apr 2019 17:28:40 +0200	[thread overview]
Message-ID: <20190417152842.71730-6-borntraeger@de.ibm.com> (raw)
In-Reply-To: <20190417152842.71730-1-borntraeger@de.ibm.com>

Some of the new features have a 32byte response for the query function.
Provide a new wrapper similar to __cpacf_query. We might want to factor
this out if other users come up, as of today there is none. So let us
keep the function within KVM.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
---
 arch/s390/kvm/kvm-s390.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index ff2444d935fd..f0404960a715 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -321,6 +321,19 @@ static inline int plo_test_bit(unsigned char nr)
 	return cc == 0;
 }
 
+static inline void __insn32_query(unsigned int opcode, u8 query[32])
+{
+	register unsigned long r0 asm("0") = 0;	/* query function */
+	register unsigned long r1 asm("1") = (unsigned long) query;
+
+	asm volatile(
+		/* Parameter regs are ignored */
+		"	.insn	rrf,%[opc] << 16,2,4,6,0\n"
+		: "=m" (*query)
+		: "d" (r0), "a" (r1), [opc] "i" (opcode)
+		: "cc");
+}
+
 static void kvm_s390_cpu_feat_init(void)
 {
 	int i;
-- 
2.19.1


  parent reply	other threads:[~2019-04-17 15:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-17 15:28 [PATCH 0/7] KVM: s390: new guest facilities Christian Borntraeger
2019-04-17 15:28 ` [PATCH 1/7] KVM: s390: add vector enhancements facility 2 to cpumodel Christian Borntraeger
2019-04-17 15:34   ` David Hildenbrand
2019-04-17 15:28 ` [PATCH 2/7] KVM: s390: add vector BCD enhancements facility " Christian Borntraeger
2019-04-17 15:34   ` David Hildenbrand
2019-04-17 15:28 ` [PATCH 3/7] KVM: s390: add MSA9 " Christian Borntraeger
2019-04-17 15:37   ` David Hildenbrand
2019-04-17 15:28 ` [PATCH 4/7] KVM: s390: enable MSA9 keywrapping functions depending on cpu model Christian Borntraeger
2019-04-17 15:38   ` David Hildenbrand
2019-04-17 15:48     ` Christian Borntraeger
2019-04-17 16:25       ` Christian Borntraeger
2019-04-17 15:47   ` David Hildenbrand
2019-04-17 15:50     ` Christian Borntraeger
2019-04-17 16:16     ` Christian Borntraeger
2019-04-17 18:29   ` [PATCH v2 " Christian Borntraeger
2019-04-18  7:35     ` Christian Borntraeger
2019-04-18  7:49       ` David Hildenbrand
2019-04-18  7:54     ` David Hildenbrand
2019-04-18  8:58       ` Christian Borntraeger
2019-04-18  9:13         ` David Hildenbrand
2019-04-18 10:17           ` Christian Borntraeger
2019-04-18 10:31             ` David Hildenbrand
2019-04-18 10:40               ` Christian Borntraeger
2019-04-18 10:46                 ` Christian Borntraeger
2019-04-17 15:28 ` Christian Borntraeger [this message]
2019-04-17 15:42   ` [PATCH 5/7] KVM: s390: provide query function for instructions returning 32 byte David Hildenbrand
2019-04-17 15:43     ` Christian Borntraeger
2019-04-17 15:45       ` David Hildenbrand
2019-04-17 15:28 ` [PATCH 6/7] KVM: s390: add enhanced sort facilty to cpu model Christian Borntraeger
2019-04-17 15:44   ` David Hildenbrand
2019-04-17 15:28 ` [PATCH 7/7] KVM: s390: add deflate conversion " Christian Borntraeger
2019-04-17 15:44   ` 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=20190417152842.71730-6-borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=jjherne@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=walling@linux.ibm.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.