All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: stable@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
	christoffer.dall@arm.com, james.morse@arm.com,
	robin.murphy@arm.com, will.deacon@arm.com
Subject: Re: [PATCH stable-4.9] KVM: arm64: Fix caching of host MDCR_EL2 value
Date: Mon, 19 Nov 2018 16:16:42 +0100	[thread overview]
Message-ID: <20181119151642.GD5340@kroah.com> (raw)
In-Reply-To: <20181112082707.26785-1-marc.zyngier@arm.com>

On Mon, Nov 12, 2018 at 08:27:07AM +0000, Marc Zyngier wrote:
> From: Mark Rutland <mark.rutland@arm.com>
> 
> commit da5a3ce66b8bb51b0ea8a89f42aac153903f90fb upstream.
> 
> At boot time, KVM stashes the host MDCR_EL2 value, but only does this
> when the kernel is not running in hyp mode (i.e. is non-VHE). In these
> cases, the stashed value of MDCR_EL2.HPMN happens to be zero, which can
> lead to CONSTRAINED UNPREDICTABLE behaviour.
> 
> Since we use this value to derive the MDCR_EL2 value when switching
> to/from a guest, after a guest have been run, the performance counters
> do not behave as expected. This has been observed to result in accesses
> via PMXEVTYPER_EL0 and PMXEVCNTR_EL0 not affecting the relevant
> counters, resulting in events not being counted. In these cases, only
> the fixed-purpose cycle counter appears to work as expected.
> 
> Fix this by always stashing the host MDCR_EL2 value, regardless of VHE.
> 
> Cc: Christopher Dall <christoffer.dall@arm.com>
> Cc: James Morse <james.morse@arm.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: stable@vger.kernel.org
> Fixes: 1e947bad0b63b351 ("arm64: KVM: Skip HYP setup when already running in HYP")
> Tested-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/kvm/arm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Now queued up, thanks.

greg k-h

      reply	other threads:[~2018-11-20  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12  8:27 [PATCH stable-4.9] KVM: arm64: Fix caching of host MDCR_EL2 value Marc Zyngier
2018-11-19 15:16 ` 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=20181119151642.GD5340@kroah.com \
    --to=greg@kroah.com \
    --cc=christoffer.dall@arm.com \
    --cc=james.morse@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    --cc=will.deacon@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.