Re: [RFC v2 02/17] x86/apic: Initialize Secure AVIC APIC backing page

From: Francesco Lavra
Date: Fri Mar 21 2025 - 12:33:19 EST


On 2025-02-26 at 9:05, Neeraj Upadhyay wrote:
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index 82492efc5d94..300bc8f6eb6f 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -1504,6 +1504,38 @@ static enum es_result vc_handle_msr(struct
> ghcb *ghcb, struct es_em_ctxt *ctxt)
> return ret;
> }
>
> +/*
> + * Register GPA of the Secure AVIC backing page.
> + *
> + * @apic_id: APIC ID of the vCPU. Use -1ULL for the current vCPU
> + * doing the call.
> + * @gpa : GPA of the Secure AVIC backing page.
> + */
> +enum es_result savic_register_gpa(u64 apic_id, u64 gpa)
> +{
> + struct ghcb_state state;
> + struct es_em_ctxt ctxt;
> + unsigned long flags;
> + struct ghcb *ghcb;
> + int ret = 0;

This should be an enum es_result, and there is no need to zero-
initialize it.
The same applies to savic_unregister_gpa() in patch 14.