Re: [PATCH 1/4] KVM: arm64: nv: Avoid full shadow s2 unmap

From: kernel test robot

Date: Tue Mar 31 2026 - 11:20:33 EST


Hi Wei-Lin,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20260327]
[cannot apply to kvmarm/next arm64/for-next/core arm/for-next arm/fixes soc/for-next v7.0-rc6 v7.0-rc5 v7.0-rc4 linus/master v7.0-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#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Wei-Lin-Chang/KVM-arm64-nv-Avoid-full-shadow-s2-unmap/20260330-230122
base: next-20260327
patch link: https://lore.kernel.org/r/20260330100633.2817076-2-weilin.chang%40arm.com
patch subject: [PATCH 1/4] KVM: arm64: nv: Avoid full shadow s2 unmap
config: arm64-randconfig-002-20260331 (https://download.01.org/0day-ci/archive/20260331/202603312322.Bli3MO76-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260331/202603312322.Bli3MO76-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603312322.Bli3MO76-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

>> arch/arm64/kvm/nested.c:792:2: error: member reference type 'rwlock_t' (aka 'struct rwlock') is not a pointer; did you mean to use '.'?
792 | lockdep_assert_held_write(kvm_s2_mmu_to_kvm(mmu)->mmu_lock);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:291:22: note: expanded from macro 'lockdep_assert_held_write'
291 | do { lockdep_assert(lockdep_is_held_type(l, 0)); __assume_ctx_lock(l); } while (0)
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:253:64: note: expanded from macro 'lockdep_is_held_type'
253 | #define lockdep_is_held_type(lock, r) lock_is_held_type(&(lock)->dep_map, (r))
| ^
include/linux/lockdep.h:279:32: note: expanded from macro 'lockdep_assert'
279 | do { WARN_ON(debug_locks && !(cond)); } while (0)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
include/asm-generic/bug.h:110:25: note: expanded from macro 'WARN_ON'
110 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
>> arch/arm64/kvm/nested.c:792:2: error: cannot take the address of an rvalue of type 'struct lockdep_map'
792 | lockdep_assert_held_write(kvm_s2_mmu_to_kvm(mmu)->mmu_lock);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:291:22: note: expanded from macro 'lockdep_assert_held_write'
291 | do { lockdep_assert(lockdep_is_held_type(l, 0)); __assume_ctx_lock(l); } while (0)
| ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/lockdep.h:253:57: note: expanded from macro 'lockdep_is_held_type'
253 | #define lockdep_is_held_type(lock, r) lock_is_held_type(&(lock)->dep_map, (r))
| ^
include/linux/lockdep.h:279:32: note: expanded from macro 'lockdep_assert'
279 | do { WARN_ON(debug_locks && !(cond)); } while (0)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
include/asm-generic/bug.h:110:25: note: expanded from macro 'WARN_ON'
110 | int __ret_warn_on = !!(condition); \
| ^~~~~~~~~
2 errors generated.


vim +792 arch/arm64/kvm/nested.c

782
783 int kvm_record_nested_revmap(gpa_t ipa, struct kvm_s2_mmu *mmu,
784 gpa_t fault_ipa, size_t map_size)
785 {
786 struct maple_tree *mt = &mmu->nested_revmap_mt;
787 gpa_t start = ipa;
788 gpa_t end = ipa + map_size - 1;
789 u64 entry, new_entry = 0;
790 int r = 0;
791
> 792 lockdep_assert_held_write(kvm_s2_mmu_to_kvm(mmu)->mmu_lock);
793
794 MA_STATE(mas, mt, start, end);
795 entry = (u64)mas_find_range(&mas, end);
796
797 if (entry) {
798 /* maybe just a perm update... */
799 if (!(entry & UNKNOWN_IPA) && mas.index == start &&
800 mas.last == end &&
801 fault_ipa == (entry & NESTED_IPA_MASK))
802 goto out;
803 /*
804 * Remove every overlapping range, then create a "polluted"
805 * range that spans all these ranges and store it.
806 */
807 while (entry && mas.index <= end) {
808 start = min(mas.index, start);
809 end = max(mas.last, end);
810 mas_erase(&mas);
811 entry = (u64)mas_find_range(&mas, end);
812 }
813 new_entry |= UNKNOWN_IPA;
814 } else {
815 new_entry |= fault_ipa;
816 }
817
818 mas_set_range(&mas, start, end);
819 r = mas_store_gfp(&mas, (void *)new_entry, GFP_KERNEL_ACCOUNT);
820 out:
821 return r;
822 }
823

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