Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752800AbeACUPb (ORCPT + 1 other); Wed, 3 Jan 2018 15:15:31 -0500 Received: from www.llwyncelyn.cymru ([82.70.14.225]:41152 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752792AbeACUP3 (ORCPT ); Wed, 3 Jan 2018 15:15:29 -0500 Date: Wed, 3 Jan 2018 20:15:26 +0000 From: Alan Cox To: Albert Cahalan Cc: linux-kernel@vger.kernel.org Subject: Re: page table isolation alternative mechanism Message-ID: <20180103201526.3e8251c6@alans-desktop> In-Reply-To: References: Organization: Intel Corporation X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, 3 Jan 2018 14:22:37 -0500 Albert Cahalan wrote: > We got into the current situation for performance reasons, avoiding the costly > reload of CR3 that a hardware task switch would cause. It seems we'll be > loading CR3 now anyway, so it might be time to reconsider hardware > task switches. > > The recent patches leave kernel entry/exit code mapped. Hardware task switches > wouldn't need that. All they need is a single entry in a reduced-size > IDT, for the > doublefault, and a minimal GDT, and a TSS. Taking the fault switches CR3. That > then gets you a proper IDT and GDT because those are virtually mapped. > Not a single byte of kernel code would need to be mapped while user code runs. I can see how that works for 32bit assuming you don't set up the fast syscall/ret stuff but for 64bit I don't see how you'd make it work easily because a syscall isn't an interrupt or trap any more so it can't be a task or any other kind of gate. Alan