Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [sean-jc:x86/no_unsync_for_nested_tdp 28/28] arch/x86/kvm/mmu/mmu.c:2270:6: warning: unused variable 'ret'
@ 2026-06-12 21:56 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-12 21:56 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: llvm, oe-kbuild-all

tree:   https://github.com/sean-jc/linux x86/no_unsync_for_nested_tdp
head:   cf61c0380b4809886b14ce509549f68bf59338d3
commit: cf61c0380b4809886b14ce509549f68bf59338d3 [28/28] KVM: x86/mmu: Add Kconfig option to disable legacy (non-TDP) shadow paging
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260612/202606122335.OYh5wFfm-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project f43d6834093b19baf79beda8c0337ab020ac5f17)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260612/202606122335.OYh5wFfm-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606122335.OYh5wFfm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kvm/mmu/mmu.c:2270:6: warning: unused variable 'ret' [-Wunused-variable]
    2270 |         int ret;
         |             ^~~
>> arch/x86/kvm/mmu/mmu.c:6743:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
    6743 | }
         | ^
   arch/x86/kvm/mmu/mmu.c:1501:13: warning: unused function 'kvm_vcpu_write_protect_gfn' [-Wunused-function]
    1501 | static bool kvm_vcpu_write_protect_gfn(struct kvm_vcpu *vcpu, u64 gfn)
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/x86/kvm/mmu/mmu.c:5295:13: warning: unused function 'sync_mmio_spte' [-Wunused-function]
    5295 | static bool sync_mmio_spte(struct kvm_vcpu *vcpu, u64 *sptep, gfn_t gfn,
         |             ^~~~~~~~~~~~~~
   arch/x86/kvm/mmu/mmu.c:5952:13: warning: unused function 'kvm_init_shadow_mmu' [-Wunused-function]
    5952 | static void kvm_init_shadow_mmu(struct kvm_vcpu *vcpu,
         |             ^~~~~~~~~~~~~~~~~~~
   5 warnings generated.


vim +/ret +2270 arch/x86/kvm/mmu/mmu.c

a30f47cb150dd8 arch/x86/kvm/mmu.c     Xiao Guangrong      2011-09-22  2256  
cbd858b17e379f arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2257  /*
cbd858b17e379f arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2258   * The vCPU is required when finding indirect shadow pages; the shadow
cbd858b17e379f arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2259   * page may already exist and syncing it needs the vCPU pointer in
cbd858b17e379f arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2260   * order to read guest page tables.  Direct shadow pages are never
cbd858b17e379f arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2261   * unsync, thus @vcpu can be NULL if @role.direct is true.
cbd858b17e379f arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2262   */
3cc736b35799ab arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2263  static struct kvm_mmu_page *kvm_mmu_find_shadow_page(struct kvm *kvm,
3cc736b35799ab arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2264  						     struct kvm_vcpu *vcpu,
94c8136448c804 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2265  						     gfn_t gfn,
94c8136448c804 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2266  						     struct hlist_head *sp_list,
2e65e842c57d72 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2267  						     union kvm_mmu_page_role role)
cea0f0e7ea5475 drivers/kvm/mmu.c      Avi Kivity          2007-01-05  2268  {
9f1a122f970dbe arch/x86/kvm/mmu.c     Xiao Guangrong      2010-05-24  2269  	struct kvm_mmu_page *sp;
8d5678a76689ac arch/x86/kvm/mmu/mmu.c Hou Wenlong         2022-03-15 @2270  	int ret;
f3414bc7741946 arch/x86/kvm/mmu.c     David Matlack       2016-12-20  2271  	int collisions = 0;
2a74003ae818cf arch/x86/kvm/mmu.c     Paolo Bonzini       2016-02-24  2272  	LIST_HEAD(invalid_list);
cea0f0e7ea5475 drivers/kvm/mmu.c      Avi Kivity          2007-01-05  2273  
3cc736b35799ab arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2274  	for_each_valid_sp(kvm, sp, sp_list) {
f3414bc7741946 arch/x86/kvm/mmu.c     David Matlack       2016-12-20  2275  		if (sp->gfn != gfn) {
f3414bc7741946 arch/x86/kvm/mmu.c     David Matlack       2016-12-20  2276  			collisions++;
f3414bc7741946 arch/x86/kvm/mmu.c     David Matlack       2016-12-20  2277  			continue;
f3414bc7741946 arch/x86/kvm/mmu.c     David Matlack       2016-12-20  2278  		}
f3414bc7741946 arch/x86/kvm/mmu.c     David Matlack       2016-12-20  2279  
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2280  		if (sp->role.word != role.word) {
cf61c0380b4809 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2026-06-12  2281  #ifdef CONFIG_KVM_LEGACY_SHADOW_PAGING
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2282  			/*
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2283  			 * If the guest is creating an upper-level page, zap
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2284  			 * unsync pages for the same gfn.  While it's possible
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2285  			 * the guest is using recursive page tables, in all
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2286  			 * likelihood the guest has stopped using the unsync
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2287  			 * page and is installing a completely unrelated page.
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2288  			 * Unsync pages must not be left as is, because the new
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2289  			 * upper-level page will be write-protected.
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2290  			 */
2e65e842c57d72 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2291  			if (role.level > PG_LEVEL_4K && sp->unsync)
3cc736b35799ab arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2292  				kvm_mmu_prepare_zap_page(kvm, sp,
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2293  							 &invalid_list);
cf61c0380b4809 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2026-06-12  2294  #endif
4731d4c7a07769 arch/x86/kvm/mmu.c     Marcelo Tosatti     2008-09-23  2295  			continue;
ddc16abbbae9cd arch/x86/kvm/mmu/mmu.c Sean Christopherson 2021-06-22  2296  		}
4731d4c7a07769 arch/x86/kvm/mmu.c     Marcelo Tosatti     2008-09-23  2297  
bb924ca69f71b4 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2298  		/* unsync and write-flooding only apply to indirect SPs. */
bb924ca69f71b4 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2299  		if (sp->role.direct)
94c8136448c804 arch/x86/kvm/mmu/mmu.c David Matlack       2022-06-22  2300  			goto out;
fb58a9c345f645 arch/x86/kvm/mmu/mmu.c Sean Christopherson 2020-06-23  2301  

:::::: The code at line 2270 was first introduced by commit
:::::: 8d5678a76689acbf91245a3791fe853ab773090f KVM: x86/mmu: Don't rebuild page when the page is synced and no tlb flushing is required

:::::: TO: Hou Wenlong <houwenlong.hwl@antgroup.com>
:::::: CC: Paolo Bonzini <pbonzini@redhat.com>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-12 21:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12 21:56 [sean-jc:x86/no_unsync_for_nested_tdp 28/28] arch/x86/kvm/mmu/mmu.c:2270:6: warning: unused variable 'ret' kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox