Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1835361imm; Thu, 23 Aug 2018 09:30:40 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxQD7v777uugAHbSK+kMi0wNbf4FE+rBlGl0XO6ql8v7eYprfplFxk2hkainA72i0tA63r9 X-Received: by 2002:a17:902:6808:: with SMTP id h8-v6mr15650816plk.27.1535041840859; Thu, 23 Aug 2018 09:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535041840; cv=none; d=google.com; s=arc-20160816; b=DCvR3MyJ55BnE1IIetZaDsZmp1pYlEbPKw8CmsT1Itk6fUXa0X3s2SUCfzNUsZLCAU Bgvid4vHpOdBbPiFEl/z/Zc44lbBtonrzsoRpEHDyNkCKIdxTrxZWAsHg+UtwyeRqhiz io3pAPSWhmBTpkFpYt+mzF4zmsCWYwEbnl34PQizpaGmZaZg3tErXjBCAnLgR/5s79OG eW1+wO6DamYTVnNd2V7kZoNDAUxuZ7gMqA/5yZE/RBe+UaE6SeAbXcZ3imrtW+IJkYAu y73DgxLGiegiMoWi0MDOElSBxxa8SGSm0vVAGCHgg5FFT5rxi7/wMvXy55FWpq3ve5ZS 4rZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=G1mJ4QQem5K6fBvdseHBQ/z4RYdxOe7aYpjG+t70R6Y=; b=pa4UceMte9A++vSwp5tDyMnQ9k3ByNGC1qmyQM5uqJvlNATq0d7p7qwkwKi9iZfXFN Ovqa7+m5WCepx/qmIn7P9thbBvcT48tTHPsZ5ACDazuMOTKvG/a8soEklbR+yn1YFaCj +eMRx4JA6CUFzL7EQZoc+4GJvpkwTIIlphVhMKptft80ycXTDD4AYpxhnUVd1uA1lKJ4 2inaUkeZulNWyYjlFl4vnwYtddk47Nv0PoZEggPQW7Tw/lGx4ql4RYw67Z05c3mVHWKv +M3DxPCNXCog7YAzcU0A9gUOFSiVyP9UOSHOn3ozVLw3aKd1zFqAeG0swSKKXmFpbWF/ FZvg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n72-v6si5195410pfk.14.2018.08.23.09.30.24; Thu, 23 Aug 2018 09:30:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728295AbeHWTQy (ORCPT + 99 others); Thu, 23 Aug 2018 15:16:54 -0400 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 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Aug 2018 08:46:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,278,1531810800"; d="scan'208";a="79522840" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by fmsmga002.fm.intel.com with ESMTP; 23 Aug 2018 08:44:37 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 5B8E0301B91; Thu, 23 Aug 2018 08:44:37 -0700 (PDT) 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> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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