Skip to contentSkip to conversation

s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity

PATCH Applied Pierre Morel 3 participants 4 messages Feb 11, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity

When facility.76 MSAX3 is present for the guest we must issue a validity interception if the CRYCBD is not valid.

The bit CRYCBD.31 is an effective field and tested at each guest level and has for effect to mask the facility.76

It follows that if CRYCBD.31 is clear and AP is not in use we do not have to test the CRYCBD validatity even facility.76 is present in the host.

Fixes 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")
---
 arch/s390/kvm/vsie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/vsie.c +1 -1
index a153257..d62fa14 100644
@@ -297,7 +297,7 @@ static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
 	scb_s->crycbd = 0;
 
 	apie_h = vcpu->arch.sie_block->eca & ECA_APIE;
-	if (!apie_h && !key_msk)
+	if (!apie_h && (!key_msk || fmt_o == CRYCB_FORMAT0))
 		return 0;
 
 	if (!crycb_addr)
Signature · 1 line
2.7.4
Acked-by on v2 1/1
#1 lore raw
Quoted 8 lines · On Mon, 11 Feb 2019 10:20:49 +0100 Pierre Morel <[email protected]> wrote:

When facility.76 MSAX3 is present for the guest we must issue a validity interception if the CRYCBD is not valid.

The bit CRYCBD.31 is an effective field and tested at each guest level and has for effect to mask the facility.76

It follows that if CRYCBD.31 is clear and AP is not in use we do not have to test the CRYCBD validatity even facility.76 is present in the

s/even/even if/

Quoted 17 lines

host.

Fixes 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")
---
 arch/s390/kvm/vsie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/vsie.c +0 -0
index a153257..d62fa14 100644

arch/s390/kvm/vsie.c static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) · line 303

Quoted 8 lines
arch/s390/kvm/vsie.c +1 -1
@@ -297,7 +297,7 @@ static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
 	scb_s->crycbd = 0;
 
 	apie_h = vcpu->arch.sie_block->eca & ECA_APIE;
-	if (!apie_h && !key_msk)
+	if (!apie_h && (!key_msk || fmt_o == CRYCB_FORMAT0))
 		return 0;
 
 	if (!crycb_addr)
#2 lore raw
Quoted 6 lines · Cornelia Huck
Quoted 3 lines · On Mon, 11 Feb 2019 10:20:49 +0100 Pierre Morel <[email protected]> wrote:

When facility.76 MSAX3 is present for the guest we must issue a validity interception if the CRYCBD is not valid.

Quoted 7 lines
Quoted 5 lines

The bit CRYCBD.31 is an effective field and tested at each guest level and has for effect to mask the facility.76

It follows that if CRYCBD.31 is clear and AP is not in use we do not have to test the CRYCBD validatity even facility.76 is present in the

s/even/even if/

yes

Quoted 20 lines
Quoted 20 lines

host.

Fixes 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")
---
  arch/s390/kvm/vsie.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/vsie.c +0 -0
index a153257..d62fa14 100644
@@ -297,7 +297,7 @@ static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
  	scb_s->crycbd = 0;
 
Quoted 9 lines

arch/s390/kvm/vsie.c static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page) · line 303

Quoted 6 lines
arch/s390/kvm/vsie.c +1 -1
  	apie_h = vcpu->arch.sie_block->eca & ECA_APIE;
-	if (!apie_h && !key_msk)
+	if (!apie_h && (!key_msk || fmt_o == CRYCB_FORMAT0))
  		return 0;
 
  	if (!crycb_addr)

Thanks Pierre

Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
Reviewed-by on v2 1/1 Applied
#3 lore raw
In reply to Pierre Morel
Quoted 10 lines · Pierre Morel

When facility.76 MSAX3 is present for the guest we must issue a validity interception if the CRYCBD is not valid.

The bit CRYCBD.31 is an effective field and tested at each guest level and has for effect to mask the facility.76

It follows that if CRYCBD.31 is clear and AP is not in use we do not have to test the CRYCBD validatity even facility.76 is present in the host.

Quoted 6 lines
Fixes 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")

thanks applied.

Quoted 18 lines
---
 arch/s390/kvm/vsie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/s390/kvm/vsie.c +1 -1
index a153257..d62fa14 100644
@@ -297,7 +297,7 @@ static int shadow_crycb(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
 	scb_s->crycbd = 0;
 
 	apie_h = vcpu->arch.sie_block->eca & ECA_APIE;
-	if (!apie_h && !key_msk)
+	if (!apie_h && (!key_msk || fmt_o == CRYCB_FORMAT0))
 		return 0;
 
 	if (!crycb_addr)