Re: [PATCH v5 05/14] virt: sev-guest: Add vmpck_id to snp_guest_dev struct

From: Nikunj A. Dadhania
Date: Thu Nov 02 2023 - 00:04:18 EST


On 10/30/2023 10:42 PM, Tom Lendacky wrote:
> On 10/30/23 11:16, Dionna Amalie Glaze wrote:
>> On Sun, Oct 29, 2023 at 11:38 PM Nikunj A Dadhania <nikunj@xxxxxxx> wrote:

>>> @@ -656,32 +674,14 @@ static const struct file_operations snp_guest_fops = {
>>>          .unlocked_ioctl = snp_guest_ioctl,
>>>   };
>>>
>>> -static u8 *get_vmpck(int id, struct snp_secrets_page_layout *layout, u32 **seqno)
>>> +bool snp_assign_vmpck(struct snp_guest_dev *dev, int vmpck_id)
>>>   {
>>> -       u8 *key = NULL;
>>> +       if (WARN_ON(vmpck_id > 3))
>>> +               return false;
>>
>> The vmpck_id is an int for some reason, so < 0 is also a problem. Can
>> we not use unsigned int?

Yes, I will update that in my next revision,

Thanks
Nikunj