All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 08/18] Nested Virtualization: function hooks
@ 2010-04-15 12:31 Christoph Egger
  0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2010-04-15 12:31 UTC (permalink / raw)
  To: xen-devel

[-- 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_nh08_hooks.diff --]
[-- Type: text/x-diff, Size: 4844 bytes --]

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

diff -r ae06190eed4a -r 6fca66c4d6f6 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -3155,6 +3155,78 @@ int hvm_debug_op(struct vcpu *v, int32_t
     return rc;
 }
 
+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_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_vmsave(struct vcpu *v, uint64_t vmcbaddr)
+{
+    if (hvm_funcs.nestedhvm_vcpu_vmsave)
+        return hvm_funcs.nestedhvm_vcpu_vmsave(v, vmcbaddr);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_vmload(struct vcpu *v, uint64_t vmcbaddr)
+{
+    if (hvm_funcs.nestedhvm_vcpu_vmload)
+        return hvm_funcs.nestedhvm_vcpu_vmload(v, vmcbaddr);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vmcb_prepare4vmrun(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vmcb_prepare4vmrun)
+        return hvm_funcs.nestedhvm_vmcb_prepare4vmrun(v);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs,
+                             unsigned int flags)
+{
+    if (hvm_funcs.nestedhvm_vcpu_vmrun)
+        return hvm_funcs.nestedhvm_vcpu_vmrun(v, regs, flags);
+    return -EOPNOTSUPP;
+}
+
+int hvm_nestedhvm_vmcb_prepare4vmexit(struct vcpu *v)
+{
+    if (hvm_funcs.nestedhvm_vmcb_prepare4vmexit)
+        return hvm_funcs.nestedhvm_vmcb_prepare4vmexit(v);
+    return -EOPNOTSUPP;
+}
+
 
 /*
  * Local variables:
diff -r ae06190eed4a -r 6fca66c4d6f6 xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -132,6 +132,21 @@ 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_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_vmload)(struct vcpu *v, uint64_t vmcbaddr);
+    int (*nestedhvm_vcpu_vmsave)(struct vcpu *v, uint64_t vmcbaddr);
+    int (*nestedhvm_vcpu_vmrun)(struct vcpu *v, struct cpu_user_regs *regs,
+                                unsigned int flags);
+    int (*nestedhvm_vmcb_prepare4vmrun)(struct vcpu *v);
+    int (*nestedhvm_vmcb_prepare4vmexit)(struct vcpu *v);
 };
 
 extern struct hvm_function_table hvm_funcs;
@@ -351,4 +366,21 @@ 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_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_vmsave(struct vcpu *v, uint64_t vmcbaddr);
+int hvm_nestedhvm_vcpu_vmload(struct vcpu *v, uint64_t vmcbaddr);
+#define NESTEDHVM_VMRUN_INTERCEPT    (1U << 0) /* VMRUN intercept */
+#define NESTEDHVM_VMRUN_VMEXIT       (1U << 1) /* resume from VMEXIT */
+int hvm_nestedhvm_vcpu_vmrun(struct vcpu *v, struct cpu_user_regs *regs,
+                             unsigned int flags);
+int hvm_nestedhvm_vmcb_eventinject(struct vcpu *v, uint64_t exitcode);
+int hvm_nestedhvm_vmcb_prepare4vmrun(struct vcpu *v);
+int hvm_nestedhvm_vmcb_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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-04-15 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15 12:31 [PATCH 08/18] Nested Virtualization: function hooks Christoph Egger

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.