Return-path: Received: from mx2.suse.de ([195.135.220.15]) by Galois.linutronix.de with esmtps (TLS1.0:DHE_RSA_CAMELLIA_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fEazJ-0004Yx-NW for speck@linutronix.de; Fri, 04 May 2018 15:43:05 +0200 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 81811AC81 for ; Fri, 4 May 2018 13:43:00 +0000 (UTC) Date: Fri, 4 May 2018 15:43:00 +0200 From: Michal Hocko Subject: [MODERATED] Re: [PATCH 7/8] L1TFv3 5 Message-ID: <20180504134300.GU4535@dhcp22.suse.cz> References: <9422c9bcd3e664ce0f3a5eeadd45fa9127e0b5ba.1525403858.git.ak@linux.intel.com> MIME-Version: 1.0 In-Reply-To: <9422c9bcd3e664ce0f3a5eeadd45fa9127e0b5ba.1525403858.git.ak@linux.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Thu 03-05-18 20:23:28, speck for Andi Kleen wrote: > From: Andi Kleen > Subject: x86, l1tf: Limit swap file size to MAX_PA/2 > > For the L1TF workaround we want to limit the swap file size to below > MAX_PA/2, so that the higher bits of the swap offset inverted never > point to valid memory. > > Add a way for the architecture to override the swap file > size check in swapfile.c and add a x86 specific max swapfile check > function that enforces that limit. > > The check is only enabled if the CPU is vulnerable to L1TF. > > In VMs with 42bit MAX_PA the typical limit is 2TB now, > on a native system with 46bit PA it is 32TB. The limit > is only per individual swap file, so it's always possible > to exceed these limits with multiple swap files or > partitions. > > Signed-off-by: Andi Kleen Acked-by: Michal Hocko still applies. Just in case the previous post got lost in the noise I repeat that I would prefer if we issued pr_want about truncated swap file. It is quite a stretch to expect such a large swap storage but let's keep users aware of the fact just in case. -- Michal Hocko SUSE Labs