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 892083E5EFA for ; Tue, 24 Mar 2026 10:52:09 +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=1774349530; cv=none; b=pQsYTKJTapaJ84gQ/ZFsvtgkJnKOFan+abff8GrT4QEHEEJum7OlhR6wGdIoQWjtmDA5VODf/Xq/bPovVCD35msch79llZ35LFnUQEbpMJioXjmj0stZsdH2uTdnXMtNxS+LZcg7dzD0k6dNgaT87H/eEVKj75YAJnvX6FLVWkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774349530; c=relaxed/simple; bh=kFqW3k9xk0+DFBq32LkW7sFFs/pgH/suDmfz+5I39pY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A6zrV39/gsPKFoDQIeYp38GfRxEtYfN7u/wLKsXsb/6PD3T8ggCVktXZboZTPP8vBQKOwj1u/YCxparDg8aO407ak5RWFLJQ4whKpl4RFd4cU4YtSaiB640D2QUUlBT/2XnIHOSMcwXtrO9fzwWyqpyDqHGWSfU5jBbXWEGwH6A= 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; 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 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 06FD6153B; Tue, 24 Mar 2026 03:52:03 -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 778003F73B; Tue, 24 Mar 2026 03:52:07 -0700 (PDT) Date: Tue, 24 Mar 2026 10:51:44 +0000 From: Mark Rutland To: Jinjie Ruan 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, tglx@kernel.org, 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> 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: On Tue, Mar 24, 2026 at 11:14:28AM +0800, Jinjie Ruan wrote: > On 2026/3/20 19:30, Mark Rutland wrote: > > On arm64, involuntary kernel preemption has been subtly broken since the > > move to the generic irq entry code. When preemption occurs, the new task > > may run with SError and Debug exceptions masked unexpectedly, leading to > > a loss of RAS events, breakpoints, watchpoints, and single-step > > exceptions. > > We can also add a check in arch_irqentry_exit_need_resched to prevent > schedule-out when the DA bit is set. That *might* be good enough for a backport to stable, but that's not the right fix going forwards. Checking the DAIF.DA bits will prevent preemption from anything other than real interrupts, and Thomas said we should preempt wherever possible: https://lore.kernel.org/linux-arm-kernel/87h5qak2uv.ffs@tglx/ The interrupt handling path is also inconsistent w.r.t. masking DAIF upon return, and with that cleaned up it'll look the same as other exceptions, and we can't rely on DAIF.DA. I think there are alternative options here; I have a half-written reply to Thomas's other message: https://lore.kernel.org/linux-arm-kernel/87fr5six4d.ffs@tglx/ ... and I'll try to finish that up and get it out shortly. Mark.