提交 a20a2285 编写于 作者: W Wei Huang 提交者: Xie Haocheng

KVM: SVM: Add 5-level page table support for SVM

mainline inclusion
from mainline-v5.15
commit 43e540cc
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5NGRU
CVE: NA

-------------------------------------------------

When the 5-level page table is enabled on host OS, the nested page table
for guest VMs must use 5-level as well. Update get_npt_level() function
to reflect this requirement. In the meanwhile, remove the code that
prevents kvm-amd driver from being loaded when 5-level page table is
detected.
Signed-off-by: NWei Huang <wei.huang2@amd.com>
Message-Id: <20210818165549.3771014-4-wei.huang2@amd.com>
[Tweak condition as suggested by Sean. - Paolo]
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NXie Haocheng <haocheng.xie@amd.com>
上级 bc1d5726
...@@ -257,7 +257,7 @@ static inline void invlpga(unsigned long addr, u32 asid) ...@@ -257,7 +257,7 @@ static inline void invlpga(unsigned long addr, u32 asid)
static int get_max_npt_level(void) static int get_max_npt_level(void)
{ {
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
return PT64_ROOT_4LEVEL; return pgtable_l5_enabled() ? PT64_ROOT_5LEVEL : PT64_ROOT_4LEVEL;
#else #else
return PT32E_ROOT_LEVEL; return PT32E_ROOT_LEVEL;
#endif #endif
...@@ -443,11 +443,6 @@ static int has_svm(void) ...@@ -443,11 +443,6 @@ static int has_svm(void)
return 0; return 0;
} }
if (pgtable_l5_enabled()) {
pr_info("KVM doesn't yet support 5-level paging on AMD SVM\n");
return 0;
}
return 1; return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册