* [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-02 15:05 FAILED: patch "[PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow" failed to apply to 4.19-stable tree gregkh
@ 2024-12-03 19:02 ` Raghavendra Rao Ananta
2024-12-03 23:34 ` Sasha Levin
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Raghavendra Rao Ananta @ 2024-12-03 19:02 UTC (permalink / raw)
To: stable; +Cc: Oliver Upton, Marc Zyngier, Raghavendra Rao Ananta
commit 54bbee190d42166209185d89070c58a343bf514b upstream.
DDI0487K.a D13.3.1 describes the PMU overflow condition, which evaluates
to true if any counter's global enable (PMCR_EL0.E), overflow flag
(PMOVSSET_EL0[n]), and interrupt enable (PMINTENSET_EL1[n]) are all 1.
Of note, this does not require a counter to be enabled
(i.e. PMCNTENSET_EL0[n] = 1) to generate an overflow.
Align kvm_pmu_overflow_status() with the reality of the architecture
and stop using PMCNTENSET_EL0 as part of the overflow condition. The
bug was discovered while running an SBSA PMU test [*], which only sets
PMCR.E, PMOVSSET<0>, PMINTENSET<0>, and expects an overflow interrupt.
Cc: stable@vger.kernel.org
Fixes: 76d883c4e640 ("arm64: KVM: Add access handler for PMOVSSET and PMOVSCLR register")
Link: https://github.com/ARM-software/sbsa-acs/blob/master/test_pool/pmu/operating_system/test_pmu001.c
Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
[ oliver: massaged changelog ]
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241120005230.2335682-2-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
virt/kvm/arm/pmu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/virt/kvm/arm/pmu.c b/virt/kvm/arm/pmu.c
index 6d52fd50c1ff..b92b1d406374 100644
--- a/virt/kvm/arm/pmu.c
+++ b/virt/kvm/arm/pmu.c
@@ -195,7 +195,6 @@ static u64 kvm_pmu_overflow_status(struct kvm_vcpu *vcpu)
if ((__vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) {
reg = __vcpu_sys_reg(vcpu, PMOVSSET_EL0);
- reg &= __vcpu_sys_reg(vcpu, PMCNTENSET_EL0);
reg &= __vcpu_sys_reg(vcpu, PMINTENSET_EL1);
reg &= kvm_pmu_valid_counter_mask(vcpu);
}
--
2.47.0.338.g60cca15819-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-03 19:02 ` [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status Raghavendra Rao Ananta
@ 2024-12-03 23:34 ` Sasha Levin
2024-12-12 7:57 ` Greg KH
2024-12-12 8:27 ` Greg KH
2 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2024-12-03 23:34 UTC (permalink / raw)
To: stable; +Cc: Raghavendra Rao Ananta, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 54bbee190d42166209185d89070c58a343bf514b
Status in newer kernel trees:
6.12.y | Present (different SHA1: 2a68705a5469)
Note: The patch differs from the upstream commit:
---
Failed to apply patch cleanly, falling back to interdiff...
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y | Failed | N/A |
| stable/linux-6.11.y | Failed | N/A |
| stable/linux-6.6.y | Failed | N/A |
| stable/linux-6.1.y | Failed | N/A |
| stable/linux-5.15.y | Failed | N/A |
| stable/linux-5.10.y | Failed | N/A |
| stable/linux-5.4.y | Success | Success |
| stable/linux-4.19.y | Success | Success |
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-03 19:02 ` [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status Raghavendra Rao Ananta
2024-12-03 23:34 ` Sasha Levin
@ 2024-12-12 7:57 ` Greg KH
2024-12-12 8:27 ` Greg KH
2 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2024-12-12 7:57 UTC (permalink / raw)
To: Raghavendra Rao Ananta; +Cc: stable, Oliver Upton, Marc Zyngier
On Tue, Dec 03, 2024 at 07:02:36PM +0000, Raghavendra Rao Ananta wrote:
> commit 54bbee190d42166209185d89070c58a343bf514b upstream.
>
> DDI0487K.a D13.3.1 describes the PMU overflow condition, which evaluates
> to true if any counter's global enable (PMCR_EL0.E), overflow flag
> (PMOVSSET_EL0[n]), and interrupt enable (PMINTENSET_EL1[n]) are all 1.
> Of note, this does not require a counter to be enabled
> (i.e. PMCNTENSET_EL0[n] = 1) to generate an overflow.
>
> Align kvm_pmu_overflow_status() with the reality of the architecture
> and stop using PMCNTENSET_EL0 as part of the overflow condition. The
> bug was discovered while running an SBSA PMU test [*], which only sets
> PMCR.E, PMOVSSET<0>, PMINTENSET<0>, and expects an overflow interrupt.
>
> Cc: stable@vger.kernel.org
> Fixes: 76d883c4e640 ("arm64: KVM: Add access handler for PMOVSSET and PMOVSCLR register")
> Link: https://github.com/ARM-software/sbsa-acs/blob/master/test_pool/pmu/operating_system/test_pmu001.c
> Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
> [ oliver: massaged changelog ]
> Reviewed-by: Marc Zyngier <maz@kernel.org>
> Link: https://lore.kernel.org/r/20241120005230.2335682-2-oliver.upton@linux.dev
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> virt/kvm/arm/pmu.c | 1 -
> 1 file changed, 1 deletion(-)
What branch is this patch for?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-03 19:02 ` [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status Raghavendra Rao Ananta
2024-12-03 23:34 ` Sasha Levin
2024-12-12 7:57 ` Greg KH
@ 2024-12-12 8:27 ` Greg KH
2024-12-12 17:41 ` Raghavendra Rao Ananta
2 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2024-12-12 8:27 UTC (permalink / raw)
To: Raghavendra Rao Ananta; +Cc: stable, Oliver Upton, Marc Zyngier
On Tue, Dec 03, 2024 at 07:02:36PM +0000, Raghavendra Rao Ananta wrote:
> commit 54bbee190d42166209185d89070c58a343bf514b upstream.
>
> DDI0487K.a D13.3.1 describes the PMU overflow condition, which evaluates
> to true if any counter's global enable (PMCR_EL0.E), overflow flag
> (PMOVSSET_EL0[n]), and interrupt enable (PMINTENSET_EL1[n]) are all 1.
> Of note, this does not require a counter to be enabled
> (i.e. PMCNTENSET_EL0[n] = 1) to generate an overflow.
>
> Align kvm_pmu_overflow_status() with the reality of the architecture
> and stop using PMCNTENSET_EL0 as part of the overflow condition. The
> bug was discovered while running an SBSA PMU test [*], which only sets
> PMCR.E, PMOVSSET<0>, PMINTENSET<0>, and expects an overflow interrupt.
>
> Cc: stable@vger.kernel.org
> Fixes: 76d883c4e640 ("arm64: KVM: Add access handler for PMOVSSET and PMOVSCLR register")
> Link: https://github.com/ARM-software/sbsa-acs/blob/master/test_pool/pmu/operating_system/test_pmu001.c
> Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
> [ oliver: massaged changelog ]
> Reviewed-by: Marc Zyngier <maz@kernel.org>
> Link: https://lore.kernel.org/r/20241120005230.2335682-2-oliver.upton@linux.dev
> Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> ---
> virt/kvm/arm/pmu.c | 1 -
> 1 file changed, 1 deletion(-)
What kernel branch(es) is this backport for?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-12 8:27 ` Greg KH
@ 2024-12-12 17:41 ` Raghavendra Rao Ananta
2024-12-12 18:07 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Raghavendra Rao Ananta @ 2024-12-12 17:41 UTC (permalink / raw)
To: Greg KH; +Cc: stable, Oliver Upton, Marc Zyngier
Hi Greg,
This is an adjustment of the original upstream patch aimed towards the
4.19.y stable branch.
Thank you.
Raghavendra
On Thu, Dec 12, 2024 at 12:27 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Tue, Dec 03, 2024 at 07:02:36PM +0000, Raghavendra Rao Ananta wrote:
> > commit 54bbee190d42166209185d89070c58a343bf514b upstream.
> >
> > DDI0487K.a D13.3.1 describes the PMU overflow condition, which evaluates
> > to true if any counter's global enable (PMCR_EL0.E), overflow flag
> > (PMOVSSET_EL0[n]), and interrupt enable (PMINTENSET_EL1[n]) are all 1.
> > Of note, this does not require a counter to be enabled
> > (i.e. PMCNTENSET_EL0[n] = 1) to generate an overflow.
> >
> > Align kvm_pmu_overflow_status() with the reality of the architecture
> > and stop using PMCNTENSET_EL0 as part of the overflow condition. The
> > bug was discovered while running an SBSA PMU test [*], which only sets
> > PMCR.E, PMOVSSET<0>, PMINTENSET<0>, and expects an overflow interrupt.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 76d883c4e640 ("arm64: KVM: Add access handler for PMOVSSET and PMOVSCLR register")
> > Link: https://github.com/ARM-software/sbsa-acs/blob/master/test_pool/pmu/operating_system/test_pmu001.c
> > Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
> > [ oliver: massaged changelog ]
> > Reviewed-by: Marc Zyngier <maz@kernel.org>
> > Link: https://lore.kernel.org/r/20241120005230.2335682-2-oliver.upton@linux.dev
> > Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
> > ---
> > virt/kvm/arm/pmu.c | 1 -
> > 1 file changed, 1 deletion(-)
>
> What kernel branch(es) is this backport for?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-12 17:41 ` Raghavendra Rao Ananta
@ 2024-12-12 18:07 ` Greg KH
2024-12-12 18:52 ` Raghavendra Rao Ananta
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2024-12-12 18:07 UTC (permalink / raw)
To: Raghavendra Rao Ananta; +Cc: stable, Oliver Upton, Marc Zyngier
On Thu, Dec 12, 2024 at 09:41:28AM -0800, Raghavendra Rao Ananta wrote:
> Hi Greg,
>
> This is an adjustment of the original upstream patch aimed towards the
> 4.19.y stable branch.
4.19.y is end-of-life, so there's nothing we can do there. But what
about 5.4.y? If it matters there, please resend it in a format we can
apply it in for that tree.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-12 18:07 ` Greg KH
@ 2024-12-12 18:52 ` Raghavendra Rao Ananta
2024-12-13 7:22 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Raghavendra Rao Ananta @ 2024-12-12 18:52 UTC (permalink / raw)
To: Greg KH; +Cc: stable, Oliver Upton, Marc Zyngier
On Thu, Dec 12, 2024 at 10:07 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Thu, Dec 12, 2024 at 09:41:28AM -0800, Raghavendra Rao Ananta wrote:
> > Hi Greg,
> >
> > This is an adjustment of the original upstream patch aimed towards the
> > 4.19.y stable branch.
>
> 4.19.y is end-of-life, so there's nothing we can do there. But what
> about 5.4.y? If it matters there, please resend it in a format we can
> apply it in for that tree.
The version of the patch from this thread applies to 5.4.y as well. Do
you want me to resend it or will you be able to pick this up?
Thank you.
Raghavendra
Raghavendra
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-12 18:52 ` Raghavendra Rao Ananta
@ 2024-12-13 7:22 ` Greg KH
0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2024-12-13 7:22 UTC (permalink / raw)
To: Raghavendra Rao Ananta; +Cc: stable, Oliver Upton, Marc Zyngier
On Thu, Dec 12, 2024 at 10:52:07AM -0800, Raghavendra Rao Ananta wrote:
> On Thu, Dec 12, 2024 at 10:07 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Thu, Dec 12, 2024 at 09:41:28AM -0800, Raghavendra Rao Ananta wrote:
> > > Hi Greg,
> > >
> > > This is an adjustment of the original upstream patch aimed towards the
> > > 4.19.y stable branch.
> >
> > 4.19.y is end-of-life, so there's nothing we can do there. But what
> > about 5.4.y? If it matters there, please resend it in a format we can
> > apply it in for that tree.
>
> The version of the patch from this thread applies to 5.4.y as well. Do
> you want me to resend it or will you be able to pick this up?
Please resend it.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
@ 2024-12-16 17:54 Raghavendra Rao Ananta
2024-12-17 0:42 ` Sasha Levin
0 siblings, 1 reply; 10+ messages in thread
From: Raghavendra Rao Ananta @ 2024-12-16 17:54 UTC (permalink / raw)
To: Greg Kroah-Hartman, stable
Cc: Oliver Upton, Marc Zyngier, Raghavendra Rao Anata
commit 54bbee190d42166209185d89070c58a343bf514b upstream.
DDI0487K.a D13.3.1 describes the PMU overflow condition, which evaluates
to true if any counter's global enable (PMCR_EL0.E), overflow flag
(PMOVSSET_EL0[n]), and interrupt enable (PMINTENSET_EL1[n]) are all 1.
Of note, this does not require a counter to be enabled
(i.e. PMCNTENSET_EL0[n] = 1) to generate an overflow.
Align kvm_pmu_overflow_status() with the reality of the architecture
and stop using PMCNTENSET_EL0 as part of the overflow condition. The
bug was discovered while running an SBSA PMU test [*], which only sets
PMCR.E, PMOVSSET<0>, PMINTENSET<0>, and expects an overflow interrupt.
Cc: stable@vger.kernel.org
Fixes: 76d883c4e640 ("arm64: KVM: Add access handler for PMOVSSET and PMOVSCLR register")
Link: https://github.com/ARM-software/sbsa-acs/blob/master/test_pool/pmu/operating_system/test_pmu001.c
Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
[ oliver: massaged changelog ]
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20241120005230.2335682-2-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
---
virt/kvm/arm/pmu.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/virt/kvm/arm/pmu.c b/virt/kvm/arm/pmu.c
index 4c08fd009768..9732c5e0ed22 100644
--- a/virt/kvm/arm/pmu.c
+++ b/virt/kvm/arm/pmu.c
@@ -357,7 +357,6 @@ static u64 kvm_pmu_overflow_status(struct kvm_vcpu *vcpu)
if ((__vcpu_sys_reg(vcpu, PMCR_EL0) & ARMV8_PMU_PMCR_E)) {
reg = __vcpu_sys_reg(vcpu, PMOVSSET_EL0);
- reg &= __vcpu_sys_reg(vcpu, PMCNTENSET_EL0);
reg &= __vcpu_sys_reg(vcpu, PMINTENSET_EL1);
reg &= kvm_pmu_valid_counter_mask(vcpu);
}
base-commit: 6708005a36cfdb32aa991ebd9ea172e1183231ef
--
2.47.1.613.gc27f4b7a9f-goog
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status
2024-12-16 17:54 [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status Raghavendra Rao Ananta
@ 2024-12-17 0:42 ` Sasha Levin
0 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2024-12-17 0:42 UTC (permalink / raw)
To: stable; +Cc: Raghavendra Rao Ananta, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 54bbee190d42166209185d89070c58a343bf514b
Status in newer kernel trees:
6.12.y | Present (different SHA1: 8b6916f4cf7d)
Note: The patch differs from the upstream commit:
---
Failed to apply patch cleanly, falling back to interdiff...
interdiff error output:
/home/sasha/stable/mailbot.sh: line 525: interdiff: command not found
interdiff failed, falling back to standard diff...
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.12.y | Failed | N/A |
| stable/linux-6.6.y | Failed | N/A |
| stable/linux-6.1.y | Failed | N/A |
| stable/linux-5.15.y | Failed | N/A |
| stable/linux-5.10.y | Failed | N/A |
| stable/linux-5.4.y | Success | Success |
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-12-17 0:42 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16 17:54 [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status Raghavendra Rao Ananta
2024-12-17 0:42 ` Sasha Levin
-- strict thread matches above, loose matches on Subject: below --
2024-12-02 15:05 FAILED: patch "[PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow" failed to apply to 4.19-stable tree gregkh
2024-12-03 19:02 ` [PATCH] KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status Raghavendra Rao Ananta
2024-12-03 23:34 ` Sasha Levin
2024-12-12 7:57 ` Greg KH
2024-12-12 8:27 ` Greg KH
2024-12-12 17:41 ` Raghavendra Rao Ananta
2024-12-12 18:07 ` Greg KH
2024-12-12 18:52 ` Raghavendra Rao Ananta
2024-12-13 7:22 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox