mbox series

[v1,0/4] s390/kvm: fix MVPG when in VSIE

Message ID 20201218141811.310267-1-imbrenda@linux.ibm.com (mailing list archive)
Headers show
Series s390/kvm: fix MVPG when in VSIE | expand

Message

Claudio Imbrenda Dec. 18, 2020, 2:18 p.m. UTC
The current handling of the MVPG instruction when executed in a nested
guest is wrong, and can lead to the nested guest hanging.

This patchset fixes the behaviour to be more architecturally correct,
and fixes the hangs observed.

Claudio Imbrenda (4):
  s390/kvm: VSIE: stop leaking host addresses
  s390/kvm: extend guest_translate for MVPG interpretation
  s390/kvm: add kvm_s390_vsie_mvpg_check needed for VSIE MVPG
  s390/kvm: VSIE: correctly handle MVPG when in VSIE

 arch/s390/kvm/gaccess.c | 88 ++++++++++++++++++++++++++++++++++++++---
 arch/s390/kvm/gaccess.h |  3 ++
 arch/s390/kvm/vsie.c    | 78 +++++++++++++++++++++++++++++++++---
 3 files changed, 159 insertions(+), 10 deletions(-)

Comments

David Hildenbrand Dec. 20, 2020, 9:40 a.m. UTC | #1
On 18.12.20 15:18, Claudio Imbrenda wrote:
> The current handling of the MVPG instruction when executed in a nested
> guest is wrong, and can lead to the nested guest hanging.

Hi,

thanks for spotting and debugging! Is this related to nested guests
hanging while migrating (mentioned by Janosch at some point)?

Or can this not be reproduced with actual Linux guests?

Thanks!

> 
> This patchset fixes the behaviour to be more architecturally correct,
> and fixes the hangs observed.
> 
> Claudio Imbrenda (4):
>   s390/kvm: VSIE: stop leaking host addresses
>   s390/kvm: extend guest_translate for MVPG interpretation
>   s390/kvm: add kvm_s390_vsie_mvpg_check needed for VSIE MVPG
>   s390/kvm: VSIE: correctly handle MVPG when in VSIE
> 
>  arch/s390/kvm/gaccess.c | 88 ++++++++++++++++++++++++++++++++++++++---
>  arch/s390/kvm/gaccess.h |  3 ++
>  arch/s390/kvm/vsie.c    | 78 +++++++++++++++++++++++++++++++++---
>  3 files changed, 159 insertions(+), 10 deletions(-)
>
Claudio Imbrenda Jan. 4, 2021, 3:23 p.m. UTC | #2
On Sun, 20 Dec 2020 10:40:27 +0100
David Hildenbrand <david@redhat.com> wrote:

> On 18.12.20 15:18, Claudio Imbrenda wrote:
> > The current handling of the MVPG instruction when executed in a
> > nested guest is wrong, and can lead to the nested guest hanging.  
> 
> Hi,
> 
> thanks for spotting and debugging! Is this related to nested guests
> hanging while migrating (mentioned by Janosch at some point)?

no, it was found by running legacy tests in VSIE (I have written
kvm-unit-tests for this now, I'll post them Soon™)

> Or can this not be reproduced with actual Linux guests?

Linux doesn't use MVPG, and gcc in general seems to avoid it, so we
never really see this in the wild. Moreover Linux does not normally run
with DAT disabled.
 
> Thanks!
> 
> > 
> > This patchset fixes the behaviour to be more architecturally
> > correct, and fixes the hangs observed.
> > 
> > Claudio Imbrenda (4):
> >   s390/kvm: VSIE: stop leaking host addresses
> >   s390/kvm: extend guest_translate for MVPG interpretation
> >   s390/kvm: add kvm_s390_vsie_mvpg_check needed for VSIE MVPG
> >   s390/kvm: VSIE: correctly handle MVPG when in VSIE
> > 
> >  arch/s390/kvm/gaccess.c | 88
> > ++++++++++++++++++++++++++++++++++++++--- arch/s390/kvm/gaccess.h |
> >  3 ++ arch/s390/kvm/vsie.c    | 78
> > +++++++++++++++++++++++++++++++++--- 3 files changed, 159
> > insertions(+), 10 deletions(-) 
> 
>