Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1284762lql; Tue, 12 Mar 2024 12:23:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZyR5yht9J5nrdbM4gvpZwlm2ypWEbp3QD/bsaNx7tGZY1PKBkrqeHVgyXBRf5sTxlIOmnOXwERxl+o0aUfTOZV40QgzkqP4O8o304Iw== X-Google-Smtp-Source: AGHT+IEvV2gwskxgdl10cTkwvo4E8UF/LX9emPGk7pu27fgcbmB+iVYNQK4Lfjh8TV4LNiM5vBuj X-Received: by 2002:a0d:dbc3:0:b0:60a:559e:8c93 with SMTP id d186-20020a0ddbc3000000b0060a559e8c93mr437122ywe.33.1710271394360; Tue, 12 Mar 2024 12:23:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710271394; cv=pass; d=google.com; s=arc-20160816; b=A9L3C/EUr0J6vMI/kZy6Sx0ZGnpD3tj1rCmQiVrx5xsEYc4K+VTFW6T267D2H5Q1G5 nsSiqW9v0YUjqAMZki0plg76tGd0Nsdd77L6+yG4DIvSxCn/BMlcfR59V5rDCZtl6fgh zq2bysG8QCscutV08DXg1AZaRA4XM3hrhoVgS5tYUYC+LmP/TMgX+ZP02kRV48EAJmyZ 5NbozJwshTVUNGWDOCAsXtIfq1IZedQOE3DaQYFZwnc/IN47lgYCV9FrQvHAIKhqXwQF 5IddrwHdQhj5YosPyjlfiv3uxQWqXvat3f2bijNUST0Jo+r8LI4MThb106EM70D6ES0m ULSw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hOqhR5v2VNSn/TDffh5ABY/7jmiPiJOXuY0ZoZRPkdY=; fh=UXJmbMunBXfSw/avGaaqXYSfxuEqdBt9dpne8XG/yh0=; b=ggk20+91gnGxjQ/v1m3nVxeX7JyTTinXQLpMj/Tfm2W6jl8OTaeGfo4J9kHCTLfsOJ F67so4mx08gaSyL66A8rFcI7I+WJPKTtucGv7PvELc4ZrcVvLrMBOROKKDZv3ktevO2B OLPr+F/nVwNHcYKBknUDuPwPYjSdNpJEIGABqNQjd4Wyqq8h2mMsWyTdLcPYqcqH0mr0 tiFlwnYzd08peD8ARMY6U22gs3UYCUKqHZ70umTH9/bBuISe1NAuyyv+j5SH6EgAuPfT Wb7E1fVFyyhShBVR8zX9wPSaXnkNAwfHHGzpQHHYqze3c2qsB78VYEVMVGepOcAVJ9EH 03CQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Kc6QvLyI; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100706-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 l6-20020a05622a050600b0042ef7a1dd98si8112767qtx.240.2024.03.12.12.23.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 12:23:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100706-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=@infradead.org header.s=casper.20170209 header.b=Kc6QvLyI; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100706-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100706-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 165781C21E50 for ; Tue, 12 Mar 2024 19:23:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9882714264A; Tue, 12 Mar 2024 19:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Kc6QvLyI" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 26FCB139584 for ; Tue, 12 Mar 2024 19:23:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710271383; cv=none; b=PzM8dGMO3sGnyAtI7HUsdleSsP725yYgO0biHIQt8HS6sKIC7oV3TvzY/sTHRS2Rwhbiy/a5vjiikb9n7Rno2ctmGuAGXkZcFRjUKx4HHp8F/EpZndV18BC4fgmZYegy7ifv0RRZj8YOcVFWUYQHJoDsL3dlPb9OV62zeXnjRBg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710271383; c=relaxed/simple; bh=wGe4NtRVvq65gwI+YLU+QcE40ieDr/r4U/4hul+164M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lvQuJdS3C06j8iIEs/ITR7ngrtvSgqgmNcRdLKn1KSAy6gqCFOu2MewO/YAV57/Vzdkhj4RoY+chGkogMuda2+r4EQu0PQWxYMhJawxQu4ND52BL42jUMRwUYwsighsbq+i1QYzogSGcv6AWHg30Vep0GiMBsiyCqBUbrnEvU5Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Kc6QvLyI; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=hOqhR5v2VNSn/TDffh5ABY/7jmiPiJOXuY0ZoZRPkdY=; b=Kc6QvLyI32dNT8583+E0evpKxC P3MEsW7OzbyTuRmIglSx1a0xMyy5smgbQDiCws+YwaPWLa1jyaqLkYiFJQy18SwzLHrwMLfaHjuHs Vux4YUNU9xYpCeflwFEteBcqMrs1q/zxhPOS5Tob/5NgA/nE5YrIHNYw4AcTw311qXnqx9e6HCFBK sjYnpKt6GwaLk5aJDKXpO3HboZffKmLHVKAhDM17dmeXO7UfUFyRQ7Ad0JkMZvU2umSGf5TmsJ7cg PMciUfgrqDpV0CbPl1tjrMh26aUqeTDLwPjeNc4MkNuB8UAvHcE7P+FbRX2mdotJqMPdbLnzAwyOr RjZCNNfQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk7iC-00000003j7D-0qvF; Tue, 12 Mar 2024 19:22:56 +0000 Date: Tue, 12 Mar 2024 19:22:56 +0000 From: Matthew Wilcox To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, Wupeng Ma , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrew Morton Subject: Re: [PATCH v1] x86/mm/pat: fix VM_PAT handling in COW mappings Message-ID: References: <20240312181118.318701-1-david@redhat.com> 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-Disposition: inline In-Reply-To: <20240312181118.318701-1-david@redhat.com> On Tue, Mar 12, 2024 at 07:11:18PM +0100, 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. I guess the first question is: Why do we want to support COW mappings of VM_PAT areas? What breaks if we just disallow it?