From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com ([134.134.136.20]:55949 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727633AbeHWTQy (ORCPT ); Thu, 23 Aug 2018 15:16:54 -0400 Date: Thu, 23 Aug 2018 08:44:37 -0700 From: Andi Kleen To: Vlastimil Babka Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds , Dave Hansen , Michal Hocko , stable@vger.kernel.org, Christopher Snowhill , George Anchev Subject: Re: [PATCH] x86/speculation/l1tf: fix off-by-one error when warning that system has too much RAM Message-ID: <20180823154437.GC12066@tassilo.jf.intel.com> References: <20180823134418.17008-1-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180823134418.17008-1-vbabka@suse.cz> Sender: stable-owner@vger.kernel.org List-ID: On Thu, Aug 23, 2018 at 03:44:18PM +0200, Vlastimil Babka wrote: > Two users have reported [1] that they have an "extremely unlikely" system > with more than MAX_PA/2 memory and L1TF mitigation is not effective. In fact > it's a CPU with 36bits phys limit (64GB) and 32GB memory, but due to holes > in the e820 map, the main region is almost 500MB over the 32GB limit: Ah I see it's a client part with very large DIMMs and someone being very brave and using that much memory without ECC. > > [ 0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000081effffff] usable > > Suggestions to use 'mem=32G' to prefer L1TF mitigation while losing the 500MB > revealed, that there's an off-by-one error in the check in > l1tf_select_mitigation(). l1tf_pfn_limit() returns the last usable pfn > (inclusive), but it's more common and hopefully less error-prone to return the > first pfn that's over limit, so this patch changes that and updates the other > callers. I can see the off by one, but does it really cause the user's problem? They will be still over the limit in any case, with or without off-by-one. So the description has nothing to do with the fix. Or do I miss something? -Andi