Skip to contentSkip to conversation

KVM: s390: add kvm reference to struct sie_page2

PATCH Pierre Morel 1 participant 1 message Oct 29, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Pierre Morel

author Reviewed-by
#1 lore raw
Quoted 34 lines · Michael Mueller

Adding the kvm reference to struct sie_page2 will allow to determine the kvm a given gisa belongs to:

   container_of(gisa, struct sie_page2, gisa)->kvm

This functionality will be required to process a gisa in gib alert interruption context.

---
  arch/s390/include/asm/kvm_host.h | 3 ++-
  arch/s390/kvm/kvm-s390.c         | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)
arch/s390/include/asm/kvm_host.h +2 -1
index a9ec2da399b5..b5f671d7d167 100644
@@ -793,7 +793,8 @@ struct sie_page2 {
  	__u64 fac_list[S390_ARCH_FAC_LIST_SIZE_U64];	/* 0x0000 */
  	struct kvm_s390_crypto_cb crycb;		/* 0x0800 */
  	struct kvm_s390_gisa gisa;			/* 0x0900 */
-	u8 reserved920[0x1000 - 0x920];			/* 0x0920 */
+	struct kvm *kvm;				/* 0x0920 */
+	u8 reserved928[0x1000 - 0x928];			/* 0x0928 */
  };
 
  struct kvm_s390_vsie {
arch/s390/kvm/kvm-s390.c +0 -0
index 213d16e5b16a..3b358b62bf55 100644

arch/s390/kvm/kvm-s390.c int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) · line 2134

Quoted 7 lines
arch/s390/kvm/kvm-s390.c +1 -0
@@ -2128,6 +2128,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
  	if (!kvm->arch.sie_page2)
  		goto out_err;
 
+	kvm->arch.sie_page2->kvm = kvm;
  	kvm->arch.model.fac_list = kvm->arch.sie_page2->fac_list;
 
  	for (i = 0; i < kvm_s390_fac_size(); i++) {
Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in B�blingen - Germany