public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Petteri Kangaslampi <pekangas@google.com>
To: kvmarm@lists.linux.dev
Cc: Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	 Vincent Donnefort <vdonnefort@google.com>,
	Joey Gouly <joey.gouly@arm.com>,
	 Suzuki K Poulose <suzuki.poulose@arm.com>,
	Zenghui Yu <yuzenghui@huawei.com>,
	 Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	 Petteri Kangaslampi <pekangas@google.com>
Subject: [PATCH v2 0/1] KVM: arm64: Calculate hyp VA size only once
Date: Tue, 13 Jan 2026 19:44:08 +0000	[thread overview]
Message-ID: <20260113194409.2970324-1-pekangas@google.com> (raw)

All,

Here's a reworked fix to keep VA size calculations consistent between
the MMU and layout initialization code paths.

Previously, if the kernel was configured with a VA size of less than
48 bits (like happens in our environment), the assumptions used to
calculate hyp_physvirt_offset in kvm_compute_layout() and the code
that determines the VA size used in the rest of the system (calculated
in kvm_mmu_init()) would get out of sync. This could eventually result
in mapping failures.

The patch here is against 6.19-rc4 and tested in default, nVHE, and pKVM
configurations thanks to help from Vincent Donnefort. Detailed
knowledge of the address map remains somewhat distributed inside the
codebase, but at least everything now uses the same VA size, and
further refactoring is probably best done if/when Will's pKVM changes
have been merged.

Petteri Kangaslampi (1):
  KVM: arm64: Calculate hyp VA size only once

 arch/arm64/include/asm/kvm_mmu.h |  3 ++-
 arch/arm64/kvm/arm.c             |  4 ++--
 arch/arm64/kvm/mmu.c             | 28 ++++-----------------------
 arch/arm64/kvm/va_layout.c       | 33 +++++++++++++++++++++++++++-----
 4 files changed, 36 insertions(+), 32 deletions(-)

-- 
2.52.0.457.g6b5491de43-goog



             reply	other threads:[~2026-01-13 19:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 19:44 Petteri Kangaslampi [this message]
2026-01-13 19:44 ` [PATCH v2 1/1] KVM: arm64: Calculate hyp VA size only once Petteri Kangaslampi
2026-01-14  9:27   ` Vincent Donnefort
2026-01-14 10:51 ` [PATCH v2 0/1] " 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=20260113194409.2970324-1-pekangas@google.com \
    --to=pekangas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.com \
    --cc=vdonnefort@google.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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