Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1528723pxb; Wed, 30 Mar 2022 05:43:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw04lPKdGcbatBK4KACXopFN2zy/pB0XVVm6AYqHTepazD0YllAQGFN8nOJfVtrxEdgH7Gd X-Received: by 2002:a05:6a00:174e:b0:4f7:6590:6d6d with SMTP id j14-20020a056a00174e00b004f765906d6dmr32562433pfc.71.1648644210576; Wed, 30 Mar 2022 05:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648644210; cv=none; d=google.com; s=arc-20160816; b=q9lHWtjiBlQT38Qlrd3vDn7MtqVDK6CnLFBac5T0XlcICWOwvycalHjop8i5VbICRU qikCJ5JYmlYeYE/PR8MNw1gO+qziTeFuMgktzmTJ/85CRkOpLtXK8Q7P6KlbO3/543sw lp7Y32RR1QN+7YNRqfqu6ATqV3zCJeXcsUfFpGF4riDrAQvtOZ65vCyue0rtqWUjs4by 1a522kORtbGKKquk5rke+38LlpyxSbGa1EltWH+a3n6J+oMlERxr8WDEajbRq9D6wFf0 Sp9cnGH3aaPxyFsJXwW1smjNskNyMPJUyaHyyqRW5IdXXVZBDhr+7pZe01/jLPszkkwo vxtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5Hh0vVsE5NsIgTehOa3nlosmMfHWGMN9c6MMyMO5zeA=; b=izGooFL0nYQoljKE3ff+bnvGjoYspuJ2XiN56X6FOwXsd3VFu/InHRS8pVcXA2+KR0 6l1eudZsDk4nSIUhlEyY9S6tHp/F6mbbfRsuY/lTUMWrNxNQkEWdyNIBCdYCoiPT8lku aMHDrNrM4fERNa+4lDM9+3dU9F/gUxx2gon3U3EFyXS2PDYlnRxMqqL+nQF+xUXMhd3O PbYdF9xnutk+JnGj4phbiD/eUeaQO1g6Y7Cv9+jm4Ch+CSiGllHQ2qAeO0jrVgUj3ZWi ez393gA/SUvVTCIJbXG7Qxub8dzUJlxq4DDVdLJvoqKz/jVd3Purv8XQxDb4uVVnWqhh aMKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RCfMNSku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q10-20020a170902b10a00b00154a965e477si19145751plr.231.2022.03.30.05.43.14; Wed, 30 Mar 2022 05:43:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RCfMNSku; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230456AbiC2UNm (ORCPT + 99 others); Tue, 29 Mar 2022 16:13:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbiC2UNk (ORCPT ); Tue, 29 Mar 2022 16:13:40 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2FB22325E0 for ; Tue, 29 Mar 2022 13:11:56 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id b16so22423262ioz.3 for ; Tue, 29 Mar 2022 13:11:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5Hh0vVsE5NsIgTehOa3nlosmMfHWGMN9c6MMyMO5zeA=; b=RCfMNSkuStRnGHPd8TI50xmq7vkhNjP1+3HBy1AUUbB8DmgOc0CeB/s2yIVkc0VV2q bb3IaX3O/QNfu92Et0gyXFhsOA9+CYX0+sQvitrSQuqIIs8b0WiXb+e0us6ol5URb8z5 q2JYqiKu2DmH3w+opGujLnnCMgY8VxNseu1l4+qsFtWTHcfhP3prOnA81Huz615X6ma/ gGzH73c7SVkFU6q37izzYhwLRK0ZDbBPXEgEug8Oxc4rOSNPVfPhSO+xh9sWe42t8nDo KIcWdKHr/IWvGkjhIAHQF7+f6dWr5jxI5Hna+4bIEpHK9u5eMgTrk3/iVHYFKcPZKr/J wvyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Hh0vVsE5NsIgTehOa3nlosmMfHWGMN9c6MMyMO5zeA=; b=iO2itVPFSzEyH+5KjZw99FbwUZtd2cA55TXIgJXyN+D2Fi64/MBOrOM0WRzB82Fcah gnJ5rrDhuVPrMVERHW+suN6LGL5Nuxgwa57ztNdIFoZlFbqnan+o4BPXXVwZ6WGRSwYT J9C7/44VrJ6i/vXG7HqOHQAzDpUxM4shnuAnh1jNwQXiZtV6c5W0sOUJBumuGUlQBKac NX+JOH1ps4u2ige2HJ87gR6d+niOzzbVmSZmmbDZMu3DHVx2KFmmaux3ZWJaab4IrpLA VyHAFgksOsTGOpp5NeTQkYcu5R3L5I46MGYV/HfLdF1ByDVVMbjV1LPuz+FSLUjbfzaS 1Cnw== X-Gm-Message-State: AOAM532j8SayfuzSB0UFoubCQyzFJXpeH919fYd9SOxGZosKyWX9MLTq gOVyNXRPmTpLLLeBF+TOv5htvdzT+2/1oBnb/Io= X-Received: by 2002:a05:6638:2113:b0:321:4e19:b04d with SMTP id n19-20020a056638211300b003214e19b04dmr18181370jaj.71.1648584716304; Tue, 29 Mar 2022 13:11:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Tue, 29 Mar 2022 22:11:45 +0200 Message-ID: Subject: Re: [PATCH v2 0/4] kasan, arm64, scs, stacktrace: collect stack traces from Shadow Call Stack To: Marco Elver Cc: andrey.konovalov@linux.dev, Alexander Potapenko , Catalin Marinas , Will Deacon , Andrew Morton , Dmitry Vyukov , Andrey Ryabinin , kasan-dev , Mark Rutland , Vincenzo Frascino , Sami Tolvanen , Peter Collingbourne , Evgenii Stepanov , Florian Mayer , Linux Memory Management List , LKML , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 29, 2022 at 8:36 PM Andrey Konovalov wrote: > > On Mon, Mar 28, 2022 at 2:36 PM Marco Elver wrote: > > > > > Changes v1->v2: > > > - Provide a kernel-wide stack_trace_save_shadow() interface for collecting > > > stack traces from shadow stack. > > > - Use ptrauth_strip_insn_pac() and READ_ONCE_NOCHECK, see the comments. > > > - Get SCS pointer from x18, as per-task value is meant to save the SCS > > > value on CPU switches. > > > - Collect stack frames from SDEI and IRQ contexts. > > > > Do any of these new changes introduce new (noticeable) overhead (in > > particular patch 2)? > > I'll measure the overheads and include the results into v3. Thanks! Hm, looks like the overhead is overly significant: ~5%. I'll explore a different approach in v3 instead.