From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753972AbbIZUia (ORCPT ); Sat, 26 Sep 2015 16:38:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33907 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753664AbbIZUi3 (ORCPT ); Sat, 26 Sep 2015 16:38:29 -0400 Message-ID: <56070241.2030407@redhat.com> Date: Sat, 26 Sep 2015 22:38:25 +0200 From: Denys Vlasenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: "H. Peter Anvin" , Ingo Molnar CC: Konrad Rzeszutek Wilk , Boris Ostrovsky , David Vrabel , Joerg Roedel , Gleb Natapov , Paolo Bonzini , kvm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: Use entire page for the per-cpu GDT only if paravirt-enabled References: <1443290440-14930-1-git-send-email-dvlasenk@redhat.com> <706E9982-24E3-442B-808A-172909449DD4@zytor.com> In-Reply-To: <706E9982-24E3-442B-808A-172909449DD4@zytor.com> 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 09/26/2015 09:50 PM, H. Peter Anvin wrote: > NAK. We really should map the GDT read-only on all 64 bit systems, > since we can't hide the address from SLDT. Same with the IDT. Sorry, I don't understand your point. > On September 26, 2015 11:00:40 AM PDT, Denys Vlasenko wrote: >> We have our GDT in a page-sized per-cpu structure, gdt_page. >> >> On x86_64 kernel, GDT is 128 bytes - only ~3% of that page is used. >> >> It is page-sized because of paravirt. Hypervisors need to know when >> GDT is changed, so they remap it read-only and handle write faults. >> If it's not in its own page, other writes nearby will cause >> those faults too. >> >> In other words, we need GDT to live in a separate page >> only if CONFIG_HYPERVISOR_GUEST=y. >> >> This patch reduces GDT alignment to cacheline-aligned >> if CONFIG_HYPERVISOR_GUEST is not set. >> >> Patch also renames gdt_page to cpu_gdt (mimicking naming of existing >> cpu_tss per-cpu variable), since now it is not always a full page.