diff for duplicates of <20210914210951.2994260-3-seanjc@google.com> diff --git a/a/1.txt b/N1/1.txt index 06f3cf8..4f31669 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,40 +1,11 @@ -From: Masahiro Kozuka <masa.koz@kozuka.jp> +From: Sean Christopherson <seanjc@google.com> -Flush the destination page before invoking RECEIVE_UPDATE_DATA, as the -PSP encrypts the data with the guest's key when writing to guest memory. -If the target memory was not previously encrypted, the cache may contain -dirty, unecrypted data that will persist on non-coherent systems. +Hello Paolo, -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: Masahiro Kozuka <masa.koz@kozuka.jp> -[sean: converted bug report to changelog] -Signed-off-by: Sean Christopherson <seanjc@google.com> ---- - arch/x86/kvm/svm/sev.c | 7 +++++++ - 1 file changed, 7 insertions(+) +I am adding a SEV migration test as part of the KVM SEV selftests. -diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c -index 95228ba3cd8f..f5edc67b261b 100644 ---- a/arch/x86/kvm/svm/sev.c -+++ b/arch/x86/kvm/svm/sev.c -@@ -1470,6 +1470,13 @@ static int sev_receive_update_data(struct kvm *kvm, struct kvm_sev_cmd *argp) - goto e_free_trans; - } - -+ /* -+ * Flush (on non-coherent CPUs) before RECEIVE_UPDATE_DATA, the PSP -+ * encrypts the written data with the guest's key, and the cache may -+ * contain dirty, unencrypted data. -+ */ -+ sev_clflush_pages(guest_page, n); -+ - /* The RECEIVE_UPDATE_DATA command requires C-bit to be always set. */ - data.guest_address = (page_to_pfn(guest_page[0]) << PAGE_SHIFT) + offset; - data.guest_address |= sev_me_mask; --- -2.33.0.309.g3052b89438-goog +And while testing SEV migration with this selftest, i observed +cache coherency issues causing migration test failures, so really +need this patch to be added. + +Tested-by: Ashish Kalra <ashish.kalra@amd.com> diff --git a/a/content_digest b/N1/content_digest index 15e9764..dcf8825 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,61 +1,32 @@ "ref\020210914210951.2994260-1-seanjc@google.com\0" - "From\0Sean Christopherson <seanjc@google.com>\0" + "From\0Ashish Kalra <Ashish.Kalra@amd.com>\0" "Subject\0[PATCH 2/2] KVM: SEV: Flush cache on non-coherent systems before RECEIVE_UPDATE_DATA\0" - "Date\0Tue, 14 Sep 2021 14:09:51 -0700\0" - "To\0Paolo Bonzini <pbonzini@redhat.com>\0" - "Cc\0Sean Christopherson <seanjc@google.com>" - 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>\0" + "Date\0Wed, 20 Oct 2021 22:58:48 +0000\0" + "To\0<seanjc@google.com>" + " Paolo Bonzini <pbonzini@redhat.com>\0" + "Cc\0<brijesh.singh@amd.com>" + <jmattson@google.com> + <joro@8bytes.org> + <kvm@vger.kernel.org> + <linux-kernel@vger.kernel.org> + <marcorr@google.com> + <masa.koz@kozuka.jp> + <pgonda@google.com> + <thomas.lendacky@amd.com> + <vkuznets@redhat.com> + " <wanpengli@tencent.com>\0" "\00:1\0" "b\0" - "From: Masahiro Kozuka <masa.koz@kozuka.jp>\n" + "From: Sean Christopherson <seanjc@google.com>\n" "\n" - "Flush the destination page before invoking RECEIVE_UPDATE_DATA, as the\n" - "PSP encrypts the data with the guest's key when writing to guest memory.\n" - "If the target memory was not previously encrypted, the cache may contain\n" - "dirty, unecrypted data that will persist on non-coherent systems.\n" + "Hello Paolo,\n" "\n" - "Fixes: 15fb7de1a7f5 (\"KVM: SVM: Add KVM_SEV_RECEIVE_UPDATE_DATA command\")\n" - "Cc: stable@vger.kernel.org\n" - "Cc: Peter Gonda <pgonda@google.com>\n" - "Cc: Marc Orr <marcorr@google.com>\n" - "Cc: Tom Lendacky <thomas.lendacky@amd.com>\n" - "Cc: Brijesh Singh <brijesh.singh@amd.com>\n" - "Signed-off-by: Masahiro Kozuka <masa.koz@kozuka.jp>\n" - "[sean: converted bug report to changelog]\n" - "Signed-off-by: Sean Christopherson <seanjc@google.com>\n" - "---\n" - " arch/x86/kvm/svm/sev.c | 7 +++++++\n" - " 1 file changed, 7 insertions(+)\n" + "I am adding a SEV migration test as part of the KVM SEV selftests.\n" "\n" - "diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c\n" - "index 95228ba3cd8f..f5edc67b261b 100644\n" - "--- a/arch/x86/kvm/svm/sev.c\n" - "+++ b/arch/x86/kvm/svm/sev.c\n" - "@@ -1470,6 +1470,13 @@ static int sev_receive_update_data(struct kvm *kvm, struct kvm_sev_cmd *argp)\n" - " \t\tgoto e_free_trans;\n" - " \t}\n" - " \n" - "+\t/*\n" - "+\t * Flush (on non-coherent CPUs) before RECEIVE_UPDATE_DATA, the PSP\n" - "+\t * encrypts the written data with the guest's key, and the cache may\n" - "+\t * contain dirty, unencrypted data.\n" - "+\t */\n" - "+\tsev_clflush_pages(guest_page, n);\n" - "+\n" - " \t/* The RECEIVE_UPDATE_DATA command requires C-bit to be always set. */\n" - " \tdata.guest_address = (page_to_pfn(guest_page[0]) << PAGE_SHIFT) + offset;\n" - " \tdata.guest_address |= sev_me_mask;\n" - "-- \n" - 2.33.0.309.g3052b89438-goog + "And while testing SEV migration with this selftest, i observed\n" + "cache coherency issues causing migration test failures, so really\n" + "need this patch to be added.\n" + "\n" + Tested-by: Ashish Kalra <ashish.kalra@amd.com> -f75a30c645323fdac32d257103d1b490fac8d3ce2287bf00dca6db92677003a3 +78329922c5f798d35881ab0795e51e9f7877083a77ba3269b7f9dbdd379c0827
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox