Re: [PATCH v9 03/24] virt: sev-guest: Make payload a variable length array

From: Tom Lendacky
Date: Mon Jun 17 2024 - 16:51:59 EST


On 5/30/24 23:30, Nikunj A Dadhania wrote:
> Currently, guest message is PAGE_SIZE bytes and payload is hard-coded to
> 4000 bytes, assuming snp_guest_msg_hdr structure as 96 bytes.
>
> Remove the structure size assumption and hard-coding of payload size and
> instead use variable length array.
>
> While at it, rename the local guest message variables for clarity.
>
> Signed-off-by: Nikunj A Dadhania <nikunj@xxxxxxx>
> Suggested-by: Tom Lendacky <thomas.lendacky@xxxxxxx>

Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>

> ---
> drivers/virt/coco/sev-guest/sev-guest.h | 5 +-
> drivers/virt/coco/sev-guest/sev-guest.c | 74 +++++++++++++++----------
> 2 files changed, 48 insertions(+), 31 deletions(-)
>