public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH v1 0/3] x86: fix async page fault issues
@ 2023-12-12  6:27 Dan Wu
  2023-12-12  6:27 ` [kvm-unit-tests PATCH v1 1/3] x86: Add a common header asyncpf.h Dan Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Dan Wu @ 2023-12-12  6:27 UTC (permalink / raw)
  To: seanjc, pbonzini, kvm; +Cc: xiaoyao.li, dan1.wu

When running asyncpf test, it gets skipped without a clear reason:

    ./asyncpf

    enabling apic
    smp: waiting for 0 APs
    paging enabled
    cr0 = 80010011
    cr3 = 107f000
    cr4 = 20
    install handler
    enable async pf
    alloc memory
    start loop
    end loop
    start loop
    end loop
    SUMMARY: 0 tests
    SKIP asyncpf (0 tests)

The reason is that KVM changed to use interrupt-based 'page-ready' notification
and abandoned #PF-based 'page-ready' notification mechanism. Interrupt-based
'page-ready' notification requires KVM_ASYNC_PF_DELIVERY_AS_INT to be set as well
in MSR_KVM_ASYNC_PF_EN to enable asyncpf.

This series tries to fix the problem by separating two testcases for different mechanisms.

- For old #PF-based notification, changes current asyncpf.c to add CPUID check
  at the beginning. It checks (KVM_FEATURE_ASYNC_PF && !KVM_FEATURE_ASYNC_PF_INT),
  otherwise it gets skipped.

- For new interrupt-based notification, add a new test, asyncpf-int.c, to check
  (KVM_FEATURE_ASYNC_PF && KVM_FEATURE_ASYNC_PF_INT) and implement interrupt-based
  'page-ready' handler.

Dan Wu (3):
  x86: Add a common header asyncpf.h
  x86: Add async page fault int test
  x86/asyncpf: Add CPUID feature bits check to ensure feature is
    available

 ci/cirrus-ci-fedora.yml |   1 +
 lib/x86/processor.h     |   6 ++
 x86/Makefile.common     |   3 +-
 x86/asyncpf.c           |  31 ++++++----
 x86/asyncpf.h           |  23 ++++++++
 x86/asyncpf_int.c       | 127 ++++++++++++++++++++++++++++++++++++++++
 x86/unittests.cfg       |   6 +-
 7 files changed, 185 insertions(+), 12 deletions(-)
 create mode 100644 x86/asyncpf.h
 create mode 100644 x86/asyncpf_int.c

-- 
2.39.3


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-14  2:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12  6:27 [kvm-unit-tests PATCH v1 0/3] x86: fix async page fault issues Dan Wu
2023-12-12  6:27 ` [kvm-unit-tests PATCH v1 1/3] x86: Add a common header asyncpf.h Dan Wu
2023-12-12  6:27 ` [kvm-unit-tests PATCH v1 2/3] x86: Add async page fault int test Dan Wu
2023-12-12  6:27 ` [kvm-unit-tests PATCH v1 3/3] x86/asyncpf: Add CPUID feature bits check to ensure feature is available Dan Wu
2023-12-12 15:17 ` [kvm-unit-tests PATCH v1 0/3] x86: fix async page fault issues Sean Christopherson
2023-12-13  1:36   ` Wu, Dan1
2023-12-13 18:20     ` Sean Christopherson
2023-12-14  2:32       ` Wu, Dan1

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox