From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Julia Lawall <julia.lawall@inria.fr>
Subject: [avpatel:riscv_trace_support_v5 17/108] arch/riscv/kvm/mmu.c:147:3-9: preceding lock on line 143
Date: Thu, 13 Aug 2026 20:00:08 +0800 [thread overview]
Message-ID: <202608131903.pedqFZRo-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Wang Yechao <wang.yechao255@zte.com.cn>
CC: Anup Patel <anup@brainfault.org>
tree: https://github.com/avpatel/linux.git riscv_trace_support_v5
head: d5f1be8d8fd44129a93976f98cc0153408015030
commit: da870fdafa8adf6f6287dbbdd2c3b3181655965e [17/108] RISC-V: KVM: Split huge pages when dirty logging is enabled
:::::: branch date: 76 minutes ago
:::::: commit date: 12 days ago
config: riscv-randconfig-r063-20260813 (https://download.01.org/0day-ci/archive/20260813/202608131903.pedqFZRo-lkp@intel.com/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project 6ea395e4fe4db26920d57779ddae98eac6ba945d)
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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202608131903.pedqFZRo-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> arch/riscv/kvm/mmu.c:147:3-9: preceding lock on line 143
vim +147 arch/riscv/kvm/mmu.c
da870fdafa8adf Wang Yechao 2026-07-31 111
da870fdafa8adf Wang Yechao 2026-07-31 112 static bool mmu_split_huge_pages(struct kvm_gstage *gstage,
da870fdafa8adf Wang Yechao 2026-07-31 113 phys_addr_t start, phys_addr_t end)
da870fdafa8adf Wang Yechao 2026-07-31 114 {
da870fdafa8adf Wang Yechao 2026-07-31 115 struct kvm *kvm = gstage->kvm;
da870fdafa8adf Wang Yechao 2026-07-31 116 struct kvm_mmu_memory_cache *pcache = &kvm->arch.pgd_split_page_cache;
da870fdafa8adf Wang Yechao 2026-07-31 117 phys_addr_t addr = ALIGN_DOWN(start, PMD_SIZE);
da870fdafa8adf Wang Yechao 2026-07-31 118 phys_addr_t last_flush_gfn = addr >> PAGE_SHIFT;
da870fdafa8adf Wang Yechao 2026-07-31 119 int count = gstage->pgd_levels;
da870fdafa8adf Wang Yechao 2026-07-31 120 bool flush = false;
da870fdafa8adf Wang Yechao 2026-07-31 121 int ret;
da870fdafa8adf Wang Yechao 2026-07-31 122
da870fdafa8adf Wang Yechao 2026-07-31 123 lockdep_assert_held_write(&kvm->mmu_lock);
da870fdafa8adf Wang Yechao 2026-07-31 124
da870fdafa8adf Wang Yechao 2026-07-31 125 while (addr < end) {
da870fdafa8adf Wang Yechao 2026-07-31 126 if (need_topup_split_caches_or_resched(kvm, count)) {
da870fdafa8adf Wang Yechao 2026-07-31 127 if (flush) {
da870fdafa8adf Wang Yechao 2026-07-31 128 kvm_flush_remote_tlbs_range(kvm, last_flush_gfn,
da870fdafa8adf Wang Yechao 2026-07-31 129 (addr >> PAGE_SHIFT) - last_flush_gfn);
da870fdafa8adf Wang Yechao 2026-07-31 130 last_flush_gfn = addr >> PAGE_SHIFT;
da870fdafa8adf Wang Yechao 2026-07-31 131 flush = false;
da870fdafa8adf Wang Yechao 2026-07-31 132 }
da870fdafa8adf Wang Yechao 2026-07-31 133
da870fdafa8adf Wang Yechao 2026-07-31 134 write_unlock(&kvm->mmu_lock);
da870fdafa8adf Wang Yechao 2026-07-31 135 cond_resched();
da870fdafa8adf Wang Yechao 2026-07-31 136
da870fdafa8adf Wang Yechao 2026-07-31 137 ret = kvm_mmu_topup_memory_cache(pcache, count);
da870fdafa8adf Wang Yechao 2026-07-31 138 if (ret) {
da870fdafa8adf Wang Yechao 2026-07-31 139 kvm_err("Failed to toup split page cache\n");
da870fdafa8adf Wang Yechao 2026-07-31 140 write_lock(&kvm->mmu_lock);
da870fdafa8adf Wang Yechao 2026-07-31 141 return flush;
da870fdafa8adf Wang Yechao 2026-07-31 142 }
da870fdafa8adf Wang Yechao 2026-07-31 @143 write_lock(&kvm->mmu_lock);
da870fdafa8adf Wang Yechao 2026-07-31 144 }
da870fdafa8adf Wang Yechao 2026-07-31 145
da870fdafa8adf Wang Yechao 2026-07-31 146 if (!kvm->arch.pgd)
da870fdafa8adf Wang Yechao 2026-07-31 @147 return flush;
da870fdafa8adf Wang Yechao 2026-07-31 148
da870fdafa8adf Wang Yechao 2026-07-31 149 flush |= kvm_riscv_gstage_split_huge(gstage, pcache, addr, 0, false);
da870fdafa8adf Wang Yechao 2026-07-31 150
da870fdafa8adf Wang Yechao 2026-07-31 151 addr += PMD_SIZE;
da870fdafa8adf Wang Yechao 2026-07-31 152 }
da870fdafa8adf Wang Yechao 2026-07-31 153
da870fdafa8adf Wang Yechao 2026-07-31 154 return flush;
da870fdafa8adf Wang Yechao 2026-07-31 155 }
da870fdafa8adf Wang Yechao 2026-07-31 156
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-08-13 12:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202608131903.pedqFZRo-lkp@intel.com \
--to=lkp@intel.com \
--cc=julia.lawall@inria.fr \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.