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 74A54C25B75 for ; Mon, 3 Jun 2024 08:39:46 +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=8tRU+1tSFzsx6uLGe423oeHRF9tJODwk+CA/bx4OTAU=; b=R3+Q8sYSxlyjgQ 3R5IwrKD3osufkbaqyP25RctoofLHIta8GQ4Q3J6GEClDU9zQBXlT0URIOUBXXYZEdJ8EWJFvl0Ku cLbV03JWKT2MxROqPRD3qq5YtzrnA0g+YHjrlzIf1gwDsGLT8uxVRgU4oMQ4ltqsk/wPervASHP2l C43RAv/jWst5bqmWKpmnpAXkECO9g7s32BCVwxM15z7qj9uUoeFj3Moott72BPX2nipoAvBSuuFbP 6k9FUufqQZtLnEsS9G8+o/oUi9qvTbSOT12QmEFlTeynW0PZRB/2213QuBinZT4Inj8pBwN4JRWyq DbMhrxvykn6pYWUtghlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE3EA-0000000G4W5-1slb; Mon, 03 Jun 2024 08:39:38 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE3E8-0000000G4VR-1OXD for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2024 08:39:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0HlUQLpV6dwNNdThUICIrY2+VfVWUdO6SeprKbBBR0Q=; b=aq000GDw6Pb4G6BYu2/HxZdiA4 s7Z5E/poXNwiGzEyRk+uoiEgrqBGdwLgF4AgGnJiOotWJSACT/lW2ZkcdNBiTE9IXgyylwTEMxZHj NDrIG4IjxEaFEuqRKOLUqWJYgfS7fIuhAJCjFPk6kWI7tx0xMkFUT7Ajmxd45o4ZOYwFcT6fY6n2s W7LxLP5P8Znsq7JQ6YPM2E+ilM7aLDq5Xwf9IefKUzecdLIlRReDgeZqsUbIhO8GJRelaFiVRngpR aUFGPXg1gl/Vr1MXZOBr700rVfFjPa3829eZTplBL6jK5gklxjt043+DQQq75zdqjlbhAbSVUz/zV kD/74iLQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:37758) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sE3Dp-0002S0-0l; Mon, 03 Jun 2024 09:39:17 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sE3Do-0000IG-DI; Mon, 03 Jun 2024 09:39:16 +0100 Date: Mon, 3 Jun 2024 09:39:16 +0100 From: "Russell King (Oracle)" To: Jinjie Ruan Cc: oleg@redhat.com, arnd@arndb.de, afd@ti.com, akpm@linux-foundation.org, linus.walleij@linaro.org, eric.devolder@oracle.com, robh@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: Add HAVE_FUNCTION_ARG_ACCESS_API support Message-ID: References: <20240603073751.2282024-1-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240603073751.2282024-1-ruanjinjie@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240603_013936_594181_AF88660E X-CRM114-Status: GOOD ( 12.20 ) 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 Mon, Jun 03, 2024 at 03:37:51PM +0800, Jinjie Ruan wrote: > Currently, kprobe on ARM32 can not use the '$argx' syntax available on > other architecture. So implement regs_get_kernel_argument() and add > HAVE_FUNCTION_ARG_ACCESS_API support. This may work in the simple case, but it just doesn't work in the general case, where a function accepts 64-bit arguments. For example, for EABI and a function taking a 64-bit argument followed by a 32-bit argument: R0/R1 = 64-bit argument R2 = 32-bit argument Now consider 32-bit argument followed by 64-bit argument: R0 = 32-bit argument R1 = unused R2/R3 = 64-bit argument Note that the mapping isn't argN = RN. Also, given that "unsigned long" is 32-bit on 32-bit Arm, one can't return a 64-bit argument through this interface. Even if one typed the function as u64, it still wouldn't work because the caller assigns the return value to an unsigned long. This seems to be an issue throughout the kernel tracing - it isn't written to support 64-bit arguments on 32-bit architectures. See, for example, fetch_store_raw(), where the unsigned long gets cast to a u64. It'll still only have 32-bits of significant value. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel