[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] s390x/pv: Retry ioctls on -EINTR
From: |
David Hildenbrand |
Subject: |
Re: [PATCH] s390x/pv: Retry ioctls on -EINTR |
Date: |
Fri, 27 Mar 2020 10:56:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 |
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 <address@hidden>
>>> Tested-by: Marc Hartmayer <address@hidden>
>>> Signed-off-by: Christian Borntraeger <address@hidden>
>>> ---
>>> 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