Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4805171ooa; Tue, 14 Aug 2018 10:47:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxs76fMV2UZcgAi+TNdndc/FNtbvGYya9Ds2DT/yYJtPFQJUbTnr8ohjpN6sMR0wl5YFVcw X-Received: by 2002:a62:4fd9:: with SMTP id f86-v6mr24119069pfj.110.1534268855070; Tue, 14 Aug 2018 10:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534268855; cv=none; d=google.com; s=arc-20160816; b=k+IjgNNQsQwCTz/H3VEqWIaWDjZl2vcrXcCW8mrcZIr0o2nfxcYOuP/Jf3Zdzb8hRk S1D/rold5HOH2Kl6fajQT2EnZE1lKhhqX4oWzOmvJKEro9UhGrwYx9ZDhGElygJ/2Qjl XBqkVqw4MMJgtKis9FBkoUI6EVAJFV2bBLKK9AsYvWCYjlE+uaGzmZvUZrc96Oxga9uJ Wyy5Ypc+y+9X7k1JWHIeBsENdyrdKNx7EezEIfSVcbYBNzXeBN192+WWv4mBNLX5ZLNs zo2MSb6Nidmo3MxpLUOVe2HqVuXQbSweR0EGnc4RAKJR8lqOxhbzl8gurhqNnCII/9Y9 JXQA== 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=MuYwmJIrRUyzv9mxleeHZfZLZf/PC37abnkuTbVnDi4=; b=sXzGd8LPaho4snZPpKC4rI4kDs4IDYBNXahWsT75MNUjA9jhHdPDZAUu7avIKn5BLM DpX/0i6bDyHMrxncl6YK3mwllwgQ3lNtn5IKJ13pZ4mhnoMxqMsCR2B7OwCidm7+fB6b ifnPLTqiPOWnNuiUcqVTjnsHhbaGzt7jwn0H9HKrD/CHWjKrqPzaSUFY5VYc36XESm50 Wq+g1qg/UejKC3HewsEVW2BwgMyUJa/Vo120Hb+8AyGmjHa2K1eGURudaoEbafMrQ8UW MQrFcUxjNQZOlg1VQkcSKnn/EnfW0UHx7O5Kru09kw2gST3j85m9jzX8Za5EA7M+zMLc U83w== 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 b34-v6si16718653pla.84.2018.08.14.10.47.20; Tue, 14 Aug 2018 10:47:35 -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 S2390954AbeHNUdy (ORCPT + 99 others); Tue, 14 Aug 2018 16:33:54 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60276 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388101AbeHNUdx (ORCPT ); Tue, 14 Aug 2018 16:33:53 -0400 Received: from localhost (unknown [194.244.16.108]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 931FFCAE; Tue, 14 Aug 2018 17:45:41 +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 Subject: [PATCH 4.9 101/107] x86/speculation/l1tf: Invert all not present mappings Date: Tue, 14 Aug 2018 19:18:04 +0200 Message-Id: <20180814171526.880435156@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180814171520.883143803@linuxfoundation.org> References: <20180814171520.883143803@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.9-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: 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. */