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 12/18] Nested Virtualization: MSR
Date: Thu, 15 Apr 2010 14:36:58 +0200	[thread overview]
Message-ID: <201004151436.58751.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_nh12_msr.diff --]
[-- Type: text/x-diff, Size: 1521 bytes --]

# HG changeset patch
# User cegger
# Date 1271330306 -7200
Emulate MSRs needed for Nested Virtualization

diff -r 01758c6195f4 -r 9731aece91ac xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2097,14 +2097,21 @@ int hvm_msr_read_intercept(struct cpu_us
          break;
 
     default:
+        ret = nestedhvm_rdmsr(v, ecx, &msr_content);
+        if ( ret < 0 )
+            goto gp_fault;
+        else if ( ret )
+            break;
+
+        BUG_ON( ret );
         ret = mce_rdmsr(ecx, &msr_content);
         if ( ret < 0 )
             goto gp_fault;
         else if ( ret )
             break;
-        /* ret == 0, This is not an MCE MSR, see other MSRs */
-        else if (!ret)
-            return hvm_funcs.msr_read_intercept(regs);
+
+        BUG_ON( ret );
+        return hvm_funcs.msr_read_intercept(regs);
     }
 
     regs->eax = (uint32_t)msr_content;
@@ -2196,13 +2203,21 @@ int hvm_msr_write_intercept(struct cpu_u
         break;
 
     default:
+        ret = nestedhvm_wrmsr(v, ecx, msr_content);
+        if ( ret < 0 )
+            goto gp_fault;
+        else if ( ret )
+            break;
+
+        BUG_ON( ret );
         ret = mce_wrmsr(ecx, msr_content);
         if ( ret < 0 )
             goto gp_fault;
         else if ( ret )
             break;
-        else if (!ret)
-            return hvm_funcs.msr_write_intercept(regs);
+
+        BUG_ON( ret );
+        return hvm_funcs.msr_write_intercept(regs);
     }
 
     return X86EMUL_OKAY;

[-- 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:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201004151436.58751.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.