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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F36C3C4332F for ; Tue, 15 Nov 2022 20:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238671AbiKOU51 (ORCPT ); Tue, 15 Nov 2022 15:57:27 -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> 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.