kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	"moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	Marc Zyngier <maz@kernel.org>,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH v2 1/3] KVM: arm64: Print warning when cpu erratum can cause guests to deadlock
Date: Thu, 2 Jul 2020 15:42:08 +0100	[thread overview]
Message-ID: <20200702144208.GA16999@willie-the-truck> (raw)
In-Reply-To: <CAL_JsqLnZHXjnYf3s6FJnVKf4kN1fhRgJov=Sb3H6J=Yro+cQg@mail.gmail.com>

On Thu, Jul 02, 2020 at 08:04:43AM -0600, Rob Herring wrote:
> On Thu, Jul 2, 2020 at 5:45 AM Will Deacon <will@kernel.org> wrote:
> >
> > On Wed, Jul 01, 2020 at 03:53:06PM -0600, Rob Herring wrote:
> > > If guests don't have certain CPU erratum work-arounds implemented, then
> > > there is a possibility a guest can deadlock the system. IOW, only trusted
> > > guests should be used on systems with the erratum.
> > >
> > > This is the case for Cortex-A57 erratum 832075.
> > >
> > > Cc: Marc Zyngier <maz@kernel.org>
> > > Cc: James Morse <james.morse@arm.com>
> > > Cc: Julien Thierry <julien.thierry.kdev@gmail.com>
> > > Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> > > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > > Cc: Will Deacon <will@kernel.org>
> > > Cc: kvmarm@lists.cs.columbia.edu
> > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > ---
> > >  arch/arm64/kvm/arm.c | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > >
> > > diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> > > index 90cb90561446..e2f50fa4d825 100644
> > > --- a/arch/arm64/kvm/arm.c
> > > +++ b/arch/arm64/kvm/arm.c
> > > @@ -1653,6 +1653,10 @@ int kvm_arch_init(void *opaque)
> > >               return -ENODEV;
> > >       }
> > >
> > > +     if (cpus_have_const_cap(ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE))
> > > +             kvm_info("Guests without required CPU erratum work-arounds can deadlock system!\n" \
> >
> > work-arounds => workarounds
> >
> > (mainly for consistency, I have no clue if this is a real word or not!).
> >
> > I'd also probably do erratum => errata given that you're about to add a
> > second one.
> 
> Humm, the plural is on workarounds. If I use a more standard singular
> vs. plural form like "CPU feature workarounds" vs "CPU features
> workarounds", the former seems more correct to me. (working around
> features may be a bit nonsensical, but big.LITTLE ;) )

Ok, "erratum" it is then!

One other thing on the actual workaround... Case B in the document says:

  | In Program Order,
  | 1. The core executes any load with device memory attributes.
  | 2. The core executes a store-exclusive or register read of PAR_EL1.

and the patch register sequence says:

  | Use the following write sequence to several IMPLEMENTATION DEFINED
  | registers to have the hardware insert a DMB SY after all load-exclusive and
  | store-exclusive instructions.

but that would mean that the sequence is effectively:

	LDR	Xa, [device address]
	STXR	Wb, Xc, [Xd]
	DMB	SY

Does that really prevent the deadlock?

Will
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2020-07-02 14:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 21:53 [PATCH v2 0/3] Cortex-A77 erratum 1508412 work-around Rob Herring
2020-07-01 21:53 ` [PATCH v2 1/3] KVM: arm64: Print warning when cpu erratum can cause guests to deadlock Rob Herring
2020-07-02 11:45   ` Will Deacon
2020-07-02 14:04     ` Rob Herring
2020-07-02 14:42       ` Will Deacon [this message]
2020-07-01 21:53 ` [PATCH v2 2/3] arm64: Add part number for Arm Cortex-A77 Rob Herring
2020-07-01 21:53 ` [PATCH v2 3/3] arm64: Add workaround for Arm Cortex-A77 erratum 1508412 Rob Herring
2020-07-02 11:42   ` Will Deacon
2020-07-02 14:56     ` Rob Herring
2020-07-02 15:01       ` Will Deacon

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=20200702144208.GA16999@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=robh@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).