linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Gonda <pgonda@google.com>, Marc Orr <marcorr@google.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Masahiro Kozuka <masa.koz@kozuka.jp>
Subject: Re: [PATCH 1/2] KVM: SEV: Pin guest memory for write for RECEIVE_UPDATE_DATA
Date: Tue, 21 Sep 2021 19:59:16 +0200	[thread overview]
Message-ID: <bdbe4098-a72c-6e73-6f1e-88c2ebc07571@redhat.com> (raw)
In-Reply-To: <20210914210951.2994260-2-seanjc@google.com>

On 14/09/21 23:09, Sean Christopherson wrote:
> Require the target guest page to be writable when pinning memory for
> RECEIVE_UPDATE_DATA.  Per the SEV API, the PSP writes to guest memory:
> 
>    The result is then encrypted with GCTX.VEK and written to the memory
>    pointed to by GUEST_PADDR field.
> 
> Fixes: 15fb7de1a7f5 ("KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command")
> Cc: stable@vger.kernel.org
> Cc: Peter Gonda <pgonda@google.com>
> Cc: Marc Orr <marcorr@google.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Cc: Brijesh Singh <brijesh.singh@amd.com>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
>   arch/x86/kvm/svm/sev.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
> index 75e0b21ad07c..95228ba3cd8f 100644
> --- a/arch/x86/kvm/svm/sev.c
> +++ b/arch/x86/kvm/svm/sev.c
> @@ -1464,7 +1464,7 @@ static int sev_receive_update_data(struct kvm *kvm, struct kvm_sev_cmd *argp)
>   
>   	/* Pin guest memory */
>   	guest_page = sev_pin_memory(kvm, params.guest_uaddr & PAGE_MASK,
> -				    PAGE_SIZE, &n, 0);
> +				    PAGE_SIZE, &n, 1);
>   	if (IS_ERR(guest_page)) {
>   		ret = PTR_ERR(guest_page);
>   		goto e_free_trans;
> 

Queued both, thanks.

Paolo


  parent reply	other threads:[~2021-09-21 17:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 21:09 [PATCH 0/2] KVM: SEV: RECEIVE_UPDATE_DATA bug fixes Sean Christopherson
2021-09-14 21:09 ` [PATCH 1/2] KVM: SEV: Pin guest memory for write for RECEIVE_UPDATE_DATA Sean Christopherson
2021-09-14 22:03   ` Peter Gonda
2021-09-14 22:15   ` Brijesh Singh
2021-09-21 17:59   ` Paolo Bonzini [this message]
2021-09-14 21:09 ` [PATCH 2/2] KVM: SEV: Flush cache on non-coherent systems before RECEIVE_UPDATE_DATA Sean Christopherson
     [not found]   ` <61709f42.1c69fb81.3b49.ecfeSMTPIN_ADDED_BROKEN@mx.google.com>
2021-10-21 17:01     ` Paolo Bonzini
2021-10-20 22:58 ` Ashish Kalra

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=bdbe4098-a72c-6e73-6f1e-88c2ebc07571@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=brijesh.singh@amd.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcorr@google.com \
    --cc=masa.koz@kozuka.jp \
    --cc=pgonda@google.com \
    --cc=seanjc@google.com \
    --cc=thomas.lendacky@amd.com \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    /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).