From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com ([192.55.52.88]) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fQZE1-0000Bj-3d for speck@linutronix.de; Wed, 06 Jun 2018 16:15:45 +0200 Subject: [MODERATED] Re: [PATCH 1/2] L1TF KVM 1 References: <20180529194214.2600-1-pbonzini@redhat.com> <20180529194236.EDB8561100@crypto-ml.lab.linutronix.de> <269d6873-c5b4-d1c8-425f-9305e4594e46@linux.intel.com> From: Dave Hansen Message-ID: <59fbb9c2-2b23-d607-0809-77acc46b8f8a@intel.com> Date: Wed, 6 Jun 2018 07:15:41 -0700 MIME-Version: 1.0 In-Reply-To: <269d6873-c5b4-d1c8-425f-9305e4594e46@linux.intel.com> Content-Type: multipart/mixed; boundary="AoKMzPB1ncFYmdRwMv4FmBwdk5qnC8A7t"; protected-headers="v1" To: speck@linutronix.de List-ID: This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) --AoKMzPB1ncFYmdRwMv4FmBwdk5qnC8A7t Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable > r =3D -ENOMEM; > + page =3D alloc_pages(GFP_ATOMIC, L1D_CACHE_ORDER); > + if (!page) > + goto out; > + empty_zero_pages =3D page_address(page); > + Couple more things: PAGE_SIZE< +void kvm_l1d_flush(void) > +{ > + asm volatile( > + "movq %0, %%rax\n\t" > + "leaq 65536(%0), %%rdx\n\t" > + "11: \n\t" =2E.. So we probably want the allocation to be something like: l1d_clear_buf_size =3D PAGE_SIZE << (L1D_CACHE_ORDER+1) + 2 * PAGE_SIZE; alloc_pages_exact(l1d_clear_buf_size, GFP_ZERO|GFP_ATOMIC); Note that we need GFP_ZERO because we could theoretically get a page that already had kernel secrets in it. --AoKMzPB1ncFYmdRwMv4FmBwdk5qnC8A7t--