SHA256
1
0
forked from pool/xen
OBS User autobuild
2009-10-12 14:04:54 +00:00
committed by Git OBS Bridge
parent acda484cb0
commit 0df7e563d6
16 changed files with 62 additions and 593 deletions

View File

@@ -3,7 +3,7 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
===================================================================
--- /dev/null
+++ xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
@@ -0,0 +1,183 @@
@@ -0,0 +1,165 @@
+/****************************************************************************
+ |
+ | Copyright (c) [2007, 2008] Novell, Inc.
@@ -74,35 +74,29 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
+static inline int
+hyperx_intercept_domain_create(struct domain *d)
+{
+#ifdef __x86_64__
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1) {
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1) {
+ return(hyperv_dom_create(d));
+ }
+#endif
+ return (0);
+}
+
+static inline void
+hyperx_intercept_domain_destroy(struct domain *d)
+{
+#ifdef __x86_64__
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ hyperv_dom_destroy(d);
+ }
+#endif
+}
+
+static inline int
+hyperx_intercept_vcpu_initialize(struct vcpu *v)
+{
+#ifdef __x86_64__
+ struct domain *d = v->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ return(hyperv_vcpu_initialize(v));
+ }
+#endif
+ return (0);
+}
+
@@ -110,77 +104,65 @@ Index: xen-3.4.1-testing/xen/include/asm-x86/hvm/hvm_extensions.h
+static inline void
+hyperx_intercept_vcpu_up(struct vcpu *v)
+{
+#ifdef __x86_64__
+ struct domain *d = current->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ hyperv_vcpu_up(v);
+ }
+#endif
+}
+
+static inline void
+hyperx_intercept_vcpu_destroy(struct vcpu *v)
+{
+#ifdef __x86_64__
+ struct domain *d = v->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ hyperv_vcpu_destroy(v);
+ }
+#endif
+}
+
+static inline int
+hyperx_intercept_do_cpuid(uint32_t idx, unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+{
+#ifdef __x86_64__
+ struct domain *d = current->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ return(hyperv_do_cpu_id(idx, eax, ebx, ecx, edx));
+ }
+#endif
+ return (0);
+}
+
+static inline int
+hyperx_intercept_do_msr_read(uint32_t idx, struct cpu_user_regs *regs)
+{
+#ifdef __x86_64__
+ struct domain *d = current->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ return(hyperv_do_rd_msr(idx, regs));
+ }
+#endif
+ return (0);
+}
+
+static inline int
+hyperx_intercept_do_msr_write(uint32_t idx, struct cpu_user_regs *regs)
+{
+#ifdef __x86_64__
+ struct domain *d = current->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ return(hyperv_do_wr_msr(idx, regs));
+ }
+#endif
+ return (0);
+}
+
+static inline int
+hyperx_intercept_do_hypercall(struct cpu_user_regs *regs)
+{
+#ifdef __x86_64__
+ struct domain *d = current->domain;
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] == 1)
+ if (d->arch.hvm_domain.params[HVM_PARAM_EXTEND_HYPERVISOR] ==1)
+ {
+ return(hyperv_do_hypercall(regs));
+ }
+#endif
+ return (0);
+}
+
@@ -345,8 +327,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
+ if (fast)
+ {
+ hvm_set_cr3(input);
+ }
+ else
+ } else
+ {
+ /*
+ * Slow path; copy the new value.
@@ -375,6 +356,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_hypercall.c
+ hv_vcpu_t *vcpup = &curp->vcpu_state[hv_get_current_vcpu_index()];
+ u64 partition_id;
+
+
+ fast = (int)((opcode >>16) & 0x1);
+ verb = (short)(opcode & 0xffff);
+ rep_count = (short)((opcode >>32) & 0xfff);
@@ -1619,7 +1601,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_shim.h
+ * Supported Synthetic MSRs. 0.83 HyperV spec, section 3.4
+ * Supported features.
+ */
+#define _MSR_VP_RUNTIME 0
+#define _MSR_VP_RUNTIME 0
+#define MSR_VP_RUNTIME (1U<<_MSR_VP_RUNTIME)
+#define _MSR_TIME_REF_CNT 1
+#define MSR_TIME_REF_CNT (1U<<_MSR_TIME_REF_CNT)
@@ -1633,7 +1615,7 @@ Index: xen-3.4.1-testing/xen/arch/x86/hvm/hyperv/hv_shim.h
+#define HYPERCALL_MSRS (1U<<_HYPERCALL_MSRS)
+#define _MSR_VP_INDEX 6
+#define MSR_VP_INDEX (1U<<_MSR_VP_INDEX)
+#define _RESET_MSR 7
+#define _RESET_MSR 7
+#define RESET_MSR (1U<<_RESET_MSR)
+
+#define HV_SHIM_SUPPORTED_MSRS \