From patchwork Fri Aug 12 20:24:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Long X-Patchwork-Id: 9277895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2FB7600CB for ; Fri, 12 Aug 2016 20:26:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A387428AE8 for ; Fri, 12 Aug 2016 20:26:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91ACF28AEB; Fri, 12 Aug 2016 20:26:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2698B28AE8 for ; Fri, 12 Aug 2016 20:26:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bYJ0z-0001so-8W; Fri, 12 Aug 2016 20:25:13 +0000 Received: from mail-qk0-x231.google.com ([2607:f8b0:400d:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bYJ0v-0000iE-4I for linux-arm-kernel@lists.infradead.org; Fri, 12 Aug 2016 20:25:10 +0000 Received: by mail-qk0-x231.google.com with SMTP id t7so36106672qkh.0 for ; Fri, 12 Aug 2016 13:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=M1sdGJpcMd18jG//schdh1G5TU029PMFzhF5lE9Awl4=; b=CrOkj4rYREKDnOcfBib7BCpZPCGIn2zP+2mFbLEEQ7FRGFNu5SrEfU7SegUI78WvZ/ 2Wa4LY4WFXnBeUzj6vvgGgWY1CbfEVCFmqzFVhyd4WjMIsCTjby0iwEYTf/wRImBMVeW uuDe0zZr8YEZwgoIFeGu2IgYjyhTkYHhQld90= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=M1sdGJpcMd18jG//schdh1G5TU029PMFzhF5lE9Awl4=; b=UukhzR7ibf/GIbH78Sl6Yb5MNMmytnvZg+u7rm8f1DxGcSkA+nckruoeriY1PCEPFu 90xcKG4PgrIihzgdT8/5q4+yQuY9unuc69+HNzXaucZa3/qJO+L1SccGVWk2IQRWTCt2 cBVKpM/BB7sPUeK6gsMfUnRAgV4ogfuajLVPQ8K95KuQyGJaoMNOX9Q4Hcxvba+tTdT7 5TyGaQShho4b++uRbRWyxulk23VFORu30vCI0SrJPtVtO/uWJKEsUns9tHbFrZ39r2nC qKPb2gcdx+Vw2t8vD60UiwfS7CTFWcGaUIDBVlU93dmjmqJ3rNuygZCGcTKQpStvr6uL Av7w== X-Gm-Message-State: AEkooutqAz6ptVx1Lfu5E+sgJWxJFSv24zaJVh6DgDerqwZ1pnFthtMmQBkp7Vl8HILnVptQ X-Received: by 10.55.111.198 with SMTP id k189mr18869165qkc.44.1471033487326; Fri, 12 Aug 2016 13:24:47 -0700 (PDT) Received: from localhost.localdomain (pool-72-71-243-24.cncdnh.fast00.myfairpoint.net. [72.71.243.24]) by smtp.googlemail.com with ESMTPSA id v126sm4069506qkh.30.2016.08.12.13.24.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Aug 2016 13:24:46 -0700 (PDT) From: David Long To: Ananth N Mavinakayanahalli , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sparclinux@vger.kernel.org, catalin.marinas@arm.com, daniel.thompson@linaro.org, marc.zyngier@arm.com Subject: [PATCH] Documentation: kprobes: Document jprobes stack copying limitations Date: Fri, 12 Aug 2016 16:24:44 -0400 Message-Id: <1471033484-2709-1-git-send-email-dave.long@linaro.org> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160812_132509_287350_D6B74C89 X-CRM114-Status: UNSURE ( 9.62 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Brown MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: "David A. Long" Some architectures (i.e.: sparc64 and arm64) make reasonable partial stack duplication for jprobes problematic. Document this. Signed-off-by: David A. Long Acked-by: Masami Hiramatsu Acked-by: Catalin Marinas --- Documentation/kprobes.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index 1f9b3e2..1f6d45a 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt @@ -103,6 +103,16 @@ Note that the probed function's args may be passed on the stack or in registers. The jprobe will work in either case, so long as the handler's prototype matches that of the probed function. +Note that in some architectures (e.g.: arm64 and sparc64) the stack +copy is not done, as the actual location of stacked parameters may be +outside of a reasonable MAX_STACK_SIZE value and because that location +cannot be determined by the jprobes code. In this case the jprobes +user must be careful to make certain the calling signature of the +function does not cause parameters to be passed on the stack (e.g.: +more than eight function arguments, an argument of more than sixteen +bytes, or more than 64 bytes of argument data, depending on +architecture). + 1.3 Return Probes 1.3.1 How Does a Return Probe Work?