* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
@ 2020-05-25 20:22 kbuild test robot
0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-25 20:22 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 5180 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200523225659.1027044-8-peterx@redhat.com>
References: <20200523225659.1027044-8-peterx@redhat.com>
TO: Peter Xu <peterx@redhat.com>
TO: linux-kernel(a)vger.kernel.org
TO: kvm(a)vger.kernel.org
CC: Vitaly Kuznetsov <vkuznets@redhat.com>
CC: Alex Williamson <alex.williamson@redhat.com>
CC: "Michael S . Tsirkin" <mst@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
CC: Christophe de Dinechin <dinechin@redhat.com>
CC: Jason Wang <jasowang@redhat.com>
CC: Kevin Tian <kevin.tian@intel.com>
CC: peterx(a)redhat.com
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200522]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> arch/x86/kvm/mmu/mmu.c:1280:3: warning: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn]
return false;
^
arch/x86/kvm/mmu/mmu.c:3725:9: warning: Redundant initialization for 'root'. The initialized value is overwritten before it is read. [redundantInitialization]
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3715:15: note: root is initialized
hpa_t root = vcpu->arch.mmu->pae_root[i];
^
arch/x86/kvm/mmu/mmu.c:3725:9: note: root is overwritten
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3769:8: warning: Redundant initialization for 'root'. The initialized value is overwritten before it is read. [redundantInitialization]
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3758:14: note: root is initialized
hpa_t root = vcpu->arch.mmu->root_hpa;
^
arch/x86/kvm/mmu/mmu.c:3769:8: note: root is overwritten
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:4670:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 x = BYTE_MASK(ACC_EXEC_MASK);
^
arch/x86/kvm/mmu/mmu.c:4671:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 w = BYTE_MASK(ACC_WRITE_MASK);
^
arch/x86/kvm/mmu/mmu.c:4672:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 u = BYTE_MASK(ACC_USER_MASK);
# https://github.com/0day-ci/linux/commit/2c23bd2b96e30ae3814e3e56f01a6234131cb531
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 2c23bd2b96e30ae3814e3e56f01a6234131cb531
vim +1280 arch/x86/kvm/mmu/mmu.c
b8e8c8303ff28c arch/x86/kvm/mmu.c Paolo Bonzini 2019-11-04 1269
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1270 static struct kvm_memory_slot *
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1272 bool no_dirty_log)
05da45583de9b3 arch/x86/kvm/mmu.c Marcelo Tosatti 2008-02-23 1273 {
05da45583de9b3 arch/x86/kvm/mmu.c Marcelo Tosatti 2008-02-23 1274 struct kvm_memory_slot *slot;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1275
54bf36aac52031 arch/x86/kvm/mmu.c Paolo Bonzini 2015-04-08 1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
91b0d268a59dd9 arch/x86/kvm/mmu/mmu.c Paolo Bonzini 2020-01-21 1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
91b0d268a59dd9 arch/x86/kvm/mmu/mmu.c Paolo Bonzini 2020-01-21 1278 return NULL;
2c23bd2b96e30a arch/x86/kvm/mmu/mmu.c Peter Xu 2020-05-23 1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
2c23bd2b96e30a arch/x86/kvm/mmu/mmu.c Peter Xu 2020-05-23 @1280 return false;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1281
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1282 return slot;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1283 }
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v9 00/14] KVM: Dirty ring interface
@ 2020-05-23 22:56 Peter Xu
2020-05-23 22:56 ` [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled Peter Xu
0 siblings, 1 reply; 10+ messages in thread
From: Peter Xu @ 2020-05-23 22:56 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: Vitaly Kuznetsov, Alex Williamson, Michael S . Tsirkin,
Paolo Bonzini, Dr . David Alan Gilbert, Christophe de Dinechin,
Jason Wang, Kevin Tian, peterx, Sean Christopherson, Yan Zhao
KVM branch:
https://github.com/xzpeter/linux/tree/kvm-dirty-ring
QEMU branch for testing:
https://github.com/xzpeter/qemu/tree/kvm-dirty-ring
v9:
- patch 3: __x86_set_memory_region: squash another trivial change to return
(0xdeadull << 48) always for slot removal [Sean]
- pick r-bs for Drew
v8:
- rebase to kvm/next
- fix test bisection issues [Drew]
- reword comment for __x86_set_memory_region [Sean]
- document fixup on "mutual exclusive", etc. [Sean]
For previous versions, please refer to:
V1: https://lore.kernel.org/kvm/20191129213505.18472-1-peterx@redhat.com
V2: https://lore.kernel.org/kvm/20191221014938.58831-1-peterx@redhat.com
V3: https://lore.kernel.org/kvm/20200109145729.32898-1-peterx@redhat.com
V4: https://lore.kernel.org/kvm/20200205025105.367213-1-peterx@redhat.com
V5: https://lore.kernel.org/kvm/20200304174947.69595-1-peterx@redhat.com
V6: https://lore.kernel.org/kvm/20200309214424.330363-1-peterx@redhat.com
V7: https://lore.kernel.org/kvm/20200318163720.93929-1-peterx@redhat.com
V8: https://lore.kernel.org/kvm/20200331190000.659614-1-peterx@redhat.com
Overview
============
This is a continued work from Lei Cao <lei.cao@stratus.com> and Paolo
Bonzini on the KVM dirty ring interface.
The new dirty ring interface is another way to collect dirty pages for
the virtual machines. It is different from the existing dirty logging
interface in a few ways, majorly:
- Data format: The dirty data was in a ring format rather than a
bitmap format, so dirty bits to sync for dirty logging does not
depend on the size of guest memory any more, but speed of
dirtying. Also, the dirty ring is per-vcpu, while the dirty
bitmap is per-vm.
- Data copy: The sync of dirty pages does not need data copy any more,
but instead the ring is shared between the userspace and kernel by
page sharings (mmap() on vcpu fd)
- Interface: Instead of using the old KVM_GET_DIRTY_LOG,
KVM_CLEAR_DIRTY_LOG interfaces, the new ring uses the new
KVM_RESET_DIRTY_RINGS ioctl when we want to reset the collected
dirty pages to protected mode again (works like
KVM_CLEAR_DIRTY_LOG, but ring based). To collecting dirty bits,
we only need to read the ring data, no ioctl is needed.
Ring Layout
===========
KVM dirty ring is per-vcpu. Each ring is an array of kvm_dirty_gfn
defined as:
struct kvm_dirty_gfn {
__u32 flags;
__u32 slot; /* as_id | slot_id */
__u64 offset;
};
Each GFN is a state machine itself. The state is embeded in the flags
field, as defined in the uapi header:
/*
* KVM dirty GFN flags, defined as:
*
* |---------------+---------------+--------------|
* | bit 1 (reset) | bit 0 (dirty) | Status |
* |---------------+---------------+--------------|
* | 0 | 0 | Invalid GFN |
* | 0 | 1 | Dirty GFN |
* | 1 | X | GFN to reset |
* |---------------+---------------+--------------|
*
* Lifecycle of a dirty GFN goes like:
*
* dirtied collected reset
* 00 -----------> 01 -------------> 1X -------+
* ^ |
* | |
* +------------------------------------------+
*
* The userspace program is only responsible for the 01->1X state
* conversion (to collect dirty bits). Also, it must not skip any
* dirty bits so that dirty bits are always collected in sequence.
*/
Testing
=======
This series provided both the implementation of the KVM dirty ring and
the test case. Also I've implemented the QEMU counterpart that can
run with the new KVM, link can be found at the top of the cover
letter. However that's still a very initial version which is prone to
change and future optimizations.
I did some measurement with the new method with 24G guest running some
dirty workload, I don't see any speedup so far, even in some heavy
dirty load it'll be slower (e.g., when 800MB/s random dirty rate, kvm
dirty ring takes average of ~73s to complete migration while dirty
logging only needs average of ~55s). However that's understandable
because 24G guest means only 1M dirty bitmap, that's still a suitable
case for dirty logging. Meanwhile heavier workload means worst case
for dirty ring.
More tests are welcomed if there's bigger host/guest, especially on
COLO-like workload.
Please review, thanks.
Peter Xu (14):
KVM: X86: Change parameter for fast_page_fault tracepoint
KVM: Cache as_id in kvm_memory_slot
KVM: X86: Don't track dirty for KVM_SET_[TSS_ADDR|IDENTITY_MAP_ADDR]
KVM: Pass in kvm pointer into mark_page_dirty_in_slot()
KVM: X86: Implement ring-based dirty memory tracking
KVM: Make dirty ring exclusive to dirty bitmap log
KVM: Don't allocate dirty bitmap if dirty ring is enabled
KVM: selftests: Always clear dirty bitmap after iteration
KVM: selftests: Sync uapi/linux/kvm.h to tools/
KVM: selftests: Use a single binary for dirty/clear log test
KVM: selftests: Introduce after_vcpu_run hook for dirty log test
KVM: selftests: Add dirty ring buffer test
KVM: selftests: Let dirty_log_test async for dirty ring test
KVM: selftests: Add "-c" parameter to dirty log test
Documentation/virt/kvm/api.rst | 123 +++++
arch/x86/include/asm/kvm_host.h | 6 +-
arch/x86/include/uapi/asm/kvm.h | 1 +
arch/x86/kvm/Makefile | 3 +-
arch/x86/kvm/mmu/mmu.c | 12 +-
arch/x86/kvm/mmutrace.h | 9 +-
arch/x86/kvm/svm/avic.c | 11 +-
arch/x86/kvm/vmx/vmx.c | 90 ++--
arch/x86/kvm/x86.c | 53 +-
include/linux/kvm_dirty_ring.h | 103 ++++
include/linux/kvm_host.h | 19 +
include/trace/events/kvm.h | 78 +++
include/uapi/linux/kvm.h | 53 ++
tools/include/uapi/linux/kvm.h | 53 ++
tools/testing/selftests/kvm/Makefile | 2 -
.../selftests/kvm/clear_dirty_log_test.c | 6 -
tools/testing/selftests/kvm/dirty_log_test.c | 505 ++++++++++++++++--
.../testing/selftests/kvm/include/kvm_util.h | 4 +
tools/testing/selftests/kvm/lib/kvm_util.c | 68 +++
.../selftests/kvm/lib/kvm_util_internal.h | 4 +
virt/kvm/dirty_ring.c | 197 +++++++
virt/kvm/kvm_main.c | 162 +++++-
22 files changed, 1423 insertions(+), 139 deletions(-)
create mode 100644 include/linux/kvm_dirty_ring.h
delete mode 100644 tools/testing/selftests/kvm/clear_dirty_log_test.c
create mode 100644 virt/kvm/dirty_ring.c
--
2.26.2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
2020-05-23 22:56 [PATCH v9 00/14] KVM: Dirty ring interface Peter Xu
@ 2020-05-23 22:56 ` Peter Xu
2020-05-26 15:05 ` kbuild test robot
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Peter Xu @ 2020-05-23 22:56 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: Vitaly Kuznetsov, Alex Williamson, Michael S . Tsirkin,
Paolo Bonzini, Dr . David Alan Gilbert, Christophe de Dinechin,
Jason Wang, Kevin Tian, peterx, Sean Christopherson, Yan Zhao
Because kvm dirty rings and kvm dirty log is used in an exclusive way,
Let's avoid creating the dirty_bitmap when kvm dirty ring is enabled.
At the meantime, since the dirty_bitmap will be conditionally created
now, we can't use it as a sign of "whether this memory slot enabled
dirty tracking". Change users like that to check against the kvm
memory slot flags.
Note that there still can be chances where the kvm memory slot got its
dirty_bitmap allocated, _if_ the memory slots are created before
enabling of the dirty rings and at the same time with the dirty
tracking capability enabled, they'll still with the dirty_bitmap.
However it should not hurt much (e.g., the bitmaps will always be
freed if they are there), and the real users normally won't trigger
this because dirty bit tracking flag should in most cases only be
applied to kvm slots only before migration starts, that should be far
latter than kvm initializes (VM starts).
Signed-off-by: Peter Xu <peterx@redhat.com>
---
arch/x86/kvm/mmu/mmu.c | 4 ++--
include/linux/kvm_host.h | 5 +++++
virt/kvm/kvm_main.c | 4 ++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 94d84a383b80..ebc86f661db3 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -1276,8 +1276,8 @@ gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
return NULL;
- if (no_dirty_log && slot->dirty_bitmap)
- return NULL;
+ if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
+ return false;
return slot;
}
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a7eaef494f45..5081c6e2ae06 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -351,6 +351,11 @@ struct kvm_memory_slot {
u16 as_id;
};
+static inline bool kvm_slot_dirty_track_enabled(struct kvm_memory_slot *slot)
+{
+ return slot->flags & KVM_MEM_LOG_DIRTY_PAGES;
+}
+
static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot)
{
return ALIGN(memslot->npages, BITS_PER_LONG) / 8;
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 9639cf8d8c9c..ae7ba67eab63 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1294,7 +1294,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
/* Allocate/free page dirty bitmap as needed */
if (!(new.flags & KVM_MEM_LOG_DIRTY_PAGES))
new.dirty_bitmap = NULL;
- else if (!new.dirty_bitmap) {
+ else if (!new.dirty_bitmap && !kvm->dirty_ring_size) {
r = kvm_alloc_dirty_bitmap(&new);
if (r)
return r;
@@ -2581,7 +2581,7 @@ static void mark_page_dirty_in_slot(struct kvm *kvm,
struct kvm_memory_slot *memslot,
gfn_t gfn)
{
- if (memslot && memslot->dirty_bitmap) {
+ if (memslot && kvm_slot_dirty_track_enabled(memslot)) {
unsigned long rel_gfn = gfn - memslot->base_gfn;
u32 slot = (memslot->as_id << 16) | memslot->id;
--
2.26.2
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
2020-05-23 22:56 ` [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled Peter Xu
@ 2020-05-26 15:05 ` kbuild test robot
2020-05-26 19:21 ` kbuild test robot
2020-05-27 12:53 ` kbuild test robot
2 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-26 15:05 UTC (permalink / raw)
To: Peter Xu, linux-kernel, kvm
Cc: kbuild-all, Vitaly Kuznetsov, Alex Williamson,
Michael S . Tsirkin, Paolo Bonzini, Dr . David Alan Gilbert,
Christophe de Dinechin, Jason Wang, Kevin Tian, peterx
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200522]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> arch/x86/kvm/mmu/mmu.c:1280:3: warning: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn]
return false;
^
arch/x86/kvm/mmu/mmu.c:3725:9: warning: Redundant initialization for 'root'. The initialized value is overwritten before it is read. [redundantInitialization]
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3715:15: note: root is initialized
hpa_t root = vcpu->arch.mmu->pae_root[i];
^
arch/x86/kvm/mmu/mmu.c:3725:9: note: root is overwritten
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3769:8: warning: Redundant initialization for 'root'. The initialized value is overwritten before it is read. [redundantInitialization]
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3758:14: note: root is initialized
hpa_t root = vcpu->arch.mmu->root_hpa;
^
arch/x86/kvm/mmu/mmu.c:3769:8: note: root is overwritten
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:4670:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 x = BYTE_MASK(ACC_EXEC_MASK);
^
arch/x86/kvm/mmu/mmu.c:4671:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 w = BYTE_MASK(ACC_WRITE_MASK);
^
arch/x86/kvm/mmu/mmu.c:4672:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 u = BYTE_MASK(ACC_USER_MASK);
# https://github.com/0day-ci/linux/commit/2c23bd2b96e30ae3814e3e56f01a6234131cb531
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 2c23bd2b96e30ae3814e3e56f01a6234131cb531
vim +1280 arch/x86/kvm/mmu/mmu.c
b8e8c8303ff28c arch/x86/kvm/mmu.c Paolo Bonzini 2019-11-04 1269
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1270 static struct kvm_memory_slot *
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1272 bool no_dirty_log)
05da45583de9b3 arch/x86/kvm/mmu.c Marcelo Tosatti 2008-02-23 1273 {
05da45583de9b3 arch/x86/kvm/mmu.c Marcelo Tosatti 2008-02-23 1274 struct kvm_memory_slot *slot;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1275
54bf36aac52031 arch/x86/kvm/mmu.c Paolo Bonzini 2015-04-08 1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
91b0d268a59dd9 arch/x86/kvm/mmu/mmu.c Paolo Bonzini 2020-01-21 1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
91b0d268a59dd9 arch/x86/kvm/mmu/mmu.c Paolo Bonzini 2020-01-21 1278 return NULL;
2c23bd2b96e30a arch/x86/kvm/mmu/mmu.c Peter Xu 2020-05-23 1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
2c23bd2b96e30a arch/x86/kvm/mmu/mmu.c Peter Xu 2020-05-23 @1280 return false;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1281
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1282 return slot;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1283 }
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
@ 2020-05-26 15:05 ` kbuild test robot
0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-26 15:05 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 4551 bytes --]
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200522]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> arch/x86/kvm/mmu/mmu.c:1280:3: warning: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn]
return false;
^
arch/x86/kvm/mmu/mmu.c:3725:9: warning: Redundant initialization for 'root'. The initialized value is overwritten before it is read. [redundantInitialization]
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3715:15: note: root is initialized
hpa_t root = vcpu->arch.mmu->pae_root[i];
^
arch/x86/kvm/mmu/mmu.c:3725:9: note: root is overwritten
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3769:8: warning: Redundant initialization for 'root'. The initialized value is overwritten before it is read. [redundantInitialization]
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:3758:14: note: root is initialized
hpa_t root = vcpu->arch.mmu->root_hpa;
^
arch/x86/kvm/mmu/mmu.c:3769:8: note: root is overwritten
root = __pa(sp->spt);
^
arch/x86/kvm/mmu/mmu.c:4670:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 x = BYTE_MASK(ACC_EXEC_MASK);
^
arch/x86/kvm/mmu/mmu.c:4671:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 w = BYTE_MASK(ACC_WRITE_MASK);
^
arch/x86/kvm/mmu/mmu.c:4672:15: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
const u8 u = BYTE_MASK(ACC_USER_MASK);
# https://github.com/0day-ci/linux/commit/2c23bd2b96e30ae3814e3e56f01a6234131cb531
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 2c23bd2b96e30ae3814e3e56f01a6234131cb531
vim +1280 arch/x86/kvm/mmu/mmu.c
b8e8c8303ff28c arch/x86/kvm/mmu.c Paolo Bonzini 2019-11-04 1269
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1270 static struct kvm_memory_slot *
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1272 bool no_dirty_log)
05da45583de9b3 arch/x86/kvm/mmu.c Marcelo Tosatti 2008-02-23 1273 {
05da45583de9b3 arch/x86/kvm/mmu.c Marcelo Tosatti 2008-02-23 1274 struct kvm_memory_slot *slot;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1275
54bf36aac52031 arch/x86/kvm/mmu.c Paolo Bonzini 2015-04-08 1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
91b0d268a59dd9 arch/x86/kvm/mmu/mmu.c Paolo Bonzini 2020-01-21 1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
91b0d268a59dd9 arch/x86/kvm/mmu/mmu.c Paolo Bonzini 2020-01-21 1278 return NULL;
2c23bd2b96e30a arch/x86/kvm/mmu/mmu.c Peter Xu 2020-05-23 1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
2c23bd2b96e30a arch/x86/kvm/mmu/mmu.c Peter Xu 2020-05-23 @1280 return false;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1281
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1282 return slot;
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1283 }
5d163b1c9d6e55 arch/x86/kvm/mmu.c Xiao Guangrong 2011-03-09 1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
2020-05-26 15:05 ` kbuild test robot
@ 2020-05-26 15:21 ` Peter Xu
-1 siblings, 0 replies; 10+ messages in thread
From: Peter Xu @ 2020-05-26 15:21 UTC (permalink / raw)
To: kbuild test robot
Cc: linux-kernel, kvm, kbuild-all, Vitaly Kuznetsov, Alex Williamson,
Michael S . Tsirkin, Paolo Bonzini, Dr . David Alan Gilbert,
Christophe de Dinechin, Jason Wang, Kevin Tian
On Tue, May 26, 2020 at 11:05:47PM +0800, kbuild test robot wrote:
> >> arch/x86/kvm/mmu/mmu.c:1280:3: warning: Returning an integer in a function with pointer return type is not portable. [CastIntegerToAddressAtReturn]
> return false;
> ^
A rebase accident for quite a few versions... Fixed.
--
Peter Xu
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
2020-05-23 22:56 ` [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled Peter Xu
@ 2020-05-26 19:21 ` kbuild test robot
2020-05-26 19:21 ` kbuild test robot
2020-05-27 12:53 ` kbuild test robot
2 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-26 19:21 UTC (permalink / raw)
To: Peter Xu, linux-kernel, kvm
Cc: kbuild-all, clang-built-linux, Vitaly Kuznetsov, Alex Williamson,
Michael S . Tsirkin, Paolo Bonzini, Dr . David Alan Gilbert,
Christophe de Dinechin, Jason Wang, Kevin Tian, peterx
[-- Attachment #1: Type: text/plain, Size: 2257 bytes --]
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/x86/kvm/mmu/mmu.c:1280:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct kvm_memory_slot *' [-Wnon-literal-null-conversion]
return false;
^~~~~
1 warning generated.
vim +1280 arch/x86/kvm/mmu/mmu.c
1269
1270 static struct kvm_memory_slot *
1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
1272 bool no_dirty_log)
1273 {
1274 struct kvm_memory_slot *slot;
1275
1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
1278 return NULL;
1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
> 1280 return false;
1281
1282 return slot;
1283 }
1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 73533 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
@ 2020-05-26 19:21 ` kbuild test robot
0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-26 19:21 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2314 bytes --]
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/x86/kvm/mmu/mmu.c:1280:10: warning: expression which evaluates to zero treated as a null pointer constant of type 'struct kvm_memory_slot *' [-Wnon-literal-null-conversion]
return false;
^~~~~
1 warning generated.
vim +1280 arch/x86/kvm/mmu/mmu.c
1269
1270 static struct kvm_memory_slot *
1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
1272 bool no_dirty_log)
1273 {
1274 struct kvm_memory_slot *slot;
1275
1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
1278 return NULL;
1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
> 1280 return false;
1281
1282 return slot;
1283 }
1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 73533 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
2020-05-23 22:56 ` [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled Peter Xu
@ 2020-05-27 12:53 ` kbuild test robot
2020-05-26 19:21 ` kbuild test robot
2020-05-27 12:53 ` kbuild test robot
2 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-27 12:53 UTC (permalink / raw)
To: Peter Xu, linux-kernel, kvm
Cc: kbuild-all, Vitaly Kuznetsov, Alex Williamson,
Michael S . Tsirkin, Paolo Bonzini, Dr . David Alan Gilbert,
Christophe de Dinechin, Jason Wang, Kevin Tian, peterx
[-- Attachment #1: Type: text/plain, Size: 2390 bytes --]
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: i386-randconfig-s002-20200527 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-240-gf0fe1cd9-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
arch/x86/kvm/mmu/mmu.c:693:18: sparse: sparse: cast to non-scalar
arch/x86/kvm/mmu/mmu.c:712:18: sparse: sparse: cast to non-scalar
arch/x86/kvm/mmu/mmu.c:731:18: sparse: sparse: cast to non-scalar
>> arch/x86/kvm/mmu/mmu.c:1280:24: sparse: sparse: Using plain integer as NULL pointer
arch/x86/kvm/mmu/mmu.c:4687:57: sparse: sparse: cast truncates bits from constant value (ffffff33 becomes 33)
arch/x86/kvm/mmu/mmu.c:4689:56: sparse: sparse: cast truncates bits from constant value (ffffff0f becomes f)
arch/x86/kvm/mmu/mmu.c:4691:57: sparse: sparse: cast truncates bits from constant value (ffffff55 becomes 55)
vim +1280 arch/x86/kvm/mmu/mmu.c
1269
1270 static struct kvm_memory_slot *
1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
1272 bool no_dirty_log)
1273 {
1274 struct kvm_memory_slot *slot;
1275
1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
1278 return NULL;
1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
> 1280 return false;
1281
1282 return slot;
1283 }
1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34976 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled
@ 2020-05-27 12:53 ` kbuild test robot
0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-27 12:53 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]
Hi Peter,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on linus/master v5.7-rc7]
[cannot apply to kvm/linux-next tip/auto-latest linux/master next-20200526]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Peter-Xu/KVM-Dirty-ring-interface/20200524-070926
base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: i386-randconfig-s002-20200527 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-240-gf0fe1cd9-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=i386 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
arch/x86/kvm/mmu/mmu.c:693:18: sparse: sparse: cast to non-scalar
arch/x86/kvm/mmu/mmu.c:712:18: sparse: sparse: cast to non-scalar
arch/x86/kvm/mmu/mmu.c:731:18: sparse: sparse: cast to non-scalar
>> arch/x86/kvm/mmu/mmu.c:1280:24: sparse: sparse: Using plain integer as NULL pointer
arch/x86/kvm/mmu/mmu.c:4687:57: sparse: sparse: cast truncates bits from constant value (ffffff33 becomes 33)
arch/x86/kvm/mmu/mmu.c:4689:56: sparse: sparse: cast truncates bits from constant value (ffffff0f becomes f)
arch/x86/kvm/mmu/mmu.c:4691:57: sparse: sparse: cast truncates bits from constant value (ffffff55 becomes 55)
vim +1280 arch/x86/kvm/mmu/mmu.c
1269
1270 static struct kvm_memory_slot *
1271 gfn_to_memslot_dirty_bitmap(struct kvm_vcpu *vcpu, gfn_t gfn,
1272 bool no_dirty_log)
1273 {
1274 struct kvm_memory_slot *slot;
1275
1276 slot = kvm_vcpu_gfn_to_memslot(vcpu, gfn);
1277 if (!slot || slot->flags & KVM_MEMSLOT_INVALID)
1278 return NULL;
1279 if (no_dirty_log && kvm_slot_dirty_track_enabled(slot))
> 1280 return false;
1281
1282 return slot;
1283 }
1284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34976 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2020-05-27 13:22 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 20:22 [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled kbuild test robot
-- strict thread matches above, loose matches on Subject: below --
2020-05-23 22:56 [PATCH v9 00/14] KVM: Dirty ring interface Peter Xu
2020-05-23 22:56 ` [PATCH v9 07/14] KVM: Don't allocate dirty bitmap if dirty ring is enabled Peter Xu
2020-05-26 15:05 ` kbuild test robot
2020-05-26 15:05 ` kbuild test robot
2020-05-26 15:21 ` Peter Xu
2020-05-26 15:21 ` Peter Xu
2020-05-26 19:21 ` kbuild test robot
2020-05-26 19:21 ` kbuild test robot
2020-05-27 12:53 ` kbuild test robot
2020-05-27 12:53 ` kbuild test robot
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.