Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4017739pxb; Tue, 17 Nov 2020 09:11:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJwJ33Xbgxcp6WFwPS2a/rSYoEolzYhEoisUxGkSn0bG8QdECff0t4/p7ZOmhza30YpKRc94 X-Received: by 2002:a17:906:1542:: with SMTP id c2mr10364996ejd.382.1605633084584; Tue, 17 Nov 2020 09:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605633084; cv=none; d=google.com; s=arc-20160816; b=0zbQ+h5wO9Z8vcZFW8a+HXAIM5N+14lgNidZ0rlTWv3Q65r5Z2Eef6fcdbPjBJt2eH OdW4R/hSyp+5GzctCxhQoNktF1twL1C+MFZXZ7Xal2Gd3oEiODPz8gwOxrGXOPs4JPrU yhQIIGlgdDFe7sXmsDGup2OUGqwVOr0qOGPplpJkvX/JVucPewvzERUMzRo67SNwmuCg t3Xl1zr6gJewOBXFH0NQC74f0HwVcxh3oWb5M6cPcfHmMIpn7BBSUhnMixbVF3Bitewe PnGEuYobbBSwKs3jLKUHTSSbgDS9oIozYFZiWgKzXiiBuOIrs+oVC7TZELwhX0j2FKDH LlNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DJgCtIjBDNS0OHlgANP+y4Xcsaz/d3+IMCtvPwqMqpI=; b=ElvSZoqMkyDM0A8iE+gUhROqbSk1UTdhEgi6Pk3HdPiNYzChHCmhrAl5Kglhs5BBh4 XGgW1ma9PkR5/VuYjS5cKmEWqgy5GEXTPSICFBC71W+hiQdWjegZgIatDGvEie9fXul/ 0gM7SQc8fGsCeH61JC5msmK0iKlitmE403y47QH8qIghXd4oY3B9aLs1HkQLu86HGook wGughHjI4FaQfL1wljUd2jBhWWTZtvaYQG+iwgOAtps5l7TggmBfP+GE+lSaiRh8YpYz GUwYekXXlGG1caSMYMU+0YHmp1YHKaPVDkJyJWAF4I3sISLzUMMgsyNII4rOnevYA0qx mWEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=QrcmnPdx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si5172592ejq.414.2020.11.17.09.10.59; Tue, 17 Nov 2020 09:11:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=QrcmnPdx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727556AbgKQRHm (ORCPT + 99 others); Tue, 17 Nov 2020 12:07:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbgKQRHm (ORCPT ); Tue, 17 Nov 2020 12:07:42 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 292C1C0613CF for ; Tue, 17 Nov 2020 09:07:42 -0800 (PST) Received: from zn.tnic (p200300ec2f1013008aaa2b5438c9ced9.dip0.t-ipconnect.de [IPv6:2003:ec:2f10:1300:8aaa:2b54:38c9:ced9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 9CB191EC027D; Tue, 17 Nov 2020 18:07:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1605632860; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=DJgCtIjBDNS0OHlgANP+y4Xcsaz/d3+IMCtvPwqMqpI=; b=QrcmnPdx8cd5goZzLYIdjA4acvgeS0gYIu0jz5r/V/z423H+0r/+8J+ucYTRsSLJ6i4oMQ OUTfULijsGXZGsrugNEX6qcCY0Noemr5SEm9KQIDi4KevmbQvoEoYJS1A159h9FnZLbdAN ufL/bQXYH16IG1fDFM6xevzOZuWpPhY= Date: Tue, 17 Nov 2020 18:07:35 +0100 From: Borislav Petkov To: Alexandre Chartre Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, thomas.lendacky@amd.com, jroedel@suse.de, konrad.wilk@oracle.com, jan.setjeeilers@oracle.com, junaids@google.com, oweisse@google.com, rppt@linux.vnet.ibm.com, graf@amazon.de, mgross@linux.intel.com, kuzuno@gmail.com Subject: Re: [RFC][PATCH v2 00/21] x86/pti: Defer CR3 switch to C code Message-ID: <20201117170735.GH5719@zn.tnic> References: <20201116144757.1920077-1-alexandre.chartre@oracle.com> <20201116202426.GF1131@zn.tnic> <692599af-53c8-7881-2bc7-8898085400cd@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <692599af-53c8-7881-2bc7-8898085400cd@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 09:19:01AM +0100, Alexandre Chartre wrote: > We are not reversing PTI, we are extending it. You're reversing it in the sense that you're mapping more kernel memory into the user page table than what is mapped now. > PTI removes all kernel mapping from the user page-table. However there's > no issue with mapping some kernel data into the user page-table as long as > these data have no sensitive information. I hope that is the case. > Actually, PTI is already doing that but with a very limited scope. PTI adds > into the user page-table some kernel mappings which are needed for userland > to enter the kernel (such as the kernel entry text, the ESPFIX, the > CPU_ENTRY_AREA_BASE...). > > So here, we are extending the PTI mapping so that we can execute more kernel > code while using the user page-table; it's a kind of PTI on steroids. And this is what bothers me - someone else might come after you and say, but but, I need to map more stuff into the user pgt because I wanna do X... and so on. > The minimum size would be 1 page (4KB) as this is the minimum mapping size. > It's certainly enough for now as the usage of the PTI stack is limited, but > we will need larger stack if we won't to execute more kernel code with the > user page-table. So on a big machine with a million tasks, that's at least a million pages more which is what, ~4 Gb? There better be a very good justification for the additional memory consumption... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette