From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62FCDC77B73 for ; Tue, 23 May 2023 00:25:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=jFmZSMOG69zfMogoIeIJSKWxylS24AhGUL4tj7PYV34=; b=cFR X1ia/W+cyFllsH6YtDTeOWiQeIKJwhyTSARpTHxPOiOF7w31LbdPaweXuty8h5LpiuNMwRjHY56zL Ru2dixJxiC1rdbYcR0lXtw7h+lucyiCcRiCDmiGFkM0q6sc3xj+2/7JgdUcqIcqhomVlEAEPVLFgx GnnYU1yv2BWxBIs0EBOIZecI5BNxJeM9Zo4uaMUZ4t7aFQjJh3sPgVLZ42s4WgepMBsrrYaWez+Nm X3ZONP9POKdpNX9CCK4jA6InI39yAFzFvK1q7siqwYaD3xZAhv5ZHNfa4Y3O973CYYyFrt+ZlVlVW kvq6kRh4ywqHyPY1R8F3MlnV4R4AkTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q1FqG-008SuJ-1g; Tue, 23 May 2023 00:25:32 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q1FqD-008SsO-1k for linux-arm-kernel@lists.infradead.org; Tue, 23 May 2023 00:25:30 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-ba8337a5861so9040969276.0 for ; Mon, 22 May 2023 17:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684801525; x=1687393525; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=SK35moxCE6AhlCZl4FimQ53XrewZjdQKUPUW9jfTNhI=; b=mquAyojadKZpounQOGCyO7aFy35Kd3gvWi/UH5BXhIZkz7tVHOTirDJcDjYG/+Pe0k PwLyo+tt3Lcs8Wt+IbcvNqnR95+2QVcsjtU2z20V1u6zihM0vSHu11VGWJe8iqXhoGRd zXt6V/zFvWazT8SskHdOr3yYcVdhnbScknjPGsxuuM5tCLYnemBLeotCSSZUK/NfGkui Y6O5KmQyVmMpmurc15Kk6+FQa6XGpSluc8K9btxF+G2ADQ8v1cr+z3KhX4nFsNxh2DBR J6j+yljeE33xePrLQmQMDd01yNnZxKWlEaAWc9ta0x6f7M0C7h+CizkiyY2F7w4LZzGN uuWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684801525; x=1687393525; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=SK35moxCE6AhlCZl4FimQ53XrewZjdQKUPUW9jfTNhI=; b=MIAz/3iRr3warSALkA0nXyWLGS6xXLrbQ5zzw8ZTLr3SzaeCDDlK40yax9iCgY4bLP T0Vp+giy0vZ4y5b0AoGUi0J/n3sgT1ay0QCljXvEYW+n41I+DoNyNsvNc1mX2FR+1Zf1 pQm3+GrELvz/X8uEpACEHseIIzVfxlvWMhCpLeKj4ZkiNQY+NdzmG90kwD6qhIiGVrWQ 3ti9rWA1IVKuxSoY0GT36QfYMLG3JP+3XsV+qHO98+b2vY7Kwtk6maj7St5qLgyuUT06 n6lgNlRoyh0r8jwTx3IJtSmSQiTwQVgxuUezZsXIe4YqDbMzyDHzbq4znkBQhSLGBYQf gWNA== X-Gm-Message-State: AC+VfDwR3+juJhTc9Vq88hUCFP4ZlDtOOq6Cey9MS1fdr8+1GRYhOAvO fJn71H6QEocWU41Nt52mjL+5URM= X-Google-Smtp-Source: ACHHUZ5H1E69i+pDVlI8FzT7yTexZ632QETLJQDEPko82BDdVWvZPB6vWKrwPvJAgrPOdHAAIQr4Vxw= X-Received: from pcc-desktop.svl.corp.google.com ([2620:15c:2d3:205:3d33:90fe:6f02:afdd]) (user=pcc job=sendgmr) by 2002:a05:6902:1343:b0:ba8:4d1c:dd04 with SMTP id g3-20020a056902134300b00ba84d1cdd04mr7758275ybu.1.1684801525229; Mon, 22 May 2023 17:25:25 -0700 (PDT) Date: Mon, 22 May 2023 17:25:14 -0700 Message-Id: <20230523002518.1799481-1-pcc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog Subject: [PATCH v4 0/3] mm: Fix bug affecting swapping in MTE tagged pages From: Peter Collingbourne To: Catalin Marinas Cc: Peter Collingbourne , "=?UTF-8?q?Qun-wei=20Lin=20=28=E6=9E=97=E7=BE=A4=E5=B4=B4=29?=" , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "surenb@google.com" , "david@redhat.com" , "=?UTF-8?q?Chinwen=20Chang=20=28=E5=BC=B5=E9=8C=A6=E6=96=87=29?=" , "kasan-dev@googlegroups.com" , "=?UTF-8?q?Kuan-Ying=20Lee=20=28=E6=9D=8E=E5=86=A0=E7=A9=8E=29?=" , "=?UTF-8?q?Casper=20Li=20=28=E6=9D=8E=E4=B8=AD=E6=A6=AE=29?=" , "gregkh@linuxfoundation.org" , vincenzo.frascino@arm.com, Alexandru Elisei , will@kernel.org, eugenis@google.com, Steven Price X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230522_172529_603358_AE81FAF7 X-CRM114-Status: GOOD ( 10.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch series reworks the logic that handles swapping in page metadata to fix a reported bug [1] where metadata can sometimes not be swapped in correctly after commit c145e0b47c77 ("mm: streamline COW logic in do_swap_page()"). - Patch 1 fixes the bug itself, but still requires architectures to restore metadata in both arch_swap_restore() and set_pte_at(). - Patch 2 makes it so that architectures only need to restore metadata in arch_swap_restore(). - Patch 3 changes arm64 to remove support for restoring metadata in set_pte_at(). [1] https://lore.kernel.org/all/5050805753ac469e8d727c797c2218a9d780d434.camel@mediatek.com/ v4: - Rebased onto v6.4-rc3 - Reverted change to arch/arm64/mm/mteswap.c; this change was not valid because swapcache pages can have arch_swap_restore() called on them multiple times v3: - Added patch to call arch_swap_restore() from unuse_pte() - Rebased onto arm64/for-next/fixes v2: - Call arch_swap_restore() directly instead of via arch_do_swap_page() Peter Collingbourne (3): mm: Call arch_swap_restore() from do_swap_page() mm: Call arch_swap_restore() from unuse_pte() arm64: mte: Simplify swap tag restoration logic arch/arm64/include/asm/mte.h | 4 ++-- arch/arm64/include/asm/pgtable.h | 14 ++---------- arch/arm64/kernel/mte.c | 37 ++++++-------------------------- mm/memory.c | 7 ++++++ mm/swapfile.c | 7 ++++++ 5 files changed, 25 insertions(+), 44 deletions(-) -- 2.40.1.698.g37aff9b760-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel