Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1098143rbb; Sun, 25 Feb 2024 20:23:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVa7V4J6kTGVwrAj1ySTeNDYeTNbhN59sBkvpdiuPOJORdpL3+9OrmUeKlyJfeRAefE0R2btnXd8/286nA1lVB98PveRsURSHa7tXzmlw== X-Google-Smtp-Source: AGHT+IHLiRM1qYWZ8X8DKOacHmYN0NYKyMVEpkb1NlGKFtDnvcljZZtyY4PAW57JcJhlGqFF0jG9 X-Received: by 2002:a05:622a:347:b0:42e:32d5:dd17 with SMTP id r7-20020a05622a034700b0042e32d5dd17mr8168258qtw.24.1708921387631; Sun, 25 Feb 2024 20:23:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708921387; cv=pass; d=google.com; s=arc-20160816; b=kCUUH8PbRC9rUb7YzGOl4ztUWexlYl+OmgRw9PR+AdxzM9U18/xTQH2fkgPX43d42x amvCQQjNtywWEYfrg/LHMz4Fn+8ijOGfYbq8Q4Ppb6BaKlIhijds+ynYLn7ix2rPf5xs O17mTBHoZcKvkmgqyYV5XBQmk20onFRhFxSjc5MpqNDuZL4XRXVtEFgSPoUWLsUumJ7h Isxhx8AEJdAGY/t1/kWt4Zk5Fk6E6pMfLRhaM6gvKrHgVIujJDx4UFRwv4DLLMSBI6Kh pcXA1blY+xeq+TTg/ODBHocqmGWP8Tletzh8p3kButizuVFep0Vwq6fv45evyDBhtqGm e8tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=aG0Q3tmaMFT7fXkXeN/yYv7bS6ZLDfO7VWog9ZNRtB4=; fh=R4avfcWb13+AC5h/zMhc/LmRwldjY/jMHOPtBynH8kA=; b=nIPBwG51BkO59U40UA7OtEL1aaJoCH4xNAYRnQb4XUnIo7RpGH2Fn0GUbXUdqjTva2 o6SIhCXeV/6wCp/2N4u9VnaMTBp7KksPvTuMPwLdUNebdVefDjwC751z0Htz9Wy1Xi/a AqgekBKSw32gupP38JsKMOJ9xo3NHa0K8O9ZVwBj0/iTMsBesQHRIRt7wrZn7/I25+mU gjloi88GhtKqMRLCOqFgtzPFRzA7QrsOSyCLxvv62W2fEK2wLttVhG3105AqydqsOTsX a91yxS3C+WCK0ReQhfoMTI4IvkZPxPcAaGnZC56m1HAP/W8S/UVVPsNJpeW7Lqkdh+Hx 1QbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-80544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 19-20020ac85653000000b0042e2b466390si4245199qtt.215.2024.02.25.20.23.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 20:23:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-80544-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80544-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 149581C213E0 for ; Mon, 26 Feb 2024 04:23:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0E0021B96E; Mon, 26 Feb 2024 04:23:01 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A2231B94C for ; Mon, 26 Feb 2024 04:22:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708921380; cv=none; b=lH51xK0zb/QjMk7YIE2lNbpoS3kJu4pqoSNR8kjxI3PyQpcv6iBJkJ52IM3PA7Zr01CjHEvTVJSKagUp9SshroT1cqElafBsXA9nGJTRZB1CTU7BPkR4uEvo6MwWVnmf7otzlFTHG3LwHN96CtVcKoLQNhM3RxL7cjMKygGEjT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708921380; c=relaxed/simple; bh=mKlrDlToVS/Maui1mRuEIRqDVpR4qfopYdpXi7rgAME=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=srJ9pD7L85045Af4PYU2u+mrW5xPh2BMJhH8wjuZnjYEbICHsVVbHb5Tdt5Y9CGx0y/gukwOQAdayWVpfPKPezNJv3YKKvAbhzC5ZNgeODpb2fjdMh8P3Bzz2FKMs+n7GQkdRlIjkHH17Voji4r6QMVwgytCYePyTDYmbiDTX6g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7744AC15; Sun, 25 Feb 2024 20:23:36 -0800 (PST) Received: from a077893.blr.arm.com (a077893.blr.arm.com [10.162.40.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E83233F6C4; Sun, 25 Feb 2024 20:22:54 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: broonie@kernel.org, mark.rutland@arm.com, Anshuman Khandual , Will Deacon , Catalin Marinas , linux-kernel@vger.kernel.org Subject: [PATCH] arm64/hw_breakpoint: Determine lengths from generic perf breakpoint macros Date: Mon, 26 Feb 2024 09:52:49 +0530 Message-Id: <20240226042249.4098185-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240125094119.2542332-2-anshuman.khandual@arm.com> References: <20240125094119.2542332-2-anshuman.khandual@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Both platform i.e ARM_BREAKPOINT_LEN_X and generic i.e HW_BREAKPOINT_LEN_X macros are used interchangeably to convert event->attr.bp_len and platform breakpoint control arch_hw_breakpoint_ctrl->len. Let's be consistent while deriving one from the other. This does not cause any functional changes. Cc: Will Deacon Cc: Mark Rutland Cc: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual --- This applies on v6.8-rc5 arch/arm64/kernel/hw_breakpoint.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index 35225632d70a..1ab9fc865ddd 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c @@ -301,28 +301,28 @@ static int get_hbp_len(u8 hbp_len) switch (hbp_len) { case ARM_BREAKPOINT_LEN_1: - len_in_bytes = 1; + len_in_bytes = HW_BREAKPOINT_LEN_1; break; case ARM_BREAKPOINT_LEN_2: - len_in_bytes = 2; + len_in_bytes = HW_BREAKPOINT_LEN_2; break; case ARM_BREAKPOINT_LEN_3: - len_in_bytes = 3; + len_in_bytes = HW_BREAKPOINT_LEN_3; break; case ARM_BREAKPOINT_LEN_4: - len_in_bytes = 4; + len_in_bytes = HW_BREAKPOINT_LEN_4; break; case ARM_BREAKPOINT_LEN_5: - len_in_bytes = 5; + len_in_bytes = HW_BREAKPOINT_LEN_5; break; case ARM_BREAKPOINT_LEN_6: - len_in_bytes = 6; + len_in_bytes = HW_BREAKPOINT_LEN_6; break; case ARM_BREAKPOINT_LEN_7: - len_in_bytes = 7; + len_in_bytes = HW_BREAKPOINT_LEN_7; break; case ARM_BREAKPOINT_LEN_8: - len_in_bytes = 8; + len_in_bytes = HW_BREAKPOINT_LEN_8; break; } -- 2.25.1