Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp822659rbd; Fri, 23 Feb 2024 04:53:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxMi+3PDxPUObb44rfBO5svkGn+kgvvFNekewSSFdjUFPp0bzreSLAP1ZQlOP64IC4DdqR3O/2zqEwhfvyQXTVBK7q7qgpzbDS0jO6Vw== X-Google-Smtp-Source: AGHT+IGuBtal5ntZBho6PFOpOMubDFfoF8apT33C+3Yd6JqXf1RjvSl2I0WtgTZNlC1SQ5neEDgH X-Received: by 2002:a17:906:2f14:b0:a3e:9e4d:dafb with SMTP id v20-20020a1709062f1400b00a3e9e4ddafbmr1129564eji.29.1708692795721; Fri, 23 Feb 2024 04:53:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708692795; cv=pass; d=google.com; s=arc-20160816; b=GRFjaiTkSXRLbfStL5BUcNrgKHQvfkCvAesk8QbwMeWdrTjf78gn6mvlBFbmublOmo W1Aq1jgSDanhL258MImZ0Bq5ccdFiq8Dbkuo/nwpPUYQwLrRaVa9TgTA7/BGEg2XNjQ3 VNfLBUnsghGzvEVgnj0NBAN52b79R2Gdrb+tnAE5XHe9TmWn7v5cdBwgaft/5kVqG3Rr exntjS4triLJxAQKolov87UX4I2bVRiZHqbBV6ExFk7nKopwQQ75kQ7eLsKcKi+EjDNb RMa2WsGRqYSk8FedtI2IzPZvGAo3l+GIDqx9dR4y2Lco+eiPkQSYXDkcNHJ74qotaVvQ LfSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=O+BtQMT8d+QQysHEqTkkCwKaqmC3BEqv0MQibZlM+dU=; fh=TWiVl7IqbUPAniRWirKYuDZ5gBgvRZKuOuGf2IahL04=; b=LEC8qFDu0OGpNtsrDYcF/jo+6GCw86+qrKr6ZaiuUKyu5sAAt/KmkTAHbVhn4t1hWG HrDvZpxNtm/BXWfjz61uqjAnQqJEHEwzNt2FzkVP8noLxq+4jhv7hGIJ8KbkTknN6GRZ sfzkSKd17TVXi7V1SjJUHRltBT30pfRuOkDd31ATOOExhZr8nrGduAVjEPtwQ/P6J7pU Af6IMGMiphya+UD+imNJ7guivAZpxenASvQXX5M1+8JF0IHE+BrB0URFl4UrMrbns1nb pODZxEEENGMC2hPOhq/91AJfI7WSarr3iFFJJ/GbreKqqJSkEtt5iH8Zc+cLxG0vlWpr EZFA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hHs2BTlA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ka11-20020a170907990b00b00a3e9e80160bsi4467420ejc.94.2024.02.23.04.53.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 04:53:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hHs2BTlA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78330-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78330-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6F78F1F25837 for ; Fri, 23 Feb 2024 12:52:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 946417CF1D; Fri, 23 Feb 2024 12:52:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hHs2BTlA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C41328C0A for ; Fri, 23 Feb 2024 12:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708692749; cv=none; b=HdVD7ipFvhpaSJEULc4NAONS+inYqhIOUqBOM5M+dywyMNzk27xcSLry1QjiZVPrRspax7+J1DaeOfrV6aS8GFS+gEAj7AbwqAtBrWQ0tNKJuIBo7uwh0AK1vn9tZ85c6C9RJfxeDQK8eTrCd0pBcLyt/Qzybsp6xFvAuZXTyCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708692749; c=relaxed/simple; bh=IyCj5keIAQfJYXAfP7hpyBP6OruhWQ1GZ9RjUxfZQm8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FG4Cgx6Kqcu+aepX8ZnQSOw+axPoAL5or+D0y6YJPtz7mP9HLYDhM7uX9uN53ObMaTWUbjBlbF/OdZHc3dbymfrMo0FyscsNPwObifyMP2HnDbcuLvyjebZmWJsl2OYdJFe60tQw3d0LwDS8jJgRGHxsrcS7PvnuvpnML0DrXhY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hHs2BTlA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20503C433F1; Fri, 23 Feb 2024 12:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708692749; bh=IyCj5keIAQfJYXAfP7hpyBP6OruhWQ1GZ9RjUxfZQm8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hHs2BTlAsibvTiPS5uMtGnbO95Z5CrS7S3+VfQE1MQ8ydoVDU/7TBA3sUrx8unWeS NlX6nPjBNeKzA3euVww5/83iSoXhurkXXlwPTVfMi8k+aHHcy/IxMkapQy924+3C4V l6tww2r6xsNFuJgm0/YJuYrO0A3LKH4hmiX6Jx56QpRoei7ASSTgjWPNRBRLsdivXv tO67neua4MvUrYTfJf2s3LCxJrvd8n9trzJ/GaCmK/nDPP+mpOSsJUajcf+uffxZt0 67YTFv9gvchP8jjUL+bp/QVlL8LBFFv/K0TzzsNo4hwAhPlH9qmcZ/ky2EMWm31rxe Ao7vrxxRrX4/w== Date: Fri, 23 Feb 2024 12:52:24 +0000 From: Will Deacon To: Anshuman Khandual Cc: linux-arm-kernel@lists.infradead.org, broonie@kernel.org, Mark Rutland , Catalin Marinas , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/hw_breakpoint: Determine lengths from generic perf breakpoint macros Message-ID: <20240223125224.GC10641@willie-the-truck> References: <20240223113102.4027779-1-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240223113102.4027779-1-anshuman.khandual@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Fri, Feb 23, 2024 at 05:01:02PM +0530, Anshuman Khandual wrote: > 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; I don't think we should do this. The HW_BREAKPOINT_LEN_* definitions are part of the user ABI and, although they correspond to the length in bytes, that's not necessarily something we should rely on. Will