Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2415482imm; Mon, 10 Sep 2018 00:18:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZKD0ohOv/jZuhmkVKYS4CSJoRDz1YuTuRSJz8mo4Jq/dl+XCUE7jiD+n14nyCUcE/AULto X-Received: by 2002:a17:902:2e83:: with SMTP id r3-v6mr20394107plb.80.1536563888125; Mon, 10 Sep 2018 00:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536563888; cv=none; d=google.com; s=arc-20160816; b=lp0++psyfOB7sixRLuciEVR1YNP7ADXLPRdnEShCezWIcoIwoepRFebuAcxNePmn3c Sk6swrlQZmX5Gx5ttUex/+L6BR3/gbjhLtp3MgErIq62zBoanx9aMok7VXXpxAVyFMPZ l6ISIUFGjNXq1NUAz+wzWv9dBHO9hEgPHufsZXdOWr2FOad9mGNAfqImg8Os4uW89Ttm 6ivAbQMXuZbVM+1kLprGUguFhgPdl062LG7VU9fd74ElKZdMlABmUlRNLuxNsxy8gB6t 6dZcYI7va2Nhp0eNtXvW03lKBqM1VyeQm4uy1Pb8ePee4iGy/WqAAUdjKdSrKl9Qh6V5 q1Cg== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=6VIcd9eeT5HuZ+JXG53fAloOOTSgf+HNxXr9xTVSNBY=; b=W2C1ddqCC2dfnpA07yw0T04DdJDILH+ItG8oeym8vRryJLEe+OyeOwTem8boa/d/3X VvIW3t1FmYxLRuZM7TIJQj55C9N5+JgpHlZ1zBscOmgnby43cF/I0oaN3PXj3QoodINU xFResWfXGJTKnaSpCcsw6PYP8p+FGwxkpJm+ixlNA7gWGMYNslob5rIBHpm5jQil2JWE RcaSP40Wafmc6X6dsVHKvzOnA1wQq59hGPF2TaQPokA/f7EtpTX8AyTmYQ9YPDA311Mc +8nvqjfHN+RawVQFFaimT4+CdM2L07Mb3kdLdPbz3g8B/4AVeJccFxY9ztiAHerNYXWL V/iQ== 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 a8-v6si17610595pgm.201.2018.09.10.00.17.52; Mon, 10 Sep 2018 00:18:08 -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 S1727803AbeIJMJJ (ORCPT + 99 others); Mon, 10 Sep 2018 08:09:09 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59606 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbeIJMJI (ORCPT ); Mon, 10 Sep 2018 08:09:08 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 01D41CAB; Mon, 10 Sep 2018 07:16:31 +0000 (UTC) Date: Mon, 10 Sep 2018 09:16:29 +0200 From: Greg Kroah-Hartman To: Guenter Roeck Cc: Ben Hutchings , David Woodhouse , Michal Hocko , stable@vger.kernel.org, Andi Kleen , Thomas Gleixner , LKML Subject: Re: [PATCH 4.4 41/43] x86/mm/pat: Make set_memory_np() L1TF safe Message-ID: <20180910071629.GA21671@kroah.com> References: <20180814171517.014285600@linuxfoundation.org> <20180814171519.769320295@linuxfoundation.org> <1536511561.3024.115.camel@codethink.co.uk> <5438e0f8-f5e0-99ef-fbdd-b5f4a079f254@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5438e0f8-f5e0-99ef-fbdd-b5f4a079f254@roeck-us.net> 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 Sun, Sep 09, 2018 at 10:06:06AM -0700, Guenter Roeck wrote: > On 09/09/2018 09:46 AM, Ben Hutchings wrote: > > On Tue, 2018-08-14 at 19:18 +0200, Greg Kroah-Hartman wrote: > > > 4.4-stable review patch.??If anyone has any objections, please let me know. > > > > > > ------------------ > > > > > > From: Andi Kleen > > > > > > commit 958f79b9ee55dfaf00c8106ed1c22a2919e0028b upstream > > [...] > > > --- a/arch/x86/include/asm/pgtable.h > > > +++ b/arch/x86/include/asm/pgtable.h > > > @@ -378,12 +378,39 @@ static inline pmd_t pfn_pmd(unsigned lon > > > > ? return __pmd(pfn | massage_pgprot(pgprot)); > > > ?} > > > +static inline pud_t pfn_pud(unsigned long page_nr, pgprot_t pgprot) > > > +{ > > > + phys_addr_t pfn = page_nr << PAGE_SHIFT; > > > + pfn ^= protnone_mask(pgprot_val(pgprot)); > > > + pfn &= PHYSICAL_PUD_PAGE_MASK; > > > + return __pud(pfn | massage_pgprot(pgprot)); > > > +} > > [...] > > > > This (and the backport to 4.9) are missing the fix from commit > > e14d7dfb41f5 "x86/speculation/l1tf: Fix up pte->pfn conversion for > > PAE", as that was applied earlier in the series.??But since PAE implies > > only 3-level paging I don't know how the PUD functions get used or > > whether this actually matters. > > > Excellent find. > > e14d7dfb41f5 (re-)applies cleanly to both 4.4.y and 4.9.y. Since most of its > changes are already applied, the only remaining change is > > diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h > index c535012bdb56..5736306bdaab 100644 > --- a/arch/x86/include/asm/pgtable.h > +++ b/arch/x86/include/asm/pgtable.h > @@ -420,7 +420,7 @@ static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot) > > static inline pud_t pfn_pud(unsigned long page_nr, pgprot_t pgprot) > { > - phys_addr_t pfn = page_nr << PAGE_SHIFT; > + phys_addr_t pfn = (phys_addr_t)page_nr << PAGE_SHIFT; > pfn ^= protnone_mask(pgprot_val(pgprot)); > pfn &= PHYSICAL_PUD_PAGE_MASK; > return __pud(pfn | massage_pgprot(pgprot)); > > after cherry-picking it into both branches. > > I think we should re-apply it to both 4.4.y and 4.9.y be on the safe side. Thanks for finding and figuring out the fix. Now queued up to both trees. greg k-h