Re: [PATCH 5/5] x86/Hyper-V: Add Hyper-V specific hvcall to set backing page

Borislav Petkov
2025-09-18T15:10:30Z

On Thu, Sep 18, 2025 at 11:00:23AM -0400, Tianyu Lan wrote:
> Secure AVIC hardware provides APIC backing page
> to aid the guest in limiting which interrupt
> vectors can be injected into the guest. Hyper-V
> introduces a new register HV_X64_REGISTER_SEV_GPA_PAGE
> to notify hypervisor with APIC backing page and call
> it in Secure AVIC driver.

Why does hyperv needs special handling again and cannot simply adhere to the
secure AVIC spec?

None of that text explains *why* it is absolutely necessary to do something
hyperv-special...

> @@ -361,7 +364,11 @@ static void savic_setup(void)
> * VMRUN, the hypervisor makes use of this information to make sure
> * the APIC backing page is mapped in NPT.
> */
> - res = savic_register_gpa(gpa);
> + if (hv_isolation_type_snp())
> + res = hv_set_savic_backing_page(gfn);
> + else
> + res = savic_register_gpa(gpa);
> +

This is ugly and doesn't belong here.

--
Regards/Gruss,
Boris.