Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7502198rwb; Tue, 15 Nov 2022 13:20:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf6k3/lrlITKlgXroSmuMEd5C4sC/TiomitHdE5BvmWuChYVrKnsZ1sSj3RmKNM1vXASax1l X-Received: by 2002:a65:5a4e:0:b0:46f:6afe:d94b with SMTP id z14-20020a655a4e000000b0046f6afed94bmr17949847pgs.72.1668547256273; Tue, 15 Nov 2022 13:20:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668547256; cv=none; d=google.com; s=arc-20160816; b=C8UzTe3eCae/eF6RSiWOONPDhAy8tEqXQH0PhPoliHarMuENvXY+nbrceXrMIlA/X/ fR9EyPXXbzewozO2YhoR0Kr4nUfz8bhLqKPuEeF70LqQF5JNfW6oJZGLe1N9nWzPpA5L roP8dPd4dsYY2DbX3tzf4GTps9IpIngqH1+2ZGOUHxArdwfYFgELiVhdldaHjQwyrh4P LLKHw47OQkwo8M53Dq6J02jNKRjvt6xa6iDbBegXNdOC8kp1kpPK/TRugLLuEHvaY9In k+aJMx1unXSowo94z2OdDgPy//PqDUKv7FCbmdQOjdQGUCm/FEmyt8vR9/1soVIPyf9e pPLg== 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=5xpV9WfbtmqX+4AnIe4/hDPc2QaV12bRadfZHnoqeoI=; b=BbYZJv9tADdyYAvMHMQLdspQNYNrwubQguhey1jM9uqBlu7Lf6JBio5EnqneqvVwzh GPq8WFNcgPFda+7J2JGZijja0PCJ16tnzqIwzFKMcH9N5qnDBZSxD6r8dXDj1gDL4ZkU fFLl9XAoJhIcLs8jQQv71OiaQ+aeE2hyOl7pNyj5RIfjZ1HRZpROcWgWg+yOz0L0loya 5f3P1EsO+FSunMIHFepZZTvteaujo9tT+X+Is64ARUnURgBT+nsR7pPnXM+Rpfut3k9l LSYqHBjdLCmLatLt7CxdToAauJuen/VJz/BWVc2NEpp5GjLwufA7eShWYkZB+8m83CO9 4Q6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tml2TgJH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jd14-20020a170903260e00b00186e9ad55c1si12675408plb.434.2022.11.15.13.20.44; Tue, 15 Nov 2022 13:20:56 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=tml2TgJH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238676AbiKOU5Z (ORCPT + 90 others); Tue, 15 Nov 2022 15:57:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231986AbiKOU5V (ORCPT ); Tue, 15 Nov 2022 15:57:21 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25F4A2ED64; Tue, 15 Nov 2022 12:57:20 -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=5xpV9WfbtmqX+4AnIe4/hDPc2QaV12bRadfZHnoqeoI=; b=tml2TgJH1mD2dmkD+cLwZIUZVu fr/XlobwIp+nHqDydSxYztW3WSHwPbxb8w9Fs5rbWAFS9TirYPXwzjJJ2m/IJuaVGFkW6EVESaAtJ h7Not2ly4fXX0XlbCo2v/aaJUQH6yqC3j/KUNrvX58PMWyltZVeMTLMxs2qluXWjzKNdVPXMp0Kpo 1WqIY+BhrdxAuDuZQOmVLCKzVdRLwWs4tpKXXHtiMoK44YGrUnox4fUs8FTGFRk3fFEmltDBxAFvi nCQMVRjQHaWkHieB0wcGJNNWFfcU4Ja68+OTbReRhuUL3QmDe/DPG4JkjFzpd5NVV2jLFI19ET8Hn pW7afWsA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ov2zF-00Gdjt-J5; Tue, 15 Nov 2022 20:56:54 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A1314300282; Tue, 15 Nov 2022 21:56:45 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8E5BD2CCDC2B8; Tue, 15 Nov 2022 21:56:45 +0100 (CET) Date: Tue, 15 Nov 2022 21:56:45 +0100 From: Peter Zijlstra To: "Edgecombe, Rick P" Cc: "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "rdunlap@infradead.org" , "keescook@chromium.org" , "Yu, Yu-cheng" , "dave.hansen@linux.intel.com" , "kirill.shutemov@linux.intel.com" , "Eranian, Stephane" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "bp@alien8.de" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "Yang, Weijiang" , "Lutomirski, Andy" , "pavel@ucw.cz" , "arnd@arndb.de" , "tglx@linutronix.de" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "linux-doc@vger.kernel.org" , "jamorris@linux.microsoft.com" , "john.allen@amd.com" , "rppt@kernel.org" , "mingo@redhat.com" , "Shankar, Ravi V" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" , "akpm@linux-foundation.org" Subject: Re: [PATCH v3 18/37] mm: Add guard pages around a shadow stack. Message-ID: References: <20221104223604.29615-1-rick.p.edgecombe@intel.com> <20221104223604.29615-19-rick.p.edgecombe@intel.com> <6e402f94fe1e942116aca729f1d54fd1399cb98a.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e402f94fe1e942116aca729f1d54fd1399cb98a.camel@intel.com> 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-kernel@vger.kernel.org On Tue, Nov 15, 2022 at 08:40:19PM +0000, Edgecombe, Rick P wrote: > > > +unsigned long __weak stack_guard_start_gap(struct vm_area_struct > > > *vma) > > > +{ > > > + if (vma->vm_flags & VM_GROWSDOWN) > > > + return stack_guard_gap; > > > + return 0; > > > +} > > > > I'm thinking perhaps this wants to be an inline function? > > I don't think it can work with weak then. That was kinda the point, __weak sucks and this is very small in any case.