public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jingqi Liu <jingqi.liu@intel.com>
To: pbonzini@redhat.com, rkrcmar@redhat.com, tglx@linutronix.de,
	mingo@redhat.com, hpa@zytor.com
Cc: x86@kernel.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, wei.w.wang@intel.com,
	Jingqi Liu <jingqi.liu@intel.com>
Subject: [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU features into VM.
Date: Tue, 10 Jul 2018 16:54:41 +0800	[thread overview]
Message-ID: <1531212883-63173-2-git-send-email-jingqi.liu@intel.com> (raw)
In-Reply-To: <1531212883-63173-1-git-send-email-jingqi.liu@intel.com>

UMONITOR, UMWAIT, and TPAUSE are a set of user wait instructions.

UMONITOR arms address monitoring hardware using an address. A store
to an address within the specified address range triggers the
monitoring hardware to wake up the processor waiting in umwait.

UMWAIT instructs the processor to enter an implementation-dependent
optimized state while monitoring a range of addresses. The optimized
state may be either a light-weight power/performance optimized state
(c0.1 state) or an improved power/performance optimized state
(c0.2 state).

TPAUSE instructs the processor to enter an implementation-dependent
optimized state c0.1 or c0.2 state and wake up when time-stamp counter
reaches specified timeout.

Availability of the user wait instructions is indicated by the presence
of the CPUID feature flag WAITPKG CPUID.0x07.0x0:ECX[5].

This patch exposes the umonitor,umwait, and tpause features to the guest.

The release document ref below link:
https://software.intel.com/sites/default/files/managed/c5/15/\
architecture-instruction-set-extensions-programming-reference.pdf
This patch has a dependency on https://lkml.org/lkml/2018/6/15/657.

Signed-off-by: Jingqi Liu <jingqi.liu@intel.com>
---
 arch/x86/kvm/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
index 7e042e3..e16c05e 100644
--- a/arch/x86/kvm/cpuid.c
+++ b/arch/x86/kvm/cpuid.c
@@ -406,7 +406,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 		F(AVX512VBMI) | F(LA57) | F(PKU) | 0 /*OSPKE*/ |
 		F(AVX512_VPOPCNTDQ) | F(UMIP) | F(AVX512_VBMI2) | F(GFNI) |
 		F(VAES) | F(VPCLMULQDQ) | F(AVX512_VNNI) | F(AVX512_BITALG) |
-		F(CLDEMOTE);
+		F(CLDEMOTE) | F(WAITPKG);
 
 	/* cpuid 7.0.edx*/
 	const u32 kvm_cpuid_7_0_edx_x86_features =
-- 
1.8.3.1

  reply	other threads:[~2018-07-10  8:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10  8:54 [PATCH 0/3] KVM: x86: expose a few new features into VM Jingqi Liu
2018-07-10  8:54 ` Jingqi Liu [this message]
2018-07-10 11:53   ` [PATCH 1/3] KVM: x86: expose UMWAIT/UMONITOR/TPAUSE CPU " kbuild test robot
2018-07-10 12:12   ` kbuild test robot
2018-08-20 10:16   ` Paolo Bonzini
2018-08-20 12:36     ` Liu, Jingqi
2018-07-10  8:54 ` [PATCH 2/3] KVM: x86: expose MOVDIRI CPU feature " Jingqi Liu
2018-07-10 12:25   ` kbuild test robot
2018-07-10  8:54 ` [PATCH 3/3] KVM: x86: expose MOVDIR64B " Jingqi Liu
2018-07-10 10:04   ` kbuild test robot
2018-08-06  8:17 ` [PATCH 0/3] KVM: x86: expose a few new features " Liu, Jingqi
2018-08-06 16:58   ` Paolo Bonzini

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=1531212883-63173-2-git-send-email-jingqi.liu@intel.com \
    --to=jingqi.liu@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 \
    --cc=wei.w.wang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox