All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Cc: KVM <kvm@vger.kernel.org>, Cornelia Huck <cohuck@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	linux-s390 <linux-s390@vger.kernel.org>,
	Janosch Frank <frankja@linux.vnet.ibm.com>,
	David Hildenbrand <david@redhat.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>,
	Michael Mueller <mimu@linux.vnet.ibm.com>
Subject: [GIT PULL 12/22] KVM: s390: define GISA format-0 data structure
Date: Fri, 26 Jan 2018 16:53:24 +0100	[thread overview]
Message-ID: <20180126155334.52956-13-borntraeger@de.ibm.com> (raw)
In-Reply-To: <20180126155334.52956-1-borntraeger@de.ibm.com>

From: Michael Mueller <mimu@linux.vnet.ibm.com>

In preperation to support pass-through adapter interrupts, the Guest
Interruption State Area (GISA) and the Adapter Interruption Virtualization
(AIV) features will be introduced here.

This patch introduces format-0 GISA (that is defines the struct describing
the GISA, allocates storage for it, and introduces fields for the
GISA address in kvm_s390_sie_block and kvm_s390_vsie).

As the GISA requires storage below 2GB, it is put in sie_page2, which is
already allocated in ZONE_DMA. In addition, The GISA requires alignment to
its integral boundary. This is already naturally aligned via the
padding in the sie_page2.

Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/kvm_host.h | 23 +++++++++++++++++++----
 arch/s390/kvm/kvm-s390.c         |  1 +
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index d2351d63afa3b..4f89b2783512e 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -183,6 +183,7 @@ struct kvm_s390_sie_block {
 #define ECA_IB		0x40000000
 #define ECA_SIGPI	0x10000000
 #define ECA_MVPGI	0x01000000
+#define ECA_AIV		0x00200000
 #define ECA_VX		0x00020000
 #define ECA_PROTEXCI	0x00002000
 #define ECA_SII		0x00000001
@@ -227,7 +228,8 @@ struct kvm_s390_sie_block {
 	__u8    epdx;			/* 0x0069 */
 	__u8    reserved6a[2];		/* 0x006a */
 	__u32	todpr;			/* 0x006c */
-	__u8	reserved70[16];		/* 0x0070 */
+	__u32	gd;			/* 0x0070 */
+	__u8	reserved74[12];		/* 0x0074 */
 	__u64	mso;			/* 0x0080 */
 	__u64	msl;			/* 0x0088 */
 	psw_t	gpsw;			/* 0x0090 */
@@ -716,14 +718,27 @@ struct kvm_s390_crypto_cb {
 	struct kvm_s390_apcb1 apcb1;		/* 0x0080 */
 };
 
+struct kvm_s390_gisa {
+	u32 next_alert;
+	u8 ipm;
+	u8 reserved01;
+	u8 : 6;
+	u8 g : 1;
+	u8 c : 1;
+	u8 iam;
+	u8 reserved02[4];
+	u32 airq_count;
+};
+
 /*
- * sie_page2 has to be allocated as DMA because fac_list and crycb need
- * 31bit addresses in the sie control block.
+ * sie_page2 has to be allocated as DMA because fac_list, crycb and
+ * gisa need 31bit addresses in the sie control block.
  */
 struct sie_page2 {
 	__u64 fac_list[S390_ARCH_FAC_LIST_SIZE_U64];	/* 0x0000 */
 	struct kvm_s390_crypto_cb crycb;		/* 0x0800 */
-	u8 reserved900[0x1000 - 0x900];			/* 0x0900 */
+	struct kvm_s390_gisa gisa;			/* 0x0900 */
+	u8 reserved910[0x1000 - 0x910];			/* 0x0910 */
 };
 
 struct kvm_s390_vsie {
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 3dd209de2e0ca..2fbdb16010894 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1928,6 +1928,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
 	if (!kvm->arch.dbf)
 		goto out_err;
 
+	BUILD_BUG_ON(sizeof(struct sie_page2) != 4096);
 	kvm->arch.sie_page2 =
 	     (struct sie_page2 *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
 	if (!kvm->arch.sie_page2)
-- 
2.13.4

  parent reply	other threads:[~2018-01-26 15:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26 15:53 [GIT PULL 00/22] KVM: s390: Fixes and features for 4.16 part 2 Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 01/22] s390/mm: Remove superfluous parameter Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 02/22] KVM: s390: vsie: use READ_ONCE to access some SCB fields Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 03/22] KVM: s390: vsie: store guest addresses of satellite blocks in vsie_page Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 04/22] s390x/mm: simplify gmap_protect_rmap() Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 05/22] KVM: s390: diagnoses are instructions as well Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 06/22] KVM: s390: add vcpu stat counters for many instruction Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 07/22] KVM: s390: rename __set_cpuflag() to kvm_s390_set_cpuflags() Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 08/22] KVM: s390: reuse kvm_s390_set_cpuflags() Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 09/22] KVM: s390: introduce and use kvm_s390_clear_cpuflags() Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 10/22] KVM: s390: introduce and use kvm_s390_test_cpuflags() Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 11/22] KVM: s390: reverse bit ordering of irqs in pending mask Christian Borntraeger
2018-01-26 15:53 ` Christian Borntraeger [this message]
2018-01-26 15:53 ` [GIT PULL 13/22] s390/bitops: add test_and_clear_bit_inv() Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 14/22] KVM: s390: implement GISA IPM related primitives Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 15/22] s390/css: indicate the availability of the AIV facility Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 16/22] KVM: s390: exploit GISA and AIV for emulated interrupts Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 17/22] KVM: s390: abstract adapter interruption word generation from ISC Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 18/22] KVM: s390: add GISA interrupts to FLIC ioctl interface Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 19/22] KVM: s390: make kvm_s390_get_io_int() aware of GISA Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 20/22] KVM: s390: activate GISA for emulated interrupts Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 21/22] s390/sclp: expose the GISA format facility Christian Borntraeger
2018-01-26 15:53 ` [GIT PULL 22/22] KVM: s390: introduce the format-1 GISA Christian Borntraeger
2018-01-30 16:57 ` [GIT PULL 00/22] KVM: s390: Fixes and features for 4.16 part 2 Radim Krčmář

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=20180126155334.52956-13-borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.vnet.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mimu@linux.vnet.ibm.com \
    --cc=pasic@linux.vnet.ibm.com \
    --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 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.