All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity
@ 2019-02-11  9:20 Pierre Morel
  2019-02-11  9:47 ` Cornelia Huck
  2019-02-11 12:12 ` Christian Borntraeger
  0 siblings, 2 replies; 4+ messages in thread
From: Pierre Morel @ 2019-02-11  9:20 UTC (permalink / raw)
  To: borntraeger
  Cc: david, linux-kernel, cohuck, linux-s390, kvm, frankja, akrowiak, pasic

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")
Cc: stable@vger.kernel.org

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
Reported-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
---
 arch/s390/kvm/vsie.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index a153257..d62fa14 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -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.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity
  2019-02-11  9:20 [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity Pierre Morel
@ 2019-02-11  9:47 ` Cornelia Huck
  2019-02-11 11:51   ` Pierre Morel
  2019-02-11 12:12 ` Christian Borntraeger
  1 sibling, 1 reply; 4+ messages in thread
From: Cornelia Huck @ 2019-02-11  9:47 UTC (permalink / raw)
  To: Pierre Morel
  Cc: borntraeger, david, linux-kernel, linux-s390, kvm, frankja,
	akrowiak, pasic

On Mon, 11 Feb 2019 10:20:49 +0100
Pierre Morel <pmorel@linux.ibm.com> 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/

> host.
> 
> Fixes: 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")
> Cc: stable@vger.kernel.org
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> Reported-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Acked-by: David Hildenbrand <david@redhat.com>
> ---
>  arch/s390/kvm/vsie.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
> index a153257..d62fa14 100644
> --- a/arch/s390/kvm/vsie.c
> +++ b/arch/s390/kvm/vsie.c
> @@ -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)

Acked-by: Cornelia Huck <cohuck@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity
  2019-02-11  9:47 ` Cornelia Huck
@ 2019-02-11 11:51   ` Pierre Morel
  0 siblings, 0 replies; 4+ messages in thread
From: Pierre Morel @ 2019-02-11 11:51 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: borntraeger, david, linux-kernel, linux-s390, kvm, frankja,
	akrowiak, pasic

On 11/02/2019 10:47, Cornelia Huck wrote:
> On Mon, 11 Feb 2019 10:20:49 +0100
> Pierre Morel <pmorel@linux.ibm.com> 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/

yes

> 
>> host.
>>
>> Fixes: 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")
>> Cc: stable@vger.kernel.org
>>
>> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
>> Reported-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
>> Acked-by: David Hildenbrand <david@redhat.com>
>> ---
>>   arch/s390/kvm/vsie.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
>> index a153257..d62fa14 100644
>> --- a/arch/s390/kvm/vsie.c
>> +++ b/arch/s390/kvm/vsie.c
>> @@ -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)
> 
> Acked-by: Cornelia Huck <cohuck@redhat.com>
> 

Thanks Pierre

-- 
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity
  2019-02-11  9:20 [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity Pierre Morel
  2019-02-11  9:47 ` Cornelia Huck
@ 2019-02-11 12:12 ` Christian Borntraeger
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Borntraeger @ 2019-02-11 12:12 UTC (permalink / raw)
  To: Pierre Morel
  Cc: david, linux-kernel, cohuck, linux-s390, kvm, frankja, akrowiak, pasic



On 11.02.2019 10:20, Pierre Morel 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
> host.
> 
> Fixes: 6ee74098201b ("KVM: s390: vsie: allow CRYCB FORMAT-0")
> Cc: stable@vger.kernel.org
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> Reported-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> Acked-by: David Hildenbrand <david@redhat.com>

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>

thanks applied.
> ---
>  arch/s390/kvm/vsie.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
> index a153257..d62fa14 100644
> --- a/arch/s390/kvm/vsie.c
> +++ b/arch/s390/kvm/vsie.c
> @@ -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)
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-11 12:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11  9:20 [PATCH v2] s390: vsie: Use effective CRYCBD.31 to check CRYCBD validity Pierre Morel
2019-02-11  9:47 ` Cornelia Huck
2019-02-11 11:51   ` Pierre Morel
2019-02-11 12:12 ` Christian Borntraeger

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.