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=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 0CBA6C2D0A3 for ; Wed, 4 Nov 2020 19:00:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 98B6A2083B for ; Wed, 4 Nov 2020 19:00:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="M8V29X75" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730627AbgKDS5G (ORCPT ); Wed, 4 Nov 2020 13:57:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729297AbgKDS5G (ORCPT ); Wed, 4 Nov 2020 13:57:06 -0500 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D10D0C0613D4 for ; Wed, 4 Nov 2020 10:57:05 -0800 (PST) Received: by mail-pl1-x643.google.com with SMTP id t22so10708306plr.9 for ; Wed, 04 Nov 2020 10:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=eFbEFkCwKJ1hR3ookQi/7V8Itg1IPtT/zHbmeIxSz6g=; b=M8V29X75bdxqtjcKywJmnyr1FqzkhvieUPrJY63jv4RFhMimKu9+P3nJ1F+HndPJsh QzfeuWZuKcE8FrwefX0HGV1DUScWByoTiabA2VGBkCDVtSUXskkYKZXjTs191p7kBgsy q5yRcPFcVQ+sw3CiP8F/EyXbTycT5ga0dpB7M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=eFbEFkCwKJ1hR3ookQi/7V8Itg1IPtT/zHbmeIxSz6g=; b=fT1IGodtksnYgpt75sIVvAkEfHs4UaLH4IPvkiSi+oE9OQ+tHM6XZNvqmv8e1uf9Jz jwvC0Zwjh3iRWd2jWg41JuIoL8S+3KbcDk5Y144NVwWLEC8+ZVmz4/SxMznc8TX5RdfZ I0c8UABvhWiwO7B04NmrYB/MhsUsknydcCaU3o+WpMoHNFcAgE1aTMuPTOAtlXetlgKJ OzLU3iki8CFVs4rRQvazndv43qsLrdKTjcG8B1GHaQr3B6z1j7p6nPEPURc2CkMBkkB/ UjSavuK0QSlvty3biM8McTnHi3ER0/Tsx3bfKOYBNuQEP7fDII2exdRklYIkn9Og/Fc7 igFg== X-Gm-Message-State: AOAM5307uy9s8j7s37J1uAp01OPkfJQxsiRyOayxcx/lMWUlq+637PKN Fi+jYCHb/UhQBOoa4g+HqfmN9g== X-Google-Smtp-Source: ABdhPJyu2rjAfEpo9PsZku1g5A6IasXMm5exN3bYVxllgILGsUnNv/NS1FwRd/sfhdORw2FuF5f16w== X-Received: by 2002:a17:902:ff0e:b029:d6:820d:cb81 with SMTP id f14-20020a170902ff0eb02900d6820dcb81mr31394012plj.47.1604516225344; Wed, 04 Nov 2020 10:57:05 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q16sm3066965pff.114.2020.11.04.10.57.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Nov 2020 10:57:04 -0800 (PST) Date: Wed, 4 Nov 2020 10:57:03 -0800 From: Kees Cook To: YiFei Zhu Cc: Linux Containers , YiFei Zhu , bpf , kernel list , Aleksa Sarai , Andrea Arcangeli , Andy Lutomirski , David Laight , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , Jann Horn , Josep Torrellas , Tianyin Xu , Tobin Feldman-Fitzthum , Tycho Andersen , Valentin Rothberg , Will Drewry Subject: Re: [PATCH v4 seccomp 5/5] seccomp/cache: Report cache data through /proc/pid/seccomp_cache Message-ID: <202011041052.0D14CD6@keescook> References: <202010121556.1110776B83@keescook> <202010221520.44C5A7833E@keescook> <202010231945.90FA4A4AA@keescook> <202011031612.6AA505157@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 04, 2020 at 05:40:51AM -0600, YiFei Zhu wrote: > On Tue, Nov 3, 2020 at 6:29 PM Kees Cook wrote: > > Yeah, this is very interesting. That there is anything measurably _slower_ > > with the cache is surprising. Though with only 4 runs, I wonder if it's > > still noisy? What happens at 10 runs -- more importantly what is the > > standard deviation? > > I could do that. it just takes such a long time. Each run takes about > 20 minutes so with 10 runs per environment, 3 environments (native + 2 > docker) per boot, and 4 boots (2 bootparam * 2 compile config), it's > 27 hours of compilation. I should probably script it at that point. Yeah, I was facing the same issues. Though perhaps hackbench (with multiple CPUs) would be a better test (and it's much faster): https://lore.kernel.org/lkml/7723ae8d-8333-ba17-6983-a45ec8b11c54@redhat.com/ (I usually run this with a CNT of 20 to get quick results.) > > I assume this is from Indirect Branch Prediction Barrier (IBPB) and > > Single Threaded Indirect Branch Prediction (STIBP) (which get enabled > > for threads under seccomp by default). > > > > Try booting with "spectre_v2_user=prctl" > > Hmm, to make sure, boot with just "spectre_v2_user=prctl" on the > command line and test the performance of that? Right, see if that eliminates the 3 minute jump seen for seccomp. -- Kees Cook