From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 144DD3ED5D6 for ; Mon, 29 Jun 2026 08:41:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782722476; cv=none; b=UsA5Xcn7t9hukZKSPCwxOSuyhMWsjaZI1vahOwREW9yh44q/W2TZncamuBYZ3qi7c3B32L86WJM9o0nEgEMOkZVM6TczrADsk1+y+WS+9Y9HHT6zbCmA9Ec/DnDBRiESz2dQHWF9HFG4eY2JOzhQvHISvpTSmIsbso+cxDpCqAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782722476; c=relaxed/simple; bh=yfkssgBoiQ6bVfPaoqfkHc4dekis+Bm6SNpXHbgRJFA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=hEI7V0L4c+SJ4zAFuIO4W/AIGkSJ8EyeGEjjaLlFmwVWDVnYX9/PiWFsCisS8yBVnicKkJLf71f8pBDHcqJ+uAuMHD7yAiCPmhRM5T/5X052OlQy6g7GrVpeYzIgSUWQF03chH84caQO60zAR2bVAx5d8XU8zfmeWdqxKqcZsUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=H0HRWXtu; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="H0HRWXtu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F5581F000E9; Mon, 29 Jun 2026 08:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782722475; bh=yfkssgBoiQ6bVfPaoqfkHc4dekis+Bm6SNpXHbgRJFA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=H0HRWXtuJ2HLeUnPWK4mdYB2zisrtpwGufv0M4V/iKLqrq5n1WACDZ2o2xj5SXrHV HwK+KkD541OO7p7m5tYnemIhi+nC9NYHm4XgFUYTfP3IxzCyt9UQcT4YiZEjLy10Yo wdYMhJzw2PT0bEv4AOxv0Ep0/zjfMqR1jJgLbEla4avhJ66Y0qK3A8m/EJrUgYIHGH fA4NLMFj2l7oP/PlsdOqZqCYFGMmY/DI94iI9+hPkGW+9/nlbYGBJFbM7X0ylrBAIs FmmydQMoXplVeO4r3x1ceaNS656nARlDZVUKxdIEnEgmfiEOCvLARz0KwRnk0dfzEq jxMsfiAXRwRSA== From: Thomas Gleixner To: "H. Peter Anvin" , David Stevens Cc: Pasha Tatashin , Linus Walleij , Will Deacon , Quentin Perret , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Andy Lutomirski , Xin Li , Peter Zijlstra , Andrew Morton , David Hildenbrand , Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Uladzislau Rezki , Kees Cook , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 12/13] x86: Add support for dynamic kernel stacks via FRED In-Reply-To: <888C322E-BF59-4C72-BFD2-2E71FD8605C0@zytor.com> References: <20260424191456.2679717-1-stevensd@google.com> <20260424191456.2679717-13-stevensd@google.com> <87zf0hgc3r.ffs@fw13> <87ldbyhatz.ffs@fw13> <888C322E-BF59-4C72-BFD2-2E71FD8605C0@zytor.com> Date: Mon, 29 Jun 2026 10:41:13 +0200 Message-ID: <878q7xspqu.ffs@fw13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Sun, Jun 28 2026 at 13:33, H. Peter Anvin wrote: > On June 28, 2026 9:46:32 AM PDT, Thomas Gleixner wrote: >>> That sort of fault would probably end up either with a >>> page_fault_oops() or risk a context switch with SL>0, but we shouldn't >>> make debugging harder with UB. >> >>Definitely not :) >> >>You can avoid quite some of the problems right in the ASM entry code. >>Instead of checking event type/vector and then going to the stack switch >>logic, you can check the stack level on which the event happened >>first. If it's not 0, then there is nothing to do. >> >> > > To be fair, for this *specific* case, memmove() does exist for a reason :) It does, but why bother doing actual work, if you know upfront that it's not required :)