* Re: [PATCH] KVM: s390: Fix pfmf and conditional skey emulation
[not found] <d85c70f9-b030-5b5a-cfd0-b4a85ee4c6b8@linux.ibm.com>
@ 2018-08-29 14:45 ` David Hildenbrand
0 siblings, 0 replies; only message in thread
From: David Hildenbrand @ 2018-08-29 14:45 UTC (permalink / raw)
To: linux-s390
On 29.08.2018 16:44, Janosch Frank wrote:
> On 29.08.2018 15:31, David Hildenbrand wrote:
>> On 29.08.2018 15:19, Janosch Frank wrote:
>>> We should not return with a lock.
>>> We also have to increase the address when we do page clearing.
>>>
>>> Fixes: bd096f644319 ("KVM: s390: Add skey emulation fault handling")
>>> Fixes: 0230cae75df6 ("KVM: s390: Replace clear_user with kvm_clear_guest")
>
> These will will be removed, KVM: s390: Add skey emulation fault handling
> is only in rc1.
>
>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>> ---
>>> arch/s390/kvm/priv.c | 9 +++++----
>>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
>>> index d68f10441a16..7d61dccfd034 100644
>>> --- a/arch/s390/kvm/priv.c
>>> +++ b/arch/s390/kvm/priv.c
>>> @@ -390,10 +390,10 @@ static int handle_sske(struct kvm_vcpu *vcpu)
>>> FAULT_FLAG_WRITE, &unlocked);
>>> rc = !rc ? -EAGAIN : rc;
>>> }
>>> + up_read(¤t->mm->mmap_sem);
>>> if (rc == -EFAULT)
>>> return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
>>>
>>> - up_read(¤t->mm->mmap_sem);
>>
>> Indeed.
>>
>>> if (rc >= 0)
>>> start += PAGE_SIZE;
>>> }
>>> @@ -1002,13 +1002,14 @@ static int handle_pfmf(struct kvm_vcpu *vcpu)
>>> FAULT_FLAG_WRITE, &unlocked);
>>> rc = !rc ? -EAGAIN : rc;
>>> }
>>> + up_read(¤t->mm->mmap_sem);
>>
>> that's certainly correct
>>
>>> if (rc == -EFAULT)
>>> return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
>>> + if (rc == -EAGAIN)
>>
>> I would prefer "rc < 0" instead I guess.
>
> No, I do not want to continue on any other rc.
> But we could add this afterwards:
> if (rc < 0)
> return rc;
Makes sense. (otherwise it could smell like an endless loop)
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-08-29 14:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <d85c70f9-b030-5b5a-cfd0-b4a85ee4c6b8@linux.ibm.com>
2018-08-29 14:45 ` [PATCH] KVM: s390: Fix pfmf and conditional skey emulation David Hildenbrand
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).