From patchwork Thu Nov 10 11:35:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 13038723 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 0FB4CC433FE for ; Thu, 10 Nov 2022 11:35:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A1BE6B0071; Thu, 10 Nov 2022 06:35:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 82A326B0072; Thu, 10 Nov 2022 06:35:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6CAF66B0074; Thu, 10 Nov 2022 06:35:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 583836B0071 for ; Thu, 10 Nov 2022 06:35:57 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1A1041A1656 for ; Thu, 10 Nov 2022 11:35:57 +0000 (UTC) X-FDA: 80117328354.04.D8E3C28 Received: from mail-ej1-f73.google.com (mail-ej1-f73.google.com [209.85.218.73]) by imf08.hostedemail.com (Postfix) with ESMTP id 93DA716000F for ; Thu, 10 Nov 2022 11:35:55 +0000 (UTC) Received: by mail-ej1-f73.google.com with SMTP id xj11-20020a170906db0b00b0077b6ecb23fcso1038987ejb.5 for ; Thu, 10 Nov 2022 03:35:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=jpQdIr8MN/KQIwACigO7iQHcDhsbP3Ee3zIRpQPEK1o=; b=BdS5DojXBcJ/OgCf0l8c6arc3q1OeaTAXv3Uy1ty5TVvDwC0HX7pEDsrLLPvPBxy8Q 6tiW59sC/5j+SR3TzXGB6Pgz9sQpaerOtslUi/ofYKiyqHZX7/b16DDBPR0g2zkPft1I gKxPQedEpYMCI6GODG0p718Pxs2BoIyzTBXMH96j23FpxFb6jIIjU6dZLx7KkfiLh7ZK AG0CDGs67AgDIodUuACO2cWPs/CvG/y2GQHpf7is6flgF1JyWN9MCctmL/JOMnqI/fzh htO6DEwe7xL4MmovUHgjG9Mvaup+R3yyVzhif4Dt4g3OKhJNf/BiKZrLDPkYhhFA0DjN zeQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=jpQdIr8MN/KQIwACigO7iQHcDhsbP3Ee3zIRpQPEK1o=; b=0ygciwcSqU67lCiqj6T83FNmsmUszD9NiL6WfBtOcG8tG0jVfNpulwaiGwn1CCZGog EYnjEa/KiNfFCd/FLGq6zobvvPoByO5lpouAlhtNLpG4MDm7z5PXwxqt1oNRIji0ZHqe LS4nYEOPcW5DEH962ntV4j2io7PJ1W+KDWpB7m4wVwCd/22BwlxHDJUT4t35AOtg2LjW Q+m/9cr2gJM1NluPogKNWIcDT12pAGJpejIBoTHHvMaeP+CXtOJIZAYpwG4fuzUNmJYy TOdj0Bf+7AQqzx16UPh0CXP9eq0WjXhmPrCf93fbK5gFjuq9uDBdtQOIekAo+zr+tjg3 i+8g== X-Gm-Message-State: ACrzQf1mUamNkKovL/PEwFLHi+XoZG0xYSjuY6khH+7keN/zdwpoNHpf Z/v2qDmU87bcDia7Fqp/4TC+Gah6dDQ= X-Google-Smtp-Source: AMsMyM5Wpq2hYUAuqWz1ozYNLgSCBs+6jjnjdfEkyB5OqXM4JKPfTlL3B70CVuNWA/k5s1z6YFE8U8wsLKw= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:4f3e:16fb:f499:bb9d]) (user=glider job=sendgmr) by 2002:aa7:ccd2:0:b0:462:73bd:3acb with SMTP id y18-20020aa7ccd2000000b0046273bd3acbmr62699894edt.378.1668080154037; Thu, 10 Nov 2022 03:35:54 -0800 (PST) Date: Thu, 10 Nov 2022 12:35:41 +0100 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221110113541.1844156-1-glider@google.com> Subject: [PATCH] Revert "kmsan: unpoison @tlb in arch_tlb_gather_mmu()" From: Alexander Potapenko To: glider@google.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Dmitry Vyukov , Eric Biggers , Linus Torvalds , Marco Elver , Peter Zijlstra , Will Deacon ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668080155; a=rsa-sha256; cv=none; b=m6TQBTLANeJbqIJpWVzmWve9M8+Bg4pwzdjJyjNKJewj9VJzC7aeTwO8Vb5zgWvMPYLaJK 3GOnt9oENriBE8LpRD0FoDK4P+GBsDf78XHvuiRT7izE6pXxtAErUtETXJVGYUlAPK9nZF oB1EpwO6USuPxsgul6wLcLKhcNz0FAA= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=BdS5DojX; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf08.hostedemail.com: domain of 3GuJsYwYKCLMZebWXkZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--glider.bounces.google.com designates 209.85.218.73 as permitted sender) smtp.mailfrom=3GuJsYwYKCLMZebWXkZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--glider.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668080155; 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-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=jpQdIr8MN/KQIwACigO7iQHcDhsbP3Ee3zIRpQPEK1o=; b=cN0USY/PYHxOuHSQuLE0KQP2xEehBAdmGmwPb+mZUMSrbKPv7PiYrjgWE5rfm3+x7LdkM4 Q5DU9lB1cGwuc/oBButEMi5yBZWVPPhX2CTVwzOjhO95Dja10bhlQvVWY7VBvK90U3mTHo q91BVDknh0y4Vd366eRIl1H/ddePboY= Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=BdS5DojX; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf08.hostedemail.com: domain of 3GuJsYwYKCLMZebWXkZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--glider.bounces.google.com designates 209.85.218.73 as permitted sender) smtp.mailfrom=3GuJsYwYKCLMZebWXkZhhZeX.Vhfebgnq-ffdoTVd.hkZ@flex--glider.bounces.google.com X-Rspam-User: X-Stat-Signature: arcokfwz57t5uhshjy6rjf4ooqfsdkm5 X-Rspamd-Queue-Id: 93DA716000F X-Rspamd-Server: rspam05 X-HE-Tag: 1668080155-299308 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: This reverts commit ac801e7e252c5588325e3c983c7d4167fc68c024. The patch in question was picked to -mm from the KMSAN v6 patch series (https://lore.kernel.org/linux-mm/20220905122452.2258262-1-glider@google.com/) and sneaked into mainline despite its removal from the v7 series (https://lore.kernel.org/linux-mm/20220915150417.722975-1-glider@google.com/) Currently KMSAN does not warn about origin chains hitting the maximum depth, so keeping @tlb poisoned won't result in any inconveniences. Cc: Andrew Morton Cc: Dmitry Vyukov Cc: Eric Biggers Cc: Linus Torvalds Cc: Marco Elver Cc: Peter Zijlstra (Intel) Cc: Will Deacon Signed-off-by: Alexander Potapenko --- mm/mmu_gather.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/mm/mmu_gather.c b/mm/mmu_gather.c index add4244e5790d..a71924bd38c0d 100644 --- a/mm/mmu_gather.c +++ b/mm/mmu_gather.c @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include @@ -266,15 +265,6 @@ void tlb_flush_mmu(struct mmu_gather *tlb) static void __tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm) { - /* - * struct mmu_gather contains 7 1-bit fields packed into a 32-bit - * unsigned int value. The remaining 25 bits remain uninitialized - * and are never used, but KMSAN updates the origin for them in - * zap_pXX_range() in mm/memory.c, thus creating very long origin - * chains. This is technically correct, but consumes too much memory. - * Unpoisoning the whole structure will prevent creating such chains. - */ - kmsan_unpoison_memory(tlb, sizeof(*tlb)); tlb->mm = mm; tlb->fullmm = fullmm;