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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1555C43458 for ; Thu, 9 Jul 2026 16:24:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IGJbYaHCyK949FwefUTFBHY38U/FL3SLqFgCztE9VPY=; b=amr9wEL6/08NeQ uDG+ysIVRaaju/by7IUIRWfHxMOUtJxTt7f12OgtMujB1rJsq1tBZMK86GmDo4KVk5nEi4tC+QKbj ceU4SfAXLHdrPBTQWHGUEKJuubDbzpl/D/94Zasmo2FoFdX8eTdLOIHkn6z7Io4GVeMlSiu+jJxgO cokYXSWSDaYh1o6vbNTu3CCGY7DmTKn0Up/tEqPm07GHwjQKICteEo4pNVAJqj9EMp0nmX0NDFjiQ 5W6ELIBvU6cuGcIsdUOhrtqorjKItqtFdBW544im3u5yE9e9CMvlQ24cvbpV9zwEALB8k+vzotrWq JVe/0ZHpihsxMf2zCVKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1whrXT-0000000321H-0d3M; Thu, 09 Jul 2026 16:23:51 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1whrXQ-000000031zu-3R3W; Thu, 09 Jul 2026 16:23:48 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 16346405C4; Thu, 9 Jul 2026 16:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F271F00A3A; Thu, 9 Jul 2026 16:23:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783614228; bh=PVNPrFU1PGB9ZkQlUfz3ePnrtlBWmUW1vci7gbMc020=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=dEsGFvG0entc+CRLpmVOaUBCJG4D03DxA7ZPHMA+0bz+ArzFZ4oZ25h3XsZAVyxRR x10/LoE7lElTzHD06XWpE2m6rYMtKRUGebUhQapIBfB+ep4fG37Ng0RaVsx6GdmjM4 W83GkVnhwTOjct2PRlsvXAgfF8WsuxadhgjUrZKIFxbiAgM07wgLkRHLtXBID76WXL vXpw2i5GZ2AEQYDFtIGxLdWwAY7AsLhILvFuoodFrluXUPHF4msNedMhyKYrHXoB8T JJj34DTu2/8Sq2sDLaSW1Xi2u/2ZNgMk1vZ51THvkxDDB/2K6ZsmwZ7UkwuT1KfO4D Hq6xN5eyBwNEw== Date: Thu, 9 Jul 2026 09:23:47 -0700 From: Kees Cook To: Thomas Gleixner Cc: LKML , Peter Zijlstra , Michael Ellerman , Shrikanth Hegde , linuxppc-dev@lists.ozlabs.org, Huacai Chen , loongarch@lists.linux.dev, Paul Walmsley , Palmer Dabbelt , linux-riscv@lists.infradead.org, Sven Schnelle , linux-s390@vger.kernel.org, x86@kernel.org, Mark Rutland , Jinjie Ruan , Andy Lutomirski , Oleg Nesterov , Richard Henderson , Russell King , Catalin Marinas , Guo Ren , Geert Uytterhoeven , Thomas Bogendoerfer , Helge Deller , Yoshinori Sato , Richard Weinberger , Chris Zankel , linux-arm-kernel@lists.infradead.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, Arnd Bergmann , Vineet Gupta , Will Deacon , Brian Cain , Michal Simek , Dinh Nguyen , "David S. Miller" , Andreas Larsson , linux-snps-arc@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, sparclinux@vger.kernel.org, linux-arch@vger.kernel.org, Michal =?iso-8859-1?Q?Such=E1nek?= , Jonathan Corbet , linux-doc@vger.kernel.org Subject: Re: [patch 02/18] randomize_kstack: Provide add_random_kstack_offset_irqsoff() Message-ID: <202607090922.4ECAE32C07@keescook> References: <20260707181957.433213175@kernel.org> <20260707190253.768842729@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260707190253.768842729@kernel.org> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Jul 07, 2026 at 09:06:02PM +0200, Thomas Gleixner wrote: > add_random_kstack_offset() uses get/put_cpu_var() which is pointless > overhead when it is invoked from low level entry code with interrupts > disabled. > > Provide a irqsoff() variant, which avoids that. > > Signed-off-by: Thomas Gleixner Seems good. I don't think macro'izing the interior is worth it since both cases are very short, with only the lockdep and raw bits changed. Reviewed-by: Kees Cook -Kees -- Kees Cook _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv