Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp825888ybv; Wed, 19 Feb 2020 10:01:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzpMKExyB0/B0Z2vdBiS3o/Odh1Iqw0HDBvh4RaZz6EHjlTIdQjuJo95u1xLLWv1k6lzfqu X-Received: by 2002:a05:6830:11:: with SMTP id c17mr20173125otp.360.1582135314100; Wed, 19 Feb 2020 10:01:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582135314; cv=none; d=google.com; s=arc-20160816; b=FmtKEMCd5ez8/WTT+il4XZLQI4NIdd0FCjIyQroll10p40YJTLo09B2dpFQuhoraFk KCPOttoHaVfJdpUKlXRLofPmHmgBC+bP0FE2hMM/S/YBX5+F/qNNW4M7v0e3WyTGwFXK Sr5jyqTY2SVRKQHSo1uysjKH3ecvJ30pjTCfwMLCljNHjhKmJnDAW3+u0Ovlsf4YS3Xt QV76U7cRWqNgHtfdO+FrT5gx0eAM8pviF48tKr0ZIftvss/Bpm9EKED7h6zCyjX4jfQN gF5sMGWvuOO9idBoxtwLp4zNWW9lY+7Pjr4RCXe90yCgL4Ly60g/Nw1ubX5Y84jk+EiH 4Y9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lkHXwFRTyqTPxv+c/LKoXDAeY6A/OlAl/xcBXxo2cgo=; b=C0rEKPqiFdlA3nhUq3lWtAZmdiCj8rhuuKWK+ErlcrlAXXZghTSWF1GnW2BlPW4GAS aekgCxyxxvxLgGGjmnNjAZfB+nfLl62KSlfDiOvR/QSqHDUYsLaersOj5RggjZRjSFsR 7s9E7fnh08kcrcheaRlqAdAOC+Yw+kJwtt7ZN/+XJMPA2gkxmO9fOq/J63rIN8nM8JlG 05v1Uo+cMJEXzHWQA0ZEV55A6ohLk7g38n1POFZHN2iMiOEyzARVLDWajw2C4N02KlNt zdBfhKX4taSkkMvMjOubuJ8Tc1ottt/bZI8bKUHp3U3TG1YxJM+3Juku0t97Tj1Z116X kLbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gh6t3G5B; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si244890otk.73.2020.02.19.10.01.39; Wed, 19 Feb 2020 10:01:54 -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=@google.com header.s=20161025 header.b=gh6t3G5B; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbgBSSB1 (ORCPT + 99 others); Wed, 19 Feb 2020 13:01:27 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:44331 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbgBSSB1 (ORCPT ); Wed, 19 Feb 2020 13:01:27 -0500 Received: by mail-vs1-f67.google.com with SMTP id p6so877288vsj.11 for ; Wed, 19 Feb 2020 10:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lkHXwFRTyqTPxv+c/LKoXDAeY6A/OlAl/xcBXxo2cgo=; b=gh6t3G5BECE9aN/9A6d1bwWVVZBG4fe4Jv0G9F7ySydWI5loDBjyb6KyvSnHC3H2xb PiYI+vSfh6PGP3+tITPcVcHh8lERKC8od4oC2sH0ZseserCl8/SeCqlEtOKaPowUnmOE 2eXS1KVuXlN0wfgWz9OeANM1/plXi4TktMssP2HUeiH/l+o/2AxWa3NY/kVCtRCjJr+f dMd7adB5l/qvK2DvV3IcWYmCoMHtH9Kl4DGNXpxeVnHW2OLrpEsXBoFzatmkLtQ0Da/S Do49a64NNoQSLpsZnbjyOORpErFk4A1akDXWP+T4B/uvtpfqQAguJp3M14618EN8fHqX JuhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lkHXwFRTyqTPxv+c/LKoXDAeY6A/OlAl/xcBXxo2cgo=; b=h6Nxb3QnPnFf+9thBWVxtV8G+OLL8AzaZPE4NVBMoT4SIqQvf0cC69seqIXCNfc3Gc kVAZ9xtEI/eh4yiV+LgeFfU55PVv2QyvnOJNJ9Jin6EWzI0IrTJRmCqXEMVGBlIqKg5I TJ96WllmsMNVTH2z99Ey8Ryl9nS/5TKTdIgpiDmCsqrJFMaNd+g3ny4v16fGqtSwq4qZ OJzZ3vCv194BdjyIUElz788FvoNxnVLv7+Wt0x6rbGuSZLiE6DHuze4fbXAuYMo4O4sp 0W2vAED3TEaVmD3XqkgNZ3mdrEr4FjHa4O/CpSPnEig9JCvugUVjvU9gX6B7g1Vgc0hS LRdw== X-Gm-Message-State: APjAAAVXmfjRqV6+8Hglb/RncP96wfJ1p7JtL8a3JFNOBp1wZvIHhkuQ a/oFi36/+Z8dYAGIUd28wVxzk09ZYgxn3pz83hU61A== X-Received: by 2002:a05:6102:1c8:: with SMTP id s8mr6086880vsq.44.1582135285718; Wed, 19 Feb 2020 10:01:25 -0800 (PST) MIME-Version: 1.0 References: <20191018161033.261971-1-samitolvanen@google.com> <20200219000817.195049-1-samitolvanen@google.com> <20200219000817.195049-5-samitolvanen@google.com> <20200219113351.GA14462@lakrids.cambridge.arm.com> In-Reply-To: <20200219113351.GA14462@lakrids.cambridge.arm.com> From: Sami Tolvanen Date: Wed, 19 Feb 2020 10:01:14 -0800 Message-ID: Subject: Re: [PATCH v8 04/12] scs: disable when function graph tracing is enabled To: Mark Rutland Cc: Will Deacon , Catalin Marinas , Steven Rostedt , Masami Hiramatsu , Ard Biesheuvel , James Morse , Dave Martin , Kees Cook , Laura Abbott , Marc Zyngier , Nick Desaulniers , Jann Horn , Miguel Ojeda , Masahiro Yamada , clang-built-linux , Kernel Hardening , linux-arm-kernel , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 19, 2020 at 3:34 AM Mark Rutland wrote: > Fangrui Song has implemented `-fpatchable-function-entry` in LLVM (for > 10.x onwards), so we can support this when DYNAMIC_FTRACE_WITH_REGS is > selected. > > This can be: > > depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER > > ... and we can update the commit message to something like: > > | With SCS the return address is taken from the shadow stack and the > | value in the frame record has no effect. The mcount based graph tracer > | hooks returns by modifying frame records on the (regular) stack, and > | thus is not compatible. The patchable-function-entry graph tracer > | used for DYNAMIC_FTRACE_WITH_REGS modifies the LR before it is saved > | to the shadow stack, and is compatible. > | > | Modifying the mcount based graph tracer to work with SCS would require > | a mechanism to determine the corresponding slot on the shadow stack > | (and to pass this through the ftrace infrastructure), and we expect > | that everyone will eventually move to the patchable-function-entry > | based graph tracer anyway, so for now let's disable SCS when the > | mcount-based graph tracer is enabled. > | > | SCS and patchable-function-entry are both supported from LLVM 10.x. > > Assuming you're happy with that: > > Reviewed-by: Mark Rutland Great, thanks for pointing that out! This looks good to me, I'll use this in v9. Sami