From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D70AEC388F9 for ; Thu, 19 Nov 2020 21:21:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6597B22254 for ; Thu, 19 Nov 2020 21:21:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="feovV58I"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="g+p6OGY5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726370AbgKSVUl (ORCPT ); Thu, 19 Nov 2020 16:20:41 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:36114 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726129AbgKSVUl (ORCPT ); Thu, 19 Nov 2020 16:20:41 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605820839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZKbqn9VXgNpOqO/gQTqxdK8gHKgwjQY8spBTlAGs3Cs=; b=feovV58IxK3uNezc6Y23E/UCPLw8nJAlrH1EYvludowU5GBgDX+NLJiUu7RN4bPFz3Fj2M Id6IJ50GvGKk88fgHtEC+sTiMVm1fjOeoqe+39x6MteCa0AK1w7AJskDjlL4XZgenXHhKj 1uw/Fnjva45pp1rgRa9/FUIrHt/EiSr+jK2kKu69Zz/8pW4Kox0xToZ13t9o0FCAfcUqMf fqnIaRfoVlyHp5R98KXYmTw1Wp8KcRt7+vrIfMfVn/3yYcEjrejmH3D5uF9i9tx1LDHGnX 3VTmHZUkGaRjbw8p4PngYU5IluwKQYFc51EXN4TZhjNDG08KLGM2xuKwvgFtDw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605820839; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZKbqn9VXgNpOqO/gQTqxdK8gHKgwjQY8spBTlAGs3Cs=; b=g+p6OGY5Zofr5cyA/kujV78vO8bjYw7zMK8UpT3wG/0ZrRAmFZ7rYQw/0cBRpH1ja0n1kT hbcvX++9WTU2XjAw== To: Alexandre Chartre , Andy Lutomirski Cc: Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , X86 ML , Dave Hansen , Peter Zijlstra , LKML , Tom Lendacky , Joerg Roedel , Konrad Rzeszutek Wilk , jan.setjeeilers@oracle.com, Junaid Shahid , oweisse@google.com, Mike Rapoport , Alexander Graf , mgross@linux.intel.com, kuzuno@gmail.com Subject: Re: [RFC][PATCH v2 12/21] x86/pti: Use PTI stack instead of trampoline stack In-Reply-To: References: <20201116144757.1920077-1-alexandre.chartre@oracle.com> <20201116144757.1920077-13-alexandre.chartre@oracle.com> <87ft55p3gp.fsf@nanos.tec.linutronix.de> Date: Thu, 19 Nov 2020 22:20:38 +0100 Message-ID: <87zh3dnivt.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 19 2020 at 20:55, Alexandre Chartre wrote: > On 11/19/20 8:10 PM, Thomas Gleixner wrote: > Sorry I mixed up a few thing; I got confused with my own code which is not a > good sign... > > It's not sleeping with the user page-table which, as you mentioned, doesn't > make sense, it's sleeping with the kernel page-table but with the PTI stack. > > Basically, it is: > - entering C code with (user page-table, PTI stack); > - then it switches to the kernel page-table so we have (kernel page-table, PTI stack); > - and then it switches to the kernel stack so we have (kernel page-table, kernel stack). > > As this is all C code, some of which is executed with the PTI stack, we need the PTI stack > to be per-task so that the stack is preserved, in case that C code does a sleep/schedule > (no matter if this happens when using the PTI stack or the kernel stack). That makes some more sense, but I'm not convinced that this dual stack is really a good thing. Thanks, tglx