Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp2989602rwl; Fri, 6 Jan 2023 13:55:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXvD6XGCudpX102ids7ZutgwXwbygOBuQJ1BFIl15k2841ASld2UafYegUw8abs/jsrv6Nqy X-Received: by 2002:a17:902:7596:b0:191:6239:5331 with SMTP id j22-20020a170902759600b0019162395331mr56286403pll.60.1673042142836; Fri, 06 Jan 2023 13:55:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673042142; cv=none; d=google.com; s=arc-20160816; b=QYSbXUV1oid7FSklTGk0uhpj/g91/TSJF7nwc6Wp+bUWCuozGgIA7xFz5QgfdKo3Fn EzbpW/2gJuLXfvO1CTfZUtZRp9RN4OAytqocBER+og+bor2E8AgfRDWbtg6DdauXdbti evIFpm6/m/QaQpeLsp97bFERkS+MyMgaGN5Nvtt/2lrKuZXPyqHsvlJUJhg/fCETsYKt lSC74BSOsAGbrySrzVdtlKTOroJPDT5WAkwUT9X9mAQBbWvGSPlmd29AOp+7pZwEqPt4 Fo68kerRWy4wKDV5TYSekieX2yt20qSAM68Tpg3LdDnkwWyoHlONsBKAqT8Fic+eH+zD 4VMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JIVcLmmyA6/m+YiOwB7DFkkX+oWdAkbzFPPqwaVy8WY=; b=NY1HRRVs3LO2ao18S3vVr44iOurmj5dNSPfAZOkvgqdrJJ6y7ElVe+3urznbf30bfv T8wPtSWS24AD8FfpvnZfeYxQHmEkJ7qWcUNFZMtoc3cTsQXBKgkYWNOAUBBySbOZJJUV ToHJC7t61fN0KCuZJpE8CCtzSzMg2Em4ksth/uUrmuqGArp5GlnhYBoRSq9I6WA4Fl7N DEQEqpwRq29OdC74s1u/xiqKiF1RmcOZ3cNLfQmm7CI54qbpjg6H41Cty9oJFamsV/tS 36OVvZXWE+sLZZERAiTim7WpZgCghXqlPqHmPTvOrGjpA6Cfj7qFMDj9Dr+B4jMl4RAH Q1nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=j0bkeeFM; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n1-20020a170902e54100b001927b1a903dsi2195159plf.332.2023.01.06.13.55.24; Fri, 06 Jan 2023 13:55:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=@infradead.org header.s=casper.20170209 header.b=j0bkeeFM; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235581AbjAFVnC (ORCPT + 99 others); Fri, 6 Jan 2023 16:43:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229949AbjAFVnB (ORCPT ); Fri, 6 Jan 2023 16:43:01 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60B3C82F43; Fri, 6 Jan 2023 13:42:58 -0800 (PST) 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=JIVcLmmyA6/m+YiOwB7DFkkX+oWdAkbzFPPqwaVy8WY=; b=j0bkeeFMEsRakLw1tzZ97Qcjr2 fMJY7Fxe4ZF7tc0SURp8dpL2Ow9Uu2YBygIcZIxjQeB5m7w8GE8zW7QCBrNV179lXrtQaP4ePRATi 1TJEzTkljdgsz7FUDMDF8WjfnVP361xy6iaMRxYmy+b829Fh7lzodyMlv8pM4Mk5DXxt93EjvnyFV KIezkNoLiLhVhGAQxFxwjvToJb7GqXE1tIBWKlUlEA/Tq6IUNO+LukGPZkpOQCDL2gV0VQogwW6Nk NUIsOqd7JzRCX2Hu433a4Ym6WbpYd69/uwECIk+3wbLNWNr5B/keRf1ZTC6K13p0SxqIWl4sUhbDu 3VpY5E5g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pDuUC-00HWiP-0T; Fri, 06 Jan 2023 21:42:48 +0000 Date: Fri, 6 Jan 2023 21:42:47 +0000 From: Matthew Wilcox To: Linus Torvalds Cc: "Jason A. Donenfeld" , Yann Droneaud , Andy Lutomirski , Ingo Molnar , linux-kernel@vger.kernel.org, patches@lists.linux.dev, tglx@linutronix.de, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Florian Weimer , Arnd Bergmann , Jann Horn , Christian Brauner , linux-mm@kvack.org Subject: Re: [PATCH v14 2/7] mm: add VM_DROPPABLE for designating always lazily freeable mappings Message-ID: References: <10302240-51ec-0854-2c86-16752d67a9be@opteya.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham 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-crypto@vger.kernel.org On Thu, Jan 05, 2023 at 06:08:28PM -0800, Linus Torvalds wrote: > Side note: making the 32-bit issue go away is likely trivial. We can > make 'vm_flags' be 64-bit, and a patch for that has been floating > around for over a decade: > > https://lore.kernel.org/all/20110412151116.B50D.A69D9226@jp.fujitsu.com/ > > but there was enough push-back on that patch that I didn't want to > take it, and some of the arguments for it were not that convincing (at > the time). > > But see commit ca16d140af91 ("mm: don't access vm_flags as 'int'"), > which happened as a result, and which I (obviously very naively) > believed would be a way to get the conversion to happen in a more > controlled manner. Sadly, it never actually took off, and we have very > few "vm_flags_t" users in the kernel, and a lot of "unsigned long > flags". We even started out with a "__nocast" annotation to try to > make sparse trigger on people who didn't use vm_flags_t properly. That > was removed due to it just never happening. > > But converting things to vm_flags_t with a coccinelle script > (hand-wave: look for variables of of "unsigned long" that use the > VM_xyz constants), and then just making vm_flags_t be a "u64" instead > sounds like a way forward. I'd be more inclined to do: typedef unsigned int vm_flags_t[2]; and deal with all the fallout. That'll find all the problems (although leave us vulnerable to people forgetting which half of the flags they want to be looking at). Hm. We never actually converted vma->vm_flags to be vm_flags_t. Only vm_region, which aiui is only used on nommu.