Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp3817734rwo; Mon, 24 Jul 2023 17:49:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlGoehRhIDkTi7ApEeHVRdg2ZtrQXhJLOWusATjqV9CZc/3SCpBlX+9TeAo8EAkm+lrUgoHW X-Received: by 2002:a17:906:1059:b0:993:d6e8:2389 with SMTP id j25-20020a170906105900b00993d6e82389mr12953500ejj.26.1690246182628; Mon, 24 Jul 2023 17:49:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690246182; cv=pass; d=google.com; s=arc-20160816; b=piq0v9aO4vQjCSZ40rzB4lAXntT91EzYZiYu24jHqNqn4NPKXxlxDk0xCgJWq+w0m8 fKLbtF3io0zopSfeD/QFzRDiSdfFIjA4BW5uDa1qBfd+quCvdh/OUYGk9NRJiQEwtQBi ErKp9tZmPNn7VOYCrIFxRzETsKyNsM1wn2bwXQM+TCPCnVg1H5JqRlpgrrRWGLZp+vzn lxBUFxU/5PMPM1ZOwn/aIkyfsJ6EB/w7GnP3DIPgjNeDE0uR8SlSnJ5RkM/GIygcrgQy Xt6kGtmeM7AlDKFus3ipXVDcRjWfjNCDv9vtgiWYgg8cmx49s/d8YXkb3nl4Y6+QbT0M GHEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=ku6MUz4MWhYaOMPRiAjUDVhN6Zt5HLCAWnUljt2NgLo=; fh=d56nRQnzCayZVnuonMv6ssSn+++udELOex8+Df2ObGA=; b=YY5xo0iu8zOBAeXnfiaU4RC+STgEuWCKNJI7GibU3So/k6ce565Xh1Dmk3YDGnIA3e EtHdUvoYX3LEExMtwoAgEmdl5EVoCy2oZO0fLfONnkMCrv02hq6lXyWWHSOf9oQoSzYo tzno7zufFCPcULNfITJ1IXGkWu9NJoPkb2E2EaNLKIvoj0zYD0+b9jDXdDYGE9u+LFiM GE/huqUoCiV0s1ENPsyLY2aFYJY9cHXMdRs+SyX6FTLJOI2I4xpmQPQEQxbdNT8v49h/ K3Vd6YV/RNqxkPVbD4AXKOSFtsakuk+FvgmQtsGeMKoZMm4vjXQdIbITEVf5YWjWwP8C 7srg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=mdsDlMRO; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v1-20020a1709064e8100b00993689daad1si7410772eju.116.2023.07.24.17.49.18; Mon, 24 Jul 2023 17:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=mdsDlMRO; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbjGYAX7 (ORCPT + 99 others); Mon, 24 Jul 2023 20:23:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjGYAX6 (ORCPT ); Mon, 24 Jul 2023 20:23:58 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2075.outbound.protection.outlook.com [40.107.220.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 312D2115; Mon, 24 Jul 2023 17:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kQshaVJo+Imw5FT/PvX0SjTY1S/D5JTwn+kMFtJBELz5ci1VIEATPDbjWlA3X+dA7fTNk4byOnlnUfMzEHUyYXnaxNHe3VLDDGu/7TiHxfSVIQmQAdljcibGiQ6+PwCQopPpXemQq2r94D0nIpoeXsTkLY1w44Nx/UzbtwtEOv2npAR0nPKO6OW+qwSPNehOO4NvmjyzGXEdgn8KfxMoAag6PiKSu1PVNkkyBZb3CDn3x2gW09zNUXC5TtuLGPl7ky1I+K/AV6OwGlI1a00wb3THQ2DFq4hFeo456OXovbVtPJ/7Di6hd4+870Y8u2wg7/3tRjtXjw1e1dXR0fm6bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ku6MUz4MWhYaOMPRiAjUDVhN6Zt5HLCAWnUljt2NgLo=; b=JQ25lgqCSeh5MPALkOkA9kQ0tNXkhLmMn7HgUpgZK4hrrWV0i1b0kgPGYyZb0Z2EwWcsTBjKh+tAxcCULGXKA04b7KCw4Z33UBJ2Mk2nb6FguIqF3OaUpuihgYFPWt0zgmZFcuC9rVUlm01wf0cc89AxS7Xjmty3/aK9BmMwryPUpcL7trPAnGrz1EfJ7GjCOg9OFQH9TzYHsi0Lgg/CV8XPJWQOqNW+DACdDseULXI2BDkJL0vZ9fqFMYKSXivPmJISRJzlqlrEJArb8uR/AXqCmW2MNPB5S85F3OTA0K3eXaToY+duCvA8RTZ6geTwzEb0hEDauRtifyFY3uQg0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ku6MUz4MWhYaOMPRiAjUDVhN6Zt5HLCAWnUljt2NgLo=; b=mdsDlMRO0DBL2q0erXUI795RiQl6DMQUds39J3UEyLbK23zeMbizJDRR0f//NbcQsDUd6EQT9gc71FmrWEq4tayoEuJCrBXIClK6yGe7/50QzWOauI779HblHYX8YsExnIfxSgQb1TjbHGzbjmQ/13eoFXUNL9Nb8/roFp3wCTu2ZoJH1XsgbJkLc5l24RwVDsnZr0WbRVykDNQps2Qin8itswWkBx90aYierPwu88n07Zu2904e5PsWiA8xeB1WLr4faD84USCBMZZwIomszGKrK0cSKSNVMh51sP7hkjZKU17wvlVyWSYzy+JrQntOe2IIpSjRgmaQ7pbCYxLBFg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3179.namprd12.prod.outlook.com (2603:10b6:5:183::18) by SJ0PR12MB5405.namprd12.prod.outlook.com (2603:10b6:a03:3af::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.33; Tue, 25 Jul 2023 00:23:55 +0000 Received: from DM6PR12MB3179.namprd12.prod.outlook.com ([fe80::3eb6:cda8:4a56:25fe]) by DM6PR12MB3179.namprd12.prod.outlook.com ([fe80::3eb6:cda8:4a56:25fe%7]) with mapi id 15.20.6609.031; Tue, 25 Jul 2023 00:23:54 +0000 References: <8f293bb51a423afa71ddc3ba46e9f323ee9ffbc7.1689768831.git-series.apopple@nvidia.com> <20230719225105.1934-1-sj@kernel.org> <877cqvl7vr.fsf@nvdebian.thelocal> User-agent: mu4e 1.8.13; emacs 28.2 From: Alistair Popple To: Luis Chamberlain Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, Pankaj Raghav , SeongJae Park , kevin.tian@intel.com, x86@kernel.org, ajd@linux.ibm.com, kvm@vger.kernel.org, linux-mm@kvack.org, catalin.marinas@arm.com, seanjc@google.com, will@kernel.org, linux-kernel@vger.kernel.org, npiggin@gmail.com, zhi.wang.linux@gmail.com, jgg@ziepe.ca, iommu@lists.linux.dev, nicolinc@nvidia.com, jhubbard@nvidia.com, fbarrat@linux.ibm.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, robin.murphy@arm.com Subject: Re: [PATCH v2 3/5] mmu_notifiers: Call invalidate_range() when invalidating TLBs Date: Tue, 25 Jul 2023 10:20:52 +1000 In-reply-to: Message-ID: <87v8e8zvmz.fsf@nvdebian.thelocal> Content-Type: text/plain X-ClientProxiedBy: SY6PR01CA0124.ausprd01.prod.outlook.com (2603:10c6:10:1b8::17) To DM6PR12MB3179.namprd12.prod.outlook.com (2603:10b6:5:183::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3179:EE_|SJ0PR12MB5405:EE_ X-MS-Office365-Filtering-Correlation-Id: f49de129-5bb2-4bb7-a2a6-08db8ca56d99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S4kV4QoyxWeJb12KnNIxvGW2EgcWAB4DcWd8MnqcX5Ow77pu+WNj0mqYhoDaSOvEx688pjOalI0g3D69B1b5S3pJDpucMVbLIM5xDSW3DDbPkitABTHFRmmxEBPbbchrPEuEp29VBu5gX+Fji3Kd9pyybSWspIE2b59MqtI8K/eA0AUCnuDtpXew2ZYCXqN+LtR5ZS6iOr4+XIdXHWGo2pWvOzYuL3yv4RcqZiyc6Mu/4iT6+zWkTBaNOiMyM9p9w4vwJjSQ6S6auhGwvkoNOJI4azOMdTOKNk0erjctx47pxsJDEnYRUHc6pec0cnhTFWx2miMAr7FFXk1hmeIj/qSotl5Ct9yuEl78Jkxt4nI+AEOG3QzaU21kWHFF3UyoXy54iLeUXQzT7zDtA1ACbihsJX6EHZuSDZqEaBVc8n1nJI06XZvconfz40/SD6XcOrb8A8c1n1zNUBcfkgdjK4Pi+rSeqfmkMT0anCle7Hw2ef64r3/YGYHlqbLryv8BZPxOEqcREM9bjx6PILY76VgcS7WdrXHoUncswyis3epNqj00f7WEm4TKreeJw1wcfRA0WaXaVNxRh9wwgasvr5t9vYaGF8vH+C6v8orLTrU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3179.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(366004)(346002)(396003)(136003)(376002)(451199021)(5660300002)(83380400001)(2906002)(7416002)(8676002)(8936002)(38100700002)(54906003)(966005)(6486002)(6506007)(478600001)(26005)(186003)(41300700001)(6512007)(86362001)(66556008)(9686003)(66476007)(6916009)(4326008)(316002)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ZyENK2BIcQ5IWgp+X9tHTNXPyEU2ibIZKb/CxXI7KPjGUXl2e1C2NjDvWLEy?= =?us-ascii?Q?FCE7ql9oHYZnGFD7yPmqjKzdjlGs5nxc0B/2+1/78nTSY+PXPzsmedG1U2tY?= =?us-ascii?Q?DvUsvPk90g7GOec06g20huyXnTlkyFZvqKG7wynGda5SpiSsVNy//xbKKmFZ?= =?us-ascii?Q?4fVZkz195vhwdNJfyTeMiroNal2tPv7oyk+dypUhWTBO+nmm/Faf3afCyGle?= =?us-ascii?Q?OaiDn9FjxP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DG84GZ1+HK?= =?us-ascii?Q?VbhEgahty7wb+WNBZXeKBBhaRiqOeBH58cytgiU8ZUxZNeiyk/tC6orRSMZs?= =?us-ascii?Q?SKjZAMAsIlxC1nJMqK5GOmlQbO8FmIiUAKzb/yLvGzARhMu7AAn2SENY7TQl?= =?us-ascii?Q?WhGpF2oAsO/Whxg9cRrwB6cRPa7hAmTX86LiIc/hvKCx+FeKgjjAYM6TQHJG?= =?us-ascii?Q?2RJRl/n1sVXTTvIGrLnW9KSSU6hcOrKNWVPBP6B4f1pnxEDmwvAEejfPhZ5W?= =?us-ascii?Q?ynTzvyvS3nwiUKeNhTSwX21JZigGHyyh/6vR+sQHrHEo29GL38/ABjO21srJ?= =?us-ascii?Q?zyod2d5ILmLm1CI7qxzq1zmCSgEGL1jfUlbgrdSdIlDO1Qn6xKiXar475e0q?= =?us-ascii?Q?luHlPvAulu15qyucFAim1QDreiIygQX+AE+Q9Ek8f6da/gEG3gSSgR0vzoHK?= =?us-ascii?Q?EKywRnJG3sP18fYRfnm2tUygPXqLy7J6vmVK60ZE?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f49de129-5bb2-4bb7-a2a6-08db8ca56d99 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3179.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2023 00:23:54.1641 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ReXHcJFhI812pCDjT2afAZrcaKRkKrRr85XtzIEtPfHZTzrKl/Dd8y2PkKPUY8EW4JYPcWveeNVV7H4KOl+Bwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5405 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Luis Chamberlain writes: >> diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h >> index 837e4a50281a..79c46da919b9 100644 >> --- a/arch/x86/include/asm/tlbflush.h >> +++ b/arch/x86/include/asm/tlbflush.h >> @@ -4,6 +4,7 @@ >> >> #include >> #include >> +#include >> >> #include >> #include >> @@ -282,6 +283,7 @@ static inline void arch_tlbbatch_add_pending(struct arch_tlbflush_unmap_batch *b >> { >> inc_mm_tlb_gen(mm); >> cpumask_or(&batch->cpumask, &batch->cpumask, mm_cpumask(mm)); >> + mmu_notifier_arch_invalidate_secondary_tlbs(mm, 0, -1UL); >> } >> >> static inline void arch_flush_tlb_batched_pending(struct mm_struct *mm) >> diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c >> index 0b990fb56b66..2d253919b3e8 100644 >> --- a/arch/x86/mm/tlb.c >> +++ b/arch/x86/mm/tlb.c >> @@ -1265,7 +1265,6 @@ void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch) >> >> put_flush_tlb_info(); >> put_cpu(); >> - mmu_notifier_arch_invalidate_secondary_tlbs(current->mm, 0, -1UL); >> } >> >> /* > > This patch also fixes a regression introduced on linux-next, the same > crash on arch_tlbbatch_flush() is reproducible with fstests generic/176 > on XFS. This patch fixes that regression [0]. This should also close out > the syzbot crash too [1] > > [0] https://gist.github.com/mcgrof/b37fc8cf7e6e1b3935242681de1a83e2 > [1] https://lore.kernel.org/all/0000000000003afcb4060135a664@google.com/ > > Tested-by: Luis Chamberlain Thanks Luis. The above fix/respin is already in yesterdays linux-next (next-20230724) so hopefully you are no longer seeing issues. > Luis