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 X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0F6AC10F13 for ; Mon, 8 Apr 2019 18:19:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8592420855 for ; Mon, 8 Apr 2019 18:19:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728591AbfDHSTK (ORCPT ); Mon, 8 Apr 2019 14:19:10 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:53653 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727056AbfDHSTK (ORCPT ); Mon, 8 Apr 2019 14:19:10 -0400 Received: from p5492ee6e.dip0.t-ipconnect.de ([84.146.238.110] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hDYrK-0004zE-Te; Mon, 08 Apr 2019 20:19:07 +0200 Date: Mon, 8 Apr 2019 20:19:06 +0200 (CEST) From: Thomas Gleixner To: Andy Lutomirski cc: LKML , X86 ML , Josh Poimboeuf , Sean Christopherson Subject: Re: [patch V2 28/29] x86/irq/64: Remap the IRQ stack with guard pages In-Reply-To: Message-ID: References: <20190405150658.237064784@linutronix.de> <20190405150930.967389183@linutronix.de> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Apr 2019, Thomas Gleixner wrote: > On Mon, 8 Apr 2019, Andy Lutomirski wrote: > > On Sun, Apr 7, 2019 at 11:46 PM Thomas Gleixner wrote: > > > > > > On Sun, 7 Apr 2019, Andy Lutomirski wrote: > > > > On Sun, Apr 7, 2019 at 3:44 PM Thomas Gleixner wrote: > > > > > Actually we have: save_stack_trace() > > > > > > > > > > > > > Like I did here: > > > > > > > > https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/log/?h=WIP.x86/stackguards > > > > > > Kinda, but what that code wants is to skip any entry before 'caller'. So we > > > either add something like save_stack_trace_from() which is trivial on x86 > > > because unwind_start() already has an argument to hand in the start of > > > stack or we filter out the entries up to 'caller' in that code. > > > > > > > > Whoops! > > > > I could add a save_stack_trace_from() or I could add a "caller" > > argument to struct stack_trace. Any preference as to which looks > > better? The latter seems a little nicer to me. Bah, all that sucks. Because 'caller' is comes from __RET_IP__ and is not a pointer to the stack. So this really needs to be a filter which prevents storing an entry _before_ caller is seen on the stack. ftrace and kasan do some post stacktrace filtering as well just different. That's all bonkers. tglx