diff options
author | Collin Walling <walling@linux.ibm.com> | 2018-08-31 12:51:19 -0400 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2018-10-01 02:51:42 -0400 |
commit | 67d49d52ae502eaea8858fbcb97e3c2891f78da9 (patch) | |
tree | 72fe89366897e691286803a123d2d1784bb22606 | |
parent | 7876320f88802b22d4e2daf7eb027dd14175a0f8 (diff) |
KVM: s390: set host program identifier
A host program identifier (HPID) provides information regarding the
underlying host environment. A level-2 (VM) guest will have an HPID
denoting Linux/KVM, which is set during VCPU setup. A level-3 (VM on a
VM) and beyond guest will have an HPID denoting KVM vSIE, which is set
for all shadow control blocks, overriding the original value of the
HPID.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Message-Id: <1535734279-10204-4-git-send-email-walling@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/kvm_host.h | 6 | ||||
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 2 | ||||
-rw-r--r-- | arch/s390/kvm/vsie.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 29c940bf8506..47a5a2562aa4 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
@@ -237,7 +237,11 @@ struct kvm_s390_sie_block { | |||
237 | psw_t gpsw; /* 0x0090 */ | 237 | psw_t gpsw; /* 0x0090 */ |
238 | __u64 gg14; /* 0x00a0 */ | 238 | __u64 gg14; /* 0x00a0 */ |
239 | __u64 gg15; /* 0x00a8 */ | 239 | __u64 gg15; /* 0x00a8 */ |
240 | __u8 reservedb0[20]; /* 0x00b0 */ | 240 | __u8 reservedb0[8]; /* 0x00b0 */ |
241 | #define HPID_KVM 0x4 | ||
242 | #define HPID_VSIE 0x5 | ||
243 | __u8 hpid; /* 0x00b8 */ | ||
244 | __u8 reservedb9[11]; /* 0x00b9 */ | ||
241 | __u16 extcpuaddr; /* 0x00c4 */ | 245 | __u16 extcpuaddr; /* 0x00c4 */ |
242 | __u16 eic; /* 0x00c6 */ | 246 | __u16 eic; /* 0x00c6 */ |
243 | __u32 reservedc8; /* 0x00c8 */ | 247 | __u32 reservedc8; /* 0x00c8 */ |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index f69333fd2fa3..a1e8205d4b6b 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -2685,6 +2685,8 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | |||
2685 | hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); | 2685 | hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); |
2686 | vcpu->arch.ckc_timer.function = kvm_s390_idle_wakeup; | 2686 | vcpu->arch.ckc_timer.function = kvm_s390_idle_wakeup; |
2687 | 2687 | ||
2688 | vcpu->arch.sie_block->hpid = HPID_KVM; | ||
2689 | |||
2688 | kvm_s390_vcpu_crypto_setup(vcpu); | 2690 | kvm_s390_vcpu_crypto_setup(vcpu); |
2689 | 2691 | ||
2690 | return rc; | 2692 | return rc; |
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c index a2b28cd1e3fe..41eab96c5f87 100644 --- a/arch/s390/kvm/vsie.c +++ b/arch/s390/kvm/vsie.c | |||
@@ -383,6 +383,8 @@ static int shadow_scb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) | |||
383 | if (test_kvm_facility(vcpu->kvm, 156)) | 383 | if (test_kvm_facility(vcpu->kvm, 156)) |
384 | scb_s->ecd |= scb_o->ecd & ECD_ETOKENF; | 384 | scb_s->ecd |= scb_o->ecd & ECD_ETOKENF; |
385 | 385 | ||
386 | scb_s->hpid = HPID_VSIE; | ||
387 | |||
386 | prepare_ibc(vcpu, vsie_page); | 388 | prepare_ibc(vcpu, vsie_page); |
387 | rc = shadow_crycb(vcpu, vsie_page); | 389 | rc = shadow_crycb(vcpu, vsie_page); |
388 | out: | 390 | out: |