Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3417784ybp; Sun, 6 Oct 2019 11:28:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+iXhW6jRuRQuaylzBLnbMM4RdbfZBiI5895pPYxHTI7vFGuOpeL33Mpowi02+KbRJqhVD X-Received: by 2002:a05:6402:651:: with SMTP id u17mr25970766edx.104.1570386482567; Sun, 06 Oct 2019 11:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570386482; cv=none; d=google.com; s=arc-20160816; b=JfI9B4qh/Yw35sGVt2hY0+CN+aCmGBNkb5fCOq5SHCcDU5s9Vp9ApyAgA4kLXa+xF6 59SPjSARcwqQJzBtslaWQEs8CI+uLLn4Qy9qL+GOLvLRA+9ckXgfVBs3sh7qS+/ttShr 1++6vj8yjLRd1fKNg+9nJSQkBdmCtg4QowXT6Ud8NSXqqkpgk9/PXP8c4+WPd3LUUp5k xzxQhSaTUrLtf7xQzeFMn09IJC5h2Hi5T1T+FTt33/zA+BHfWdnt+LSImHsT6MttqzDc pfQDZMX6iTQE4748Hw0mEV5dMQx2iw/ogmd3/1OChUvOVqSHPDOrOwEHwymPFVUYv8XW 7MVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=LSwrr4EKUZ4tCfO+qrPjuD/XJ+zP1LA36jiW6xcbRg4=; b=J+DsgtsL5p8/5UiqKT5p69Bj1c+Wg5ud77c8Rp0TzTjeHUe1Ks4V7JcMGXkOWZfzp6 knDaJJhHiUXaf/9QN4llvO0edIbPrfjKeXUtlHErMdXm8wtVmoWX3EJv4YyHzrk7Gdqx vVVNNC9loQax/irmgPjrqHWkUyjrgPYGbXeDLadLfXd01fGVTsUriYz7e/UOUwRt1QNk WN1ocdQERcus8H7sQXdUG/rMBo6uhJOMjoG7NSGmsvQTrspqzPTh2i5GPzWWTbBGcEoi vx9rQjcZIpgDcU1GuhmXKfcQiqXznpixDjTCRLQGfk3Vxb0EGys99TymRF89qXRnyT6q GXlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="A7x/snAk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ha16si309614ejb.258.2019.10.06.11.27.38; Sun, 06 Oct 2019 11:28:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="A7x/snAk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbfJFS1S (ORCPT + 99 others); Sun, 6 Oct 2019 14:27:18 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:38345 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbfJFS1S (ORCPT ); Sun, 6 Oct 2019 14:27:18 -0400 Received: by mail-lf1-f67.google.com with SMTP id u28so7689513lfc.5 for ; Sun, 06 Oct 2019 11:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LSwrr4EKUZ4tCfO+qrPjuD/XJ+zP1LA36jiW6xcbRg4=; b=A7x/snAk50gSY/c2Z1Cok2ZTKX1E1o/8rt/5cHQQYg6HVTex37287kziYL0yqfjzhE 8D5UQZ31JhL9jyMv3H/Dz000hD/VDflP/kX6GMT3vaAG3fFyM00+tAlHFV8M7lxLvgfG Q++yJLhsRcx68SYLR3LdHp6yprRxIfJ27U0AY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LSwrr4EKUZ4tCfO+qrPjuD/XJ+zP1LA36jiW6xcbRg4=; b=Yqsg/DsifeUTaH6fAoReNgFxKvkomCMn3Y9R4hp8Z/WnJJIJpeLFP0BeUpFySCIO3u QEZ5gS72svFpxkC23XxINzMCK04l/UJSwthZVQMmGK4XR6RPIwmwhNM2u6/LWEZ4+PWX 4448EWFGCYij4Lvj2fcHXTRqjDj95KRogr5+3zk9WTbu8i0YFo+sYY7K0QTPZKQGmNN0 7wXMer6rWjd1xLJ88L2wHrkc1XWor9oqhvtdJyqw0GUseItjqP2LfgIDx2qg6jJk1Kqy GsNpWOU4jp6c+yGkQyKn1yByewNIJFYGn+JCNRv3fn2w0sunEmjMc2OmeG1cFYb3Sb2O SKsw== X-Gm-Message-State: APjAAAWXtE21oRlAddqqHnMrn8yoytfAf2nLYr3TtT3LtO3vCHt0aoni 5pEXEZu6YpE3egm5cGVdGkIxoyi5M7Y= X-Received: by 2002:ac2:554e:: with SMTP id l14mr15439706lfk.32.1570386435626; Sun, 06 Oct 2019 11:27:15 -0700 (PDT) Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com. [2a00:1450:4864:20::232]) by smtp.gmail.com with ESMTPSA id 126sm2896531lfh.45.2019.10.06.11.27.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 06 Oct 2019 11:27:15 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id m7so11331083lji.2 for ; Sun, 06 Oct 2019 11:27:15 -0700 (PDT) X-Received: by 2002:a2e:551:: with SMTP id 78mr16247833ljf.48.1570386430371; Sun, 06 Oct 2019 11:27:10 -0700 (PDT) MIME-Version: 1.0 References: <20191006114129.GD24605@amd> <20191006173501.GA31243@amd> <20191006182103.GA2394@amd> In-Reply-To: <20191006182103.GA2394@amd> From: Linus Torvalds Date: Sun, 6 Oct 2019 11:26:54 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: x86/random: Speculation to the rescue To: Pavel Machek Cc: Thomas Gleixner , "Ahmed S. Darwish" , LKML , "Theodore Ts'o" , Nicholas Mc Guire , "the arch/x86 maintainers" , Andy Lutomirski , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 6, 2019 at 11:21 AM Pavel Machek wrote: > > > Even without cycle counter... if we _know_ we are trying to generate > entropy and have MMC available, we don't care about power and > performance. > > So we can just... > > issue read request on MMC > while (!interrupt_done) > i++ > > ...and then use i++ as poor man's version of cycle counter. > > [We would not want to do that in normal operation, for obvious > reasons, just when userland is blocked and waiting for entropy.] > > Hmm? I hate it, but it might be worth it for the existing timer thing alternative when we don't have a cycle counter. Then we'd have _something_ for those bad embedded devices. I still absolutely hate the idea of doing disk IO for this. Linus