public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: linux-s390@vger.kernel.org
Subject: Re: [PATCH 09/10] KVM: s390: add and wire function gib_alert_irq_handler()
Date: Wed, 07 Nov 2018 17:52:03 +0000	[thread overview]
Message-ID: <d5fd0955-5baf-992b-9d69-df31d4d6ff94@linux.ibm.com> (raw)
In-Reply-To: <afec0606-d9c3-9938-e74d-0602e5713685@linux.ibm.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2504 bytes --]

On 07/11/2018 17:25, Michael Mueller wrote:
> 
> 
> On 06.11.18 19:42, Pierre Morel wrote:
>> On 05/11/2018 18:41, Michael Mueller wrote:
>>>
>>>
>>> On 31.10.18 13:10, Pierre Morel wrote:
>>>>> atomic_inc(&vcpu->kvm->arch.vcpus_in_sie);
>>>>> +��� if (vcpu->kvm->arch.gib_in_use)
>>>>> +������� vcpu->kvm->arch.gisa->iam = 0;
>>>>
>>>> I am not sure that this is race free....
>>>
>>> It is, I looked at the generated instructions.
>>
>> Here we clear IAM, so an IPM can be set and should trigger an 
>> interrupt in the guest
> 
> Setting or clearing the IAM has no effect whether a ISC can be set or 
> not in the IPM.
> It is cleared because we are about to enter the SIE and which will 
> evaluate the IPM and
> process the interruption possibly.
> 
> Clearing the IAM has the effect, that the fallback path (GIB alert) will 
> not be used.
> 
>>
>>>>
>>>>> vcpu->arch.sie_block->icptcode = 0;
>>>>> ����� cpuflags = atomic_read(&vcpu->arch.sie_block->cpuflags);
>>>>> @@ -3421,6 +3423,9 @@ static int vcpu_post_run(struct kvm_vcpu 
>>>>> *vcpu, int exit_reason)
>>>>> ����� vcpu->run->s.regs.gprs[15] = vcpu->arch.sie_block->gg15;
>>>>> � ����� atomic_dec(&vcpu->kvm->arch.vcpus_in_sie);
>>>>> +��� if (vcpu->kvm->arch.gib_in_use &&
>>>>> +������� !atomic_fetch_andnot(0, &vcpu->kvm->arch.vcpus_in_sie))
>>>>> +������� vcpu->kvm->arch.gisa->iam = vcpu->kvm->arch.iam;
>>>>
>>>> ... with this. Is it?
>>>
>>> the same here
>>
>> No, here we set the IAM if the interrupt comes after the vCPU sleeps 
>> and before we set the IAM we have a race window.
>>
>> What I mean is: here we should check the IPM bit to be sure not to 
>> loose an interrupt in case the IPM bit is also set.
> 
> The fallback path will be activated by setting the IAM here if no vCPU 
> of the guest is in SIE.
> 
> Yes, the ISC can be set in the IPM in the short window between exiting 
> the SIE and setting the IAM here.
> Do we loose the interruption because of that or is it just delayed? It 
> will be delivered as soon vCPU enters
> the SIE again. Can we speed up this? Maybe yes, that is further tuning.

OK, if the interruptions are delivered to the guest even if AIM is set 
then there is not problem.


> 
>>
>>>>
>>>>
>>>>> � ����� if (exit_reason == -EINTR) {
>>>>> ��������� VCPU_EVENT(vcpu, 3, "%s", "machine check");
>>>>>
>>>
>>
>>
> 


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

       reply	other threads:[~2018-11-07 17:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <afec0606-d9c3-9938-e74d-0602e5713685@linux.ibm.com>
2018-11-07 17:52 ` Pierre Morel [this message]
     [not found] <e4d9545a-32f9-6e0b-b781-49e5cc2162f1@linux.ibm.com>
2018-10-31 12:45 ` [PATCH 09/10] KVM: s390: add and wire function gib_alert_irq_handler() Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5fd0955-5baf-992b-9d69-df31d4d6ff94@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox