mbox series

[v2,0/2] KVM: Coalesced IO cleanup and test

Message ID 20240828181446.652474-1-seanjc@google.com (mailing list archive)
Headers show
Series KVM: Coalesced IO cleanup and test | expand

Message

Sean Christopherson Aug. 28, 2024, 6:14 p.m. UTC
Add a regression test for the bug fixed by commit 92f6d4130497 ("KVM:
Fix coalesced_mmio_has_room() to avoid premature userspace exit"), and
then do additional clean up on the offending KVM code.  I wrote the test
mainly so that I was confident I actually understood Ilias' fix.

This applies on the aforementioned commit, which is sitting in
kvm-x86/generic.

Fully tested on x86 and arm64, compile tested on RISC-V.

Ilias, I deliberately didn't include your Reviewed-by for the selftest, just
in case I botched something during the (minor, in theory) rework.

v2:
 - Collect a review. [Ilias]
 - Fix a typo in patch 2's changelog. [Ilias]
 - Rework the selftest to containerize the coalesced I/O ring and its state,
   to hopefully make it easier to extend the test to validate using a ring
   other than KVM's built-in default. [Ilias]

Sean Christopherson (2):
  KVM: selftests: Add a test for coalesced MMIO (and PIO on x86)
  KVM: Clean up coalesced MMIO ring full check

 tools/testing/selftests/kvm/Makefile          |   3 +
 .../testing/selftests/kvm/coalesced_io_test.c | 236 ++++++++++++++++++
 .../testing/selftests/kvm/include/kvm_util.h  |  26 ++
 virt/kvm/coalesced_mmio.c                     |  29 +--
 4 files changed, 273 insertions(+), 21 deletions(-)
 create mode 100644 tools/testing/selftests/kvm/coalesced_io_test.c


base-commit: 728d17c2cb8cc5f9ac899173d0e9a67fb8887622

Comments

Sean Christopherson Aug. 31, 2024, 12:20 a.m. UTC | #1
On Wed, 28 Aug 2024 11:14:44 -0700, Sean Christopherson wrote:
> Add a regression test for the bug fixed by commit 92f6d4130497 ("KVM:
> Fix coalesced_mmio_has_room() to avoid premature userspace exit"), and
> then do additional clean up on the offending KVM code.  I wrote the test
> mainly so that I was confident I actually understood Ilias' fix.
> 
> This applies on the aforementioned commit, which is sitting in
> kvm-x86/generic.
> 
> [...]

Applied to kvm-x86 generic, thanks!

[1/2] KVM: selftests: Add a test for coalesced MMIO (and PIO on x86)
      https://github.com/kvm-x86/linux/commit/215b3cb7a84f
[2/2] KVM: Clean up coalesced MMIO ring full check
      https://github.com/kvm-x86/linux/commit/e027ba1b83ad

--
https://github.com/kvm-x86/linux/tree/next
patchwork-bot+linux-riscv@kernel.org Oct. 1, 2024, 11:35 a.m. UTC | #2
Hello:

This series was applied to riscv/linux.git (fixes)
by Sean Christopherson <seanjc@google.com>:

On Wed, 28 Aug 2024 11:14:44 -0700 you wrote:
> Add a regression test for the bug fixed by commit 92f6d4130497 ("KVM:
> Fix coalesced_mmio_has_room() to avoid premature userspace exit"), and
> then do additional clean up on the offending KVM code.  I wrote the test
> mainly so that I was confident I actually understood Ilias' fix.
> 
> This applies on the aforementioned commit, which is sitting in
> kvm-x86/generic.
> 
> [...]

Here is the summary with links:
  - [v2,1/2] KVM: selftests: Add a test for coalesced MMIO (and PIO on x86)
    https://git.kernel.org/riscv/c/215b3cb7a84f
  - [v2,2/2] KVM: Clean up coalesced MMIO ring full check
    https://git.kernel.org/riscv/c/e027ba1b83ad

You are awesome, thank you!