Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2769203imj; Mon, 11 Feb 2019 08:11:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IbmBWIwTwJkmQ9zgySUsWw5A/PbZID39XoM8S0hscKxTUN18tqISxL9mYi9Kpv9pADOuVr7 X-Received: by 2002:a63:c04b:: with SMTP id z11mr4333506pgi.135.1549901500247; Mon, 11 Feb 2019 08:11:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901500; cv=none; d=google.com; s=arc-20160816; b=Q2185Wj9+MsZomGa4sc5ZS3BJnYTDMMcnfOfEtHfKJk5/zC+pStOxv6O6NF9awhMJ+ yJToGyAdMjaZBw8NoGUG8kwjllTh0fBG398qhspsC/I8F2FhNTLL63XXMn4U9Sgoc7ks bG1/OC3Ac3N9sXEA8FtTQtM6z1SFDfdwoGsQ564Ou0kdZFXChSamhMNYdDdvaK3++xhy VdBjG8zGiyEWz5znzYLPM71w2YlQ7qXHz1GDRiEcM5yDNuFItlKR0iqqLsK5MTS8Vvxz kRdK3CLCz6uJBDx3VN2NfeNqWIGKlDB57RZ0twOrFevSTQs64QCzczWQRenf7+ZHQse2 oOMg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1u9FgoheHClI7yMn6OWc91dj1qISTTZsuv3SInbj5BU=; b=ZKWyNU0ZigxAer6NUZ7OKHmcxnMKUceiBvl0dEzWjY+/E2gL14d1Tsc14nYpRnqWIH 26tEoUkIzAmIym/N2m1DqzcxPT3UblKtAwbDjCDoAloC4dJZ2mYc+81WJsjzh/9JYwFO o21xSTEcF+VUm0hgBF6p05Kp/lhg3D/tlsGyxAvyuKHKYb3lYtSDYzb3uY0c/FfQobQt x70y9Yc/DUlby7CR//Fr7Y2yT+KWxV2ZS5kJ8WvMof0ZvzB6ghm808CcZUnGMSKcNm5Q rbd0UJn3uPSk4znpG74/n4lSY6HWCxaO8W9LdChbJaaMhwDRh8PXssnyOuB/eL66C60J Q+OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ra4+pkwo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si4394156plx.331.2019.02.11.08.11.24; Mon, 11 Feb 2019 08:11:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ra4+pkwo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729628AbfBKQJi (ORCPT + 99 others); Mon, 11 Feb 2019 11:09:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:58730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729357AbfBKOZU (ORCPT ); Mon, 11 Feb 2019 09:25:20 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 4941C20821; Mon, 11 Feb 2019 14:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895119; bh=dSTna1BVmIjtekNhv0Td8QLhTu5kU9lddzIBk0PnI+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ra4+pkwodzO//eh1IkDDgiq08LoZwZGCqheqBuq8tozU2CNHyxaraop/+RDIf4e9P pc/iNk4+aG5ntFJmX3/FDew1rr9kr5Z3MJ9kXogk4V/fHwp/KArJUh+gSiCqYQM22J qG+JTZsWq4fAxwaJ3AxlUjYhwHXC7iSb/1COc3qs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , AKASHI Takahiro , Ard Biesheuvel , Catalin Marinas , Torsten Duwe , Will Deacon , Sasha Levin Subject: [PATCH 4.20 098/352] arm64: ftrace: dont adjust the LR value Date: Mon, 11 Feb 2019 15:15:25 +0100 Message-Id: <20190211141852.061272496@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 6e803e2e6e367db9a0d6ecae1bd24bb5752011bd ] The core ftrace code requires that when it is handed the PC of an instrumented function, this PC is the address of the instrumented instruction. This is necessary so that the core ftrace code can identify the specific instrumentation site. Since the instrumented function will be a BL, the address of the instrumented function is LR - 4 at entry to the ftrace code. This fixup is applied in the mcount_get_pc and mcount_get_pc0 helpers, which acquire the PC of the instrumented function. The mcount_get_lr helper is used to acquire the LR of the instrumented function, whose value does not require this adjustment, and cannot be adjusted to anything meaningful. No adjustment of this value is made on other architectures, including arm. However, arm64 adjusts this value by 4. This patch brings arm64 in line with other architectures and removes the adjustment of the LR value. Signed-off-by: Mark Rutland Cc: AKASHI Takahiro Cc: Ard Biesheuvel Cc: Catalin Marinas Cc: Torsten Duwe Cc: Will Deacon Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/entry-ftrace.S | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/kernel/entry-ftrace.S b/arch/arm64/kernel/entry-ftrace.S index 1175f5827ae1..295951f3172e 100644 --- a/arch/arm64/kernel/entry-ftrace.S +++ b/arch/arm64/kernel/entry-ftrace.S @@ -79,7 +79,6 @@ .macro mcount_get_lr reg ldr \reg, [x29] ldr \reg, [\reg, #8] - mcount_adjust_addr \reg, \reg .endm .macro mcount_get_lr_addr reg -- 2.19.1