kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>, linux-kernel@vger.kernel.org
Cc: borntraeger@de.ibm.com, frankja@linux.ibm.com,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v1 4/4] s390/kvm: VSIE: correctly handle MVPG when in VSIE
Date: Sun, 20 Dec 2020 11:13:57 +0100	[thread overview]
Message-ID: <6836573a-a49d-9d9f-49e0-96b5aa479c52@redhat.com> (raw)
In-Reply-To: <20201218141811.310267-5-imbrenda@linux.ibm.com>

On 18.12.20 15:18, Claudio Imbrenda wrote:
> Correctly handle the MVPG instruction when issued by a VSIE guest.
> 

I remember that MVPG SIE documentation was completely crazy and full of
corner cases. :)

Looking at arch/s390/kvm/intercept.c:handle_mvpg_pei(), I can spot that

1. "This interception can only happen for guests with DAT disabled ..."
2. KVM does not make use of any mvpg state inside the SCB.

Can this be observed with Linux guests?


Can I get some information on what information is stored at [0xc0, 0xd)
inside the SCB? I assume it's:

0xc0: guest physical address of source PTE
0xc8: guest physical address of target PTE


Also, which conditions have to be met such that we get a ICPT_PARTEXEC:

a) State of guest DAT (I assume off?)
b) State of PTEs: What happens if there is no PTE (I assume we need two
PTEs, otherwise no such intercept)? I assume we get an intercept if one
of both PTEs is not present or the destination PTE is protected. Correct?

So, when we (g1) get an intercept for g3, can we be sure 0xc0 and 0xc8
in the scb are both valid g1 addresses pointing at our PTE, and what do
we know about these PTEs (one not present or destination protected)?

[...]
>  /*
>   * Run the vsie on a shadow scb and a shadow gmap, without any further
>   * sanity checks, handling SIE faults.
> @@ -1063,6 +1132,10 @@ static int do_vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
>  		if ((scb_s->ipa & 0xf000) != 0xf000)
>  			scb_s->ipa += 0x1000;
>  		break;
> +	case ICPT_PARTEXEC:
> +		if (scb_s->ipa == 0xb254)

Old code hat "/* MVPG only */" - why is this condition now necessary?

> +			rc = vsie_handle_mvpg(vcpu, vsie_page);
> +		break;
>  	}
>  	return rc;
>  }
> 


-- 
Thanks,

David / dhildenb


  reply	other threads:[~2020-12-20 10:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 14:18 [PATCH v1 0/4] s390/kvm: fix MVPG when in VSIE Claudio Imbrenda
2020-12-18 14:18 ` [PATCH v1 1/4] s390/kvm: VSIE: stop leaking host addresses Claudio Imbrenda
2020-12-20  9:44   ` David Hildenbrand
2021-01-04 13:58     ` Claudio Imbrenda
2021-01-04 15:36       ` David Hildenbrand
2021-01-19 14:23   ` Janosch Frank
2020-12-18 14:18 ` [PATCH v1 2/4] s390/kvm: extend guest_translate for MVPG interpretation Claudio Imbrenda
2021-01-19 14:59   ` Janosch Frank
2020-12-18 14:18 ` [PATCH v1 3/4] s390/kvm: add kvm_s390_vsie_mvpg_check needed for VSIE MVPG Claudio Imbrenda
2021-01-05 10:31   ` David Hildenbrand
2020-12-18 14:18 ` [PATCH v1 4/4] s390/kvm: VSIE: correctly handle MVPG when in VSIE Claudio Imbrenda
2020-12-20 10:13   ` David Hildenbrand [this message]
2021-01-04 15:22     ` Claudio Imbrenda
2021-01-04 16:08       ` David Hildenbrand
2021-01-04 16:36         ` Claudio Imbrenda
2021-01-05 10:17           ` David Hildenbrand
2020-12-20  9:40 ` [PATCH v1 0/4] s390/kvm: fix " David Hildenbrand
2021-01-04 15:23   ` Claudio Imbrenda

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=6836573a-a49d-9d9f-49e0-96b5aa479c52@redhat.com \
    --to=david@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).