From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE08DC61D85 for ; Tue, 21 Nov 2023 16:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xXMynRRokevEwFGCmNzxNWr8p24H+bNTA2M8SbuA4ak=; b=AK6CxMK66LFUaJ aCRYZXZOcSkZAT3QTfe+W0YRXo4guCT7GIm0+cW5KVvAXAvYo366YNYF5rqWYMtJh82wBYpwwZG2O gnHNjWjcAvkEy4vev2+M6uWvYwTn5KPpyiMmZWoERpPPUfaYGIV21yECHeIGu5GZI8kIB1mE/o8kS Qx8AqazTUx0Kb8YeCt/1Ki/dfqtF46SNXvQJjkQUVHxh3RbPhA+q8yTZ45BvDBpxsPPr2dRt3Lyu/ EPj+Hpgzn/bUS6njVtuXy98yoqTikpy37xcsayqzLlnJn/SXVRNM581p+3xaVNe+KIiSmpRB456X/ ODOXNgpwAnggnm9v0mjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r5Tlj-00HItd-2G; Tue, 21 Nov 2023 16:38:35 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r5Tlh-00HIt3-1D for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2023 16:38:34 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id CB25D61189; Tue, 21 Nov 2023 16:38:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1008C433C8; Tue, 21 Nov 2023 16:38:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700584712; bh=I9ZH/e6KtTHN2UHi0fUQgC/I219UZFtlAoAwKkrjbcE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CIuck4j4FS3Th2Qg6/yfyYjczl8E2bvtKdh8PF0v8/T1n7u5A3PTNFdZmXNNkVwY5 3lRB+7j8NjJHp4GSIMKmhmMO6UZs+6JnKEK4YK6avhOQ7k+Th+QxH9whbGIqzgeFHS NFZQwEF5iHtTXdRDw1SYU8iSsfejNVCoDA6LSHiBCBT9CL6uQNU49cmrIc2Q6KwLKn /drPNzhKzZbcBz0MTX9Bh4ek04c6IA887OqF08oLR7WtSdrW4sKrzZK8gm8xMAFGNf BnQVtsjMLGUnys8OpppGt7itl83rfcA5+hzKjZ5dFi3oagDSHiPwbG7UjCSmyy5ZyX OX64f7FCJfZAQ== Date: Tue, 21 Nov 2023 09:38:30 -0700 From: Nathan Chancellor To: Ard Biesheuvel Cc: Maria Yu , linux@armlinux.org.uk, mhiramat@kernel.org, kernel@quicinc.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, quic_lijuang@quicinc.com, stable@vger.kernel.org Subject: Re: [PATCH v3 1/1] ARM: kprobes: Explicitly reserve r7 for local variables Message-ID: <20231121163830.GA3437094@dev-arch.thelio-3990X> References: <20231120032909.19186-1-quic_aiquny@quicinc.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231121_083833_459259_16571750 X-CRM114-Status: GOOD ( 21.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 21, 2023 at 11:11:56AM -0500, Ard Biesheuvel wrote: > On Sun, 19 Nov 2023 at 22:29, Maria Yu wrote: > > > > Registers r7 is removed in clobber list, so compiler may choose r7 for > > local variables usage, while r7 will be actually updated by the inline asm > > code. This caused the runtime behavior wrong. > > While those kind of reserved registers cannot be set to clobber list > > because of error like "inline asm clobber list contains reserved > > registers". > > Explicitly reserve r7 by adding attribute no-omit-frame-pointer for this > > file, then in T32 asm code r7 is used as a frame pointer and is not > > available for use as a general-purpose register. > > Note that "no-omit-frame-pointer" will make the code size a little bigger > > to store the stack frame pointer. > > > > Fixes: dd12e97f3c72 ("ARM: kprobes: treat R7 as the frame pointer register in Thumb2 builds") > > Suggested-by: Ard Biesheuvel > > Signed-off-by: Maria Yu > > Cc: stable@vger.kernel.org > > --- > > arch/arm/probes/kprobes/Makefile | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm/probes/kprobes/Makefile b/arch/arm/probes/kprobes/Makefile > > index 6159010dac4a..b1f21e78950b 100644 > > --- a/arch/arm/probes/kprobes/Makefile > > +++ b/arch/arm/probes/kprobes/Makefile > > @@ -8,6 +8,7 @@ test-kprobes-objs := test-core.o > > > > ifdef CONFIG_THUMB2_KERNEL > > obj-$(CONFIG_KPROBES) += actions-thumb.o checkers-thumb.o > > +CFLAGS_actions-thumb.o += -fno-omit-frame-pointer > > test-kprobes-objs += test-thumb.o > > else > > obj-$(CONFIG_KPROBES) += actions-arm.o checkers-arm.o > > > > If Nathan is happy with this, I think we can drop this into the patch tracker. I have no qualms with this approach, there are no issues with the couple of LLVM versions that I tested. Cheers, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel