From: "Sampat, Pratik Rajesh" <pratikrajesh.sampat@amd.com>
To: Peter Gonda <pgonda@google.com>
Cc: <kvm@vger.kernel.org>, <shuah@kernel.org>,
<thomas.lendacky@amd.com>, <michael.roth@amd.com>,
<seanjc@google.com>, <pbonzini@redhat.com>,
<linux-kselftest@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 2/5] selftests: KVM: Decouple SEV ioctls from asserts
Date: Thu, 11 Jul 2024 11:27:57 -0500 [thread overview]
Message-ID: <7a449bc1-8ae6-4242-a8ce-df917042a1a6@amd.com> (raw)
In-Reply-To: <CAMkAt6pYAKzEVkKV1iriQei3opD9j3M4bM3-0yB4sX1wss+jsQ@mail.gmail.com>
On 7/11/2024 11:11 AM, Peter Gonda wrote:
>> +int sev_vm_launch_update(struct kvm_vm *vm, uint32_t policy)
>> +{
>> + struct userspace_mem_region *region;
>> + int ctr, ret;
>>
>> + hash_for_each(vm->regions.slot_hash, ctr, region, slot_node) {
>> + ret = encrypt_region(vm, region, 0);
>> + if (ret)
>> + return ret;
>> + }
>> if (policy & SEV_POLICY_ES)
>> vm_sev_ioctl(vm, KVM_SEV_LAUNCH_UPDATE_VMSA, NULL);
>
> Adding the sev-es policy bit for negative testing is a bit confusing,
> but I guess it works. For negative testing should we be more explicit?
> Ditto for other usages of `policy` simply to toggle sev-es features.
You're right. Although it works because the way we want for negative
testing it does go by exercising a different path meant for a different
policy.
Maybe I can refactor the old code to all test for type instead like I
have done with the rest of the patchset just so that we are more
explicit. Would that fare any better?
next prev parent reply other threads:[~2024-07-11 16:28 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 22:05 [RFC 0/5] SEV Kernel Selftests Pratik R. Sampat
2024-07-10 22:05 ` [RFC 1/5] selftests: KVM: Add a basic SNP smoke test Pratik R. Sampat
2024-07-11 15:16 ` Peter Gonda
2024-07-11 16:21 ` Sampat, Pratik Rajesh
2024-07-11 15:56 ` Tom Lendacky
2024-07-11 16:23 ` Sampat, Pratik Rajesh
2024-07-10 22:05 ` [RFC 2/5] selftests: KVM: Decouple SEV ioctls from asserts Pratik R. Sampat
2024-07-11 15:19 ` Peter Gonda
2024-07-11 16:11 ` Peter Gonda
2024-07-11 16:27 ` Sampat, Pratik Rajesh [this message]
2024-08-09 15:40 ` Sean Christopherson
2024-08-13 15:23 ` Pratik R. Sampat
2024-08-13 15:27 ` Sean Christopherson
2024-08-13 15:30 ` Pratik R. Sampat
2024-07-10 22:05 ` [RFC 3/5] selftests: KVM: SEV IOCTL test Pratik R. Sampat
2024-07-11 15:23 ` Peter Gonda
2024-07-11 16:23 ` Sampat, Pratik Rajesh
2024-07-11 18:34 ` Tom Lendacky
2024-07-11 20:02 ` Sampat, Pratik Rajesh
2024-08-09 15:45 ` Sean Christopherson
2024-08-13 15:23 ` Pratik R. Sampat
2024-07-10 22:05 ` [RFC 4/5] selftests: KVM: SNP " Pratik R. Sampat
2024-07-11 15:57 ` Peter Gonda
2024-07-11 16:27 ` Sampat, Pratik Rajesh
2024-08-09 15:48 ` Sean Christopherson
2024-08-13 15:23 ` Pratik R. Sampat
2024-07-10 22:05 ` [RFC 5/5] selftests: KVM: SEV-SNP test for KVM_SEV_INIT2 Pratik R. Sampat
2024-07-11 15:57 ` Peter Gonda
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=7a449bc1-8ae6-4242-a8ce-df917042a1a6@amd.com \
--to=pratikrajesh.sampat@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=pgonda@google.com \
--cc=seanjc@google.com \
--cc=shuah@kernel.org \
--cc=thomas.lendacky@amd.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