All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Egger <Christoph.Egger@amd.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Cc: "Dong, Eddie" <eddie.dong@intel.com>, Tim Deegan <Tim.Deegan@citrix.com>
Subject: [PATCH 03/14] Nested Virtualization: function hooks
Date: Wed, 1 Sep 2010 16:58:53 +0200	[thread overview]
Message-ID: <201009011658.54567.Christoph.Egger@amd.com> (raw)

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


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

-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632

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

# HG changeset patch
# User cegger
# Date 1283345874 -7200
add nestedhvm function hooks for svm/vmx specific code

diff -r 32aec447e8a1 -r ae9ad9723925 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3269,6 +3269,96 @@ int hvm_debug_op(struct vcpu *v, int32_t
 }
 
 
+int hvm_nestedhvm_vcpu_initialise(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vcpu_initialise)
+        return hvm_funcs.nestedhvm_vcpu_initialise(v);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_destroy(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vcpu_destroy)
+        return hvm_funcs.nestedhvm_vcpu_destroy(v);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_reset(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vcpu_reset)
+        return hvm_funcs.nestedhvm_vcpu_reset(v);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_features(struct vcpu *v,
+    uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
+{
+    if (hvm_funcs.nestedhvm_vcpu_features)
+        return hvm_funcs.nestedhvm_vcpu_features(v, eax, ebx, ecx, edx);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_hostsave(struct vcpu *v, unsigned int inst_len)
+{
+    if (hvm_funcs.nestedhvm_vcpu_hostsave)
+        return hvm_funcs.nestedhvm_vcpu_hostsave(v, inst_len);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
+{
+    if (hvm_funcs.nestedhvm_vcpu_hostrestore)
+        return hvm_funcs.nestedhvm_vcpu_hostrestore(v, regs);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_vmentry(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vcpu_vmentry)
+        return hvm_funcs.nestedhvm_vcpu_vmentry(v);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_vmexit(struct vcpu *v, struct cpu_user_regs *regs,
+                             uint64_t exitcode)
+{
+    if (hvm_funcs.nestedhvm_vcpu_vmexit)
+        return hvm_funcs.nestedhvm_vcpu_vmexit(v, regs, exitcode);
+    return -EOPNOTSUPP;
+}
+
+uint64_t hvm_nestedhvm_vm_exitcode_native2generic(struct vcpu *v,
+    struct cpu_user_regs *regs, uint64_t exitcode,
+    uint64_t *info1, uint64_t *info2)
+{
+    if (hvm_funcs.nestedhvm_vm_exitcode_native2generic)
+        return hvm_funcs.nestedhvm_vm_exitcode_native2generic(v, regs,
+                                                  exitcode, info1, info2);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vm_intercepted_by_guest(struct vcpu *v, uint64_t exitcode)
+{
+    if (hvm_funcs.nestedhvm_vm_intercepted_by_guest)
+        return hvm_funcs.nestedhvm_vm_intercepted_by_guest(v, exitcode);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vm_prepare4vmentry(struct vcpu *v, struct cpu_user_regs *regs)
+{
+    if (hvm_funcs.nestedhvm_vm_prepare4vmentry)
+        return hvm_funcs.nestedhvm_vm_prepare4vmentry(v, regs);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vm_prepare4vmexit(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vm_prepare4vmexit)
+        return hvm_funcs.nestedhvm_vm_prepare4vmexit(v);
+    return -EOPNOTSUPP;
+}
+
+
 /*
  * Local variables:
  * mode: C
diff -r 32aec447e8a1 -r ae9ad9723925 xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -145,6 +145,26 @@ struct hvm_function_table {
     void (*set_uc_mode)(struct vcpu *v);
     void (*set_info_guest)(struct vcpu *v);
     void (*set_rdtsc_exiting)(struct vcpu *v, bool_t);
+
+    /* Nested HVM */
+    int (*nestedhvm_vcpu_initialise)(struct vcpu *v);
+    int (*nestedhvm_vcpu_destroy)(struct vcpu *v);
+    int (*nestedhvm_vcpu_reset)(struct vcpu *v);
+    int (*nestedhvm_vcpu_features)(struct vcpu *v,
+        uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
+    int (*nestedhvm_vcpu_hostsave)(struct vcpu *v, unsigned int inst_len);
+    int (*nestedhvm_vcpu_hostrestore)(struct vcpu *v,
+                                struct cpu_user_regs *regs);
+    int (*nestedhvm_vcpu_vmentry)(struct vcpu *v);
+    int (*nestedhvm_vcpu_vmexit)(struct vcpu *v, struct cpu_user_regs *regs,
+                                uint64_t exitcode);
+    uint64_t (*nestedhvm_vm_exitcode_native2generic)(struct vcpu *v,
+                                struct cpu_user_regs *regs, uint64_t exitcode,
+                                uint64_t *info1, uint64_t *info2);
+    int (*nestedhvm_vm_intercepted_by_guest)(struct vcpu *v, uint64_t exitcode);
+    int (*nestedhvm_vm_prepare4vmentry)(struct vcpu *v,
+                                struct cpu_user_regs *regs);
+    int (*nestedhvm_vm_prepare4vmexit)(struct vcpu *v);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -363,4 +383,22 @@ bool_t hvm_hap_nested_page_fault(unsigne
         ? (u32)__d->arch.incarnation : (u32)(v)->arch.hvm_vcpu.msr_tsc_aux; \
 })
 
+/* Nested HVM */
+int hvm_nestedhvm_vcpu_initialise(struct vcpu *v);
+int hvm_nestedhvm_vcpu_destroy(struct vcpu *v);
+int hvm_nestedhvm_vcpu_reset(struct vcpu *v);
+int hvm_nestedhvm_vcpu_features(struct vcpu *v,
+    uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
+int hvm_nestedhvm_vcpu_hostsave(struct vcpu *v, unsigned int inst_len);
+int hvm_nestedhvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs);
+int hvm_nestedhvm_vcpu_vmentry(struct vcpu *v);
+int hvm_nestedhvm_vcpu_vmexit(struct vcpu *v, struct cpu_user_regs *regs,
+                             uint64_t exitcode);
+uint64_t hvm_nestedhvm_vm_exitcode_native2generic(struct vcpu *v,
+                             struct cpu_user_regs *regs, uint64_t exitcode,
+                             uint64_t *info1, uint64_t *info2);
+int hvm_nestedhvm_vm_intercepted_by_guest(struct vcpu *v, uint64_t exitcode);
+int hvm_nestedhvm_vm_prepare4vmentry(struct vcpu *v, struct cpu_user_regs *regs);
+int hvm_nestedhvm_vm_prepare4vmexit(struct vcpu *v);
+
 #endif /* __ASM_X86_HVM_HVM_H__ */

[-- 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-09-01 14:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 14:58 Christoph Egger [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-10-15 12:59 [PATCH 03/14] Nested Virtualization: function hooks Christoph Egger

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=201009011658.54567.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=Tim.Deegan@citrix.com \
    --cc=eddie.dong@intel.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.