Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 25 Jun 2018 16:32:52 -0000 Received: from mga05.intel.com ([192.55.52.43]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fXUQ6-0003Zp-Hu for speck@linutronix.de; Mon, 25 Jun 2018 18:32:51 +0200 Subject: [MODERATED] Re: [PATCH v4 3/8] [PATCH v4 3/8] Linux Patch #3 References: <20180623135445.641656585@localhost.localdomain> From: Dave Hansen Message-ID: Date: Mon, 25 Jun 2018 09:32:45 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="awr9KukLBKqSZUU6zhW96IGyMOO8LAbP7"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --awr9KukLBKqSZUU6zhW96IGyMOO8LAbP7 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 06/25/2018 07:26 AM, speck for Paolo Bonzini wrote: > On 23/06/2018 15:54, speck for konrad.wilk_at_oracle.com wrote: >> + if (static_cpu_has(X86_FEATURE_FLUSH_L1D)) { >> + wrmsrl(MSR_IA32_FLUSH_CMD, L1D_FLUSH); >> + return; >> + } >> + >> + /* FIXME: could this be boot_cpu_data.x86_cache_size * 2? */ >> + size =3D PAGE_SIZE << L1D_CACHE_ORDER; > Regarding this "FIXME": Peter or Tim, do you know if loading 32KiB is > enough on pre-Skylake parts to clear the L1D cache? As usual, it's complicated. 32k is theoretically enough, but _only_ if none of the lines being touched were in the cache previously. That's why it was a 64k buffer in some examples. You also need guard pages at either end to ensure the prefetchers don't run into the next page. --awr9KukLBKqSZUU6zhW96IGyMOO8LAbP7--