From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 A78F57C086; Thu, 11 Jul 2024 08:15:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720685727; cv=none; b=TFBEE6OSSVWokYeFF7b6kAq+KqQiAdrt5YblUReh+rk1E9xq4vfg+64dEaBQoWbx6NfwVu+XVKOwC+lzYhC8ja+5l55DrzygTr+0fat5gjtfAgVp15wVRO67cntIUn1iTDSHe3DB/F8k3348pw2Tpyto1zxdnTX7sXKbF7jxg1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720685727; c=relaxed/simple; bh=x1Jcj6NeCHQN+40mLrILfGkWZv5ImKM4gWH+YNibv8A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h4YNYg+9L/7dWNMMGs4pjDrw5L7q7/lMzHxK9XO8rFHbNCMTtZEjlo/xp4pF9hl3xnldEpCvsTUK+UX7T8b8wBf/NYTvo/+1MrGVNq3b4RyOp66fa6tBhmQTCkBrIFLPegmAPtnAJTuVrD53X1103CWJmzxW14IeKslqpziGS2Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (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=bDIS618x; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (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="bDIS618x" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; 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=6wtDOfAx6qXoOFW0qLJr9ozkAFTcFE7m6rFzVFkQzO0=; b=bDIS618xw2CxgiOtsh/B1dnK1c 5JxPG3AbH1eB2KbyzbpFIS68eMDIWBBCocACVVe0B0ks1BIusZuYjKgOxgUn5YaUaSuDLiX7savkg qv+Ib+kmFId0ueTeEQsoI+aPpbo3dN1DGWQeGZ/laUcxWPDhYdj0dDwXR/knUfxWq2vYVNbV3vXCZ hXAftDHoT3WLufeo50lSqDsPIPI9pPrXbHOscPRD57CGGM4MbercD0nOAs/1WOJRLbY0kD1PbeGps /CeRzudxg3FpfW/wEJ1NfH/LEGC9fRLCIt+d0P8Hy7udIGJzm2pdYWzps+bx5H/BRQeoha+vqYmMV 9poUU9Bg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRoxA-000000013Yy-0kHs; Thu, 11 Jul 2024 08:15:00 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id CCDF730050D; Thu, 11 Jul 2024 10:14:59 +0200 (CEST) Date: Thu, 11 Jul 2024 10:14:59 +0200 From: Peter Zijlstra To: "Kirill A. Shutemov" Cc: Borislav Petkov , Alexander Shishkin , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Ard Biesheuvel , "Paul E. McKenney" , Josh Poimboeuf , Xiongwei Song , Xin Li , "Mike Rapoport (IBM)" , Brijesh Singh , Michael Roth , Tony Luck , Alexey Kardashevskiy , Jonathan Corbet , Sohil Mehta , Ingo Molnar , Pawan Gupta , Daniel Sneddon , Kai Huang , Sandipan Das , Breno Leitao , Rick Edgecombe , Yian Chen , Alexei Starovoitov , Hou Tao , Juergen Gross , Vegard Nossum , Kees Cook , Eric Biggers , Jason Gunthorpe , "Masami Hiramatsu (Google)" , Andrew Morton , Luis Chamberlain , Yuntao Wang , Rasmus Villemoes , Christophe Leroy , Tejun Heo , Changbin Du , Huang Shijie , Geert Uytterhoeven , Namhyung Kim , Arnaldo Carvalho de Melo , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org Subject: Re: [PATCH v4 03/16] x86/alternatives: Disable LASS when patching kernel alternatives Message-ID: <20240711081459.GE4587@noisy.programming.kicks-ass.net> References: <20240710160655.3402786-1-alexander.shishkin@linux.intel.com> <20240710160655.3402786-4-alexander.shishkin@linux.intel.com> <20240710171836.GGZo7CbFJeZwLCZUAt@fat_crate.local> Precedence: bulk X-Mailing-List: linux-doc@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 Thu, Jul 11, 2024 at 01:33:23AM +0300, Kirill A. Shutemov wrote: > On Wed, Jul 10, 2024 at 07:18:36PM +0200, Borislav Petkov wrote: > > On Wed, Jul 10, 2024 at 07:06:39PM +0300, Alexander Shishkin wrote: > > > static void text_poke_memcpy(void *dst, const void *src, size_t len) > > > { > > > - memcpy(dst, src, len); > > > + stac(); > > > + __inline_memcpy(dst, src, len); > > > + clac(); > > > > I think you need LASS-specific stac()/clac() or an alternative_2 or so. You > > can't cause that perf penalty on !LASS machines. > > Hm. Do we have text_poke() in hot path? > > Even if we do, I doubt flipping AC flag would make any performance > difference in context of all locking and TLB flushing we do in this > codepath. The one where performance might matter is text_poke_early(), the full fat one is comically slow as you point out.