Skip to content

Commit f98689e

Browse files
committed
allocate the VTL0 savic page
1 parent 552ae32 commit f98689e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/hv/mshv_vtl_main.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static struct page *snp_secure_avic_page(int cpu)
259259
#endif
260260
}
261261

262-
struct page* mshv_apic_page(int cpu)
262+
static struct page* mshv_apic_page(int cpu)
263263
{
264264
if (hv_isolation_type_tdx())
265265
return tdx_apic_page(cpu);
@@ -652,9 +652,16 @@ static int mshv_vtl_alloc_context(unsigned int cpu)
652652
mshv_write_tdx_apic_page(page_to_phys(tdx_apic_page));
653653
#endif
654654
} else if (hv_isolation_type_snp()) {
655-
#ifdef CONFIG_X86_64
655+
#if defined(CONFIG_X86_64) && defined(CONFIG_SEV_GUEST)
656656
int ret;
657657

658+
struct page *secure_avic_page;
659+
660+
secure_avic_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
661+
if (!secure_avic_page)
662+
return -ENOMEM;
663+
per_cpu->secure_avic_page = secure_avic_page;
664+
658665
ret = mshv_configure_vmsa_page(0, &per_cpu->vmsa_page);
659666
if (ret < 0)
660667
return ret;

0 commit comments

Comments
 (0)