From nobody Sun Feb 8 08:49:36 2026 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) (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 5A1A7303C8B for ; Sat, 13 Dec 2025 11:23:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765625038; cv=none; b=GNpCuKHHb+97jgXJpAfsyiTbCAqXIu4IE8fpMmuPjcFcTXXNtr4SW6qkeIa1l1XQxa66DTbPy05ALtXtHk6NiJU5xo9vVL5uquDaHA+s2lz6fZwtzLntgojy5DuagubJpaX4FVOML5yGLNaWXIK+/6dyFWuLBPgAOmK7KzhsrWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765625038; c=relaxed/simple; bh=YUb6eCJc2It5mGWeIKRhG0AajcF/ry4goXO3kCBbqQI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J4ABMWKNo33eY1FkbyFN5DshiNcNl1MZK9KyBRISsM69YbVTnRdHaHUDsv9kyyyDFaGR7d5erXHpX9drQdBVt9B2G0RZ1FEu0Rg/ZBntPDP/svewPuYuXbwAHaFYXRsHWXbls2Ry6i5zig3CPtf+UBRdioFc3WCL/0S1eXT+eE4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YHR+5p/O; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YHR+5p/O" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-644f90587e5so3444016a12.0 for ; Sat, 13 Dec 2025 03:23:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765625036; x=1766229836; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=vjpSv14GaC6bVnOsXqyBmuVelpdv//4j+xpDz+T18ZA=; b=YHR+5p/Oujzv+X9RPHQXshsfkzpgOcDonVn6X3Q1khY0KSq+grz80OYt47cPfkzvHY B0f2P5TNAdmW22++4gKMpeiZ/0J9gvXWFzkptC8ZCVDb4ziCYIw3xTAWMk91NBCOb60T ec5A7/h0Wb3hBgGyAM425d8zfLw2I3bAMT5Z2S+3crU7dP26LqgV038+WNSioslv/Znv ucgRh3W5DnJb8WF4UkOS2tbsMcvffHq0MtRYQtTIa1p2xdoS8HlUqYpvQWpIUFVxOsQQ oSwtNnAC+TvDeeBE+B9uDuFw1ExuKU/RmtnmZbHr7ZqN9T3xCs7NhmUkmLFYSRppEms0 OFng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765625036; x=1766229836; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vjpSv14GaC6bVnOsXqyBmuVelpdv//4j+xpDz+T18ZA=; b=MAo8lOR9NSsTbNnxptaDwbWVXSrP621RnLvXrxVxer7m7PoUbqPaMc8v0xAYCr4wQg atj4zghTuHQYjXP3dheN5txfQIpEdd4ErqXNonc0jNHOA1ZriraqDr3hqXYkdQLGshJY oEas3ogB6buw8qOe7pXqsxbIfhLYTeK+d2PvpuBYotPwXCPLx/El2rgMiM6vnNpL55jB i01nwaV/v+hh1nsbg8mBcxclfe4OP1Z1ZyYftp7F418gv0FRDGT10Mi0gdCujc97YUuX nR5Ep+2WjI0Pa0Zxi1L3yrVYPkMdrIif+DuaJCGlfdskdAGIehw+8iUizPesmynk7arG /rog== X-Forwarded-Encrypted: i=1; AJvYcCUTzTtoDzipWEiea5qHqp/6eOSwW41ye+e7VWvUUoxpyWmGd/mPIxUHflQ64XusnWZffkquUeAjarvdwW0=@vger.kernel.org X-Gm-Message-State: AOJu0YyzFQan2EuuffangkhSJPhAdSB66FHqPa4PhSl4mSdq5Jot3l9K Rtsr+3ftnTfIRURb5h2WP6kAiahzzOki+/DyWnrXS0a4y/loY5EYRhpj X-Gm-Gg: AY/fxX7UOTcHSnIyaY51py2oxxe90hyXuVCr0WfbZmX3UfjVEOdHSdotj4/6shkzXtb CfYwlrFmerc7BUBYESID+6LZiDYm/cOpzMLb+Ll5p7RUP2PHeafA/m5/1/oflpiugBCqGHu6rYJ wOVJyKaoTbOdulwXnjlg+WIbu4/qWvvw351TxA/EiVLo4w64TEb89j+hWI5FgUwO+8vjL0l72Nj o7YvnNe4scFqxZ6JAspCKx/tnlVgYElsH+PC17x8b2LCn/Q4coHwFms4Mu7wHt8pvTlCMY32kBu CtsHAV05QEsqa0wMFB9wZc5qsQBgcT4aT3WunL+JOT4C5mQJppUnp0tr2nBr02K5kol0ockLqQm 0Rjqoh/6i+LgJH+rtm1xSAxm8ZaW9bLNmw7MZne7gMXvZcAj1r/rELc8pcTNGzDPX7eaT9DbTzZ ZjNilmuVCieF6Y6Q7f2F1KWvB8oQ== X-Google-Smtp-Source: AGHT+IEYxe6Uk2UQSbaAfOrK6Hid6iWaqht7OeoTZHp/E0x3y8PM9pi89/83Voy42lfYQGlSBhaidQ== X-Received: by 2002:a17:907:94c7:b0:b76:f5b8:79e5 with SMTP id a640c23a62f3a-b7d235cfe6emr493959666b.3.1765625035543; Sat, 13 Dec 2025 03:23:55 -0800 (PST) Received: from osama.. ([2a02:908:1b4:dac0:609b:e733:f100:d3dd]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b7cfa56a7f9sm822910466b.51.2025.12.13.03.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Dec 2025 03:23:55 -0800 (PST) From: Osama Abdelkader To: Will Deacon , Mark Rutland , Catalin Marinas , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Osama Abdelkader Subject: [PATCH v2] arm64: hw_breakpoint: warn on invalid breakpoint length Date: Sat, 13 Dec 2025 12:23:35 +0100 Message-ID: <20251213112336.26503-1-osama.abdelkader@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some tools (e.g. perf) incorrectly assume that breakpoints should be sizeof(long), but this is wrong for AArch64 where breakpoints must be 4 bytes. Add a warning when we silently fix up the parameter so tool developers can get notified. This addresses the FIXME comment by adding diagnostic output rather than breaking existing tools by returning -EINVAL. Signed-off-by: Osama Abdelkader --- v2: fix warning messageline splitting --- arch/arm64/kernel/hw_breakpoint.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_break= point.c index ab76b36dce82..cce306145d78 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -475,11 +475,13 @@ static int arch_build_bp_info(struct perf_event *bp, return -EINVAL; } else if (hw->ctrl.len !=3D ARM_BREAKPOINT_LEN_4) { /* - * FIXME: Some tools (I'm looking at you perf) assume - * that breakpoints should be sizeof(long). This - * is nonsense. For now, we fix up the parameter - * but we should probably return -EINVAL instead. + * Some tools (e.g. perf) incorrectly assume that + * breakpoints should be sizeof(long). This is wrong + * for AArch64 where breakpoints must be 4 bytes. + * Warn the user and fix up the parameter. */ + pr_warn_once("hw_breakpoint: invalid AArch64 breakpoint length %d, fixi= ng to 4 bytes\n", + hw->ctrl.len); hw->ctrl.len =3D ARM_BREAKPOINT_LEN_4; } } --=20 2.43.0