Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: s390: vsie: Disable some bits when in ESA mode

In the event that a nested guest is put in ESA mode,
ensure that some bits are scrubbed from the shadow SCB.

Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Hendrik Brueckner <brueckner@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

authored by

Eric Farman and committed by
Janosch Frank
a9640e2e b0ad874d

+14
+14
arch/s390/kvm/vsie.c
··· 387 387 return 0; 388 388 } 389 389 390 + static void shadow_esa(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) 391 + { 392 + struct kvm_s390_sie_block *scb_s = &vsie_page->scb_s; 393 + 394 + /* Ensure these bits are indeed turned off */ 395 + scb_s->eca &= ~ECA_VX; 396 + scb_s->ecb &= ~(ECB_GS | ECB_TE); 397 + scb_s->ecb3 &= ~ECB3_RI; 398 + scb_s->ecd &= ~ECD_HOSTREGMGMT; 399 + } 400 + 390 401 /* shadow (round up/down) the ibc to avoid validity icpt */ 391 402 static void prepare_ibc(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) 392 403 { ··· 600 589 601 590 scb_s->hpid = HPID_VSIE; 602 591 scb_s->cpnc = scb_o->cpnc; 592 + 593 + if (!(atomic_read(&scb_s->cpuflags) & CPUSTAT_ZARCH)) 594 + shadow_esa(vcpu, vsie_page); 603 595 604 596 prepare_ibc(vcpu, vsie_page); 605 597 rc = shadow_crycb(vcpu, vsie_page);