fix: kvm: x86/mmu: Add TDP MMU PF handler (v5.10)
authorMichael Jeanson <mjeanson@efficios.com>
Mon, 26 Oct 2020 18:28:35 +0000 (14:28 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 20 Nov 2020 20:38:47 +0000 (15:38 -0500)
See upstream commit :

  commit bb18842e21111a979e2e0e1c5d85c09646f18d51
  Author: Ben Gardon <bgardon@google.com>
  Date:   Wed Oct 14 11:26:50 2020 -0700

    kvm: x86/mmu: Add TDP MMU PF handler

    Add functions to handle page faults in the TDP MMU. These page faults
    are currently handled in much the same way as the x86 shadow paging
    based MMU, however the ordering of some operations is slightly
    different. Future patches will add eager NX splitting, a fast page fault
    handler, and parallel page faults.

    Tested by running kvm-unit-tests and KVM selftests on an Intel Haswell
    machine. This series introduced no new failures.

Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ie56959cb6c77913d2f1188b0ca15da9114623a4e

include/instrumentation/events/arch/x86/kvm/mmutrace.h
src/probes/lttng-probe-kvm-x86-mmu.c

index 6275b0691c7405c1d060151ba3a04134a0f0fc60..8e5bf1c1e44c002665d2555d8c06ab61bf0e5b49 100644 (file)
@@ -163,7 +163,25 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_prepare_zap_page,
        TP_ARGS(sp)
 )
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
+
+LTTNG_TRACEPOINT_EVENT_MAP(
+       mark_mmio_spte,
+
+       kvm_mmu_mark_mmio_spte,
+
+       TP_PROTO(u64 *sptep, gfn_t gfn, u64 spte),
+       TP_ARGS(sptep, gfn, spte),
+
+       TP_FIELDS(
+               ctf_integer_hex(void *, sptep, sptep)
+               ctf_integer(gfn_t, gfn, gfn)
+               ctf_integer(unsigned, access, spte & ACC_ALL)
+               ctf_integer(unsigned int, gen, get_mmio_spte_generation(spte))
+       )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
 
 LTTNG_TRACEPOINT_EVENT_MAP(
        mark_mmio_spte,
index 7d1692b5c3b643f39943c364e762be4c55096171..f301a16e3a8964170e9605fa9feb02ab4480b4b8 100644 (file)
 #include <../../arch/x86/kvm/mmutrace.h>
 #endif
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0))
+#include <../arch/x86/kvm/mmu.h>
+#include <../arch/x86/kvm/mmu/spte.h>
+#endif
+
 #undef TRACE_INCLUDE_PATH
 #undef TRACE_INCLUDE_FILE
 
This page took 0.030102 seconds and 4 git commands to generate.