From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBD523932E8 for ; Thu, 26 Mar 2026 18:11:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774548722; cv=none; b=WQHtrNiB65C1+XsvZImFYHhgg1G1HiNsTqGbQXS+JzUTZj4uVaweFceED9RgoJAXmg+ysRMctggsBSvIMYuwtd4tDKpFK6IVUL3cb5hks6IkXaaa2ScDuJ/8aDMHRFDEySw4tNOYwilB+iqB21iZELyzMoDb8ih7hV++m1d9x2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774548722; c=relaxed/simple; bh=dgIj3a5tK1onWSWVfqDJCKoL+8uwDoGTJyJ7ifoq1WE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=INeJ60/2g2GevlN+huWsLrBJqi2MqhlFeGK3plxBoD7we5le8hICV57UQtwLwAzpyUMNpkELvdRyqInlpWkP51zTtyU/j1mtElpO3zXhf4FcMXcDMnXEUgINS5keBCG0MGRkTrpzC5+aeHOL7txmNmJz52hhvu0LykZH7iiSGT4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=pI8s02Y0; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="pI8s02Y0" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A8BAA1AED; Thu, 26 Mar 2026 11:11:52 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A0A43F905; Thu, 26 Mar 2026 11:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1774548718; bh=dgIj3a5tK1onWSWVfqDJCKoL+8uwDoGTJyJ7ifoq1WE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pI8s02Y0og85zbp1uQ8eqYQhI5vaRqB/BdG9J9LhF+uyJtQfveZ9OA2eDC5pKbLZ7 uh+Oa5bRLyHYGTTeXgVYdM5ddoR/qrKKdcafCsmegawct+nuY/dIFNB3sSOLvG2PV6 flVGMh48lSb196pxzpduqOUBoBeYQdCsS9c2h4tY= Date: Thu, 26 Mar 2026 18:11:51 +0000 From: Mark Rutland To: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, ada.coupriediaz@arm.com, catalin.marinas@arm.com, linux-kernel@vger.kernel.org, luto@kernel.org, peterz@infradead.org, ruanjinjie@huawei.com, vladimir.murzin@arm.com, will@kernel.org Subject: Re: [PATCH 1/2] arm64/entry: Fix involuntary preemption exception masking Message-ID: References: <20260320113026.3219620-1-mark.rutland@arm.com> <20260320113026.3219620-2-mark.rutland@arm.com> <87eclek0mb.ffs@tglx> <87341ujwl4.ffs@tglx> <87fr5six4d.ffs@tglx> <87ecl7gbeu.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ecl7gbeu.ffs@tglx> On Wed, Mar 25, 2026 at 04:46:01PM +0100, Thomas Gleixner wrote: > On Wed, Mar 25 2026 at 11:03, Mark Rutland wrote: > > On Sun, Mar 22, 2026 at 12:25:06AM +0100, Thomas Gleixner wrote: > > I *think* what would work for us is we could split some of the exit > > handling (including involuntary preemption) into a "prepare" step, as we > > have for return to userspace. That way, arm64 could handle exiting > > something like: > > > > local_irq_disable(); > > irqentry_exit_prepare(); // new, all generic logic > > local_daif_mask(); > > arm64_exit_to_kernel_mode() { > > ... > > irqentry_exit(); // ideally irqentry_exit_to_kernel_mode(). > > ... > > } > > > > ... and other architectures can use a combined exit_to_kernel_mode() (or > > whatever we call that), which does both, e.g. > > > > // either noinstr, __always_inline, or a macro > > void irqentry_prepare_and_exit(void) > > That's a bad idea as that would require to do a full kernel rename of > all existing irqentry_exit() users. > > > { > > irqentry_exit_prepare(); > > irqentry_exit(); > > } > > Aside of the naming that should work. Thanks for confirming! I've pushed a (very early, WIP) draft to https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/log/?h=arm64/entry/rework ... which is missing commit messages, comments, etc, but seems to work. I'll see about getting that tested, cleaned up, and on-list. Mark.