All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <dvlasenk@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Joerg Roedel <joro@8bytes.org>, Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	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
Date: Sat, 26 Sep 2015 22:38:25 +0200	[thread overview]
Message-ID: <56070241.2030407@redhat.com> (raw)
In-Reply-To: <706E9982-24E3-442B-808A-172909449DD4@zytor.com>

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@redhat.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.


  reply	other threads:[~2015-09-26 20:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-26 18:00 [PATCH] x86: Use entire page for the per-cpu GDT only if paravirt-enabled Denys Vlasenko
2015-09-26 19:50 ` H. Peter Anvin
2015-09-26 20:38   ` Denys Vlasenko [this message]
2015-09-28  7:58     ` Ingo Molnar
2015-09-28 12:45       ` Denys Vlasenko
2015-09-29  9:01         ` Ingo Molnar
2015-09-29 17:35           ` Andy Lutomirski
2015-09-29 17:50             ` Linus Torvalds
2015-09-29 18:02               ` Andy Lutomirski
2015-09-29 20:30                 ` H. Peter Anvin
2015-09-30  1:20               ` Eric W. Biederman
2015-09-30  1:31                 ` H. Peter Anvin
2015-09-30  2:11                   ` Eric W. Biederman
2015-09-30  2:26                     ` H. Peter Anvin
2015-09-29 18:18             ` H. Peter Anvin
2015-09-29 18:22               ` Andy Lutomirski
2015-09-29 18:27                 ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56070241.2030407@redhat.com \
    --to=dvlasenk@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=gleb@kernel.org \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.