From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E6D22236FA for ; Wed, 26 Nov 2025 16:30:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174661; cv=none; b=p2J/h4G43f3Q48/BfAqPrv6ioyMqgpJKagWVtPahpTtahV2WLs32iLhRjnfWkPiR+DWCwl21kr02Qxo/fBcH+P3U3ZSA21fmxjvIGHAuZMh/YR20jokBGEC9+KCHF6ljPMcklhKQo/TC4nlNH/tG3Qgnx+USZav/MN6SttUDzLY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174661; c=relaxed/simple; bh=7BlUGTaO7dQGI1yeOghzP953qq4VGMiV9A0t5kye/og=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=n2L0TvKZ/KfmwAq1byft9Pbo9pbTwtgm/yrnmxaejujTfZVHE3FHiGrRXAoMkdaydB6T5Yu8X3QpjmYhmBPF9MCdu134NwlXGtTtJZtNTed5xvx3Fn6hC8NkcG7CQVX6TqNtbS4HFfDgsHzPTuG23QIgZDVSdohhEDn0+Tjb1qs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=LHZFJ3TT; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="LHZFJ3TT" 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=CMvi7Fy6ZGhm2TzTfBzzepWGAOaPiHfR1FWPBoJ99yc=; b=LHZFJ3TTL2+yOZ2D+kF1CegwD3 p4scd3WZKwU0D5zRXgeRfIExYWDrmDbma+ITQOJpheC5LLgSNaM2As3+iC591dDZ41CckZWnyWwBW 64IsnZLxjoFIFxByVOR5FXEn2q6QCmj6KDsgrBsyPZOeQCqoVulQbgy2oTZ1N/n5biahQcPv4Q0sK 3PoHjBaQHTBkSlWqiLJIecNZre8tc7hy8nN8G8/EOInLAY4ZTUDRQsiYRmYR4nbs1PNZETbEn/URh RGcUUBeIOTK1PMABWo5qdCnTnhuDGskBhj6inkPd5qOesFR2mYcvnpCGWqDTi+n0alLWTD+TQn63i LWv8H7Ow==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOIPo-0000000AOF6-3KI9; Wed, 26 Nov 2025 16:30:48 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 61B2730036B; Wed, 26 Nov 2025 17:30:47 +0100 (CET) Date: Wed, 26 Nov 2025 17:30:47 +0100 From: Peter Zijlstra To: "Chang S. Bae" Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Subject: Re: [DISCUSSION] x86: In-Kernel Use of Extended General-Purpose Registers Message-ID: <20251126163047.GA3666665@noisy.programming.kicks-ass.net> References: <20251124213227.123779-1-chang.seok.bae@intel.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: <20251124213227.123779-1-chang.seok.bae@intel.com> On Mon, Nov 24, 2025 at 09:32:23PM +0000, Chang S. Bae wrote: > This follows how vector registers are used today in places like crypto > routines. AVX state usage is bracketed by kernel_fpu_begin() / > kernel_fpu_end(). EGPRs could be similarly used in a small bounded > region. > > Under this model: > > * No changes are needed to the existing XSTATE management API. > > * Preemption and softirqs would be disabled while EGPRs are live, > subsequently limiting usage to small regions. > > * This lends itself mostly to hand-written assembly, which is less > scalable for broader adoption. IIRC it isn't hard to make kernel_fpu_begin/end() preemptible. It came up with the last xsave rework -- mostly in the context of -rt, but nobody ever picked it up and did it.