Message ID | 20240222125059.13331-1-hchauhan@ventanamicro.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-76543-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp227663dyb; Thu, 22 Feb 2024 04:51:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVLZmF4A0psFjAkiZmASsauSiv9P8MxFjiZLFMWboYY+OAm+fiVuXAfl3NoM4TlJb4Intg5qmBtixfhCjn0kh6rq8Y5Cg== X-Google-Smtp-Source: AGHT+IGw3HdtG3XuKfgz3WY3MVgmMgs/y/DODePAaVkDLNMwZfv6tkyLL/ziOD2MdK0CKr2QXXzu X-Received: by 2002:a05:620a:956:b0:785:c078:9fd3 with SMTP id w22-20020a05620a095600b00785c0789fd3mr21316777qkw.2.1708606305133; Thu, 22 Feb 2024 04:51:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708606305; cv=pass; d=google.com; s=arc-20160816; b=ufx8k+TISp9iNVsNEb+++28Og2nNFIJu6mYHCRKy7VRRvK4H5F+GITKqhJ//VG/uqX pRtfhPaXlf7xY41vPBR9GuWLuczHNbHsWXlhsRLi46lMaT6o1ltDXTaPWirhj2Rhdr6u pr5ePNxr+KdG2yUHARvxOkTQkXFjlRz/39mf/yZl4DVx1QE6rRcNmUEzi2DsPlV/ady2 LUeSKjcpnX0Vy0021lgFEIZofRhqB18/Xp/jEnw/rCUtGPR6o5VgL1MaW53eh2t53bmo d+M4VcN5mLm8TKTGLL+q2ORFFdd9Z9HputdNbe0vbkMStp9HFRTwhaALUifrDO7dqPcY 8YHQ== 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:dkim-signature; bh=2dGL6re92CbNNHJMPdFIuyeYfruvRTt7XkXoiR2obBU=; fh=1VW8e6HHLXKBqzwgn27vIwMarOdyvfAr+ptdufRuRko=; b=yjlcK1aW8ZqBuM/RbzwhFoPGiNENaJg1/4zk0DTOiqmc6TQ20gcarX4QYj7DDPWR9l YFo07K1FdRalW4vOlR0YPSoiKFSQHqV6fWepg9pPvA3eCu3dsRd0njLGqmIFbB0wSsPt ZuozXYt2J6sNmYxYgPMCQm8bNDJMCeRgl+QpBco3NkJK1JTopKSDL1nu3k+0wcIvbbTK eRgAcfblHxVt6od6r7gU+TixFe0L0Gj7kUWfji2e6ELIKaMnZFkZ3DXBEHW4sLFadrLN lbSIROITuyGiMZGzy9K72RM9gjN5jyDXZz1RGSTBsXZP8dSrY6DJa0Dz1NEyOKbyQv2N h0nQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=lWgIFwc+; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-76543-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76543-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vr27-20020a05620a55bb00b00787a6ab41ccsi411913qkn.737.2024.02.22.04.51.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 04:51:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76543-ouuuleilei=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; dkim=pass header.i=@ventanamicro.com header.s=google header.b=lWgIFwc+; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-76543-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76543-ouuuleilei=gmail.com@vger.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E7A021C24A9B for <ouuuleilei@gmail.com>; Thu, 22 Feb 2024 12:51:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5BD3B1332AC; Thu, 22 Feb 2024 12:51:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="lWgIFwc+" Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 407EB12E1C6 for <linux-kernel@vger.kernel.org>; Thu, 22 Feb 2024 12:51:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606265; cv=none; b=dJ7/cjesxzsRTtonUd7WL7rhJi5BS6eRlivBLmgihm9nQuSLcklXkMqL47g6Aa6EsSEYAzhy5My0kizrRpxlXg2DV5ejH8AZ019Xbl6FhDIGk1yXOetnRS0WmPQR8cmPqzNalCY+b3Tc7KSnAEUrRgj29JVIhVzJKq35ASCpj0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606265; c=relaxed/simple; bh=Iaix6aPDV3Ekm1vsTQVRiK0bk18pj7k/AkSkAqYAbuU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=GEbQytydFdnYkDo4pcV4J1Nbwuqw0zqasMvNADNyUwn9EarO8xdYNuMf+jbpDIPYlCwBUSCmlF57PiwLZvPOLGp2i7LBzQPkvHVZ6T7icGhZ1tR+iBJ3rW8amSvqVLHfsMdbnDMTWsTmlUcU747WKgKY8QIxE3kc8XrvNDXWGDg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=lWgIFwc+; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-58962bf3f89so2325956a12.0 for <linux-kernel@vger.kernel.org>; Thu, 22 Feb 2024 04:51:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1708606263; x=1709211063; 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=2dGL6re92CbNNHJMPdFIuyeYfruvRTt7XkXoiR2obBU=; b=lWgIFwc+aSwTuAQH0E9wyoQSSDn2Ko33MrV2lUREyx+QLfLFQyY2Y0oZtWw5k6LvDk iiHa/TvyOOuURNpeB82GOvVV/6V67rPCQEOIJltpNt0NZlblW2PlgnKTO5lxm8/etG8c 9udVPtbjXoRghUuf0WrM5dDmJRZ0tuEy8upmmsaXU9BhGIlan2H9fkNIewGnZlGXVwVQ JgEV3UsZDnff2ZOR44QW5omAWS9clShbocmDH3oHQOk6jTg++nEbzaSkzZdksFAq+knA ySBm80xX/d+PfZfcuxVtYqFHSTOESpUHEqJP3m5ZmUKjlapCTeUewKY3YDoPIE9M6UO8 sTtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708606263; x=1709211063; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2dGL6re92CbNNHJMPdFIuyeYfruvRTt7XkXoiR2obBU=; b=HxlA6TERBtkJhioXydlEyTQgGzdB0rdHFi7xsrKcbgclPNuY84rXD4L7hGAYs60be+ 5QjtiedCPlzT/vOIoLyR+gM+QHyLH66t9McQtcnCm7ZlQw/4QkrxS3SH3L4CnOOx5D4b xT0Oo2HQxiIZg1rVz4JkSf2OKlhVDc7dun3KLKsGSsc8l6F/J7+Wg6VKRU4nfj4OeAPA 8q6zkhZ5g8faAgy4Xo8SmwCoy1k3Pi62R4iodyKlplLeNuTGsrVNDs2vxI9h9ygZ4xQ5 Lmv5i5hI3yTI5A4SyQDe7/qvxyRcBI2vaxE/C8Z5oWCtLiAOcNkU4GrR1jvYADLyX2rR Qmzw== X-Forwarded-Encrypted: i=1; AJvYcCXa6dyw2CM6tOXxTObVd/JrjXOI4MTGO05sOPja/S2gPhny71vEQ6b9dgQHt++EJjjSYuZAlAzcaqsQceazDGA9MUxySr68uDi5K5eB X-Gm-Message-State: AOJu0YxoSAz88n200JyyTkBaaihdCoVLemPudNOmvuDl8Bh7lkT7MK5N lyfo7++d0mwFW5qxPI6gancmJyOkFJblMy5Hzhc68kizgvVIpa2+btOvE8M8j8s= X-Received: by 2002:a17:903:50b:b0:1db:4b1b:d726 with SMTP id jn11-20020a170903050b00b001db4b1bd726mr19709333plb.1.1708606263443; Thu, 22 Feb 2024 04:51:03 -0800 (PST) Received: from aryabhatta.. ([49.37.248.155]) by smtp.gmail.com with ESMTPSA id k5-20020a170902e90500b001db7599aba0sm9898438pld.24.2024.02.22.04.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 04:51:03 -0800 (PST) From: Himanshu Chauhan <hchauhan@ventanamicro.com> To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu Subject: [RFC PATCH 0/2] Introduce support for hardware break/watchpoints Date: Thu, 22 Feb 2024 18:20:57 +0530 Message-Id: <20240222125059.13331-1-hchauhan@ventanamicro.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791603564960957066 X-GMAIL-MSGID: 1791603564960957066 |
Series |
Introduce support for hardware break/watchpoints
|
|
Message
Himanshu Chauhan
Feb. 22, 2024, 12:50 p.m. UTC
This patchset adds support of hardware breakpoints and watchpoints in RISC-V architecture. The framework is built on top of perf subsystem and SBI debug trigger extension. Currently following features are not supported and are in works: - Ptrace support - Single stepping - Virtualization of debug triggers The SBI debug trigger extension proposal (Draft v6) can be found at: https://lists.riscv.org/g/sig-hypervisors/message/361 The Sdtrig ISA is part of RISC-V debug specification which can be found at: https://github.com/riscv/riscv-debug-spec Himanshu Chauhan (2): riscv: Add SBI debug trigger extension and function ids riscv: Introduce support for hardware break/watchpoints arch/riscv/Kconfig | 1 + arch/riscv/include/asm/hw_breakpoint.h | 327 ++++++++++++ arch/riscv/include/asm/kdebug.h | 3 +- arch/riscv/include/asm/sbi.h | 31 ++ arch/riscv/kernel/Makefile | 1 + arch/riscv/kernel/hw_breakpoint.c | 659 +++++++++++++++++++++++++ arch/riscv/kernel/traps.c | 6 + 7 files changed, 1027 insertions(+), 1 deletion(-) create mode 100644 arch/riscv/include/asm/hw_breakpoint.h create mode 100644 arch/riscv/kernel/hw_breakpoint.c