diff mbox series

[v5,12/15] KVM: s390: do not restore IAM immediately before SIE entry

Message ID 20181219191756.57973-13-mimu@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series KVM: s390: make use of the GIB | expand

Commit Message

Michael Mueller Dec. 19, 2018, 7:17 p.m. UTC
The IAM shall no be restored when deliverable interruptions are
delivered to vcpus by means of the PSW swap mechanism. That would
trigger the GIB alert millicode although we know that SIE will be
able to handle the pending interruption on entry.

Signed-off-by: Michael Mueller <mimu@linux.ibm.com>
---
 arch/s390/kvm/interrupt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Pierre Morel Jan. 3, 2019, 3 p.m. UTC | #1
On 19/12/2018 20:17, Michael Mueller wrote:
> The IAM shall no be restored when deliverable interruptions are
> delivered to vcpus by means of the PSW swap mechanism. That would
> trigger the GIB alert millicode although we know that SIE will be
> able to handle the pending interruption on entry.
> 
> Signed-off-by: Michael Mueller <mimu@linux.ibm.com>
> ---
>   arch/s390/kvm/interrupt.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
> index 8307717e3caf..48a93f5e5333 100644
> --- a/arch/s390/kvm/interrupt.c
> +++ b/arch/s390/kvm/interrupt.c
> @@ -328,11 +328,11 @@ static unsigned long disable_iscs(struct kvm_vcpu *vcpu,
>   	return active_mask;
>   }
>   
> -static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)
> +static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu, u16 irq_flags)
>   {
>   	unsigned long active_mask;
>   
> -	active_mask = pending_irqs(vcpu, IRQ_MASK_ALL);
> +	active_mask = pending_irqs(vcpu, irq_flags);
>   	if (!active_mask)
>   		return 0;
>   
> @@ -1090,7 +1090,7 @@ int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu)
>   
>   int kvm_s390_vcpu_has_irq(struct kvm_vcpu *vcpu, int exclude_stop)
>   {
> -	if (deliverable_irqs(vcpu))
> +	if (deliverable_irqs(vcpu, IRQ_MASK_ALL | IRQ_FLAG_IAM))

Why do we need to restore IAM here?
Michael Mueller Jan. 7, 2019, 5:53 p.m. UTC | #2
On 03.01.19 16:00, Pierre Morel wrote:
> On 19/12/2018 20:17, Michael Mueller wrote:
>> The IAM shall no be restored when deliverable interruptions are
>> delivered to vcpus by means of the PSW swap mechanism. That would
>> trigger the GIB alert millicode although we know that SIE will be
>> able to handle the pending interruption on entry.
>>
>> Signed-off-by: Michael Mueller <mimu@linux.ibm.com>
>> ---
>>   arch/s390/kvm/interrupt.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
>> index 8307717e3caf..48a93f5e5333 100644
>> --- a/arch/s390/kvm/interrupt.c
>> +++ b/arch/s390/kvm/interrupt.c
>> @@ -328,11 +328,11 @@ static unsigned long disable_iscs(struct 
>> kvm_vcpu *vcpu,
>>       return active_mask;
>>   }
>> -static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)
>> +static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu, u16 
>> irq_flags)
>>   {
>>       unsigned long active_mask;
>> -    active_mask = pending_irqs(vcpu, IRQ_MASK_ALL);
>> +    active_mask = pending_irqs(vcpu, irq_flags);
>>       if (!active_mask)
>>           return 0;
>> @@ -1090,7 +1090,7 @@ int kvm_s390_ext_call_pending(struct kvm_vcpu 
>> *vcpu)
>>   int kvm_s390_vcpu_has_irq(struct kvm_vcpu *vcpu, int exclude_stop)
>>   {
>> -    if (deliverable_irqs(vcpu))
>> +    if (deliverable_irqs(vcpu, IRQ_MASK_ALL | IRQ_FLAG_IAM))
> 
> Why do we need to restore IAM here?


please see kvm_s390_handle_wait()

It calls kvm_arch_vcpu_runnable() / kvm_s390_vcpu_has_irq()

That's the place where we want the IAM to be restored when
no ISC is pending in the IPM anymore.

> 
> 
>
diff mbox series

Patch

diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 8307717e3caf..48a93f5e5333 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -328,11 +328,11 @@  static unsigned long disable_iscs(struct kvm_vcpu *vcpu,
 	return active_mask;
 }
 
-static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu)
+static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu, u16 irq_flags)
 {
 	unsigned long active_mask;
 
-	active_mask = pending_irqs(vcpu, IRQ_MASK_ALL);
+	active_mask = pending_irqs(vcpu, irq_flags);
 	if (!active_mask)
 		return 0;
 
@@ -1090,7 +1090,7 @@  int kvm_s390_ext_call_pending(struct kvm_vcpu *vcpu)
 
 int kvm_s390_vcpu_has_irq(struct kvm_vcpu *vcpu, int exclude_stop)
 {
-	if (deliverable_irqs(vcpu))
+	if (deliverable_irqs(vcpu, IRQ_MASK_ALL | IRQ_FLAG_IAM))
 		return 1;
 
 	if (kvm_cpu_has_pending_timer(vcpu))
@@ -1262,7 +1262,7 @@  int __must_check kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu)
 	if (cpu_timer_irq_pending(vcpu))
 		set_bit(IRQ_PEND_EXT_CPU_TIMER, &li->pending_irqs);
 
-	while ((irqs = deliverable_irqs(vcpu)) && !rc) {
+	while ((irqs = deliverable_irqs(vcpu, IRQ_MASK_ALL)) && !rc) {
 		/* bits are in the reverse order of interrupt priority */
 		irq_type = find_last_bit(&irqs, IRQ_PEND_COUNT);
 		switch (irq_type) {