Commit ae97a3b8 authored by Radim Krčmář's avatar Radim Krčmář Committed by Paolo Bonzini

KVM: x86: introduce sched_in to kvm_x86_ops

sched_in preempt notifier is available for x86, allow its use in
specific virtualization technlogies as well.
Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent e790d9ef
...@@ -771,6 +771,8 @@ struct kvm_x86_ops { ...@@ -771,6 +771,8 @@ struct kvm_x86_ops {
bool (*mpx_supported)(void); bool (*mpx_supported)(void);
int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr); int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr);
void (*sched_in)(struct kvm_vcpu *kvm, int cpu);
}; };
struct kvm_arch_async_pf { struct kvm_arch_async_pf {
......
...@@ -4305,6 +4305,10 @@ static void svm_handle_external_intr(struct kvm_vcpu *vcpu) ...@@ -4305,6 +4305,10 @@ static void svm_handle_external_intr(struct kvm_vcpu *vcpu)
local_irq_enable(); local_irq_enable();
} }
static void svm_sched_in(struct kvm_vcpu *vcpu, int cpu)
{
}
static struct kvm_x86_ops svm_x86_ops = { static struct kvm_x86_ops svm_x86_ops = {
.cpu_has_kvm_support = has_svm, .cpu_has_kvm_support = has_svm,
.disabled_by_bios = is_disabled, .disabled_by_bios = is_disabled,
...@@ -4405,6 +4409,8 @@ static struct kvm_x86_ops svm_x86_ops = { ...@@ -4405,6 +4409,8 @@ static struct kvm_x86_ops svm_x86_ops = {
.check_intercept = svm_check_intercept, .check_intercept = svm_check_intercept,
.handle_external_intr = svm_handle_external_intr, .handle_external_intr = svm_handle_external_intr,
.sched_in = svm_sched_in,
}; };
static int __init svm_init(void) static int __init svm_init(void)
......
...@@ -8848,6 +8848,10 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu, ...@@ -8848,6 +8848,10 @@ static int vmx_check_intercept(struct kvm_vcpu *vcpu,
return X86EMUL_CONTINUE; return X86EMUL_CONTINUE;
} }
void vmx_sched_in(struct kvm_vcpu *vcpu, int cpu)
{
}
static struct kvm_x86_ops vmx_x86_ops = { static struct kvm_x86_ops vmx_x86_ops = {
.cpu_has_kvm_support = cpu_has_kvm_support, .cpu_has_kvm_support = cpu_has_kvm_support,
.disabled_by_bios = vmx_disabled_by_bios, .disabled_by_bios = vmx_disabled_by_bios,
...@@ -8952,6 +8956,8 @@ static struct kvm_x86_ops vmx_x86_ops = { ...@@ -8952,6 +8956,8 @@ static struct kvm_x86_ops vmx_x86_ops = {
.mpx_supported = vmx_mpx_supported, .mpx_supported = vmx_mpx_supported,
.check_nested_events = vmx_check_nested_events, .check_nested_events = vmx_check_nested_events,
.sched_in = vmx_sched_in,
}; };
static int __init vmx_init(void) static int __init vmx_init(void)
......
...@@ -7173,6 +7173,7 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) ...@@ -7173,6 +7173,7 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu)
{ {
kvm_x86_ops->sched_in(vcpu, cpu);
} }
int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment