From: Peter Gonda <pgonda@google.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Peter Gonda <pgonda@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Marc Orr <marcorr@google.com>
Subject: [PATCH 1/3] selftests: sev_migrate_tests: Fix test_sev_mirror()
Date: Wed, 8 Dec 2021 11:16:40 -0800 [thread overview]
Message-ID: <20211208191642.3792819-2-pgonda@google.com> (raw)
In-Reply-To: <20211208191642.3792819-1-pgonda@google.com>
Mirrors should not be able to call LAUNCH_START. Remove the call on the
mirror to correct the test before fixing sev_ioctl() to correctly assert
on this failed ioctl.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Cc: Marc Orr <marcorr@google.com>
Signed-off-by: Peter Gonda <pgonda@google.com>
---
tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c b/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c
index 29b18d565cf4..fbc742b42145 100644
--- a/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c
+++ b/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c
@@ -228,9 +228,6 @@ static void sev_mirror_create(int dst_fd, int src_fd)
static void test_sev_mirror(bool es)
{
struct kvm_vm *src_vm, *dst_vm;
- struct kvm_sev_launch_start start = {
- .policy = es ? SEV_POLICY_ES : 0
- };
int i;
src_vm = sev_vm_create(es);
@@ -241,7 +238,7 @@ static void test_sev_mirror(bool es)
/* Check that we can complete creation of the mirror VM. */
for (i = 0; i < NR_MIGRATE_TEST_VCPUS; ++i)
vm_vcpu_add(dst_vm, i);
- sev_ioctl(dst_vm->fd, KVM_SEV_LAUNCH_START, &start);
+
if (es)
sev_ioctl(dst_vm->fd, KVM_SEV_LAUNCH_UPDATE_VMSA, NULL);
--
2.34.1.400.ga245620fadb-goog
next prev parent reply other threads:[~2021-12-08 19:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 19:16 [PATCH 0/3] Fixes for SEV mirror VM tests Peter Gonda
2021-12-08 19:16 ` Peter Gonda [this message]
2021-12-09 5:43 ` [PATCH 1/3] selftests: sev_migrate_tests: Fix test_sev_mirror() Marc Orr
2021-12-08 19:16 ` [PATCH 2/3] selftests: sev_migrate_tests: Fix sev_ioctl() Peter Gonda
2021-12-09 5:45 ` Marc Orr
2021-12-09 18:25 ` Peter Gonda
2021-12-08 19:16 ` [PATCH 3/3] selftests: sev_migrate_tests: Add mirror command tests Peter Gonda
2021-12-09 5:53 ` Marc Orr
2021-12-09 20:45 ` Marc Orr
2021-12-09 11:27 ` Paolo Bonzini
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=20211208191642.3792819-2-pgonda@google.com \
--to=pgonda@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcorr@google.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.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).