All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 11/18] Nested Virtualization: cpuid
Date: Thu, 15 Apr 2010 14:35:49 +0200	[thread overview]
Message-ID: <201004151435.50232.Christoph.Egger@amd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]


Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>

-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

[-- Attachment #2: xen_nh11_cpuid.diff --]
[-- Type: text/x-diff, Size: 1579 bytes --]

# HG changeset patch
# User cegger
# Date 1271330304 -7200
Pass cpuid feature bits to guest

diff -r e905f1d81e63 -r 01758c6195f4 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1970,12 +1970,38 @@ void hvm_cpuid(unsigned int input, unsig
             }
         }
         break;
+    case 0x80000000:
+        if ( !nestedhvm_enabled(v->domain) )
+            break;
+        if (*eax < 0x8000000a)
+            *eax = 0x8000000a;
+        break;
     case 0x80000001:
         /* We expose RDTSCP feature to guest only when
            tsc_mode == TSC_MODE_DEFAULT and host_tsc_is_safe() returns 1 */
         if ( v->domain->arch.tsc_mode != TSC_MODE_DEFAULT ||
              !host_tsc_is_safe() )
             *edx &= ~bitmaskof(X86_FEATURE_RDTSCP);
+
+        /* Don't expose SVM feature bit when host does not run with
+         * nested paging enabled. This check is needed as long as
+         * we don't support shadow-on-shadow.
+         */
+        if ( !paging_mode_hap(v->domain) )
+            *ecx &= ~bitmaskof(X86_FEATURE_SVME);
+
+        /* Don't expose SVM feature bit when nestedhvm is disabled. */
+        if ( !nestedhvm_enabled(v->domain) )
+            *ecx &= ~bitmaskof(X86_FEATURE_SVME);
+        break;
+    case 0x8000000a:
+        /* Don't expose SVM feature bits when nestedhvm is disabled. */
+        if ( !nestedhvm_enabled(v->domain) ) {
+            *eax = *ebx = *ecx = *edx = 0;
+            break;
+        }
+
+        hvm_nestedhvm_vcpu_features(v, eax, ebx, ecx, edx);
         break;
     }
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2010-04-15 12:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 12:35 Christoph Egger [this message]
     [not found] ` <20100416130047.GH31304@whitby.uk.xensource.com>
     [not found]   ` <201004161513.16116.Christoph.Egger@amd.com>
2010-04-16 14:33     ` [PATCH 11/18] Nested Virtualization: cpuid Tim Deegan

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=201004151435.50232.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /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.