Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1679743ybh; Tue, 14 Jul 2020 04:36:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcRFuvbHsnGADfi7Oeh0k59MEz9wOLGq70p+92IivZIEi28B5Ze+jhgJyhw+PmDTmyZil2 X-Received: by 2002:aa7:d297:: with SMTP id w23mr3879693edq.49.1594726599144; Tue, 14 Jul 2020 04:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594726599; cv=none; d=google.com; s=arc-20160816; b=qqhR9kKkOEvkmU9fF+KPiUYEpZBoeqGffaF6FBmAE7GaAbQykLH4YDwZmNAPCW0OJe ZS67tHf9bX9/M3GwuiwdFe35Yno2h13+ZiBZSLFdjKKheHHbax/gdUVaLtil6d1Fz4ih xnfnEcOnfZNlFT5U7SXZSQZawvNneRizpmZYyTWsHthOMH4Xf8/LKjF9AvoGOeqXExhJ H/heozyPlY72nxOeF61/+6LOhX7aROMugqt6iEYRFtYF0gpSEHYaUOk3kFrMctekMz9q M94dhD8vP0LIrt6XgEJhwGgVjNaj82pA4B/TghRuhEJTq0RfajcS5tI52LODAiPVycks gmiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Pb4K+v8rmb/nVPHiHqOYdBcXMBuiSbd+mxHdfJrPCWM=; b=T2iVJRDJEQfbk3a4xCVh394FhCr2GjwU3TBhxNp9asVLfZIOkICwBdHsPN2G4Btg1n Kkn/4Cs73iBdqwyOB98EPaNHVU0S/AeFxYm10mg4sCAUw+vwwOQsGqSID3ickM9Gqq/P 1MAB0tpCTyWL3xyhd8EYoQUc47yzPkmYF+7EGHMv/FFxkX8b801H6kfqpESWoQqna6/4 cla5seyCX9OFkmsC6Tx1B5nfGD8Gtqoyzpa2lPBhul5PfWfIB9lr/qC6Ca+DiALGMt3J D3qAek7pwhhG9tYYTfB0LNuDWJoDKMtqONHc9+XRYZYijYRY60+160xr3kN/bd5E41JM zQ2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zTQBpnFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ni2si10576533ejb.480.2020.07.14.04.36.15; Tue, 14 Jul 2020 04:36:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zTQBpnFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727978AbgGNLdB (ORCPT + 99 others); Tue, 14 Jul 2020 07:33:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:47486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbgGNLdA (ORCPT ); Tue, 14 Jul 2020 07:33:00 -0400 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93E8D22203; Tue, 14 Jul 2020 11:32:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594726379; bh=xtlPS16rUP0cZpPl3xHF2nG2TcZJBkhS95GJ/HsuOQY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zTQBpnFEX2pPCkEykFECtnPpIeKK4NCUdJCau7L5YFva8nbkZp88ivOiqjtv3lwub zmDz4QV045BTzWzonZdhcb2ZBR+Pax1ADo0Rt3/xW8MryhlDSjCyZv6Mrda1wMgRE3 Xod5/7cZYzljtqb6Y4GXyouBwTTpvg4IpJWa+CRY= Date: Tue, 14 Jul 2020 20:32:54 +0900 From: Masami Hiramatsu To: guoren@kernel.org Cc: palmerdabbelt@google.com, paul.walmsley@sifive.com, oleg@redhat.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, anup@brainfault.org, linux-csky@vger.kernel.org, greentime.hu@sifive.com, zong.li@sifive.com, me@packi.ch, bjorn.topel@gmail.com, Guo Ren Subject: Re: [PATCH v3 3/7] riscv: Fixup kprobes handler couldn't change pc Message-Id: <20200714203254.aa34b5c3f50c881e29ecf7a8@kernel.org> In-Reply-To: <1594683562-68149-4-git-send-email-guoren@kernel.org> References: <1594683562-68149-1-git-send-email-guoren@kernel.org> <1594683562-68149-4-git-send-email-guoren@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Jul 2020 23:39:18 +0000 guoren@kernel.org wrote: > From: Guo Ren > > The "Changing Execution Path" section in the Documentation/kprobes.txt > said: > > Since kprobes can probe into a running kernel code, it can change the > register set, including instruction pointer. > Looks Good to me:) Reviewed-by: Masami Hiramatsu Thank you! > Signed-off-by: Guo Ren > Cc: Masami Hiramatsu > Cc: Palmer Dabbelt > --- > arch/riscv/kernel/mcount-dyn.S | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/riscv/kernel/mcount-dyn.S b/arch/riscv/kernel/mcount-dyn.S > index 35a6ed7..4b58b54 100644 > --- a/arch/riscv/kernel/mcount-dyn.S > +++ b/arch/riscv/kernel/mcount-dyn.S > @@ -123,6 +123,7 @@ ENDPROC(ftrace_caller) > sd ra, (PT_SIZE_ON_STACK+8)(sp) > addi s0, sp, (PT_SIZE_ON_STACK+16) > > + sd ra, PT_EPC(sp) > sd x1, PT_RA(sp) > sd x2, PT_SP(sp) > sd x3, PT_GP(sp) > @@ -157,6 +158,7 @@ ENDPROC(ftrace_caller) > .endm > > .macro RESTORE_ALL > + ld ra, PT_EPC(sp) > ld x1, PT_RA(sp) > ld x2, PT_SP(sp) > ld x3, PT_GP(sp) > @@ -190,7 +192,6 @@ ENDPROC(ftrace_caller) > ld x31, PT_T6(sp) > > ld s0, (PT_SIZE_ON_STACK)(sp) > - ld ra, (PT_SIZE_ON_STACK+8)(sp) > addi sp, sp, (PT_SIZE_ON_STACK+16) > .endm > > -- > 2.7.4 > -- Masami Hiramatsu