]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: Don't set Accessed/Dirty bits for ZERO_PAGE
authorSean Christopherson <seanjc@google.com>
Fri, 29 Apr 2022 01:04:09 +0000 (01:04 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 20 Jun 2022 10:21:31 +0000 (06:21 -0400)
commitc80716dfbd00fdddc424e36704e12254c21e9376
tree666224b6dacea24df002e09d3e1bbebb676b3471
parent56c16cb178603d406ece204ee991ecd21d00a247
KVM: Don't set Accessed/Dirty bits for ZERO_PAGE

Don't set Accessed/Dirty bits for a struct page with PG_reserved set,
i.e. don't set A/D bits for the ZERO_PAGE.  The ZERO_PAGE (or pages
depending on the architecture) should obviously never be written, and
similarly there's no point in marking it accessed as the page will never
be swapped out or reclaimed.  The comment in page-flags.h is quite clear
that PG_reserved pages should be managed only by their owner, and
strictly following that mandate also simplifies KVM's logic.

Fixes: 148bda399795 ("KVM: fix overflow of zero page refcount with ksm running")
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20220429010416.2788472-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c