[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56070241.2030407@redhat.com>
Date: Sat, 26 Sep 2015 22:38:25 +0200
From: Denys Vlasenko <dvlasenk@...hat.com>
To: "H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...nel.org>
CC: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
David Vrabel <david.vrabel@...rix.com>,
Joerg Roedel <joro@...tes.org>, Gleb Natapov <gleb@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>, kvm@...r.kernel.org,
x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86: Use entire page for the per-cpu GDT only if paravirt-enabled
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 <dvlasenk@...hat.com> 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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists