qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sheng Yang <sheng@linux.intel.com>
To: Marcelo Tosatti <mtosatti@redhat.com>, Avi Kivity <avi@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
	Sheng Yang <sheng@linux.intel.com>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] qemu: Enable XSAVE related CPUID
Date: Thu, 17 Jun 2010 15:18:14 +0800	[thread overview]
Message-ID: <1276759096-29104-3-git-send-email-sheng@linux.intel.com> (raw)
In-Reply-To: <1276759096-29104-1-git-send-email-sheng@linux.intel.com>

We can support it in KVM now. The 0xd leaf is queried from KVM.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 target-i386/cpuid.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 99d1f44..ab6536b 100644
--- a/target-i386/cpuid.c
+++ b/target-i386/cpuid.c
@@ -1067,6 +1067,27 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
         *ecx = 0;
         *edx = 0;
         break;
+    case 0xD:
+        /* Processor Extended State */
+        if (!(env->cpuid_ext_features & CPUID_EXT_XSAVE)) {
+            *eax = 0;
+            *ebx = 0;
+            *ecx = 0;
+            *edx = 0;
+            break;
+        }
+        if (kvm_enabled()) {
+            *eax = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EAX);
+            *ebx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EBX);
+            *ecx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_ECX);
+            *edx = kvm_arch_get_supported_cpuid(env, 0xd, count, R_EDX);
+        } else {
+            *eax = 0;
+            *ebx = 0;
+            *ecx = 0;
+            *edx = 0;
+        }
+        break;
     case 0x80000000:
         *eax = env->cpuid_xlevel;
         *ebx = env->cpuid_vendor1;
-- 
1.7.0.1

  parent reply	other threads:[~2010-06-17  7:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-17  7:18 [Qemu-devel] [PATCH v4 0/4] XSAVE enabling in QEmu Sheng Yang
2010-06-17  7:18 ` [Qemu-devel] [PATCH 1/4] qemu: kvm: Extend kvm_arch_get_supported_cpuid() to support index Sheng Yang
2010-06-17  7:18 ` Sheng Yang [this message]
2010-06-17  7:18 ` [Qemu-devel] [PATCH 3/4] qemu: kvm: Enable XSAVE live migration support Sheng Yang
2010-06-17  7:40   ` [Qemu-devel] " Jan Kiszka
2010-06-17  8:26     ` [Qemu-devel] " Sheng Yang
2010-06-17  8:57       ` [Qemu-devel] " Jan Kiszka
2010-06-17  9:53         ` [Qemu-devel] " Sheng Yang
2010-06-17 13:25           ` [Qemu-devel] " Jan Kiszka
2010-06-17  7:18 ` [Qemu-devel] [PATCH 4/4] qemu-kvm: " Sheng Yang
2010-06-17  7:41   ` [Qemu-devel] " Jan Kiszka
2010-06-17  8:32     ` Sheng Yang
2010-06-17  8:44       ` Jan Kiszka
2010-06-17 10:00         ` [Qemu-devel] [PATCH] qemu-kvm: Replace kvm_set/get_fpu() with upstream version Sheng Yang
2010-06-17 13:27           ` [Qemu-devel] " Jan Kiszka
2010-06-18 19:26 ` [Qemu-devel] Re: [PATCH v4 0/4] XSAVE enabling in QEmu Marcelo Tosatti

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=1276759096-29104-3-git-send-email-sheng@linux.intel.com \
    --to=sheng@linux.intel.com \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).