From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Readonly GDT Date: Tue, 09 Apr 2013 17:43:41 -0700 Message-ID: <5164B5BD.5050702@zytor.com> References: <20130408224328.GA17641@www.outflux.net> <51634935.9010905@zytor.com> <51645D6F.7070705@zytor.com> <51646054.3090509@zytor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Eric Northup Cc: Alexander Duyck , Alex Shi , Jeremy Fitzhardinge , Will Drewry , Kees Cook , Julien Tinnes , Konrad Rzeszutek Wilk , Frederic Weisbecker , Dan Rosenberg , "x86@kernel.org" , LKML , Steven Rostedt , Borislav Petkov , Ingo Molnar , "kernel-hardening@lists.openwall.com" , "Paul E. McKenney" , "virtualization@lists.linux-foundation.org" , "xen-devel@lists.xensource.com" List-Id: virtualization@lists.linuxfoundation.org OK, thinking about the GDT here. The GDT is quite small -- 256 bytes on i386, 128 bytes on x86-64. As such, we probably don't want to allocate a full page to it for only that. This means that in order to create a readonly mapping we have to pack GDTs from different CPUs together in the same pages, *or* we tolerate that other things on the same page gets reflected in the same mapping. However, the packing solution has the advantage of reducing address space consumption which matters on 32 bits: even on i386 we can easily burn a megabyte of address space for 4096 processors, but burning 16 megabytes starts to hurt. It would be important to measure the performance impact on task switch, though. -hpa -- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.