Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp124104pxb; Wed, 4 Nov 2020 16:46:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJws7bT5WkwAtYpP2q6sSjcA3OU800VbggkU3K5WPGsPt5eaQxwhrhrg2eOWD4gMVMi1XV64 X-Received: by 2002:a05:6402:1542:: with SMTP id p2mr4394edx.298.1604537171850; Wed, 04 Nov 2020 16:46:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604537171; cv=none; d=google.com; s=arc-20160816; b=uxA4xFklI73ZCMgZHUX3ATH3oxKmiYfOTwmhNj1L6rttVAMROshMNBUzL7qwyCNHGz PSucWViuwt1osmRj/FP0dRX3AshoxtHOSREMp5ff5Wv39yfFpNuQr1fpn/W+eTrh5Q2Y ZOewA6blnYL5V3StUG372/Jif0iMumKfH9n452q4TY5wJzLZ7vr19nFsOcK2nPDW0mul wihFY3ScW3DUo6tBQ2AWOeuXSBhKO1JII3m1d5ssNYN+9oRkrgCHcJA5Y2TA1bcH9uSv AuYz8tZs8SjtLXEF+AipSOAX1HKmxpGLnQNx4XoANKow2NQw0IbX9zLBkrYXRFrIAsK4 g48g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eFbEFkCwKJ1hR3ookQi/7V8Itg1IPtT/zHbmeIxSz6g=; b=m9hGV7/NCEnA7um1Vot7GIIW0gumMvUiVm9AU5Du5Gaz3RNbIxjFiVGtogNcbxuy4t qV3csrHOdKxdTgom0QS3TXSD0ROXhSRpJW4f603SRTW+WofLxZ0FpWckHDr7HlrxmIkz sb6kcBYuEM5rfeStDTlktmEdWC0Bnqkk2s+znhJ309lgkCnD8fKDRfHLY8N4Q70e/hXu X2SqL1O+pxIe0G7KCZr+Trf4EaR8vD6EPY5sVjWOBOQvAuImph0nh7WhpHecE3r17jvE PmCa//B0gL517gaABxovkoWEW5+CWKuSZ/7AgLx+pS/+QzcdaxwkIndmq8L5mjdCy1oC 1Nqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=M8V29X75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si2441343ejs.498.2020.11.04.16.45.49; Wed, 04 Nov 2020 16:46:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=M8V29X75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730311AbgKDS5G (ORCPT + 99 others); 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-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