From patchwork Wed Apr 3 21:21:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 13616711 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE1F1CD1297 for ; Wed, 3 Apr 2024 21:21:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 598886B0092; Wed, 3 Apr 2024 17:21:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 520C56B0093; Wed, 3 Apr 2024 17:21:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D85C6B0095; Wed, 3 Apr 2024 17:21:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0965C6B0092 for ; Wed, 3 Apr 2024 17:21:51 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id BF98E160131 for ; Wed, 3 Apr 2024 21:21:50 +0000 (UTC) X-FDA: 81969492780.15.64E086B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf23.hostedemail.com (Postfix) with ESMTP id A7ECE140013 for ; Wed, 3 Apr 2024 21:21:47 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SI2nRORY; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712179307; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=FBBcDMAj2JPHjs8hqyTFLFBiCM24FpZuuFwCRwuga2E=; b=YxW9/LWJSQciBEiWyw+SjRHH/VoTHrHFYEUE+2CROrUkFKCjOIEomT6Kj33er0rOVuI6nP Y1l2uSUn0fJ1JqColL3AysBLd+8jhACjyE/LOiGS/mg6HO3791ylBxZA1CHxDjcYWULwNM IZt4QWbMogu6E+sLqotXA4PhWhtNmQg= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=SI2nRORY; spf=pass (imf23.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712179307; a=rsa-sha256; cv=none; b=v6hZ2uYbsHR+65sVy5ef+8EhTgpDLJvYrqhcuJnm7dVe0+iax+RtYhMCzkUGUPX/rfQQet P4exYoAWxp6Fx4DLb4MXlDKyieQ1S93ggLG9J96yqpUtZj91zwfLi/0UET3Z43CtqYZhvc 7lu7ufOCTWiscuUKFEOgpKbGwa4HPRs= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712179307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=FBBcDMAj2JPHjs8hqyTFLFBiCM24FpZuuFwCRwuga2E=; b=SI2nRORYlgyTVVUvGHbYEJDax9c8YWlAY92O6FmG5wsqJjQ6vY3PtjkdLxYp46TY7IQpSC XTriTjYzetdbTf5ZgjS1ztSUFCYaNnDI2Lj5JbE3L92DDRbw1kO5V71r020wdy9kgTs7uo pGLwgtuPOsYTUo5Y6gNeiC9Ll99pyRU= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-395-re2vfINaNi6nhzm7UomUJA-1; Wed, 03 Apr 2024 17:21:44 -0400 X-MC-Unique: re2vfINaNi6nhzm7UomUJA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 521421C01B2A; Wed, 3 Apr 2024 21:21:40 +0000 (UTC) Received: from t14s.fritz.box (unknown [10.39.192.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id B30291121312; Wed, 3 Apr 2024 21:21:36 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, x86@kernel.org, David Hildenbrand , Andrew Morton , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Christoph Hellwig , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Dave Hansen , Fei Li , Nathan Chancellor Subject: [PATCH v2 0/3] x86/mm/pat: fix VM_PAT handling in COW mappings Date: Wed, 3 Apr 2024 23:21:28 +0200 Message-ID: <20240403212131.929421-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Rspamd-Queue-Id: A7ECE140013 X-Rspam-User: X-Stat-Signature: d3koetawcthnapm5r6d8nt1db8cor6jq X-Rspamd-Server: rspam01 X-HE-Tag: 1712179307-386605 X-HE-Meta: U2FsdGVkX1/9OfaXy0oRFhQ2wxe/alwIO6rswpBB02eM/zwMcMKqF9fCOSg8BPaiEavN8xUeEu9owOcZlApa5Y874hcSdYHHhaZaLGxSowvKPt7h88flH8KF67YK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bYhS7nyn4hKocQ5T0zn1b3h/x2SGUU8n9OuFHBGyidvtllgdr2YJjkNf2ZnZjPVPrOixWV6v1NP5IV46o75ApqHydgxUUQytaly6Ijx9FunYsZdxs64RTyXh9G0JZV2/6F0gufGpaT7+FBEKXGDfqphZBWIQZWXVHF707aQXTX66k9oD5XTcOUz/zNSg8KCewa1dCmqAZ3UVtfb4JCgubs1cahlUEU36HvWCGbGl4PvqNFh9yAfK6TpUMNuZWrVqX/JnM3XH70AeUOq6/IqY X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Rebased on latest mm-unstable. As we have a conflict now with a cleanup from Chrostoph, temporarily revert that one, so we can apply the fix, and reapply the adjusted cleanup on top. I squashed the fixups sitting in Andrew's tree for that patch. The fix should likely go in first via the hotfix route, that's why I'm moving it to the front. Tested with my reproducer. v1 -> v2: * Rebased to latest mm-unstable * "x86/mm/pat: fix VM_PAT handling in COW mappings" -> Fix function parameter indentation -> Add Ingos Ack Cc: Andrew Morton Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Christoph Hellwig Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fei Li Cc: Nathan Chancellor Christoph Hellwig (1): mm: move follow_phys to arch/x86/mm/pat/memtype.c David Hildenbrand (2): [mm-unstable] Revert "mm: move follow_phys to arch/x86/mm/pat/memtype.c" x86/mm/pat: fix VM_PAT handling in COW mappings arch/x86/mm/pat/memtype.c | 56 +++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 14 deletions(-)