From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 8C3F038AC86 for ; Tue, 7 Apr 2026 10:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557794; cv=none; b=Oir0XLxvhLJ84iafnBcoEY4JfV07V6TrhwvjkWw0OGjBM5idYNT47Syk/dnfhOItzUTbaffGSxG4jxnkLrrXzpFEYIacASEUdho/VOBsPNF5tqVX6SvxEkDxPGqI+8egu/7xsEWx3gyihBg4RhH8Sw7y1BRBauy5BAP32C0/Chw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775557794; c=relaxed/simple; bh=POrzWoxjFqaHIcxRk2MuYykP427nLHqvQLcVZDvwfOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZuA20zOPfI72CmHQRttdT6a72Qn/QgWB4DzrgumHbUjLhaxkQWaXTwo33ooIYqlM5eMnakWDR4QtZFsMU32iG2NY1rEJ9Y5ZJ4IL3gp63JuJJMkhh6kR6f334iSC31oNfYYev2WFPcosHpLXmhBVePOnqV02k4eTFel2DwFAk/o= 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=LX9RL2Ip; arc=none smtp.client-ip=209.85.167.52 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="LX9RL2Ip" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5a2b636b944so5072706e87.1 for ; Tue, 07 Apr 2026 03:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775557792; x=1776162592; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=3KUFRYM7uo6PHZh70JDXGJABWfyo8JyfSs37/SAoz8M=; b=LX9RL2Ip3QejsFQ+E1CjOYM1ubzl/psOYEbgObAEjd0/3UyD9tstUTfQrMWMO6F1/7 Fx9XtkNmb1d64Smkv1SY9sePOuK4ASHb87CSdDSEmIOE+GrpNtH5Ym8egKSpnjvU3qTj UphZhhaADXghoc+qOZq2De88qEDWa7sK3fgG0j37NjJsyEkNSTJGp+xJC2+HHqXqtvWV JlUxuM0QrbxXxIe2VvTlzjEJZd9lLXHrgsp1oHSyH3oShpi+I4h0cw0J4ABdMBXQO3ad O6bqVpchyrxHeA4n5rNrZqBR79OGDjUhAEGMpoPB6O1m6usehDwpnh2fD3haL8n2pE7/ fs/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775557792; x=1776162592; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3KUFRYM7uo6PHZh70JDXGJABWfyo8JyfSs37/SAoz8M=; b=ZtEZ86Uv3Pcn+f33kGUHW6NxOMkANPKr3KlNaO/qmcKGn/xF3pLZBT95cRVLOolFQm 2XMpobEtVKC/ZeLB3DwiZtTWbS0lTIZ3Nql+9S+TCCGIKkqs+O3si6anqp0khSK2+OGz 47WmyvrZs4qCJFfNK7CylcD1IoBAdfntvuhfQoTfzNkXc5ndnvXvY6R8WezIQ552Hv7l BKic52+dnl1aJtDBf9FxMRPuwrXrq85Jdnmk3dsJcvITTbTOakc2ogNnc91S4C820/4E HPuBigDxvAHdXK/S1gJyQBV2fZCNPVTt+EPSwZYoF5G31Ca6lrhwEDriz9a210AFiXJ0 yyRg== X-Forwarded-Encrypted: i=1; AJvYcCWy0fd25tiSTNSNTYl54/U9CJj2UtLrifKTDCN4IHkPUfU9WRvlsvRKzDQakeqkM2HVdeexT0LxogYZZbw=@vger.kernel.org X-Gm-Message-State: AOJu0Yyh1KGSpinARDSa1Bss9jQX2RfNRVcy5saVGgAtJvkmg6fGABV+ egIcjR1hCOYutp5T2f7VXl2J8eOyKkznT/JSior79tPEaNr1J4DUZbNMwf6kcSef X-Gm-Gg: AeBDievToAs71fwkrHzyEUlHpEvGG0ZumTc1Uaacwki0niQGJnV0sDH20hO/oka9B68 jsQr9ndDwnEf/rf/ewhb3zDaxNjB9F72vz0pJe2QdClYJrlcyQ+Fzn+kVy2Ed6CoN0lllAXBwpq S0f3iPhp0DNKFXxODO6t+2d28TrZ3taqNHkHkLw3gy5sGCp9cQrCR1GgMt5cbVFkbEl8eFpZOcw 7Exn/LWbrPUO3Ndiy1w3Zn2GqEFeKUSe0BgfBZPGEGbtlG8jFvgQD7BEhL516QrOwnQ+AJizno5 PbSAYCXGZnYa7oFgI4On+Fvc1bvuUkxRjektfZU251NKujLw3qlvDHSRoktD+t8ZfV+tNbnWXm+ GMA/nyqocM7qUuvhTw9Alx6ms8y6gz+RqvXn19eBxrA9c3f796FEQRFSrXCRMYOYCTwGl37C1nj 6J9sy9SL4Tyu8aFQqff0DaZCg/3KqIdWnt6L/W0rs= X-Received: by 2002:a05:6512:39d3:b0:5a2:a525:511e with SMTP id 2adb3069b0e04-5a33754ed82mr5198883e87.3.1775557791400; Tue, 07 Apr 2026 03:29:51 -0700 (PDT) Received: from imamay-pc ([46.73.133.192]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a2c6ccc3adsm4012574e87.55.2026.04.07.03.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2026 03:29:50 -0700 (PDT) Date: Tue, 7 Apr 2026 13:29:49 +0300 From: Ilya Mamay To: Himanshu Chauhan Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, shuah@kernel.org Subject: Re: [PATCH v3 1/2] riscv: Introduce support for hardware break/watchpoints Message-ID: <20260407102949.yjsihtpgkau6fndl@imamay-pc> References: <20260223044918.1359983-1-himanshu.chauhan@oss.qualcomm.com> <20260223044918.1359983-2-himanshu.chauhan@oss.qualcomm.com> <20260318120019.z656r53gkv6kulq6@imamay-pc> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Hi, Himanshu Thanks for your reply. However, could you please explain the actual purpose of this ecall_lock? I still don't understand why it is needed. On Mon, Apr 06, 2026 at 10:21:06AM +0530, Himanshu Chauhan wrote: > Hi, > > On Wed, Mar 18, 2026 at 5:30 PM Ilya Mamay wrote: > > > > Hi, > > > > Thank you for this patch - it;s a valuable addition to the RISC-V HBP support. > > I have one question regarding the locking: > > > > On Mon, Feb 23, 2026 at 10:19:17AM +0530, Himanshu Chauhan wrote: > > > +int arch_install_hw_breakpoint(struct perf_event *event) > > > +{ > > > + struct arch_hw_breakpoint *bp = counter_arch_bp(event); > > > + union sbi_dbtr_shmem_entry *shmem = this_cpu_ptr(sbi_dbtr_shmem); > > > + struct sbi_dbtr_data_msg *xmit; > > > + struct sbi_dbtr_id_msg *recv; > > > + struct perf_event **slot; > > > + unsigned long idx; > > > + struct sbiret ret; > > > + int err = 0; > > > + > > > + raw_spin_lock_irqsave(this_cpu_ptr(&ecall_lock), > > > + *this_cpu_ptr(&ecall_lock_flags)); > > > > Could you clarify the purpose of the ecall_lock in arch_install_hw_breakpoint and > > arch_update_hw_breakpoint? Why is it used only in two functions mentioned above, > > but not in other PMU callbacks like arch_uninstall_hw_breakpoint? > > > I probably missed it in arch_uninstall_hw_breakpoint. I will take care of it. > > Thanks & Regards > Himanshu > > > Regards > > Ilya > > > > > _______________________________________________ > > > linux-riscv mailing list > > > linux-riscv@lists.infradead.org > > > http://lists.infradead.org/mailman/listinfo/linux-riscv