Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4795425ooa; Tue, 14 Aug 2018 10:39:25 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwygFcYd1T+N8TaeHrAKeA7bjQ9XZt3tqgh8/9ef1PEPMsoDeNXI5BbsAYrQXSFrc9n1h/e X-Received: by 2002:a63:4d06:: with SMTP id a6-v6mr21742832pgb.408.1534268365906; Tue, 14 Aug 2018 10:39:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534268365; cv=none; d=google.com; s=arc-20160816; b=G/9p3WaTQfND5vgZt3wNkPZHBRkK+jG1eq3t1E39DFNPmIzDDE8oUgdr6ONEEx1nHz h9IPjUrfC9fjfuHjt3LSjYzNAJnG+0rw+UyjZL8jtsmZWlvUrl+inWsZkKaPxyMe33OX AoMBUYEzlKogzNhN6PEFIXfvErTcrkqsDN3PxHwQ7VY7vcD6THw1drz62IqZU0/GUUiU xymg39YK/v+M3y5xoIAa3z5yuzZwGUR4cT9d/Iq0pMRS0LEa7KPcnxW2GS3OaWNvD43Z C4BgHJ5ow/NXpMLmq1NsuegtEo7lPBCAkgqckxvt5EC36ErX+Qa0fJ1uHBn2WxJoJMo4 E2cw== 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=5XqxLjYP/REDHFvzAT0/ziEnQ2ty69JF2QJdkpwRvYo=; b=1HNiuwJRrcB9LWSe1UNadex/pEjcJpyIdfNDkYHLWnQOrcrw9+TGd2nzVFmskUeE11 S4ELA6ciOGFEcR3KCTUOhHycVbb3WvDtCxIYeEyqMjH3FfdrcSEuIlUOn0IGuq1bnPSA bfh+7r4qLH2tHxx0HHy/Tk5kdy4gkOESNIPR2+ZgiOsMHxxBr2nw8neczkBtTfYyttK6 nTjHRuRfsdRvddQ7RFfFmY4OY/XlCGU9jQXQ70Ase8uaMdhYDWF8ynngALQv4f0ruA1X X04QqcaR1AL3L5UlbAasL0MVMRpHUK4o91y6wThhtpJyULdJ+6oWd/XShWngLbDG0J3I RvPA== 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 g12-v6si16198084pla.403.2018.08.14.10.39.10; Tue, 14 Aug 2018 10:39:25 -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 S1732761AbeHNU0d (ORCPT + 99 others); Tue, 14 Aug 2018 16:26:33 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58320 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728301AbeHNU0c (ORCPT ); Tue, 14 Aug 2018 16:26:32 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 812D4D65; Tue, 14 Aug 2018 17:38:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Kleen , Thomas Gleixner Subject: [PATCH 4.14 099/104] x86/speculation/l1tf: Invert all not present mappings Date: Tue, 14 Aug 2018 19:17:53 +0200 Message-Id: <20180814171521.494993335@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171515.270692185@linuxfoundation.org> References: <20180814171515.270692185@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.14-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: 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. */