Re: [RFC 04/14] x86/apic: Initialize APIC backing page for Secure AVIC

From: Neeraj Upadhyay
Date: Sat Nov 09 2024 - 11:51:42 EST



>> and provide a secure avic specific function here (will do the same for
>> sev_ghcb_msr_write(), which comes later in this series).
>>
>> "x2avic" terminology is not used in guest code. As this function only has secure
>> avic user, does secure_avic_ghcb_msr_read() work?
>
> That or "savic_..."
>

Ok sure.

>>>> +enum lapic_lvt_entry {
>>>
>>> What's that enum for?
>>
>> It's used in init_backing_page()
>
> Then use it properly:
>

I will update it.

> diff --git a/arch/x86/kernel/apic/x2apic_savic.c b/arch/x86/kernel/apic/x2apic_savic.c
> index 99151be4e173..1753c4a71b50 100644
> --- a/arch/x86/kernel/apic/x2apic_savic.c
> +++ b/arch/x86/kernel/apic/x2apic_savic.c
> @@ -200,8 +200,8 @@ static void x2apic_savic_send_IPI_mask_allbutself(const struct cpumask *mask, in
>
> static void init_backing_page(void *backing_page)
> {
> + enum lapic_lvt_entry i;
> u32 val;
> - int i;
>
> val = read_msr_from_hv(APIC_LVR);
> set_reg(backing_page, APIC_LVR, val);
>
>>>> + pr_err("Secure AVIC msr (%#llx) read returned error (%d)\n", msr, ret);
>>>
>>> Prepend "0x" to the format specifier.
>>>
>>
>> Using '#' prepends "0x". Am I missing something here?
>
> Let's use the common thing pls even if the alternate form works too:
>

Ok sure, will change to "0x".



- Neeraj

> $ git grep "\"%#" | wc -l
> 411
> $ git grep "\"0x" | wc -l
> 112823
>