qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Cornelia Huck <cohuck@redhat.com>
Cc: Halil Pasic <pasic@linux.ibm.com>,
	qemu-s390x <qemu-s390x@nongnu.org>,
	Marc Hartmayer <mhartmay@linux.ibm.com>,
	Janosch Frank <frankja@linux.ibm.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH] s390x/pv: Retry ioctls on -EINTR
Date: Fri, 27 Mar 2020 10:56:29 +0100	[thread overview]
Message-ID: <f5b72e7d-57ab-f3c3-6b37-c4a6b50e0018@redhat.com> (raw)
In-Reply-To: <2c4613ec-6a56-4288-8aa8-5599f2624c3b@de.ibm.com>

On 27.03.20 10:54, Christian Borntraeger wrote:
> 
> 
> On 27.03.20 10:49, David Hildenbrand wrote:
>> On 27.03.20 10:43, Christian Borntraeger wrote:
>>> PV_ENABLE (and maybe others) might return -EINTR when a signal is
>>> pending. Let us retry the ioctl in that case.
>>>
>>> Fixes: 4d226deafc44 ("s390x: protvirt: Support unpack facility")
>>> Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
>>> Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
>>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>>> ---
>>>  hw/s390x/pv.c | 6 +++++-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c
>>> index 8cf5cd2c9b..2758b02c96 100644
>>> --- a/hw/s390x/pv.c
>>> +++ b/hw/s390x/pv.c
>>> @@ -23,7 +23,11 @@ static int __s390_pv_cmd(uint32_t cmd, const char *cmdname, void *data)
>>>          .cmd = cmd,
>>>          .data = (uint64_t)data,
>>>      };
>>> -    int rc = kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd);
>>> +    int rc;
>>> +
>>> +    do {
>>> +        rc  = kvm_vm_ioctl(kvm_state, KVM_S390_PV_COMMAND, &pv_cmd);
>>> +    } while (rc == -EINTR);
>>>  
>>>      if (rc) {
>>>          error_report("KVM PV command %d (%s) failed: header rc %x rrc %x "
>>>
>>
>> I fail to see where that is triggered in the kernel.
>>
>> t480s: ~/git/linux/arch/s390/kvm (HEAD losgelöst bei next/master) $ git
>> grep "EINTR"
>> kvm-s390.c:     if (exit_reason == -EINTR) {
>> kvm-s390.c:             return -EINTR;
>> kvm-s390.c:             rc = -EINTR;
>> vsie.c: if (rc == -EINTR) {
>>
>>
>> Can you help me out? Is that documented?
> 
> It is related to the kernel patch.
> ksm_madvise->unmerge_ksm_pages has
> 
>                 if (signal_pending(current))
>                         err = -ERESTARTSYS;
> 
> 
> entry.S will retranslate ERESTARTSYS into -EINTR. 

That's valuable information that should go into the patch description.
Also, the documentation should be updated to reflect this. Not obvious :)


-- 
Thanks,

David / dhildenb



  reply	other threads:[~2020-03-27  9:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27  9:43 [PATCH] s390x/pv: Retry ioctls on -EINTR Christian Borntraeger
2020-03-27  9:49 ` David Hildenbrand
2020-03-27  9:54   ` Christian Borntraeger
2020-03-27  9:56     ` David Hildenbrand [this message]
2020-03-27  9:58     ` Christian Borntraeger
2020-03-27 10:01       ` David Hildenbrand
2020-03-27  9:49 ` Janosch Frank

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=f5b72e7d-57ab-f3c3-6b37-c4a6b50e0018@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=mhartmay@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    /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;
as well as URLs for NNTP newsgroup(s).