Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758895AbaDXWjM (ORCPT ); Thu, 24 Apr 2014 18:39:12 -0400 Received: from terminus.zytor.com ([198.137.202.10]:33201 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757639AbaDXWjJ (ORCPT ); Thu, 24 Apr 2014 18:39:09 -0400 Message-ID: <53599225.7010407@zytor.com> Date: Thu, 24 Apr 2014 15:37:25 -0700 From: "H. Peter Anvin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Andrew Lutomirski , "H. Peter Anvin" CC: comex , Linux Kernel Mailing List , Linus Torvalds , Ingo Molnar , Alexander van Heukelum , Konrad Rzeszutek Wilk , Boris Ostrovsky , Borislav Petkov , Arjan van de Ven , Brian Gerst , Alexandre Julliard , Andi Kleen , Thomas Gleixner Subject: Re: [PATCH] x86-64: espfix for 64-bit mode *PROTOTYPE* References: <1398120472-6190-1-git-send-email-hpa@linux.intel.com> <53598F2F.1030306@linux.intel.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/24/2014 03:31 PM, Andrew Lutomirski wrote: > > I was imagining just randomizing a couple of high bits so the whole > espfix area moves as a unit. > >> We could XOR with a random constant with no penalty at all. Only >> problem is that this happens early, so the entropy system is not yet >> available. Fine if we have RDRAND, but... > > How many people have SMAP and not RDRAND? I think this is a complete > nonissue for non-SMAP systems. > Most likely none, unless some "clever" virtualizer turns off RDRAND out of spite. >>> Peter, is this idea completely nuts? The only exceptions that can >>> happen there are NMI, MCE, #DB, #SS, and #GP. The first four use IST, >>> so they won't double-fault. >> >> It is completely nuts, but sometimes completely nuts is actually useful. >> It is more complexity, to be sure, but it doesn't seem completely out >> of the realm of reason, and avoids having to unwind the ministack except >> in the normally-fatal #DF handler. #DFs are documented as not >> recoverable, but we might be able to do something here. >> >> The only real disadvantage I see is the need for more bookkeeping >> metadata. Basically the bitmask in espfix_64.c now needs to turn into >> an array, plus we need a second percpu variable. Given that if >> CONFIG_NR_CPUS=8192 the array has 128 entries I think we can survive that. > > Doing something in #DF needs percpu data? What am I missing? You need the second percpu variable in the espfix setup code so you have both the write address and the target rsp (read address). -hpa -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/