From: Sean Christopherson <seanjc@google.com>
To: Peter Gonda <pgonda@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH 2/4] selftests: sev_migrate_tests: add tests for KVM_CAP_VM_COPY_ENC_CONTEXT_FROM
Date: Mon, 22 Nov 2021 19:52:08 +0000 [thread overview]
Message-ID: <YZv06IHPynOqozNA@google.com> (raw)
In-Reply-To: <CAMkAt6ovkWTxwhcWMG7UT8X68TogG-0L_6rwTisTfgcWVNapSQ@mail.gmail.com>
On Wed, Nov 17, 2021, Peter Gonda wrote:
> On Wed, Nov 17, 2021 at 9:38 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
> > +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);
> > + dst_vm = aux_vm_create(false);
> > +
> > + sev_mirror_create(dst_vm->fd, src_vm->fd);
> > +
> > + /* 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);
>
> Style question. I realized I didn't do this myself but should there
> always be blank line after these conditionals/loops without {}s? Tom
> had me add them to work in ccp driver, unsure if that should be
> maintained everywhere.
Generally speaking, yes. There will inevitably be exceptions where it's ok to
omit a blank line, e.g. kvm_ioapic_clear_all() is a decent example, as is
kvm_update_dr0123(). But for something like this where the for-loop is a different
"block" than the following code, a blank line is preferred.
next prev parent reply other threads:[~2021-11-22 19:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 16:38 [PATCH 0/4] MOVE/COPY_ENC_CONTEXT_FROM locking cleanup and tests Paolo Bonzini
2021-11-17 16:38 ` [PATCH 1/4] selftests: sev_migrate_tests: free all VMs Paolo Bonzini
2021-11-17 16:52 ` Peter Gonda
2021-11-17 18:24 ` Paolo Bonzini
2021-11-17 16:38 ` [PATCH 2/4] selftests: sev_migrate_tests: add tests for KVM_CAP_VM_COPY_ENC_CONTEXT_FROM Paolo Bonzini
2021-11-17 17:03 ` Peter Gonda
2021-11-22 19:52 ` Sean Christopherson [this message]
2021-11-17 16:38 ` [PATCH 3/4] KVM: SEV: cleanup locking for KVM_CAP_VM_MOVE_ENC_CONTEXT_FROM Paolo Bonzini
2021-11-17 17:47 ` Peter Gonda
2021-11-17 16:38 ` [PATCH 4/4] KVM: SEV: Do COPY_ENC_CONTEXT_FROM with both VMs locked Paolo Bonzini
2021-11-17 17:46 ` Peter Gonda
2021-11-17 18: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=YZv06IHPynOqozNA@google.com \
--to=seanjc@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=pgonda@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