Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4807345ooa; Tue, 14 Aug 2018 10:49:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz/BvXsvJL13FejthkkKBB0ryfLK0Ri0EpqdiYdzzQ1bhs1WJWkSXsAMPkt3SvKd0BOwOkB X-Received: by 2002:a17:902:6501:: with SMTP id b1-v6mr21372431plk.31.1534268976538; Tue, 14 Aug 2018 10:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534268976; cv=none; d=google.com; s=arc-20160816; b=Z2Xf/92kfWS+DmNgilNHjg3d/spinWigsmxhqG8oSU6ljiP02pthJ5yaEq71a40XYu dVG7EuccYLkbgmLA0VqT+XHDK/LLvOlQo0Q6Sm7YoGNLNDaERmiYWKi2T6qWXKPuf8Gt spkjcbKddeBtxpIw++sMRikizpVGI2Kv8N1Ru4zHBSm1OMbjUKPltDlSJWDmL9YD1+qy DHqU26NYrfeV8pYdPxrAEALfHTOCC1URF70nzulbheLnK9Sg8yprNcDYF4B6v6de46T6 YK4WnjNjETTjcBUm0UtzQFT0MkbQ5Bh9TM7M82F6u9Hvngi2MuSVaIfKofPEOGA0w0a6 cWeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+vCR5E6lTjWh8kpZWEPIFKBuFvURS5axPB9BjNCvN2c=; b=KRR299amFfHH3thSG9wo5l7r8ILfzmAZn8Bz7fvaLldc+o5L05VL8bb/qCl1YVPjS3 /CTgFL9e8z3XFh9Wp4GpIRxlqv8C4ELMGz8OMH0nBW2iB223aSg3zuqgAimyV3xzFb6y Rcrn2AJXb+soGKe4cwrSH32Qpi2MWhSlEK1eb1cIw2Bwm16zhsndw7MFpUAgODmurzal m1cfIFtRK2JIlzE82Q/pI7YKdaJ5M11aweogoxuJ4tkPG0+6wm9KTDR11aqjEQau4nSI u4hDEcNDBdYSirAVcC6giY0Q4U0ziqvTfxmXlNCL7LbXpr3mK816713FDHvja1P4sPE6 JNUg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si17593930pgp.469.2018.08.14.10.49.21; Tue, 14 Aug 2018 10:49:36 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391284AbeHNUgV (ORCPT + 99 others); Tue, 14 Aug 2018 16:36:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:32932 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390872AbeHNUgU (ORCPT ); Tue, 14 Aug 2018 16:36:20 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E1D6DC8D; Tue, 14 Aug 2018 17:48:07 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Thomas Gleixner , David Woodhouse , Guenter Roeck Subject: [PATCH 4.4 39/43] x86/speculation/l1tf: Invert all not present mappings Date: Tue, 14 Aug 2018 19:18:15 +0200 Message-Id: <20180814171519.636218399@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171517.014285600@linuxfoundation.org> References: <20180814171517.014285600@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andi Kleen commit f22cc87f6c1f771b57c407555cfefd811cdd9507 upstream For kernel mappings PAGE_PROTNONE is not necessarily set for a non present mapping, but the inversion logic explicitely checks for !PRESENT and PROT_NONE. Remove the PROT_NONE check and make the inversion unconditional for all not present mappings. Signed-off-by: Andi Kleen Signed-off-by: Thomas Gleixner Signed-off-by: David Woodhouse Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/pgtable-invert.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/include/asm/pgtable-invert.h +++ b/arch/x86/include/asm/pgtable-invert.h @@ -6,7 +6,7 @@ static inline bool __pte_needs_invert(u64 val) { - return (val & (_PAGE_PRESENT|_PAGE_PROTNONE)) == _PAGE_PROTNONE; + return !(val & _PAGE_PRESENT); } /* Get a mask to xor with the page table entry to get the correct pfn. */