From nobody Wed Sep 30 13:56:21 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B0CE2DC783 for ; Fri, 7 Aug 2026 09:15:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786094122; cv=none; b=KQrVKG220ymOiPQnnIBCju7wakPFkrY/Ubv2oX+N8GpJ8Ygha2etNNdYZSM2vqMV3HCWNHsEUVDaGbhHQafNR8ejvuPBmuu7AI+dZui2sDXXFvIWh9xHBRPgdbrSfGLCPMPxD1AEjs8GUO/yUcAjBXm/7bch6FGGRQGHbynNT54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786094122; c=relaxed/simple; bh=M1pf+02huWyWg7XJVqpd9nXyaTXfzjeclnrKBHS5JO8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=dhHzPAijIVBKRyKjKAdvDzmya122yhnJLm8pgC1wf0JPl5wAVAJ31VTvmPjLnN2BaEj05DmuKnfrZJSKTv0fsqHZovubyLVV5RFx5/R7oYuypoDnAvHnLpN8z6J0nP7tWSOQfWD7V468FT6wtJLH7pqqb9IZoZ9YATFwaZwL0k8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IJxYfMNU; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IJxYfMNU" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-476a130c138so2711985f8f.0 for ; Fri, 07 Aug 2026 02:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1786094119; x=1786698919; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=e6t3+tBS5sN1Dfvci+p8e/0NE4L3dqjBbVzFjBmD5o0=; b=IJxYfMNU6c6p+SQnqF7Y+hjp15zi0HYXKnLUMSkpIxqE6Q/bXyEXrxfeajDhXsXqGi 3xOwnZ4D/xwLpwRJ/JlCLuiFHPs0hcYAFqItQo4q6Yv3YkCs15mmWJsEyEpLUCqFj1J2 vd+Kl1bpW69O8cjc76PBe12PCzmVE3ZU05k7OhoWQLQsVGq0DdgVFxp1uH9tAVPIH9N+ h9bCUxSVyM3cOrHE+tfU+JFXiBSign2tMrx5qWW7Y+p6wiZUZttOd1fXoND6eo25FQ72 n11ryd+5eJwZbNxq4uKx/12v5HrOPUVh9fhfWlzN+97q48CamgWeu3pWFORO/yFIdMs1 SWGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786094119; x=1786698919; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=e6t3+tBS5sN1Dfvci+p8e/0NE4L3dqjBbVzFjBmD5o0=; b=BiX0Oz0K6KCykg0wv7u7TELdCWUy1QVrf2B2YPldF4NwIkCgJUn6RGjNDdsgJlYU76 cofuPhAQb1GOAeAXOC6xR837tBNleQDNIXd+Kp28nJdfbk3AP4eKPK6gOh6m9BCkup/7 3oNs1BMFZ+mrZndoSQoi9/BGFftGegy2nS/1+j/mkt52Vko6TDCbsSBA6eu4YOAZ8oJL 19h3vrfSGhHHViqvqqnnNVT1xd1RQ/QzRNwUKw34B3oX0foOmZhgDIKvMse2sbfoFyty qTR5SR1n5B3hDevOEqBhskpOx8Bu+hSlXXEqEmWsbt7kKaJ/pzJMinGTq8hn+h2EkY4c IOqA== X-Forwarded-Encrypted: i=1; AHgh+Rr7KAr//0zjY/qKllUnTqPlpcLkV10xWR6Rni7mYW+bkJgCP1yq1h3Fzw8/+KSkzCfMtlc8AwDRV6I7ugY=@vger.kernel.org X-Gm-Message-State: AOJu0YzpIFDU/KMltU/GdrQHNDxC1B+OuRHDlXMlXYgsIKRDOk7mjlQE ThxjVSjI/PdYkOjYYcJ73Jw73BpsqUIvhWu7W7Mkv4WOCUgvOpPcPL4VOIyg795QO3s= X-Gm-Gg: AR+sD12/x6lXbYseWPv/K6br9KYfGHflII4Swe8aWj4xjaf8AEWwxv/bOaCqFNpjjad aGBa+3gP6KgBHXHbJQe0A2U04GjntYI0Cum6HuES2w7Xr5F6eP34nQeRyU6urXg5Gzy49eHuwJ1 waWMSlG4q0fC8152SVG+KMLUGuWYsjlMBaBkxPn4AbF0nZ3uvsTezLDHmeg7WnfuSa5d3HYv9hH TET3fu6Gk0G8+7xfvx7GZdnJ6Z9xQBn7I5hJ8akAwzQaO6o+y2XKAB963PtOu+LYVuo/xVRJFej 7wBU11NJuf9bAVW0k1r3Y/nKw9iYUGqaXGuzuBjQFulKnWLg9otNvxsU22Zz+zdhD5wfEmvlwFh MgHTdZFD/T36nWIfLgvOBmB3geYY2g+jSm+758IbSs6WEBvcnyLW9VvNhf/8CeIKw4VGVq42vE4 9PQ5uHq0G6aoRgMVKcp61038oJtqpiYZC1Wj0n5fodSjUq0hjYvNCr4pVx5BTtClw5 X-Received: by 2002:a05:6000:d0e:b0:47f:9557:8d77 with SMTP id ffacd0b85a97d-47ffd2236f6mr9845559f8f.10.1786094119255; Fri, 07 Aug 2026 02:15:19 -0700 (PDT) Received: from pop-os.local ([37.18.141.193]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021fd392sm3809077f8f.31.2026.08.07.02.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 02:15:18 -0700 (PDT) From: James Clark Date: Fri, 07 Aug 2026 10:14:59 +0100 Subject: [PATCH] perf: arm_pmuv3: Zero initialize hw_id branch stack field Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260807-james-brbe-init-hw-idx-v1-1-009d1843960a@linaro.org> X-B4-Tracking: v=1; b=H4sIABKidWoC/yWM0Q6CMBAEf4Xcs5fUKtX4K8YHWhY5EqvpoZIQ/ p1DHye7MzMpikDpUs1U8BGVZzbY7ypKfZPvYGmNyTsf3NmdeGgeUI4l2pJl5P5rj4nrQ4tUHzv 4EMjkV0En0y98vf1Z33FAGrcaLcsK1wyFaHoAAAA= X-Change-ID: 20260807-james-brbe-init-hw-idx-53dec54fe266 To: Will Deacon , Mark Rutland , "Rob Herring (Arm)" , Anshuman Khandual , Leo Yan , Suzuki Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, James Clark X-Mailer: b4 0.15.2 PERF_SAMPLE_BRANCH_HW_INDEX is supported by BRBE so hw_id is passed to userspace, but it's never set by the BRBE driver. Zero initialize it as it should be according to the docs: * For the architectures whose raw branch records are * already stored in age order, the hw_idx should be 0. It's probably too risky to remove PERF_SAMPLE_BRANCH_HW_INDEX from BRBE now in case anyone is setting it and reading the value, but zero initializing the whole struct also protects against the same issue with new fields that are added in the future. Fixes: 58074a0fce66 ("perf: arm_pmuv3: Add support for the Branch Record Bu= ffer Extension (BRBE)") Signed-off-by: James Clark Reviewed-by: Anshuman Khandual --- Very small fix spotted by Sashiko. It was probably always zero during testing or never looked at. --- drivers/perf/arm_pmuv3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c index 8014ff766cff..b9a8592bf112 100644 --- a/drivers/perf/arm_pmuv3.c +++ b/drivers/perf/arm_pmuv3.c @@ -1361,7 +1361,7 @@ static int branch_records_alloc(struct arm_pmu *armpm= u) struct pmu_hw_events *events_cpu; =20 events_cpu =3D per_cpu_ptr(armpmu->hw_events, cpu); - events_cpu->branch_stack =3D kmalloc(size, GFP_KERNEL); + events_cpu->branch_stack =3D kzalloc(size, GFP_KERNEL); if (!events_cpu->branch_stack) return -ENOMEM; } --- base-commit: f9a2394a23482bfd330911e9c8295b71724feacd change-id: 20260807-james-brbe-init-hw-idx-53dec54fe266 Best regards, -- =20 James Clark