Received: by 2002:ac0:c50a:0:0:0:0:0 with SMTP id y10csp1116809imi; Fri, 1 Jul 2022 03:33:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tt8n6Nqwk/byftv6AE+1sbCecDXplj3gdoQWSEDURXLw7k3cW2t/4qUQsdthd6mFxrj0AC X-Received: by 2002:a05:6402:2741:b0:434:fe8a:1f96 with SMTP id z1-20020a056402274100b00434fe8a1f96mr18323155edd.331.1656671579815; Fri, 01 Jul 2022 03:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656671579; cv=none; d=google.com; s=arc-20160816; b=wC4H96Lrv3d0wWJo+U3yM91Z47yL+VvpnvTkIPhZwbyoHeJtYF5MLU7+CFuqXq2Bly v5dHD/roPYew6sI/VAPf9twyWBxTsKvYWT5r5d5y93m9nKKEmo/dIBmteP6DkSt+Pkj+ yixWRpVeymhP5e/6WqeDWch6CGCBCT/bmZ//Ku/6i+oie9HGjZZZGU82+fQYXW5q1cTf zrL6dKiVplp5U4+okwRcJGap42UFlGDK28qaF/u1vk5OE+J/aXD8+3zfxzFRuKF4zk2T /YIa94dZIT1KMT+nJuUhZE6HGxDyJm//0vmLL3vqAzImmQIvq4MwFuXOZFeCeIK3sI56 PFsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=C9yKLAcuZ5hnkYBCpoRQx1zMhVYu01vnHM+Lplb5HMc=; b=B8crvdqtio2uYCPKA9B4XyWDT3wvbFaif88E/QEt1wdYPHRMCDCmZFIj+NBtND2Lhl 4ow+d2SUYja7ijMiO3XlOw6Nj5O9rM7n/ZjiGQYGwwhRxHoFEuNZ+8URvT4OmyvigvyK 23+dE4nEG41aEN79BNz5vgHn+LOrzyHFb5nbWXZ98PrEb3uCALh8guVlbpBppGOgMEVO JZWlNpPWrpowahnaoe9U7k9BD0Fa7XIln51IO6LQwNI+uU4VNxjfuBJAQXVASxq0wzc/ +2b8p9NyCY/8X8zYeYxfV9PvX/oZaTjhj7/N3GyYAe7XzxKIqSaYbR7Gw5V7f54+xIuD SUaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=BxifDh2c; 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=NONE dis=NONE) header.from=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa14-20020a170907868e00b00726b4533ce8si1870745ejc.383.2022.07.01.03.32.34; Fri, 01 Jul 2022 03:32:59 -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 (test mode) header.i=@axis.com header.s=axis-central1 header.b=BxifDh2c; 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=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232726AbiGAKEv (ORCPT + 99 others); Fri, 1 Jul 2022 06:04:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232866AbiGAKEt (ORCPT ); Fri, 1 Jul 2022 06:04:49 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1F0574DD6 for ; Fri, 1 Jul 2022 03:04:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1656669884; x=1688205884; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=C9yKLAcuZ5hnkYBCpoRQx1zMhVYu01vnHM+Lplb5HMc=; b=BxifDh2c1kPEu3rm1uWBi2bGi5bTCS9kg/uE4xzOjT92oHFOlMDR1D/Z IWBmJCDtu6BncqQHiRcTH+F8ziELcFgldto5cd8o6IQye5mVHg4fA91e5 spohbFvaQ+RfKqnXuN7+uc9/59MhEJVPfIj1eNlPNLPGN1+9k9ewdiOdV rcaSrJlkY/rZhNA6l6Jb3XHDJ5dP9pghrwdEqrmJxo73+C5+qJYUNw94Z RxHjBc+PdtgbzVUxV49SU/jLqd5BYmz5VFh5EjN783/Rx8xkOsXt5mOj8 WfR106TfTFYzuLfgpAhNzVk8+UpaQ9NaMANVPUBoWHZ701FR4igDc+DeN Q==; Date: Fri, 1 Jul 2022 12:04:41 +0200 From: Vincent Whitchurch To: David Gow CC: Andrey Konovalov , Dmitry Vyukov , Johannes Berg , Patricia Alfonso , Jeff Dike , Richard Weinberger , "anton.ivanov@cambridgegreys.com" , Brendan Higgins , Andrew Morton , Andrey Ryabinin , kasan-dev , "linux-um@lists.infradead.org" , LKML , Daniel Latypov , "linux-mm@kvack.org" , "kunit-dev@googlegroups.com" Subject: Re: [PATCH v4 2/2] UML: add support for KASAN under x86_64 Message-ID: <20220701100441.GA8082@axis.com> References: <20220630080834.2742777-1-davidgow@google.com> <20220630080834.2742777-2-davidgow@google.com> <20220630125434.GA20153@axis.com> <20220701091653.GA7009@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, 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 Fri, Jul 01, 2022 at 05:43:26PM +0800, David Gow wrote: > On Fri, Jul 1, 2022 at 5:16 PM Vincent Whitchurch > wrote: > > On Fri, Jul 01, 2022 at 11:08:27AM +0200, David Gow wrote: > > > On Thu, Jun 30, 2022 at 9:29 PM Andrey Konovalov wrote: > > > > Stack trace collection code might trigger KASAN splats when walking > > > > stack frames, but this can be resolved by using unchecked accesses. > > > > The main reason to disable instrumentation here is for performance > > > > reasons, see the upcoming patch for arm64 [1] for some details. > > > > > > > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=802b91118d11 > > > > > > Ah -- that does it! Using READ_ONCE_NOCHECK() in dump_trace() gets rid > > > of the nasty recursive KASAN failures we were getting in the tests. > > > > > > I'll send out v5 with those files instrumented again. > > > > Hmm, do we really want that? In the patch Andrey linked to above he > > removed the READ_ONCE_NOCHECK() and added the KASAN_SANITIZE on the > > corresponding files for arm64, just like it's already the case in this > > patch for UML. > > Personally, I'm okay with the performance overhead so far: in my tests > with a collection of ~350 KUnit tests, the total difference in runtime > was about ~.2 seconds, and was within the margin of error caused by > fluctuations in the compilation time. > > As an example, without the stacktrace code instrumented: > [17:36:50] Testing complete. Passed: 364, Failed: 0, Crashed: 0, > Skipped: 47, Errors: 0 > [17:36:50] Elapsed time: 15.114s total, 0.003s configuring, 8.518s > building, 6.433s running > > versus with it instrumented: > [17:35:40] Testing complete. Passed: 364, Failed: 0, Crashed: 0, > Skipped: 47, Errors: 0 > [17:35:40] Elapsed time: 15.497s total, 0.003s configuring, 8.691s > building, 6.640s running OK, good to know. > That being said, I'm okay with disabling it again and adding a comment > if it's slow enough in some other usecase to cause problems (or even > just be annoying). That could either be done in a v6 of this patchset, > or a follow-up patch, depending on what people would prefer. But I'd > not have a problem with leaving it instrumented for now. I don't have any strong opinion either way either, so you don't have to change it back on my account. Thanks.