Received: by 2002:ab2:78c:0:b0:1ec:b906:25e5 with SMTP id h12csp253309lqe; Fri, 23 Feb 2024 03:31:31 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWiAqfkhMyKpER+BHT1k7+Y8Cgw0T6pB8ZUcxalIZreDleeFBzfv4SsGCP8sOBl62hLqIY4xZLeOPnH2mwpQkjZPjYVWCJjDRuViV+aOg== X-Google-Smtp-Source: AGHT+IER/FPr11bbb9TNUKpxL36n+COm1AQsSKClC4v0u1cWQ/tNxWqdU3CNmWLwXApuGBvAWuLM X-Received: by 2002:a05:620a:3b81:b0:787:28b1:f25e with SMTP id ye1-20020a05620a3b8100b0078728b1f25emr1907639qkn.31.1708687891110; Fri, 23 Feb 2024 03:31:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708687891; cv=pass; d=google.com; s=arc-20160816; b=svgfMd1XjH/yHCLnng/XHplKGUK6+vA3NR5BgEnL0oc2dhsLMB0CCd/s4nbyN4JqBv GZL0Z3bqrFOnC6b8P/nLSvfTJBnCNcx4pDwSVLQOkwkC6qblXoAN/kNjxHK7cYVWJ8aY 2CSSFLmE79F+6KNNEolbcHVStgXPhcKmVVGXjwDPnNkpIUDupsOmIE6vzzm3ZONfVpV/ bmJ/a3HbM3otuEyLTbxErTF5IQ/f+GchjD5TuSb/fDxLQJ1S1SI2SR64uRzykl2LtEYK Mh35fcmOX1hK4kG+AFIW/SAGvLLg4mN3d2+YGvRVYSQgN67eZ0SdmOS+80phYW6CbjPW ZtpQ== 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:message-id:date:subject:cc:to :from; bh=aG0Q3tmaMFT7fXkXeN/yYv7bS6ZLDfO7VWog9ZNRtB4=; fh=MXolhX1m9kctuPXyDYxFwIPst9rjHcYkNAPnI2NP2KE=; b=OEcddtpaCwBzDatDkWm+UkYd8aEHRs3cHbPYiRlc27VlrO2kRKIG8UWIaoXirf7tDP VSQUgltgkZlwYgzYZy8oG2j4LAlIial3uwPuPe4xcal4yM99ddZ6oFDIKexU0k6/u0xH NCLr0siLHzXBbDWfapcNwG64DBBuNTa5GMSN7/gsQ3+4VdQyiKvbiuV7Dyaj2i4v0GDn UZ4NS8NNPX+KlAzn8m52cMPatapteZIzG8hhMUoAA8qKUqO1gESaCj6PnAL2T9y3DBID zpIBHdmmsyI5gSAKu6SEbfMDTFLf2cY7iNWG2X5KIQJJzRvnRZcxp0IsJ8AD+YuiAzvC 6eYQ==; 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-78221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78221-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. [147.75.199.223]) by mx.google.com with ESMTPS id c10-20020ae9e20a000000b007873fd9eedcsi14080623qkc.584.2024.02.23.03.31.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:31:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-78221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78221-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 BAB931C2137D for ; Fri, 23 Feb 2024 11:31:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8919478B5F; Fri, 23 Feb 2024 11:31:18 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B91F478667 for ; Fri, 23 Feb 2024 11:31:15 +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=1708687878; cv=none; b=n1tb2lpfGlLTJkmBV66f7OlVDjXBOwtWJHTacJ1KRFraF7baWN2c3TiKo7lUH4IrNS2dsN9E6b40xdzx6nVhy+mIFvGMZSgy9q/OizWQ87ZJ+cn0wR9r+6Yme4CubdNI30KYSwErZ8uyC0Dl2ezvVEk7gkENQfUdVIieptGWm6M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708687878; c=relaxed/simple; bh=mKlrDlToVS/Maui1mRuEIRqDVpR4qfopYdpXi7rgAME=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=VokkERuW7mhLNEpc3KBMWEriaYarDrf+B91GOCPAjWwh1EdyAxt4VS5Te3YuuuIbqBvQBXq0W0GSeBtMKO45gGoUWhZddYTIxYlId3BDJfzTtyUVyNgER0pQc7zFZ6uNXHCz1+cxYrD5bBfCYNqdXsRhDAv+Le4f3mKqeA9fWiw= 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 83A6811FB; Fri, 23 Feb 2024 03:31:53 -0800 (PST) Received: from a077893.arm.com (unknown [10.163.47.143]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 324713F762; Fri, 23 Feb 2024 03:31:11 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org Cc: broonie@kernel.org, Anshuman Khandual , Will Deacon , Mark Rutland , Catalin Marinas , linux-kernel@vger.kernel.org Subject: [PATCH] arm64/hw_breakpoint: Determine lengths from generic perf breakpoint macros Date: Fri, 23 Feb 2024 17:01:02 +0530 Message-Id: <20240223113102.4027779-1-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 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