Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4783880ooa; Tue, 14 Aug 2018 10:29:55 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxP/bq+0FhMqQ0+zww9QKnz3jJSYsFkBZSrMMe+0Fkql2jT0LjWvboKnCMix5f9tJoWT5lo X-Received: by 2002:a17:902:9b93:: with SMTP id y19-v6mr16945022plp.113.1534267795919; Tue, 14 Aug 2018 10:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534267795; cv=none; d=google.com; s=arc-20160816; b=ervp07jxACr2M1DkoiVd8oRQ76WiS7wpUAVfDsCVuSyLM9lKQL0y5FlpUbX2x3g9Xf r0ePePHS6e2X+Qo7h76jVYXUnCmU3DVtq8u8FKit+UjLs2ALtMB6jIBwmo6kg0STCWxb qT5qAtLP3UOIvaEESykoyH4uJO7rO+I9UN5tfES05Q6ia8oaLMmRK8hX29wu0E+fRVJE jxejdONo+biWNjpnICsrg97/Z25avYvTt9/dLVapZ9InYN7is50ZmTaKeeHDtj5EQTsk pjWA7m+Ce7KifPlJVj62nuyQ/hikE+2D8xrkdWWTK61SBV5YOPJueA2lQneT9tdPaT6v v6dA== 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=Xz4DQJMR/CoV5ZI20vIPIpN78qWd5qOhWTdwYMa7LBI=; b=vIoL7kmlXX7Nyh8uzRxhwugpjgl3WI/li1t3u3oJysKLHVzgU8bpX4ha/m0mcO14jl 9NNZoC2amq5Etm7d4/+yydDn6Iv5jpvE4gcjOpwAu8EkEuluLGhxCZZlzwfoqzFUxKr8 VMrfHbdCszYOcgLujMkMyX1BH/d4OckeLU5aAvYofXkkY0+yCtacHG7GeeP/NyjkXogp +WjWmlWMU77p+7RNz5m/87Lxs835dJ1fuICnLyxfTPpBJiq+aQcp5XZzrwNl+P67quXe D8hYT3n/qdisd2pnaxUJpRuaSh2wBeHSQ85Izrtyja1pNOH089nmaDBjMBMAqU3gbYLp RdTw== 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 o123-v6si21799615pgo.190.2018.08.14.10.29.41; Tue, 14 Aug 2018 10:29:55 -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 S2388858AbeHNUQH (ORCPT + 99 others); Tue, 14 Aug 2018 16:16:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52568 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387825AbeHNUQG (ORCPT ); Tue, 14 Aug 2018 16:16:06 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7B157BDB; Tue, 14 Aug 2018 17:27:59 +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.18 74/79] x86/speculation/l1tf: Invert all not present mappings Date: Tue, 14 Aug 2018 19:17:33 +0200 Message-Id: <20180814171340.982719980@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171336.799314117@linuxfoundation.org> References: <20180814171336.799314117@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andi Kleen 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. */