...
 
Commits (6)
......@@ -24,7 +24,7 @@
#ifdef CONFIG_IPIPE
#define IPIPE_CORE_RELEASE 13
#define IPIPE_CORE_RELEASE 14
struct ipipe_domain;
struct pt_regs;
......
......@@ -43,7 +43,7 @@ static inline void stack_overflow_check(struct pt_regs *regs)
return;
if (IS_ENABLED(CONFIG_IPIPE))
sp = current_stack_pointer();
sp = current_stack_pointer;
else
sp = regs->sp;
......
......@@ -3090,9 +3090,14 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
u64 old_msr_data = msr->data;
msr->data = data;
if (msr - vmx->guest_msrs < vmx->save_nmsrs) {
unsigned long flags;
preempt_disable();
flags = hard_cond_local_irq_save();
__ipipe_enter_vm(&vcpu->ipipe_notifier);
ret = kvm_set_shared_msr(msr->index, msr->data,
msr->mask);
hard_cond_local_irq_restore(flags);
preempt_enable();
if (ret)
msr->data = old_msr_data;
......@@ -8453,6 +8458,10 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu)
unsigned long tmp;
#endif
#ifdef CONFIG_IPIPE
__clear_bit(IPIPE_STALL_FLAG,
&ipipe_this_cpu_root_context()->status);
#endif
vector = exit_intr_info & INTR_INFO_VECTOR_MASK;
desc = (gate_desc *)vmx->host_idt_base + vector;
entry = gate_offset(*desc);
......@@ -9016,9 +9025,6 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id)
vmx->nested.posted_intr_nv = -1;
vmx->nested.current_vmptr = -1ull;
vmx->nested.current_vmcs12 = NULL;
#ifdef CONFIG_IPIPE
vmx->vcpu.ipipe_notifier.handler = __ipipe_handle_vm_preemption;
#endif
return &vmx->vcpu;
......
......@@ -2787,8 +2787,11 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
*/
set_debugreg(0, 6);
#ifdef CONFIG_IPIPE
vcpu->ipipe_put_vcpu = false;
if (!smsr->dirty)
__ipipe_exit_vm();
#endif
hard_cond_local_irq_restore(flags);
}
......@@ -2802,6 +2805,7 @@ void __ipipe_handle_vm_preemption(struct ipipe_vm_notifier *nfy)
struct kvm_vcpu *vcpu;
vcpu = container_of(nfy, struct kvm_vcpu, ipipe_notifier);
if (vcpu->ipipe_put_vcpu)
kvm_arch_vcpu_put(vcpu);
kvm_restore_shared_msrs(smsr);
__ipipe_exit_vm();
......@@ -6621,7 +6625,10 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
local_irq_disable();
hard_cond_local_irq_disable();
#ifdef CONFIG_IPIPE
__ipipe_enter_vm(&vcpu->ipipe_notifier);
vcpu->ipipe_put_vcpu = true;
#endif
kvm_x86_ops->prepare_guest_switch(vcpu);
if (vcpu->fpu_active)
......@@ -7394,6 +7401,9 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
"guest TSC will not be reliable\n");
vcpu = kvm_x86_ops->vcpu_create(kvm, id);
#ifdef CONFIG_IPIPE
vcpu->ipipe_notifier.handler = __ipipe_handle_vm_preemption;
#endif
return vcpu;
}
......
......@@ -229,6 +229,7 @@ struct kvm_vcpu {
#endif
#ifdef CONFIG_IPIPE
struct ipipe_vm_notifier ipipe_notifier;
bool ipipe_put_vcpu;
#endif
int cpu;
int vcpu_id;
......