Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp3001320lqz; Wed, 3 Apr 2024 15:13:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWg1MvLw8ArPAU9Qy4uIsnOe/VbG00Lx8XcJTncOHC+ubAKC82PiblPel5Qa84mWXUXAKwysBafoSCBLgEgtS9lUuYqkoLbi8eoszQ7eg== X-Google-Smtp-Source: AGHT+IHd8ZSx9i+C1saR8neIFFyX5+Tvj/LlJYhqHTP1+i3wRQP3hXayUu71KYJGCAIVyRzOpWvx X-Received: by 2002:a67:f7c6:0:b0:476:334:4992 with SMTP id a6-20020a67f7c6000000b0047603344992mr716550vsp.15.1712182415143; Wed, 03 Apr 2024 15:13:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712182415; cv=pass; d=google.com; s=arc-20160816; b=zTv8ZqfLqkei+HVKgKIO+mylfdr1PGKFtBh9ErOuij40k8BdDvRIg8LFyL5JOS2XUE nMerbCtYKIxrnaZk1k1d8atBK50eIY/ZP/hQdIMPE6Y7uUp82FRF6SlAFmd8wBFHe91+ QHrkl0eShb4tCz1eitHYp8f8zD8Mpqa3L0SA0P5097Gmlg7w1p/DyRB95CMtJ33dQPWX yb//5Qayt0FL68rCrB65bMEUdkw+bWPa8XWxyqjBEOCqfImlVBlEwlowghTlDaD5eKN3 sCKBdGLdkw3fSLDr8RQYAirBMbqhg+dMFgMMO2F88NNY5qLtFOjMA0hRohpgl3eZh9Hy YkYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=p4kt+v4TbKXZay9UQorIdkoHH9iAVV3wYiy/0481fLQ=; fh=NQtpIpYmOsnIbhkCOixpK4MaSOleio293cycynjavkY=; b=kVDMR5px+4tXa3emoUsqkjyXPM4Fw8IgKQq8peM5Lm2s+giTFcUVnyEP4xtGV4LSLg DQL9XtsWwbD+BfZJbEg8LXn8ok838pfmBfnvOEy4QTm1D6Ge1e/tSFNmC8g2txI7OKiT 6iMkrT7of9ksdT1wxDSYRhdGXk9ZhPey+x7XXHogC4nRJkQiEvsDxH5JqGK1zRpd49qs bQThTxFFKTyOwb9hSHuXGXd56a+K687rKlMnSOgKtrRcI80G7g1jxupBDklJ324YtKWO etkQTi/R0QSSy+ZlNC0nhmREbjb94j++J+KAjZw4xHfzUjDsaxFtnbgvCl/ERV/iCS+n /eWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="KfvaZ5i/"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-130670-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130670-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id w13-20020a0cf70d000000b0069614edd5a4si4551548qvn.535.2024.04.03.15.13.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 15:13:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-130670-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="KfvaZ5i/"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-130670-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-130670-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5D0921C23D26 for ; Wed, 3 Apr 2024 22:13:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF9EE15698F; Wed, 3 Apr 2024 22:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="KfvaZ5i/" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D513415697B for ; Wed, 3 Apr 2024 22:12:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712182370; cv=none; b=l3RSAWXkb5oK26hMeudE6fgnSBZVxuNp9U5VDUY0pFXoumJoZ9+MkN2UamCwv52oZ8Hs8l138F5zubCPaHSDg5pQVvN8+ybkx+xX8f2mCgDdQyYkf4AAcqa2jxMh7jDpPLd9SesK1X2VfcNPq7KC9z9ED8/5gdCrIxtYiwK3XFM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712182370; c=relaxed/simple; bh=roWU9RuueugFHJ+VZi2kPiMpLoS/48KqVlv8GvhGgkg=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=UH47b9FuUZm3F9/46wC4dQ3MsClkyiX+d31k+mY4CF4mAUkbI/KYLzwm59Q6MB/Z/E4iBbA5W0zD2gBG0Su30HhYajCYuWonUp9XoecLoDtxo9Ny3RPzDboiIgH7DNvbEbErNBY1pF3GUk+nAkPY0MaQjNEMVFY234ltR2//HNs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=KfvaZ5i/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05C35C433C7; Wed, 3 Apr 2024 22:12:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1712182370; bh=roWU9RuueugFHJ+VZi2kPiMpLoS/48KqVlv8GvhGgkg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KfvaZ5i/irPWoKLIwbxSJu5us9boUGd7c13hto//1WOxmJEBxAS0AHDzhUhL/sKvw 7tt34LuWK1rREpZXtS6Z5AaufOT+N8BOh+ulQg2dWe+a4271x3hOIcsFabHeQhOpTa tGhWU8H4JNBLo9e07aKh0zpuH7Ag1zXDrJNIbmtI= Date: Wed, 3 Apr 2024 15:12:49 -0700 From: Andrew Morton To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Christoph Hellwig , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Dave Hansen , Fei Li , Nathan Chancellor , Wupeng Ma , Ingo Molnar Subject: Re: [PATCH v2 2/3] x86/mm/pat: fix VM_PAT handling in COW mappings Message-Id: <20240403151249.0f4fc5b4f8c07630fbbb6338@linux-foundation.org> In-Reply-To: <20240403212131.929421-3-david@redhat.com> References: <20240403212131.929421-1-david@redhat.com> <20240403212131.929421-3-david@redhat.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 3 Apr 2024 23:21:30 +0200 David Hildenbrand wrote: > PAT handling won't do the right thing in COW mappings: the first PTE > (or, in fact, all PTEs) can be replaced during write faults to point at > anon folios. Reliably recovering the correct PFN and cachemode using > follow_phys() from PTEs will not work in COW mappings. > > ... > > Reported-by: Wupeng Ma > Closes: https://lkml.kernel.org/r/20240227122814.3781907-1-mawupeng1@huawei.com > Fixes: b1a86e15dc03 ("x86, pat: remove the dependency on 'vm_pgoff' in track/untrack pfn vma routines") > Fixes: 5899329b1910 ("x86: PAT: implement track/untrack of pfnmap regions for x86 - v3") These are really old. Should we backport this?