From: Marc Zyngier <maz@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>,
will@kernel.org, Catalin Marinas <catalin.marinas@arm.com>
Cc: dbrazdil@google.com, kvmarm@lists.cs.columbia.edu,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCHv2 0/3] arm64: kvm: avoid referencing cpu_hwcaps from hyp
Date: Thu, 29 Oct 2020 19:48:16 +0000 [thread overview]
Message-ID: <87ft5werun.wl-maz@kernel.org> (raw)
In-Reply-To: <20201026134931.28246-1-mark.rutland@arm.com>
[+ Catalin]
On Mon, 26 Oct 2020 13:49:28 +0000,
Mark Rutland <mark.rutland@arm.com> wrote:
>
> In a few places we use cpus_have_const_cap() in hyp code, usually
> because this is hidden within a helper that's also used in regular
> kernel context. As cpus_have_const_cap() generates code to read the
> cpu_hwcaps array before capabilities are finalized, this means we
> generate some potentially-unsound references to regular kernel VAs, but
> this these are redundant as capabilities are finalized before we
> initialize the kvm hyp code.
>
> This series gets rid of the redundant code by automatically upgrading
> cpust_have_const_cap() to cpus_have_final_cap() when used in hyp code.
> This allows us to avoid creating an NVHE alias for the cpu_hwcaps array,
> so we can catch if we accidentally introduce an runtime reference to
> this (e.g. via cpus_have_cap()).
>
> Since v1 [1]:
> * Trivial rebase to v5.10-rc1
>
> [1] https://lore.kernel.org/r/20201007125211.30043-1-mark.rutland@arm.com
>
> Mark Rutland (3):
> arm64: kvm: factor out is_{vhe,nvhe}_hyp_code()
> arm64: cpufeature: reorder cpus_have_{const,final}_cap()
> arm64: cpufeature: upgrade hyp caps to final
>
> arch/arm64/include/asm/cpufeature.h | 40 ++++++++++++++++++++++++++++---------
> arch/arm64/include/asm/virt.h | 9 ++++-----
> arch/arm64/kernel/image-vars.h | 1 -
> 3 files changed, 35 insertions(+), 15 deletions(-)
Catalin, Will: can I get an Ack for patches 2 and 3? I'd be quite
happy to drop yet another reference from the nVHE object...
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-10-29 19:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 13:49 [PATCHv2 0/3] arm64: kvm: avoid referencing cpu_hwcaps from hyp Mark Rutland
2020-10-26 13:49 ` [PATCHv2 1/3] arm64: kvm: factor out is_{vhe,nvhe}_hyp_code() Mark Rutland
2020-10-30 8:21 ` Will Deacon
2020-10-26 13:49 ` [PATCHv2 2/3] arm64: cpufeature: reorder cpus_have_{const, final}_cap() Mark Rutland
2020-10-30 8:18 ` [PATCHv2 2/3] arm64: cpufeature: reorder cpus_have_{const,final}_cap() Will Deacon
2020-10-30 8:20 ` Will Deacon
2020-10-30 14:18 ` Mark Rutland
2020-10-26 13:49 ` [PATCHv2 3/3] arm64: cpufeature: upgrade hyp caps to final Mark Rutland
2020-10-30 8:24 ` Will Deacon
2020-10-29 19:48 ` Marc Zyngier [this message]
2020-10-30 10:59 ` [PATCHv2 0/3] arm64: kvm: avoid referencing cpu_hwcaps from hyp 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=87ft5werun.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=dbrazdil@google.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@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 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).