lkml.org 
[lkml]   [2021]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 08/15] KVM: SVM: Rename get_max_npt_level() to get_npt_level()
    Date
    From: Lai Jiangshan <laijs@linux.alibaba.com>

    It returns the only proper NPT level, so the "max" in the name
    is not appropriate.

    Signed-off-by: Lai Jiangshan <laijs@linux.alibaba.com>
    ---
    arch/x86/kvm/svm/svm.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
    index 943da8a7d850..33b434fd5d9b 100644
    --- a/arch/x86/kvm/svm/svm.c
    +++ b/arch/x86/kvm/svm/svm.c
    @@ -265,7 +265,7 @@ u32 svm_msrpm_offset(u32 msr)

    #define MAX_INST_SIZE 15

    -static int get_max_npt_level(void)
    +static int get_npt_level(void)
    {
    #ifdef CONFIG_X86_64
    return pgtable_l5_enabled() ? PT64_ROOT_5LEVEL : PT64_ROOT_4LEVEL;
    @@ -1029,9 +1029,9 @@ static __init int svm_hardware_setup(void)
    if (!boot_cpu_has(X86_FEATURE_NPT))
    npt_enabled = false;

    - /* Force VM NPT level equal to the host's max NPT level */
    - kvm_configure_mmu(npt_enabled, get_max_npt_level(),
    - get_max_npt_level(), PG_LEVEL_1G);
    + /* Force VM NPT level equal to the host's paging level */
    + kvm_configure_mmu(npt_enabled, get_npt_level(),
    + get_npt_level(), PG_LEVEL_1G);
    pr_info("kvm: Nested Paging %sabled\n", npt_enabled ? "en" : "dis");

    /* Note, SEV setup consumes npt_enabled. */
    --
    2.19.1.6.gb485710b
    \
     
     \ /
      Last update: 2021-11-18 12:11    [W:2.510 / U:0.392 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site