From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752634AbdK0Wjz (ORCPT ); Mon, 27 Nov 2017 17:39:55 -0500 Received: from merlin.infradead.org ([205.233.59.134]:39586 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752126AbdK0Wjy (ORCPT ); Mon, 27 Nov 2017 17:39:54 -0500 Date: Mon, 27 Nov 2017 23:39:40 +0100 From: Peter Zijlstra To: linux-kernel@vger.kernel.org Cc: Dave Hansen , Andy Lutomirski , Ingo Molnar , Borislav Petkov , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Josh Poimboeuf , Linus Torvalds , Rik van Riel , daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, linux-mm@kvack.org, michael.schwarz@iaik.tugraz.at, moritz.lipp@iaik.tugraz.at, richard.fellner@student.tugraz.at Subject: Re: [PATCH 1/5] x86/mm/kaiser: Alternative ESPFIX Message-ID: <20171127223940.eedtdizvjqclz4xc@hirez.programming.kicks-ass.net> References: <20171127223110.479550152@infradead.org> <20171127223405.181647306@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171127223405.181647306@infradead.org> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 27, 2017 at 11:31:11PM +0100, Peter Zijlstra wrote: > Change the asm to do the CR3 switcheroo so we can remove the magic > mappings. > > Since RDI is unused after SWAPGS we can use it as a scratch reg for > SWITCH_TO_KERNEL. And once we've computed the new RSP (in RAX) we no > longer need RDI and can again use it as scratch reg for > SWITCH_TO_USER. Forgot to note; this passes tools/testing/selftests/x86/sigreturn_64. > Signed-off-by: Peter Zijlstra (Intel)