From: Oliver Upton <oupton@google.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Marc Zyngier <maz@kernel.org>, Peter Shier <pshier@google.com>,
Jim Mattson <jmattson@google.com>,
David Matlack <dmatlack@google.com>,
Ricardo Koller <ricarkol@google.com>,
Jing Zhang <jingzhangos@google.com>,
Raghavendra Rao Anata <rananta@google.com>,
James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org,
Andrew Jones <drjones@redhat.com>, Will Deacon <will@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Oliver Upton <oupton@google.com>
Subject: [PATCH v7 0/9] selftests: KVM: Test offset-based counter controls
Date: Mon, 16 Aug 2021 00:12:37 +0000 [thread overview]
Message-ID: <20210816001246.3067312-1-oupton@google.com> (raw)
This series implements new tests for the x86 and arm64 counter migration
changes that I've mailed out. These are sent separately as a dependent
change since there are cross-arch dependencies here.
Patch 1 yanks the pvclock headers into the tools/ directory so we can
make use of them within a KVM selftest guest.
Patch 2 tests the new capabilities of the KVM_*_CLOCK ioctls, ensuring
that the kernel accounts for elapsed time when restoring the KVM clock.
Patches 3-4 add some device attribute helpers and clean up some mistakes
in the assertions thereof.
Patch 5 implements a test for the KVM_VCPU_TSC_OFFSET attribute,
asserting that manipulation of the offset results in correct TSC values
within the guest.
Patch 6 adds a helper to check if KVM supports a given register in the
KVM_*_REG ioctls.
Patch 7 adds basic arm64 support to the counter offset test, checking
that the virtual counter-timer offset works correctly. Patch 8 does the
same for the physical counter-timer offset.
Patch 9 adds a benchmark for physical counter offsetting, since most
implementations available right now will rely on emulation.
This series applies cleanly to kvm/queue at the following commit:
3e0b8bd99ab ("KVM: MMU: change tracepoints arguments to kvm_page_fault")
Tests were ran against the respective architecture changes on the
following systems:
- Haswell (x86)
- Ampere Mt. Jade (non-ECV, nVHE and VHE)
- ARM Base RevC FVP (ECV, nVHE and VHE)
*NOTE*: Though this tests changes between both x86 and arm64, these
tests check for capabilities and skip if missing, so its OK if they're
merged in trees that lack the patches for both architectures.
v6: https://lore.kernel.org/r/20210804085819.846610-1-oupton@google.com
v6 -> v7:
- adapted to UAPI renaming for physical counter offsetting on arm64
Oliver Upton (9):
tools: arch: x86: pull in pvclock headers
selftests: KVM: Add test for KVM_{GET,SET}_CLOCK
selftests: KVM: Fix kvm device helper ioctl assertions
selftests: KVM: Add helpers for vCPU device attributes
selftests: KVM: Introduce system counter offset test
selftests: KVM: Add helper to check for register presence
selftests: KVM: Add support for aarch64 to system_counter_offset_test
selftests: KVM: Test physical counter offsetting
selftests: KVM: Add counter emulation benchmark
tools/arch/x86/include/asm/pvclock-abi.h | 48 ++++
tools/arch/x86/include/asm/pvclock.h | 103 +++++++++
tools/testing/selftests/kvm/.gitignore | 3 +
tools/testing/selftests/kvm/Makefile | 4 +
.../kvm/aarch64/counter_emulation_benchmark.c | 207 +++++++++++++++++
.../selftests/kvm/include/aarch64/processor.h | 24 ++
.../testing/selftests/kvm/include/kvm_util.h | 13 ++
tools/testing/selftests/kvm/lib/kvm_util.c | 63 +++++-
.../kvm/system_counter_offset_test.c | 211 ++++++++++++++++++
.../selftests/kvm/x86_64/kvm_clock_test.c | 204 +++++++++++++++++
10 files changed, 877 insertions(+), 3 deletions(-)
create mode 100644 tools/arch/x86/include/asm/pvclock-abi.h
create mode 100644 tools/arch/x86/include/asm/pvclock.h
create mode 100644 tools/testing/selftests/kvm/aarch64/counter_emulation_benchmark.c
create mode 100644 tools/testing/selftests/kvm/system_counter_offset_test.c
create mode 100644 tools/testing/selftests/kvm/x86_64/kvm_clock_test.c
--
2.33.0.rc1.237.g0d66db33f3-goog
WARNING: multiple messages have this Message-ID (diff)
From: Oliver Upton <oupton@google.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>, Marc Zyngier <maz@kernel.org>,
Raghavendra Rao Anata <rananta@google.com>,
Peter Shier <pshier@google.com>,
Sean Christopherson <seanjc@google.com>,
David Matlack <dmatlack@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
linux-arm-kernel@lists.infradead.org,
Jim Mattson <jmattson@google.com>
Subject: [PATCH v7 0/9] selftests: KVM: Test offset-based counter controls
Date: Mon, 16 Aug 2021 00:12:37 +0000 [thread overview]
Message-ID: <20210816001246.3067312-1-oupton@google.com> (raw)
This series implements new tests for the x86 and arm64 counter migration
changes that I've mailed out. These are sent separately as a dependent
change since there are cross-arch dependencies here.
Patch 1 yanks the pvclock headers into the tools/ directory so we can
make use of them within a KVM selftest guest.
Patch 2 tests the new capabilities of the KVM_*_CLOCK ioctls, ensuring
that the kernel accounts for elapsed time when restoring the KVM clock.
Patches 3-4 add some device attribute helpers and clean up some mistakes
in the assertions thereof.
Patch 5 implements a test for the KVM_VCPU_TSC_OFFSET attribute,
asserting that manipulation of the offset results in correct TSC values
within the guest.
Patch 6 adds a helper to check if KVM supports a given register in the
KVM_*_REG ioctls.
Patch 7 adds basic arm64 support to the counter offset test, checking
that the virtual counter-timer offset works correctly. Patch 8 does the
same for the physical counter-timer offset.
Patch 9 adds a benchmark for physical counter offsetting, since most
implementations available right now will rely on emulation.
This series applies cleanly to kvm/queue at the following commit:
3e0b8bd99ab ("KVM: MMU: change tracepoints arguments to kvm_page_fault")
Tests were ran against the respective architecture changes on the
following systems:
- Haswell (x86)
- Ampere Mt. Jade (non-ECV, nVHE and VHE)
- ARM Base RevC FVP (ECV, nVHE and VHE)
*NOTE*: Though this tests changes between both x86 and arm64, these
tests check for capabilities and skip if missing, so its OK if they're
merged in trees that lack the patches for both architectures.
v6: https://lore.kernel.org/r/20210804085819.846610-1-oupton@google.com
v6 -> v7:
- adapted to UAPI renaming for physical counter offsetting on arm64
Oliver Upton (9):
tools: arch: x86: pull in pvclock headers
selftests: KVM: Add test for KVM_{GET,SET}_CLOCK
selftests: KVM: Fix kvm device helper ioctl assertions
selftests: KVM: Add helpers for vCPU device attributes
selftests: KVM: Introduce system counter offset test
selftests: KVM: Add helper to check for register presence
selftests: KVM: Add support for aarch64 to system_counter_offset_test
selftests: KVM: Test physical counter offsetting
selftests: KVM: Add counter emulation benchmark
tools/arch/x86/include/asm/pvclock-abi.h | 48 ++++
tools/arch/x86/include/asm/pvclock.h | 103 +++++++++
tools/testing/selftests/kvm/.gitignore | 3 +
tools/testing/selftests/kvm/Makefile | 4 +
.../kvm/aarch64/counter_emulation_benchmark.c | 207 +++++++++++++++++
.../selftests/kvm/include/aarch64/processor.h | 24 ++
.../testing/selftests/kvm/include/kvm_util.h | 13 ++
tools/testing/selftests/kvm/lib/kvm_util.c | 63 +++++-
.../kvm/system_counter_offset_test.c | 211 ++++++++++++++++++
.../selftests/kvm/x86_64/kvm_clock_test.c | 204 +++++++++++++++++
10 files changed, 877 insertions(+), 3 deletions(-)
create mode 100644 tools/arch/x86/include/asm/pvclock-abi.h
create mode 100644 tools/arch/x86/include/asm/pvclock.h
create mode 100644 tools/testing/selftests/kvm/aarch64/counter_emulation_benchmark.c
create mode 100644 tools/testing/selftests/kvm/system_counter_offset_test.c
create mode 100644 tools/testing/selftests/kvm/x86_64/kvm_clock_test.c
--
2.33.0.rc1.237.g0d66db33f3-goog
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
WARNING: multiple messages have this Message-ID (diff)
From: Oliver Upton <oupton@google.com>
To: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Marc Zyngier <maz@kernel.org>, Peter Shier <pshier@google.com>,
Jim Mattson <jmattson@google.com>,
David Matlack <dmatlack@google.com>,
Ricardo Koller <ricarkol@google.com>,
Jing Zhang <jingzhangos@google.com>,
Raghavendra Rao Anata <rananta@google.com>,
James Morse <james.morse@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
linux-arm-kernel@lists.infradead.org,
Andrew Jones <drjones@redhat.com>, Will Deacon <will@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Oliver Upton <oupton@google.com>
Subject: [PATCH v7 0/9] selftests: KVM: Test offset-based counter controls
Date: Mon, 16 Aug 2021 00:12:37 +0000 [thread overview]
Message-ID: <20210816001246.3067312-1-oupton@google.com> (raw)
This series implements new tests for the x86 and arm64 counter migration
changes that I've mailed out. These are sent separately as a dependent
change since there are cross-arch dependencies here.
Patch 1 yanks the pvclock headers into the tools/ directory so we can
make use of them within a KVM selftest guest.
Patch 2 tests the new capabilities of the KVM_*_CLOCK ioctls, ensuring
that the kernel accounts for elapsed time when restoring the KVM clock.
Patches 3-4 add some device attribute helpers and clean up some mistakes
in the assertions thereof.
Patch 5 implements a test for the KVM_VCPU_TSC_OFFSET attribute,
asserting that manipulation of the offset results in correct TSC values
within the guest.
Patch 6 adds a helper to check if KVM supports a given register in the
KVM_*_REG ioctls.
Patch 7 adds basic arm64 support to the counter offset test, checking
that the virtual counter-timer offset works correctly. Patch 8 does the
same for the physical counter-timer offset.
Patch 9 adds a benchmark for physical counter offsetting, since most
implementations available right now will rely on emulation.
This series applies cleanly to kvm/queue at the following commit:
3e0b8bd99ab ("KVM: MMU: change tracepoints arguments to kvm_page_fault")
Tests were ran against the respective architecture changes on the
following systems:
- Haswell (x86)
- Ampere Mt. Jade (non-ECV, nVHE and VHE)
- ARM Base RevC FVP (ECV, nVHE and VHE)
*NOTE*: Though this tests changes between both x86 and arm64, these
tests check for capabilities and skip if missing, so its OK if they're
merged in trees that lack the patches for both architectures.
v6: https://lore.kernel.org/r/20210804085819.846610-1-oupton@google.com
v6 -> v7:
- adapted to UAPI renaming for physical counter offsetting on arm64
Oliver Upton (9):
tools: arch: x86: pull in pvclock headers
selftests: KVM: Add test for KVM_{GET,SET}_CLOCK
selftests: KVM: Fix kvm device helper ioctl assertions
selftests: KVM: Add helpers for vCPU device attributes
selftests: KVM: Introduce system counter offset test
selftests: KVM: Add helper to check for register presence
selftests: KVM: Add support for aarch64 to system_counter_offset_test
selftests: KVM: Test physical counter offsetting
selftests: KVM: Add counter emulation benchmark
tools/arch/x86/include/asm/pvclock-abi.h | 48 ++++
tools/arch/x86/include/asm/pvclock.h | 103 +++++++++
tools/testing/selftests/kvm/.gitignore | 3 +
tools/testing/selftests/kvm/Makefile | 4 +
.../kvm/aarch64/counter_emulation_benchmark.c | 207 +++++++++++++++++
.../selftests/kvm/include/aarch64/processor.h | 24 ++
.../testing/selftests/kvm/include/kvm_util.h | 13 ++
tools/testing/selftests/kvm/lib/kvm_util.c | 63 +++++-
.../kvm/system_counter_offset_test.c | 211 ++++++++++++++++++
.../selftests/kvm/x86_64/kvm_clock_test.c | 204 +++++++++++++++++
10 files changed, 877 insertions(+), 3 deletions(-)
create mode 100644 tools/arch/x86/include/asm/pvclock-abi.h
create mode 100644 tools/arch/x86/include/asm/pvclock.h
create mode 100644 tools/testing/selftests/kvm/aarch64/counter_emulation_benchmark.c
create mode 100644 tools/testing/selftests/kvm/system_counter_offset_test.c
create mode 100644 tools/testing/selftests/kvm/x86_64/kvm_clock_test.c
--
2.33.0.rc1.237.g0d66db33f3-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2021-08-16 0:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-16 0:12 Oliver Upton [this message]
2021-08-16 0:12 ` [PATCH v7 0/9] selftests: KVM: Test offset-based counter controls Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 1/9] tools: arch: x86: pull in pvclock headers Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 2/9] selftests: KVM: Add test for KVM_{GET,SET}_CLOCK Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 3/9] selftests: KVM: Fix kvm device helper ioctl assertions Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 4/9] selftests: KVM: Add helpers for vCPU device attributes Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 5/9] selftests: KVM: Introduce system counter offset test Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 6/9] selftests: KVM: Add helper to check for register presence Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 7/9] selftests: KVM: Add support for aarch64 to system_counter_offset_test Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 8/9] selftests: KVM: Test physical counter offsetting Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` [PATCH v7 9/9] selftests: KVM: Add counter emulation benchmark Oliver Upton
2021-08-16 0:12 ` Oliver Upton
2021-08-16 0:12 ` Oliver Upton
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=20210816001246.3067312-1-oupton@google.com \
--to=oupton@google.com \
--cc=alexandru.elisei@arm.com \
--cc=catalin.marinas@arm.com \
--cc=dmatlack@google.com \
--cc=drjones@redhat.com \
--cc=james.morse@arm.com \
--cc=jingzhangos@google.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=pbonzini@redhat.com \
--cc=pshier@google.com \
--cc=rananta@google.com \
--cc=ricarkol@google.com \
--cc=seanjc@google.com \
--cc=suzuki.poulose@arm.com \
--cc=will@kernel.org \
/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 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.