CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: David Matlack <[email protected]>
TO: Paolo Bonzini <[email protected]>
CC: [email protected]
CC: Ben Gardon <[email protected]>
CC: Joerg Roedel <[email protected]>
CC: Jim Mattson <[email protected]>
CC: Wanpeng Li <[email protected]>
CC: Vitaly Kuznetsov <[email protected]>
CC: Sean Christopherson <[email protected]>
CC: "Janis Schoetterl-Glausch" <[email protected]>
CC: Junaid Shahid <[email protected]>

Hi David,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on 1c10f4b4877ffaed602d12ff8cbbd5009e82c970]

url:    
https://github.com/0day-ci/linux/commits/David-Matlack/KVM-x86-mmu-Eager-Page-Splitting-for-the-TDP-MMU/20211214-070153
base:   1c10f4b4877ffaed602d12ff8cbbd5009e82c970
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-m021-20211216 
(https://download.01.org/0day-ci/archive/20211216/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
arch/x86/kvm/mmu/spte.c:239 make_huge_page_split_spte() warn: should '(index * 
((1 << (12 + ((child_level - 1) * 9))) / ((1) << 12))) << 12' be a 64 bit type?

vim +239 arch/x86/kvm/mmu/spte.c

4be03bd08ef69e David Matlack 2021-12-13  209  
4be03bd08ef69e David Matlack 2021-12-13  210  /*
4be03bd08ef69e David Matlack 2021-12-13  211   * Construct an SPTE that maps a 
sub-page of the given huge page SPTE where
4be03bd08ef69e David Matlack 2021-12-13  212   * `index` identifies which 
sub-page.
4be03bd08ef69e David Matlack 2021-12-13  213   *
4be03bd08ef69e David Matlack 2021-12-13  214   * This is used during huge page 
splitting to build the SPTEs that make up the
4be03bd08ef69e David Matlack 2021-12-13  215   * new page table.
4be03bd08ef69e David Matlack 2021-12-13  216   */
4be03bd08ef69e David Matlack 2021-12-13  217  u64 make_huge_page_split_spte(u64 
huge_spte, int huge_level, int index, unsigned int access)
4be03bd08ef69e David Matlack 2021-12-13  218  {
4be03bd08ef69e David Matlack 2021-12-13  219    u64 child_spte;
4be03bd08ef69e David Matlack 2021-12-13  220    int child_level;
4be03bd08ef69e David Matlack 2021-12-13  221  
4be03bd08ef69e David Matlack 2021-12-13  222    if 
(WARN_ON(is_mmio_spte(huge_spte)))
4be03bd08ef69e David Matlack 2021-12-13  223            return 0;
4be03bd08ef69e David Matlack 2021-12-13  224  
4be03bd08ef69e David Matlack 2021-12-13  225    if 
(WARN_ON(!is_shadow_present_pte(huge_spte)))
4be03bd08ef69e David Matlack 2021-12-13  226            return 0;
4be03bd08ef69e David Matlack 2021-12-13  227  
4be03bd08ef69e David Matlack 2021-12-13  228    if 
(WARN_ON(!is_large_pte(huge_spte)))
4be03bd08ef69e David Matlack 2021-12-13  229            return 0;
4be03bd08ef69e David Matlack 2021-12-13  230  
4be03bd08ef69e David Matlack 2021-12-13  231    child_spte = huge_spte;
4be03bd08ef69e David Matlack 2021-12-13  232    child_level = huge_level - 1;
4be03bd08ef69e David Matlack 2021-12-13  233  
4be03bd08ef69e David Matlack 2021-12-13  234    /*
4be03bd08ef69e David Matlack 2021-12-13  235     * The child_spte already has 
the base address of the huge page being
4be03bd08ef69e David Matlack 2021-12-13  236     * split. So we just have to OR 
in the offset to the page at the next
4be03bd08ef69e David Matlack 2021-12-13  237     * lower level for the given 
index.
4be03bd08ef69e David Matlack 2021-12-13  238     */
4be03bd08ef69e David Matlack 2021-12-13 @239    child_spte |= (index * 
KVM_PAGES_PER_HPAGE(child_level)) << PAGE_SHIFT;
4be03bd08ef69e David Matlack 2021-12-13  240  
4be03bd08ef69e David Matlack 2021-12-13  241    if (child_level == PG_LEVEL_4K) 
{
4be03bd08ef69e David Matlack 2021-12-13  242            child_spte &= 
~PT_PAGE_SIZE_MASK;
4be03bd08ef69e David Matlack 2021-12-13  243  
4be03bd08ef69e David Matlack 2021-12-13  244            /* Allow execution for 
4K pages if it was disabled for NX HugePages. */
4be03bd08ef69e David Matlack 2021-12-13  245            if 
(is_nx_huge_page_enabled() && access & ACC_EXEC_MASK)
4be03bd08ef69e David Matlack 2021-12-13  246                    child_spte = 
mark_spte_executable(child_spte);
4be03bd08ef69e David Matlack 2021-12-13  247    }
4be03bd08ef69e David Matlack 2021-12-13  248  
4be03bd08ef69e David Matlack 2021-12-13  249    return child_spte;
4be03bd08ef69e David Matlack 2021-12-13  250  }
4be03bd08ef69e David Matlack 2021-12-13  251  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to