From patchwork Thu Jan 16 10:45:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Pihet X-Patchwork-Id: 23262 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A5AB202E2 for ; Thu, 16 Jan 2014 10:46:06 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wp4sf8071397obc.3 for ; Thu, 16 Jan 2014 02:46:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=2JULUcBfneki2ACm9qVl/NRawCbLxmdL0rbjSRDZMz0=; b=VOjhDeB0/RDL8n+e5zYLo6rOWIVWApHZFK/JGCXoNZ+m56EYWnw0QTEzWsGyv5x2Fp YNFVYsOkGbg5DvKrr7+Srs/doIt+N7knUfho1z6MOVbXLHLCWVUhFtSK6Znu34Z7nnlR E7NZMwJE5nrsca/CRJ5uSh/PgpeBMSd53e0NaOZCRAjyPcFGnR9TSYBa6wMi1DY2Tp35 jKaobg4jqzEldOaSYNOme7gq/3E28/hVEYapClozofV3ltlxqm17ibp0BBWXhiObzSBw yHcwM5+KsTw2bsjXWdopsLNeG5DmWWnHMVxNSqA0YvY/a8GD3a9t8sU5BgIibMniqrZK 85Gw== X-Gm-Message-State: ALoCoQn+u7s0ZMubsjpgZVDlNMGSSQiHLMAPRxIehDpjgNiJjPxXk7wVl/CU35hdHz6FNGyPErsM X-Received: by 10.42.84.136 with SMTP id m8mr2695597icl.9.1389869165350; Thu, 16 Jan 2014 02:46:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.134 with SMTP id b6ls141714qgb.91.gmail; Thu, 16 Jan 2014 02:46:05 -0800 (PST) X-Received: by 10.220.192.198 with SMTP id dr6mr31244vcb.26.1389869165208; Thu, 16 Jan 2014 02:46:05 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id gv8si3162423veb.120.2014.01.16.02.46.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 02:46:05 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so937283veb.11 for ; Thu, 16 Jan 2014 02:46:05 -0800 (PST) X-Received: by 10.58.69.41 with SMTP id b9mr6144651veu.5.1389869165140; Thu, 16 Jan 2014 02:46:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp337300ved; Thu, 16 Jan 2014 02:46:04 -0800 (PST) X-Received: by 10.194.79.165 with SMTP id k5mr7560719wjx.44.1389869164112; Thu, 16 Jan 2014 02:46:04 -0800 (PST) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx.google.com with ESMTPS id n10si5749356wiy.82.2014.01.16.02.45.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 02:45:57 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.47 is neither permitted nor denied by best guess record for domain of jean.pihet@linaro.org) client-ip=74.125.82.47; Received: by mail-wg0-f47.google.com with SMTP id m15so2922808wgh.2 for ; Thu, 16 Jan 2014 02:45:57 -0800 (PST) X-Received: by 10.180.104.164 with SMTP id gf4mr7153950wib.35.1389869154998; Thu, 16 Jan 2014 02:45:54 -0800 (PST) Received: from localhost.localdomain ([81.241.7.250]) by mx.google.com with ESMTPSA id ey3sm32948590wib.4.2014.01.16.02.45.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 16 Jan 2014 02:45:53 -0800 (PST) From: Jean Pihet To: linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, linux-arm-kernel@lists.infradead.org, Will Deacon , Arnaldo Cc: patches@linaro.org, Jiri Olsa , Ingo Molnar , Jean Pihet Subject: [PATCH] ARM64: perf: support dwarf unwinding in compat mode Date: Thu, 16 Jan 2014 11:45:23 +0100 Message-Id: <1389869123-5884-1-git-send-email-jean.pihet@linaro.org> X-Mailer: git-send-email 1.7.11.7 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jean.pihet@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add support for unwinding using the dwarf information in compat mode. Using the correct user stack pointer allows perf to record the frames correctly in the native and compat modes. Note that although the dwarf frame unwinding works ok using libunwind in native mode (on ARMv7 & ARMv8), some changes are required to the libunwind code for the compat mode. Those changes are posted separately on the libunwind mailing list. Tested on ARMv8 platform with v8 and compat v7 binaries, the latter are statically built. Signed-off-by: Jean Pihet --- arch/arm64/include/asm/ptrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h index fbb0020..86d5b54 100644 --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h @@ -133,7 +133,7 @@ struct pt_regs { (!((regs)->pstate & PSR_F_BIT)) #define user_stack_pointer(regs) \ - ((regs)->sp) + (!compat_user_mode(regs)) ? ((regs)->sp) : ((regs)->compat_sp) /* * Are the current registers suitable for user mode? (used to maintain