linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Paolo Bonzini <pbonzini@redhat.com>, Andrew Jones <drjones@redhat.com>
Cc: James Morse <james.morse@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kernel-team@android.com
Subject: [PATCH v2 0/6] KVM: arm64: Selftest IPA fixes and 16kB support
Date: Mon, 27 Dec 2021 12:48:03 +0000	[thread overview]
Message-ID: <20211227124809.1335409-1-maz@kernel.org> (raw)

Now that the common variety of fruity arm64 systems makes a pretty
remarkable KVM host, I have decided to run the collection of selftests
on it.

Nothing works. Oh no!

As it turns out, the tests have a notion of "default mode" (40bit PA,
4kB), which cannot work in general on arm64 because there no such
thing as an IPA size that would be valid everywhere (apart from the
minimal 32bit), nor a guaranteed to be supported page size.

This small series is a first attempt at making these things computed
at runtime by making the default something else on systems that do not
support it. It also makes the supported page sizes dynamically
discovered, which allows us to implement support for 16kB pages.

With that, the selftests do run on the M1, with the exception of the
memslot tests that are freaked out by the use of 16kB pages on the
host and 4kB in the guest (these tests are hardcoded to use 4kB
pages even if the VM uses something else -- oh well...).

* From v1:
  - Rebased on 5.16-rc7 and dropped the initial patch, now that
    non-x86 systems are up and running again
  - Used Andrew's trick to initialise the default mode as a
    constructor instead of hacking every single test (I decided to
    make it an arm64-special instead of an all-arch thing though)
  - Reworked the way TCR_EL1 gets configured for easier integration of
    new modes
  - Added support for various 16kB modes
  - Various cleanups as requested by Andrew

Marc Zyngier (6):
  KVM: selftests: arm64: Initialise default guest mode at test startup
    time
  KVM: selftests: arm64: Introduce a variable default IPA size
  KVM: selftests: arm64: Check for supported page sizes
  KVM: selftests: arm64: Rework TCR_EL1 configuration
  KVM: selftests: arm64: Add support for VM_MODE_P36V48_{4K,64K}
  KVM: selftests: arm64: Add support for various modes with 16kB page
    size

 .../selftests/kvm/include/aarch64/processor.h |  3 +
 .../testing/selftests/kvm/include/kvm_util.h  | 10 ++-
 .../selftests/kvm/lib/aarch64/processor.c     | 82 +++++++++++++++++--
 tools/testing/selftests/kvm/lib/guest_modes.c | 49 +++++++++--
 tools/testing/selftests/kvm/lib/kvm_util.c    | 22 +++++
 5 files changed, 152 insertions(+), 14 deletions(-)

-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2021-12-27 12:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 12:48 Marc Zyngier [this message]
2021-12-27 12:48 ` [PATCH v2 1/6] KVM: selftests: arm64: Initialise default guest mode at test startup time Marc Zyngier
2021-12-28  9:37   ` Andrew Jones
2021-12-27 12:48 ` [PATCH v2 2/6] KVM: selftests: arm64: Introduce a variable default IPA size Marc Zyngier
2021-12-28  9:26   ` Andrew Jones
2021-12-28 10:29     ` Marc Zyngier
2021-12-28 10:33       ` Andrew Jones
2021-12-27 12:48 ` [PATCH v2 3/6] KVM: selftests: arm64: Check for supported page sizes Marc Zyngier
2021-12-28  9:37   ` Andrew Jones
2021-12-27 12:48 ` [PATCH v2 4/6] KVM: selftests: arm64: Rework TCR_EL1 configuration Marc Zyngier
2021-12-28  9:37   ` Andrew Jones
2021-12-27 12:48 ` [PATCH v2 5/6] KVM: selftests: arm64: Add support for VM_MODE_P36V48_{4K, 64K} Marc Zyngier
2021-12-27 12:48 ` [PATCH v2 6/6] KVM: selftests: arm64: Add support for various modes with 16kB page size Marc Zyngier
2021-12-28  9:38   ` Andrew Jones
2021-12-28 11:09 ` [PATCH v2 0/6] KVM: arm64: Selftest IPA fixes and 16kB support Marc Zyngier

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=20211227124809.1335409-1-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alexandru.elisei@arm.com \
    --cc=drjones@redhat.com \
    --cc=james.morse@arm.com \
    --cc=kernel-team@android.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=pbonzini@redhat.com \
    --cc=suzuki.poulose@arm.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;
as well as URLs for NNTP newsgroup(s).