public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: David Matlack <dmatlack@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: Vipin Sharma <vipinsh@google.com>,
	kvm@vger.kernel.org,  David Matlack <dmatlack@google.com>
Subject: [PATCH 0/4] KVM: x86/mmu: Fix TDP MMU dirty logging bug L2 running with EPT disabled
Date: Fri, 15 Mar 2024 16:05:37 -0700	[thread overview]
Message-ID: <20240315230541.1635322-1-dmatlack@google.com> (raw)

Fix a bug in the TDP MMU caught by syzkaller and CONFIG_KVM_PROVE_MMU
that causes writes made by L2 to no be reflected in the dirty log when
L1 has disabled EPT.

Patch 1 contains the fix. Patch 2 and 3 fix comments related to clearing
dirty bits in the TDP MMU. Patch 4 adds selftests coverage of dirty
logging of L2 when L1 has disabled EPT. i.e.  a regression test for this
bug.

David Matlack (4):
  KVM: x86/mmu: Check kvm_mmu_page_ad_need_write_protect() when clearing
    TDP MMU dirty bits
  KVM: x86/mmu: Remove function comments above
    clear_dirty_{gfn_range,pt_masked}()
  KVM: x86/mmu: Fix and clarify comments about clearing D-bit vs.
    write-protecting
  KVM: selftests: Add coverage of EPT-disabled to vmx_dirty_log_test

 arch/x86/kvm/mmu/tdp_mmu.c                    | 51 +++++++---------
 .../selftests/kvm/x86_64/vmx_dirty_log_test.c | 60 ++++++++++++++-----
 2 files changed, 68 insertions(+), 43 deletions(-)


base-commit: 687d8f4c3dea0758afd748968d91288220bbe7e3
-- 
2.44.0.291.gc1ea87d7ee-goog


             reply	other threads:[~2024-03-15 23:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 23:05 David Matlack [this message]
2024-03-15 23:05 ` [PATCH 1/4] KVM: x86/mmu: Check kvm_mmu_page_ad_need_write_protect() when clearing TDP MMU dirty bits David Matlack
2024-04-09 23:13   ` Sean Christopherson
2024-03-15 23:05 ` [PATCH 2/4] KVM: x86/mmu: Remove function comments above clear_dirty_{gfn_range,pt_masked}() David Matlack
2024-03-15 23:05 ` [PATCH 3/4] KVM: x86/mmu: Fix and clarify comments about clearing D-bit vs. write-protecting David Matlack
2024-04-09 23:14   ` Sean Christopherson
2024-03-15 23:05 ` [PATCH 4/4] KVM: selftests: Add coverage of EPT-disabled to vmx_dirty_log_test David Matlack
2024-03-17 16:59   ` David Matlack
2024-04-10  0:19 ` [PATCH 0/4] KVM: x86/mmu: Fix TDP MMU dirty logging bug L2 running with EPT disabled Sean Christopherson
2024-04-10 16:05   ` David Matlack
2024-04-10 16:17     ` Sean Christopherson

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=20240315230541.1635322-1-dmatlack@google.com \
    --to=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vipinsh@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox