mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@linux.intel.com>
To: kvm@vger.kernel.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Cc: Xiaoyao Li <xiaoyao.li@linux.intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org, chao.gao@intel.com
Subject: [PATCH v2 0/2] Avoid cpuid faulting leaking and one optimization
Date: Mon, 18 Mar 2019 19:43:22 +0800	[thread overview]
Message-ID: <20190318114324.14198-1-xiaoyao.li@linux.intel.com> (raw)

This series avoid cpuid faulting of host leakding to guest, which may
potentially cause guest boot failure, and use hardware cpuid faulting
to remove emulation overhead.

Patch 1 avoids cpuid faulting leaking to guest through clearing cpuid faulting
bit before enter guest and restoring host's cpuid faulting bit when switch
to host.

Patch 2 enables hardware cpuid faulting for guest if it exists, to avoid
the emulation overhead.

==changelog==
v2:
- move the save/restore of cpuid faulting bit to
vmx_prepare_swich_to_guest/vmx_prepare_swich_to_host to avoid every
vmentry RDMSR, based on Paolo's comment.

==previous version==
v1: https://patchwork.kernel.org/patch/10852253/

Xiaoyao Li (2):
  kvm/vmx: avoid CPUID faulting leaking to guest
  kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

 arch/x86/include/asm/kvm_host.h |  2 ++
 arch/x86/kvm/vmx/vmx.c          | 45 +++++++++++++++++++++++++++++++++
 arch/x86/kvm/vmx/vmx.h          |  2 ++
 arch/x86/kvm/x86.c              | 15 ++++++++---
 4 files changed, 61 insertions(+), 3 deletions(-)

-- 
2.19.1


             reply	other threads:[~2019-03-18 11:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 11:43 Xiaoyao Li [this message]
2019-03-18 11:43 ` [PATCH v2 1/2] kvm/vmx: avoid CPUID faulting leaking to guest Xiaoyao Li
2019-03-18 16:23   ` Sean Christopherson
     [not found]     ` <676340c3796e588900658475dbbcb7d1c6e8ecfe.camel@linux.intel.com>
2019-03-19 14:18       ` Sean Christopherson
2019-03-18 11:43 ` [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead Xiaoyao Li
2019-03-18 16:38   ` Sean Christopherson
2019-03-19  4:37     ` Xiaoyao Li
2019-03-19 14:28       ` Sean Christopherson
2019-03-19 17:51         ` Xiaoyao Li
2019-03-20  0:09           ` Sean Christopherson
2019-03-20 13:26             ` Xiaoyao Li

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=20190318114324.14198-1-xiaoyao.li@linux.intel.com \
    --to=xiaoyao.li@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=chao.gao@intel.com \
    --cc=hpa@zytor.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®