tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git dirty-ring-buffer head: 8d19462882d3ad12238755956d9154f3732f78bf commit: 9a13921dd3dcd4b653b6eaefd46668d7d7cf0b7c [79/80] KVM: Implement ring-based dirty memory tracking reproduce: # apt-get install sparse git checkout 9a13921dd3dcd4b653b6eaefd46668d7d7cf0b7c make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) vim +/kvm_gfn_ring_push +122 arch/x86/kvm/../../../virt/kvm/gfn_ring.c 88 89 int kvm_gfn_ring_push(struct kvm_gfn_ring *gfnring, 90 u32 slot, 91 u64 offset, 92 bool locked) 93 { 94 int ret; 95 u16 num; 96 struct kvm_dirty_gfn *entry; 97 98 if (locked) 99 spin_lock(&gfnring->lock); 100 101 num = (u16)(gfnring->dirty_index - gfnring->reset_index); 102 if (num >= gfnring->size) { 103 WARN_ON_ONCE(num > gfnring->size); 104 ret = -EBUSY; 105 goto out; 106 } 107 108 entry = &gfnring->dirty_ring->dirty_gfns[gfnring->dirty_index & 109 (gfnring->size - 1)]; 110 entry->slot = slot; 111 entry->offset = offset; 112 smp_wmb(); 113 gfnring->dirty_index++; 114 num = gfnring->dirty_index - gfnring->reset_index; 115 gfnring->dirty_ring->indices.avail_index = gfnring->dirty_index; 116 ret = num >= gfnring->soft_limit; 117 118 out: 119 if (locked) 120 spin_unlock(&gfnring->lock); 121 > 122 return ret; 123 } 124 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation