From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ACDB1ACED5 for ; Tue, 20 Jan 2026 18:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768934746; cv=none; b=oyp/zZc58gVTIGNWj4XFCu1ol7RQj4zWEPDJX+yQRoc1122y+bhVDtCpBwv+mvhYWz6+msIxplEv4mybGw69boROaddR2TW7sx7DkfPgVA2OkkxYSAdhVBEV/O7xlft+0XoekrtTBiMhHtWzZGBuZRnoNfqLuv/e+2PRiW6707U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768934746; c=relaxed/simple; bh=yDbiboXvrRh+ivSKcybv8FalD/6w3BtuEBLuaJUmJwE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h2/TkOmUpsFhyJ9eIyPbTjpk1v83gmGHbslXt6ZmR7MJ6/hvS5caJMBZ/0ARdOqR3q9vWnJrXwA/bVkFENuipaQecECk5MMyxRryEqW+JjWHzPSgJ14xASlhqTdVQS7XeYO5WY+ya+mml+XI3Wff0iPh2/Ej+g5UZ/Z98Nh8U0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AV/ELTjQ; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AV/ELTjQ" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4358fb60802so65970f8f.1 for ; Tue, 20 Jan 2026 10:45:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768934743; x=1769539543; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=thnE7Lerq2YAOWgwctI0eLWWpc+gSu6vXOqPs3mAkT8=; b=AV/ELTjQ1q2kuPpOal2LcflAh8YWQ0n/W6YBPlugIgwvsrq2Sn8td5EZTtyGf5LG5Z aE2A6UTUU2ExQB22aU73V+hJay8yMrTXF+a0y9kTl7rSaNzpOzepQ0O5ABciIIfNSIFA rSLVpZj60j94NG/XkcXTJuyQsq6VOD4Z9rRIHGrpw+kVFqax/WWLO/EyuruEsHu/To+U Ii+iwTzt1DGIfytCSvXKGvBt/4GsvDQOoeGTJnl4Pz9fVaJ8uKAG5D05pNt366oYAmdu tOyQAx6bR1z6iiWHbPw2ZsIfBlBAlys69iWGylIk8e4ToINaSrZW7B5OyKM+Se+/6FH6 523A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768934743; x=1769539543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=thnE7Lerq2YAOWgwctI0eLWWpc+gSu6vXOqPs3mAkT8=; b=UMq5OVa+hnPnmhpPD5mskMuNregmx1idDCOx/byAjuS07pVbf4dTn+UE5NPw1W8H5j /5T/Jp2/ajlpTYdqC/K3+0ZBYJTj+hQrnk82Ab7DwMMJ2t8mxVLBi+15yPjfqx4Am7f+ 6uySrfjlEFIbAd1wytn+mCKrmIls3PP582dXvXxIaaSk1NHraQhNDg8rpPU0mHJd4wFP i6l4T630X5rpCVIzmw6siL5ni+t6ovhZiRoH81l+kODpcJDkoDPLQm4omJI5Jyh8PRMa BPtTmD985BvtVcorz0X95vuXmDCsAG23AZIVcnxTqM7yxGwpyYSsg/8H6+ihUVLsWjSS nWNA== X-Forwarded-Encrypted: i=1; AJvYcCU772cLAGDshkhSDB+yQw9XYNri4G3uBTghe2TVQIUuK2NJE6PlqLaRSe/5VS7QotTCMbYla6QlrtY17xg=@vger.kernel.org X-Gm-Message-State: AOJu0Yxu3xLn6v0uWFibxYgsmXLr1vgGWgD/2C4QQmhBieBnNH4V+GeO 1t8DzmSnC0SnkzLRf9dzwRCQOjni5AMOMbwD/7FdOk4MjRR+4SyJSbTM X-Gm-Gg: AZuq6aK2BsURWbceVIBdDPNeT/xOrWLJLoV4tTP90lvE+4RfSmex9fymqIIz3gIJE0e 0wuuyUjt7yttR2XDa6y9AnkFvQXspI7pn7CjisEpGI7O2TJF/595YB4k396vSyO7zAjtz42AHuw CHf3mvh5R7qMfF7HZhAn4FaqnlXAuB5eXfKffekw1iwomXMJb7LpOtG9OKarerQJw507Jo3XOXn DSe1HOKKVbFACZUF74TNqWEzgQKt6sA9fRTakDKppHPSTu6T29Z4/Wo04AGOEOMCReK1I/lwH1z oh5jxGBTvw1xgxYi7y4+1B3X4uYm32dr/hvCH71AnevzlMeo9ry5enC0mPp5OvCFWKstWetr8rA H6QFS7hzhMrBREyOvDBK9IHG2W3Vz+yvuTZL/lNS1NQcohIusphf5rj80vCOq/9EbLR727L7AL6 MaaRrqDcA/gna2BSdvGW/E8055lQvxrh/xrgWmEaxiXRS03xVTQYkU X-Received: by 2002:a05:6000:2484:b0:430:fcbc:dc4a with SMTP id ffacd0b85a97d-434d75c16c1mr25592154f8f.19.1768934743113; Tue, 20 Jan 2026 10:45:43 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356997eb1fsm30869735f8f.35.2026.01.20.10.45.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 10:45:42 -0800 (PST) Date: Tue, 20 Jan 2026 18:45:41 +0000 From: David Laight To: Dave Hansen Cc: Ryan Roberts , Kees Cook , Catalin Marinas , Will Deacon , Huacai Chen , Madhavan Srinivasan , Michael Ellerman , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "Gustavo A. R. Silva" , Arnd Bergmann , Mark Rutland , "Jason A. Donenfeld" , Ard Biesheuvel , Jeremy Linton , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v4 0/3] Fix bugs and performance of kstack offset randomisation Message-ID: <20260120184541.0a463cd1@pumpkin> In-Reply-To: References: <20260119130122.1283821-1-ryan.roberts@arm.com> <20fb97f1-7e50-485a-bdfd-a2901d20ec84@intel.com> <785a7d90-babe-43af-93a6-c220c1877bcf@arm.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 20 Jan 2026 08:37:43 -0800 Dave Hansen wrote: > On 1/20/26 08:32, Ryan Roberts wrote: > > I don't think this question was really addressed to me, but I'll give m= y opinion > > anyway; I agree it's pretty binary - it will either work or it will exp= lode. > > I've tested on arm64 and x86_64 so I have high confidence that it works= . If you > > get it into -next ASAP it has 3 weeks to soak before the merge window o= pens > > right? (Linus said he would do an -rc8 this cycle). That feels like eno= ugh time > > to me. But it's your tree =F0=9F=98=89 =20 >=20 > First of all, thank you for testing it on x86! Having that one data > point where it helped performance is super valuable. >=20 > I'm more worried that it's going to regress performance somewhere and > then it's going to be a pain to back out. I'm not super worried about > functional regressions. Unlikely, on x86 the 'rdtsc' is ~20 clocks on Intel cpu and even slower on amd (according to Agner). (That is serialised against another rdtsc rather than other instructions.) Whereas the four TAUSWORTHE() are independent so can execute in parallel. IIRC each is a memory read and 5 ALU instructions - not much at all. The slow bit will be the cache miss on the per-cpu data. You lose a clock at the end because gcc will compile the a | b | c | d as (((a | b) | c) | d) not ((a | b) | (c | d)). I think someone reported the 'new' version being faster on x86, that might be why. David