The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: c631a2de7ae48d50434bdc205d901423f8577c65
Gitweb: https://git.kernel.org/tip/c631a2de7ae48d50434bdc205d901423f8577c65
Author: Sean Christopherson <seanjc(a)google.com>
AuthorDate: Thu, 30 Jan 2025 17:07:21 -08:00
Committer: Peter Zijlstra <peterz(a)infradead.org>
CommitterDate: Sat, 08 Feb 2025 15:47:26 +01:00
perf/x86/intel: Ensure LBRs are disabled when a CPU is starting
Explicitly clear DEBUGCTL.LBR when a CPU is starting, prior to purging the
LBR MSRs themselves, as at least one system has been found to transfer
control to the kernel with LBRs enabled (it's unclear whether it's a BIOS
flaw or a CPU goof). Because the kernel preserves the original DEBUGCTL,
even when toggling LBRs, leaving DEBUGCTL.LBR as is results in running
with LBRs enabled at all times.
Closes: https://lore.kernel.org/all/c9d8269bff69f6359731d758e3b1135dedd7cc61.camel@…
Reported-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Signed-off-by: Sean Christopherson <seanjc(a)google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz(a)infradead.org>
Reviewed-by: Maxim Levitsky <mlevitsk(a)redhat.com>
Cc: stable(a)vger.kernel.org
Link: https://lkml.kernel.org/r/20250131010721.470503-1-seanjc@google.com
---
arch/x86/events/intel/core.c | 5 ++++-
arch/x86/include/asm/msr-index.h | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index f3d5b71..e86333e 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -5042,8 +5042,11 @@ static void intel_pmu_cpu_starting(int cpu)
init_debug_store_on_cpu(cpu);
/*
- * Deal with CPUs that don't clear their LBRs on power-up.
+ * Deal with CPUs that don't clear their LBRs on power-up, and that may
+ * even boot with LBRs enabled.
*/
+ if (!static_cpu_has(X86_FEATURE_ARCH_LBR) && x86_pmu.lbr_nr)
+ msr_clear_bit(MSR_IA32_DEBUGCTLMSR, DEBUGCTLMSR_LBR_BIT);
intel_pmu_lbr_reset();
cpuc->lbr_sel = NULL;
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 9a71880..72765b2 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -395,7 +395,8 @@
#define MSR_IA32_PASID_VALID BIT_ULL(31)
/* DEBUGCTLMSR bits (others vary by model): */
-#define DEBUGCTLMSR_LBR (1UL << 0) /* last branch recording */
+#define DEBUGCTLMSR_LBR_BIT 0 /* last branch recording */
+#define DEBUGCTLMSR_LBR (1UL << DEBUGCTLMSR_LBR_BIT)
#define DEBUGCTLMSR_BTF_SHIFT 1
#define DEBUGCTLMSR_BTF (1UL << 1) /* single-step on branches */
#define DEBUGCTLMSR_BUS_LOCK_DETECT (1UL << 2)
Hello,
New build issue found on stable-rc/linux-6.1.y:
---
‘struct drm_connector’ has no member named ‘eld_mutex’ in
drivers/gpu/drm/sti/sti_hdmi.o (drivers/gpu/drm/sti/sti_hdmi.c)
[logspec:kbuild,kbuild.compiler.error]
---
- dashboard: https://dashboard.kernelci.org/issue/maestro:7fe27892aa3e055cf7cbc7660b6921…
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: 5beb9a3ea62e7725d8cd88410dbd269ebf683ce0
Log excerpt:
=====================================================
drivers/gpu/drm/sti/sti_hdmi.c:1223:30: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1223 | mutex_lock(&connector->eld_mutex);
| ^~
drivers/gpu/drm/sti/sti_hdmi.c:1225:32: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1225 | mutex_unlock(&connector->eld_mutex);
| ^~
=====================================================
# Builds where the incident occurred:
## multi_v7_defconfig on (arm):
- compiler: gcc-12
- dashboard: https://dashboard.kernelci.org/build/maestro:67ab310db27a1f56cc37e118
#kernelci issue maestro:7fe27892aa3e055cf7cbc7660b69219ecce56688
Reported-by: kernelci.org bot <bot(a)kernelci.org>
--
This is an experimental report format. Please send feedback in!
Talk to us at kerneci(a)lists.linux.dev
Made with love by the KernelCI team - https://kernelci.org
Hello,
New build issue found on stable-rc/linux-5.4.y:
---
‘struct drm_connector’ has no member named ‘eld_mutex’ in
drivers/gpu/drm/sti/sti_hdmi.o (drivers/gpu/drm/sti/sti_hdmi.c)
[logspec:kbuild,kbuild.compiler.error]
---
- dashboard: https://dashboard.kernelci.org/issue/maestro:5e925d96a3540cf43ab1b679d0e9b4…
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: 16f808b001a697126972a39c8a2600c33a616ebf
Log excerpt:
=====================================================
drivers/gpu/drm/sti/sti_hdmi.c:1217:30: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1217 | mutex_lock(&connector->eld_mutex);
| ^~
drivers/gpu/drm/sti/sti_hdmi.c:1219:32: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1219 | mutex_unlock(&connector->eld_mutex);
| ^~
=====================================================
# Builds where the incident occurred:
## multi_v7_defconfig on (arm):
- compiler: gcc-12
- dashboard: https://dashboard.kernelci.org/build/maestro:67ab2fc1b27a1f56cc37dfff
#kernelci issue maestro:5e925d96a3540cf43ab1b679d0e9b4356b623237
Reported-by: kernelci.org bot <bot(a)kernelci.org>
--
This is an experimental report format. Please send feedback in!
Talk to us at kerneci(a)lists.linux.dev
Made with love by the KernelCI team - https://kernelci.org
Hello,
New build issue found on stable-rc/linux-5.10.y:
---
‘struct drm_connector’ has no member named ‘eld_mutex’ in
drivers/gpu/drm/sti/sti_hdmi.o (drivers/gpu/drm/sti/sti_hdmi.c)
[logspec:kbuild,kbuild.compiler.error]
---
- dashboard: https://dashboard.kernelci.org/issue/maestro:fa3672570798747730c19859539289…
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: a12eb63b1d685a20c1abe34c84c383f0b7b829b5
Log excerpt:
=====================================================
drivers/gpu/drm/sti/sti_hdmi.c:1216:30: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1216 | mutex_lock(&connector->eld_mutex);
| ^~
drivers/gpu/drm/sti/sti_hdmi.c:1218:32: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1218 | mutex_unlock(&connector->eld_mutex);
| ^~
CC [M] drivers/gpu/drm/msm/dp/dp_display.o
=====================================================
# Builds where the incident occurred:
## multi_v7_defconfig on (arm):
- compiler: gcc-12
- dashboard: https://dashboard.kernelci.org/build/maestro:67ab302ab27a1f56cc37e05b
#kernelci issue maestro:fa3672570798747730c198595392890f2f99404c
Reported-by: kernelci.org bot <bot(a)kernelci.org>
--
This is an experimental report format. Please send feedback in!
Talk to us at kerneci(a)lists.linux.dev
Made with love by the KernelCI team - https://kernelci.org
Hello,
New build issue found on stable-rc/linux-5.4.y:
---
implicit declaration of function
‘drm_connector_helper_hpd_irq_event’; did you mean
‘drm_helper_hpd_irq_event’? [-Werror=implicit-function-declaration] in
drivers/gpu/drm/rockchip/cdn-dp-core.o
(drivers/gpu/drm/rockchip/cdn-dp-core.c)
[logspec:kbuild,kbuild.compiler.error]
---
- dashboard: https://dashboard.kernelci.org/issue/maestro:15d7ea9fd5f2bedae85bc45a4267a6…
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: 16f808b001a697126972a39c8a2600c33a616ebf
Log excerpt:
=====================================================
drivers/gpu/drm/rockchip/cdn-dp-core.c:981:9: error: implicit
declaration of function ‘drm_connector_helper_hpd_irq_event’; did you
mean ‘drm_helper_hpd_irq_event’?
[-Werror=implicit-function-declaration]
981 | drm_connector_helper_hpd_irq_event(&dp->connector);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| drm_helper_hpd_irq_event
CC [M] drivers/gpu/drm/nouveau/nvkm/engine/dma/gv100.o
CC [M] drivers/gpu/drm/sun4i/sun4i_tv.o
CC [M] drivers/gpu/drm/tegra/gem.o
CC [M] drivers/gpu/drm/nouveau/nvkm/engine/dma/user.o
cc1: some warnings being treated as errors
=====================================================
# Builds where the incident occurred:
## defconfig on (arm64):
- compiler: gcc-12
- dashboard: https://dashboard.kernelci.org/build/maestro:67ab2fcbb27a1f56cc37e008
#kernelci issue maestro:15d7ea9fd5f2bedae85bc45a4267a66024d1b429
Reported-by: kernelci.org bot <bot(a)kernelci.org>
--
This is an experimental report format. Please send feedback in!
Talk to us at kerneci(a)lists.linux.dev
Made with love by the KernelCI team - https://kernelci.org
Hello,
New build issue found on stable-rc/linux-5.15.y:
---
‘struct drm_connector’ has no member named ‘eld_mutex’ in
drivers/gpu/drm/sti/sti_hdmi.o (drivers/gpu/drm/sti/sti_hdmi.c)
[logspec:kbuild,kbuild.compiler.error]
---
- dashboard: https://dashboard.kernelci.org/issue/maestro:c489b0f0574bd38579af0eba0ab35e…
- giturl: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
- commit HEAD: fbe69012f6c01a2b7fea011bfad0655f1d28eea5
Log excerpt:
=====================================================
drivers/gpu/drm/sti/sti_hdmi.c:1222:30: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1222 | mutex_lock(&connector->eld_mutex);
| ^~
drivers/gpu/drm/sti/sti_hdmi.c:1224:32: error: ‘struct drm_connector’
has no member named ‘eld_mutex’
1224 | mutex_unlock(&connector->eld_mutex);
| ^~
=====================================================
# Builds where the incident occurred:
## multi_v7_defconfig on (arm):
- compiler: gcc-12
- dashboard: https://dashboard.kernelci.org/build/maestro:67ab309ab27a1f56cc37e0b7
#kernelci issue maestro:c489b0f0574bd38579af0eba0ab35e7b2e49d000
Reported-by: kernelci.org bot <bot(a)kernelci.org>
--
This is an experimental report format. Please send feedback in!
Talk to us at kerneci(a)lists.linux.dev
Made with love by the KernelCI team - https://kernelci.org
Certain registers in the AFE IO space require the apll1 clock to be
enabled in order to be read, otherwise the machine hangs (registers like
0x280, 0x410 (AFE_GAIN1_CON0) and 0x830 (AFE_CONN0_5)). During AFE
driver probe, when initializing the regmap for the AFE IO space those
registers are read, resulting in a hang during boot.
This has been observed on the Genio 700 EVK, Genio 510 EVK and
MT8188-Geralt-Ciri Chromebook, all of which are based on the MT8188 SoC.
Assign CLK_TOP_APLL1_D4 as the parent for CLK_TOP_A1SYS_HP, which is
enabled during register read and write, to make sure the apll1 is
enabled during register operations and prevent the MT8188 machines from
hanging during boot.
Cc: stable(a)vger.kernel.org
Fixes: 4dbec3a59a71 ("arm64: dts: mediatek: mt8188: Add audio support")
Suggested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno(a)collabora.com>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado(a)collabora.com>
---
Changes in v2:
- Changed patch from explicitly enabling apll1 clock in the driver to
assigning apll1_d4 as the parent for the a1sys_hp clock in the
mt8188.dtsi
- Link to v1: https://lore.kernel.org/r/20241203-mt8188-afe-fix-hang-disabled-apll1-clk-v…
---
arch/arm64/boot/dts/mediatek/mt8188.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/mediatek/mt8188.dtsi b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
index 5d78f51c6183c15018986df2c76e6fdc1f9f43b4..6352c9bd436550dce66435f23653ebcb43ccf0cd 100644
--- a/arch/arm64/boot/dts/mediatek/mt8188.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8188.dtsi
@@ -1392,7 +1392,7 @@ afe: audio-controller@10b10000 {
compatible = "mediatek,mt8188-afe";
reg = <0 0x10b10000 0 0x10000>;
assigned-clocks = <&topckgen CLK_TOP_A1SYS_HP>;
- assigned-clock-parents = <&clk26m>;
+ assigned-clock-parents = <&topckgen CLK_TOP_APLL1_D4>;
clocks = <&clk26m>,
<&apmixedsys CLK_APMIXED_APLL1>,
<&apmixedsys CLK_APMIXED_APLL2>,
---
base-commit: ed58d103e6da15a442ff87567898768dc3a66987
change-id: 20241203-mt8188-afe-fix-hang-disabled-apll1-clk-b3c11782cbaf
Best regards,
--
Nícolas F. R. A. Prado <nfraprado(a)collabora.com>