Hi David, Thank you for the patch! Yet something to improve: [auto build test ERROR on kvm/queue] [also build test ERROR on vhost/linux-next v5.13-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/David-Matlack/KVM-x86-mmu-Remove-redundant-is_tdp_mmu_root-check/20210618-082018 base: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue config: i386-randconfig-a016-20210618 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://github.com/0day-ci/linux/commit/6ab060f3cf9061da492b1eb89808eb2da5406781 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review David-Matlack/KVM-x86-mmu-Remove-redundant-is_tdp_mmu_root-check/20210618-082018 git checkout 6ab060f3cf9061da492b1eb89808eb2da5406781 # save the attached .config to linux build tree make W=1 ARCH=i386 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): ld: arch/x86/kvm/mmu/mmu.o: in function `get_mmio_spte': >> arch/x86/kvm/mmu/mmu.c:3612: undefined reference to `kvm_tdp_mmu_get_walk' ld: arch/x86/kvm/mmu/mmu.o: in function `direct_page_fault': >> arch/x86/kvm/mmu/mmu.c:3830: undefined reference to `kvm_tdp_mmu_map' vim +3612 arch/x86/kvm/mmu/mmu.c 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3597 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3598 /* return true if reserved bit(s) are detected on a valid, non-MMIO SPTE. */ 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3599 static bool get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep) 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3600 { dde81f9477d018 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3601 u64 sptes[PT64_ROOT_MAX_LEVEL + 1]; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3602 struct rsvd_bits_validate *rsvd_check; 39b4d43e6003ce arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3603 int root, leaf, level; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3604 bool reserved = false; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3605 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3606 if (!VALID_PAGE(vcpu->arch.mmu->root_hpa)) { 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3607 *sptep = 0ull; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3608 return reserved; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3609 } 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3610 6ab060f3cf9061 arch/x86/kvm/mmu/mmu.c David Matlack 2021-06-17 3611 if (is_tdp_mmu_root(vcpu->arch.mmu->root_hpa)) 39b4d43e6003ce arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 @3612 leaf = kvm_tdp_mmu_get_walk(vcpu, addr, sptes, &root); 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3613 else 39b4d43e6003ce arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3614 leaf = get_walk(vcpu, addr, sptes, &root); 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3615 2aa078932ff6c6 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3616 if (unlikely(leaf < 0)) { 2aa078932ff6c6 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3617 *sptep = 0ull; 2aa078932ff6c6 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3618 return reserved; 2aa078932ff6c6 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3619 } 2aa078932ff6c6 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3620 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3621 *sptep = sptes[leaf]; 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3622 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3623 /* 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3624 * Skip reserved bits checks on the terminal leaf if it's not a valid 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3625 * SPTE. Note, this also (intentionally) skips MMIO SPTEs, which, by 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3626 * design, always have reserved bits set. The purpose of the checks is 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3627 * to detect reserved bits on non-MMIO SPTEs. i.e. buggy SPTEs. 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3628 */ 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3629 if (!is_shadow_present_pte(sptes[leaf])) 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3630 leaf++; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3631 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3632 rsvd_check = &vcpu->arch.mmu->shadow_zero_check; 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3633 9aa418792f5f11 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3634 for (level = root; level >= leaf; level--) b5c3c1b3c6e95c arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-01-09 3635 /* b5c3c1b3c6e95c arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-01-09 3636 * Use a bitwise-OR instead of a logical-OR to aggregate the b5c3c1b3c6e95c arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-01-09 3637 * reserved bit and EPT's invalid memtype/XWR checks to avoid b5c3c1b3c6e95c arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-01-09 3638 * adding a Jcc in the loop. b5c3c1b3c6e95c arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-01-09 3639 */ dde81f9477d018 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3640 reserved |= __is_bad_mt_xwr(rsvd_check, sptes[level]) | dde81f9477d018 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-12-17 3641 __is_rsvd_bits_set(rsvd_check, sptes[level], level); 47ab8751695f71 arch/x86/kvm/mmu.c Xiao Guangrong 2015-08-05 3642 47ab8751695f71 arch/x86/kvm/mmu.c Xiao Guangrong 2015-08-05 3643 if (reserved) { bb4cdf3af9395d arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-02-25 3644 pr_err("%s: reserved bits set on MMU-present spte, addr 0x%llx, hierarchy:\n", 47ab8751695f71 arch/x86/kvm/mmu.c Xiao Guangrong 2015-08-05 3645 __func__, addr); 95fb5b0258b7bd arch/x86/kvm/mmu/mmu.c Ben Gardon 2020-10-14 3646 for (level = root; level >= leaf; level--) bb4cdf3af9395d arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-02-25 3647 pr_err("------ spte = 0x%llx level = %d, rsvd bits = 0x%llx", bb4cdf3af9395d arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-02-25 3648 sptes[level], level, bb4cdf3af9395d arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-02-25 3649 rsvd_check->rsvd_bits_mask[(sptes[level] >> 7) & 1][level-1]); 47ab8751695f71 arch/x86/kvm/mmu.c Xiao Guangrong 2015-08-05 3650 } ddce6208217c1a arch/x86/kvm/mmu/mmu.c Sean Christopherson 2019-12-06 3651 47ab8751695f71 arch/x86/kvm/mmu.c Xiao Guangrong 2015-08-05 3652 return reserved; ce88decffd17bf arch/x86/kvm/mmu.c Xiao Guangrong 2011-07-12 3653 } ce88decffd17bf arch/x86/kvm/mmu.c Xiao Guangrong 2011-07-12 3654 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org