All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] KVM/arm64: Don't emulate a PMU for 32-bit guests if feature not set
Date: Mon, 25 Apr 2022 18:14:13 +0100	[thread overview]
Message-ID: <875ymx9jbu.wl-maz@kernel.org> (raw)
In-Reply-To: <20220425145530.723858-1-alexandru.elisei@arm.com>

[+ Oliver]

Hi Alex,

On Mon, 25 Apr 2022 15:55:30 +0100,
Alexandru Elisei <alexandru.elisei@arm.com> wrote:
> 
> kvm->arch.arm_pmu is set when userspace attempts to set the first PMU
> attribute. As certain attributes are mandatory, arm_pmu ends up always
> being set to a valid arm_pmu, otherwise KVM will refuse to run the VCPU.
> However, this only happens if the VCPU has the PMU feature. If the VCPU
> doesn't have the feature bit set, kvm->arch.arm_pmu will be left
> uninitialized and equal to NULL.

Although I'm not opposed to this as an immediate workaround to avoid
the ugly crash, I think sanitising the AArch32 regs is the way to go.
Oliver had a stab at this a few weeks back[1], but this seem to have
stalled.

Could you have a look and see if anything was missing (the patches
needed some rework, but I haven't checked whether DFR0 was correctly
handled or not).

Thanks,

	M.

[1] https://lore.kernel.org/r/20220401010832.3425787-1-oupton@google.com

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Alexandru Elisei <alexandru.elisei@arm.com>
Cc: james.morse@arm.com, suzuki.poulose@arm.com,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, Oliver Upton <oupton@google.com>
Subject: Re: [PATCH] KVM/arm64: Don't emulate a PMU for 32-bit guests if feature not set
Date: Mon, 25 Apr 2022 18:14:13 +0100	[thread overview]
Message-ID: <875ymx9jbu.wl-maz@kernel.org> (raw)
In-Reply-To: <20220425145530.723858-1-alexandru.elisei@arm.com>

[+ Oliver]

Hi Alex,

On Mon, 25 Apr 2022 15:55:30 +0100,
Alexandru Elisei <alexandru.elisei@arm.com> wrote:
> 
> kvm->arch.arm_pmu is set when userspace attempts to set the first PMU
> attribute. As certain attributes are mandatory, arm_pmu ends up always
> being set to a valid arm_pmu, otherwise KVM will refuse to run the VCPU.
> However, this only happens if the VCPU has the PMU feature. If the VCPU
> doesn't have the feature bit set, kvm->arch.arm_pmu will be left
> uninitialized and equal to NULL.

Although I'm not opposed to this as an immediate workaround to avoid
the ugly crash, I think sanitising the AArch32 regs is the way to go.
Oliver had a stab at this a few weeks back[1], but this seem to have
stalled.

Could you have a look and see if anything was missing (the patches
needed some rework, but I haven't checked whether DFR0 was correctly
handled or not).

Thanks,

	M.

[1] https://lore.kernel.org/r/20220401010832.3425787-1-oupton@google.com

-- 
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

  reply	other threads:[~2022-04-25 17:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 14:55 [PATCH] KVM/arm64: Don't emulate a PMU for 32-bit guests if feature not set Alexandru Elisei
2022-04-25 14:55 ` Alexandru Elisei
2022-04-25 17:14 ` Marc Zyngier [this message]
2022-04-25 17:14   ` Marc Zyngier
2022-04-25 17:26   ` Oliver Upton
2022-04-25 17:26     ` Oliver Upton
2022-04-26  9:30   ` Alexandru Elisei
2022-04-26  9:30     ` Alexandru Elisei
2022-04-26  8:05 ` Oliver Upton
2022-04-26  8:05   ` Oliver Upton
2022-04-26  9:01   ` Alexandru Elisei
2022-04-26  9:01     ` Alexandru Elisei
2022-04-27  7:57     ` Oliver Upton
2022-04-27  7:57       ` Oliver Upton
2022-04-27  9:45       ` Alexandru Elisei
2022-04-27  9:45         ` Alexandru Elisei
2022-04-27 21:10         ` Marc Zyngier
2022-04-27 21:10           ` Marc Zyngier
2022-04-28 19:58 ` Marc Zyngier
2022-04-28 19:58   ` 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=875ymx9jbu.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=alexandru.elisei@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.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 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.