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:47:10 -0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fXUdx-0003mm-4H for speck@linutronix.de; Mon, 25 Jun 2018 18:47:09 +0200 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C460C40D9B14 for ; Mon, 25 Jun 2018 16:47:00 +0000 (UTC) Received: from [10.36.112.27] (ovpn-112-27.ams2.redhat.com [10.36.112.27]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1106D7C30 for ; Mon, 25 Jun 2018 16:46:59 +0000 (UTC) Subject: [MODERATED] Re: [PATCH v4 3/8] [PATCH v4 3/8] Linux Patch #3 References: <20180623135445.641656585@localhost.localdomain> From: Paolo Bonzini Message-ID: Date: Mon, 25 Jun 2018 18:46:57 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="EiEErHlsVq3Kvh15TgSP0QrNuH9Tf3iFe"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --EiEErHlsVq3Kvh15TgSP0QrNuH9Tf3iFe Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 25/06/2018 18:32, speck for Dave Hansen wrote: > 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? >=20 > As usual, it's complicated. >=20 > 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 i= n > some examples. But pre-Skylake has 16k cache only, doesn't it? Does it need to read in 4 times the cache size? > You also need guard pages at either end to ensure the prefetchers don't= > run into the next page. Hmm, it would be a pity to require order 5 even. Earlier in the thread someone said that 52 KiB were enough, if that's confirmed we could keep order 4 and have guard pages. Paolo --EiEErHlsVq3Kvh15TgSP0QrNuH9Tf3iFe--