All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Upton <oupton@google.com>
To: Fuad Tabba <tabba@google.com>
Cc: will@kernel.org, maz@kernel.org, catalin.marinas@arm.com,
	kernel-team@android.com, kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/4] KVM: arm64: Reenable pmu in Protected Mode
Date: Mon, 9 May 2022 22:36:00 +0000	[thread overview]
Message-ID: <YnmXULIsOO27g/8N@google.com> (raw)
In-Reply-To: <20220509120330.3043773-5-tabba@google.com>

Hi Fuad,

On Mon, May 09, 2022 at 12:03:30PM +0000, Fuad Tabba wrote:
> Now that the pmu code does not access hyp data, reenable it in
> protected mode.
> 
> Signed-off-by: Fuad Tabba <tabba@google.com>
> ---
>  arch/arm64/kvm/pmu-emul.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c
> index 3dc990ac4f44..11c43bed5f97 100644
> --- a/arch/arm64/kvm/pmu-emul.c
> +++ b/arch/arm64/kvm/pmu-emul.c
> @@ -774,8 +774,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu)
>  {
>  	struct arm_pmu_entry *entry;
>  
> -	if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_PMUVER_IMP_DEF ||
> -	    is_protected_kvm_enabled())
> +	if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_PMUVER_IMP_DEF)

IIUC, you intend to enable the PMU for non-pVM guests, right? Based on
the pKVM feature registers + trap handlers I can see that pVM use of the
PMU is in fact disabled. It'd be good to state in the commit message
what is exactly intended for pVMs and non-pVMs.

Since the PMU counters are disabled outright for pVMs, is there any
value in context switching between host/guest in this case?

--
Thanks,
Oliver
_______________________________________________
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: Oliver Upton <oupton@google.com>
To: Fuad Tabba <tabba@google.com>
Cc: kvmarm@lists.cs.columbia.edu, kernel-team@android.com,
	maz@kernel.org, catalin.marinas@arm.com, will@kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 4/4] KVM: arm64: Reenable pmu in Protected Mode
Date: Mon, 9 May 2022 22:36:00 +0000	[thread overview]
Message-ID: <YnmXULIsOO27g/8N@google.com> (raw)
In-Reply-To: <20220509120330.3043773-5-tabba@google.com>

Hi Fuad,

On Mon, May 09, 2022 at 12:03:30PM +0000, Fuad Tabba wrote:
> Now that the pmu code does not access hyp data, reenable it in
> protected mode.
> 
> Signed-off-by: Fuad Tabba <tabba@google.com>
> ---
>  arch/arm64/kvm/pmu-emul.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c
> index 3dc990ac4f44..11c43bed5f97 100644
> --- a/arch/arm64/kvm/pmu-emul.c
> +++ b/arch/arm64/kvm/pmu-emul.c
> @@ -774,8 +774,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu)
>  {
>  	struct arm_pmu_entry *entry;
>  
> -	if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_PMUVER_IMP_DEF ||
> -	    is_protected_kvm_enabled())
> +	if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_PMUVER_IMP_DEF)

IIUC, you intend to enable the PMU for non-pVM guests, right? Based on
the pKVM feature registers + trap handlers I can see that pVM use of the
PMU is in fact disabled. It'd be good to state in the commit message
what is exactly intended for pVMs and non-pVMs.

Since the PMU counters are disabled outright for pVMs, is there any
value in context switching between host/guest in this case?

--
Thanks,
Oliver

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-05-09 22:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 12:03 [PATCH v3 0/4] KVM: arm64: Do not communicate host pmu event changes by accessing hyp data Fuad Tabba
2022-05-09 12:03 ` Fuad Tabba
2022-05-09 12:03 ` [PATCH v3 1/4] KVM: arm64: Wrapper for getting pmu_events Fuad Tabba
2022-05-09 12:03   ` Fuad Tabba
2022-05-09 19:41   ` Oliver Upton
2022-05-09 19:41     ` Oliver Upton
2022-05-09 12:03 ` [PATCH v3 2/4] KVM: arm64: Repack struct kvm_pmu to reduce size Fuad Tabba
2022-05-09 12:03   ` Fuad Tabba
2022-05-09 19:57   ` Oliver Upton
2022-05-09 19:57     ` Oliver Upton
2022-05-10  6:38     ` Fuad Tabba
2022-05-10  6:38       ` Fuad Tabba
2022-05-09 12:03 ` [PATCH v3 3/4] KVM: arm64: Pass pmu events to hyp via vcpu Fuad Tabba
2022-05-09 12:03   ` Fuad Tabba
2022-05-09 20:21   ` Oliver Upton
2022-05-09 20:21     ` Oliver Upton
2022-05-10  6:43     ` Fuad Tabba
2022-05-10  6:43       ` Fuad Tabba
2022-05-10  9:21       ` Marc Zyngier
2022-05-10  9:21         ` Marc Zyngier
2022-05-09 12:03 ` [PATCH v3 4/4] KVM: arm64: Reenable pmu in Protected Mode Fuad Tabba
2022-05-09 12:03   ` Fuad Tabba
2022-05-09 22:36   ` Oliver Upton [this message]
2022-05-09 22:36     ` Oliver Upton
2022-05-10  6:45     ` Fuad Tabba
2022-05-10  6:45       ` Fuad Tabba

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=YnmXULIsOO27g/8N@google.com \
    --to=oupton@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=kernel-team@android.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=tabba@google.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 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.