From: Greg KH <greg@kroah.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org,
Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
Andre Przywara <andre.przywara@arm.com>,
Steven Price <steven.price@arm.com>
Subject: Re: [PATCH stable 5.9] KVM: arm64: ARM_SMCCC_ARCH_WORKAROUND_1 doesn't return SMCCC_RET_NOT_REQUIRED
Date: Tue, 3 Nov 2020 21:21:57 +0100 [thread overview]
Message-ID: <20201103202157.GA470743@kroah.com> (raw)
In-Reply-To: <20201103201526.372590-1-swboyd@chromium.org>
On Tue, Nov 03, 2020 at 12:15:26PM -0800, Stephen Boyd wrote:
> commit 1de111b51b829bcf01d2e57971f8fd07a665fa3f upstream.
>
> According to the SMCCC spec[1](7.5.2 Discovery) the
> ARM_SMCCC_ARCH_WORKAROUND_1 function id only returns 0, 1, and
> SMCCC_RET_NOT_SUPPORTED.
>
> 0 is "workaround required and safe to call this function"
> 1 is "workaround not required but safe to call this function"
> SMCCC_RET_NOT_SUPPORTED is "might be vulnerable or might not be, who knows, I give up!"
>
> SMCCC_RET_NOT_SUPPORTED might as well mean "workaround required, except
> calling this function may not work because it isn't implemented in some
> cases". Wonderful. We map this SMC call to
>
> 0 is SPECTRE_MITIGATED
> 1 is SPECTRE_UNAFFECTED
> SMCCC_RET_NOT_SUPPORTED is SPECTRE_VULNERABLE
>
> For KVM hypercalls (hvc), we've implemented this function id to return
> SMCCC_RET_NOT_SUPPORTED, 0, and SMCCC_RET_NOT_REQUIRED. One of those
> isn't supposed to be there. Per the code we call
> arm64_get_spectre_v2_state() to figure out what to return for this
> feature discovery call.
>
> 0 is SPECTRE_MITIGATED
> SMCCC_RET_NOT_REQUIRED is SPECTRE_UNAFFECTED
> SMCCC_RET_NOT_SUPPORTED is SPECTRE_VULNERABLE
>
> Let's clean this up so that KVM tells the guest this mapping:
>
> 0 is SPECTRE_MITIGATED
> 1 is SPECTRE_UNAFFECTED
> SMCCC_RET_NOT_SUPPORTED is SPECTRE_VULNERABLE
>
> Note: SMCCC_RET_NOT_AFFECTED is 1 but isn't part of the SMCCC spec
>
> Fixes: c118bbb52743 ("arm64: KVM: Propagate full Spectre v2 workaround state to KVM guests")
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> Acked-by: Marc Zyngier <maz@kernel.org>
> Acked-by: Will Deacon <will@kernel.org>
> Cc: Andre Przywara <andre.przywara@arm.com>
> Cc: Steven Price <steven.price@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: stable@vger.kernel.org
> Link: https://developer.arm.com/documentation/den0028/latest [1]
> Link: https://lore.kernel.org/r/20201023154751.1973872-1-swboyd@chromium.org
> Signed-off-by: Will Deacon <will@kernel.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
> arch/arm64/kvm/hypercalls.c | 2 +-
> include/linux/arm-smccc.h | 2 ++
> 2 files changed, 3 insertions(+), 1 deletion(-)
Thanks for both of these, now queued up.
greg k-h
prev parent reply other threads:[~2020-11-03 20:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 20:15 Stephen Boyd
2020-11-03 20:21 ` Greg KH [this message]
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=20201103202157.GA470743@kroah.com \
--to=greg@kroah.com \
--cc=andre.przywara@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=stable@vger.kernel.org \
--cc=steven.price@arm.com \
--cc=swboyd@chromium.org \
--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
all inboxes | Powered by JetHome®