aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorSheng Yang <sheng.yang@intel.com>2008-04-24 22:20:22 -0400
committerAvi Kivity <avi@qumranet.com>2008-05-04 07:44:34 -0400
commit67253af52e9133fb4cfbf7a2448a2d3524d1fa6c (patch)
tree5098624f90989a3844bb1b494658ea400d629b1f /arch/x86/kvm/svm.c
parent8c6d6adc6b87daa364ee9deb2e966021d37a7622 (diff)
KVM: Add kvm_x86_ops get_tdp_level()
The function get_tdp_level() provided the number of tdp level for EPT and NPT rather than the NPT specific macro. Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 89e0be2c10d0..ab22615eee89 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1863,6 +1863,15 @@ static bool svm_cpu_has_accelerated_tpr(void)
1863 return false; 1863 return false;
1864} 1864}
1865 1865
1866static int get_npt_level(void)
1867{
1868#ifdef CONFIG_X86_64
1869 return PT64_ROOT_LEVEL;
1870#else
1871 return PT32E_ROOT_LEVEL;
1872#endif
1873}
1874
1866static struct kvm_x86_ops svm_x86_ops = { 1875static struct kvm_x86_ops svm_x86_ops = {
1867 .cpu_has_kvm_support = has_svm, 1876 .cpu_has_kvm_support = has_svm,
1868 .disabled_by_bios = is_disabled, 1877 .disabled_by_bios = is_disabled,
@@ -1920,6 +1929,7 @@ static struct kvm_x86_ops svm_x86_ops = {
1920 .inject_pending_vectors = do_interrupt_requests, 1929 .inject_pending_vectors = do_interrupt_requests,
1921 1930
1922 .set_tss_addr = svm_set_tss_addr, 1931 .set_tss_addr = svm_set_tss_addr,
1932 .get_tdp_level = get_npt_level,
1923}; 1933};
1924 1934
1925static int __init svm_init(void) 1935static int __init svm_init(void)