search for: kvm_x86_ops

Displaying 20 results from an estimated 94 matches for "kvm_x86_ops".

2020 Feb 07
0
[RFC PATCH v7 10/78] KVM: x86: add .bp_intercepted() to struct kvm_x86_ops
.../x86/kvm/vmx/vmx.c | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index b79cd6aa4075..d279195dac97 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1048,6 +1048,7 @@ struct kvm_x86_ops { void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu); void (*vcpu_put)(struct kvm_vcpu *vcpu); + bool (*bp_intercepted)(struct kvm_vcpu *vcpu); void (*update_bp_intercept)(struct kvm_vcpu *vcpu); int (*get_msr)(struct kvm_vcpu *vcpu, struct msr_data *msr); int (*set_msr)(struct kvm_vcpu...
2020 Feb 07
0
[RFC PATCH v7 11/78] KVM: x86: add .control_cr3_intercept() to struct kvm_x86_ops
...@ -134,6 +134,10 @@ static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) #define KVM_NR_FIXED_MTRR_REGION 88 #define KVM_NR_VAR_MTRR 8 +#define CR_TYPE_R 1 +#define CR_TYPE_W 2 +#define CR_TYPE_RW 3 + #define ASYNC_PF_PER_VCPU 64 enum kvm_reg { @@ -1064,6 +1068,8 @@ struct kvm_x86_ops { void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); void (*set_cr3)(struct kvm_vcpu *vcpu, unsigned long cr3); int (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); + void (*control_cr3_intercept)(struct kvm_vcpu *vcpu, int type, + bool enable); void (*set_efer)(struct...
2020 Jul 21
0
[PATCH v9 10/84] KVM: x86: add .control_cr3_intercept() to struct kvm_x86_ops
...@ -136,6 +136,10 @@ static inline gfn_t gfn_to_index(gfn_t gfn, gfn_t base_gfn, int level) #define KVM_NR_FIXED_MTRR_REGION 88 #define KVM_NR_VAR_MTRR 8 +#define CR_TYPE_R 1 +#define CR_TYPE_W 2 +#define CR_TYPE_RW 3 + #define ASYNC_PF_PER_VCPU 64 enum kvm_reg { @@ -1111,6 +1115,8 @@ struct kvm_x86_ops { void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); int (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); + void (*control_cr3_intercept)(struct kvm_vcpu *vcpu, int type, + bool enable); void (*set_efer)...
2019 Aug 09
0
[RFC PATCH v6 26/92] kvm: x86: add kvm_mmu_nested_pagefault()
...86/kvm/vmx/vmx.c | 9 +++++++++ 4 files changed, 25 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 2d6bde6fa59f..7da1137a2b82 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1004,6 +1004,8 @@ struct kvm_x86_ops { bool (*has_emulated_msr)(int index); void (*cpuid_update)(struct kvm_vcpu *vcpu); + bool (*nested_pagefault)(struct kvm_vcpu *vcpu); + struct kvm *(*vm_alloc)(void); void (*vm_free)(struct kvm *); int (*vm_init)(struct kvm *kvm); @@ -1593,4 +1595,6 @@ static inline int kvm_cpu_get_api...
2020 Feb 07
0
[RFC PATCH v7 24/78] KVM: x86: add .gpt_translation_fault()
...86/kvm/vmx/vmx.c | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 0f25f69fc8be..e05569a5da10 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1256,6 +1256,7 @@ struct kvm_x86_ops { u64 (*fault_gla)(struct kvm_vcpu *vcpu); bool (*spt_fault)(struct kvm_vcpu *vcpu); + bool (*gpt_translation_fault)(struct kvm_vcpu *vcpu); }; struct kvm_arch_async_pf { diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index f908ef374617..38ecd86c1d58 100644 --- a/arch/x86/kvm/svm.c...
2020 Feb 07
0
[RFC PATCH v7 23/78] KVM: x86: add .spt_fault()
...x86/kvm/vmx/vmx.c | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 6094884d3015..0f25f69fc8be 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1255,6 +1255,7 @@ struct kvm_x86_ops { int (*enable_direct_tlbflush)(struct kvm_vcpu *vcpu); u64 (*fault_gla)(struct kvm_vcpu *vcpu); + bool (*spt_fault)(struct kvm_vcpu *vcpu); }; struct kvm_arch_async_pf { diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index ab9576444e6b..f908ef374617 100644 --- a/arch/x86/kvm/svm.c...
2020 Jul 21
0
[PATCH v9 25/84] KVM: x86: add .gpt_translation_fault()
...86/kvm/vmx/vmx.c | 8 ++++++++ 3 files changed, 21 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index fb41199b33fc..a905e14e4c75 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1293,6 +1293,7 @@ struct kvm_x86_ops { u64 (*fault_gla)(struct kvm_vcpu *vcpu); bool (*spt_fault)(struct kvm_vcpu *vcpu); + bool (*gpt_translation_fault)(struct kvm_vcpu *vcpu); }; struct kvm_x86_nested_ops { diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 7ecfa10dce5d..580997701b1c 100644 --- a/arch/x86/k...
2020 Jul 22
0
[RFC PATCH v1 12/34] KVM: introspection: extend struct kvmi_features with the EPT views status support
...b/arch/x86/kvm/kvmi.c index 7b3b64d27d18..25c1f8f2e221 100644 --- a/arch/x86/kvm/kvmi.c +++ b/arch/x86/kvm/kvmi.c @@ -1356,6 +1356,10 @@ static void kvmi_track_flush_slot(struct kvm *kvm, struct kvm_memory_slot *slot, void kvmi_arch_features(struct kvmi_features *feat) { feat->singlestep = !!kvm_x86_ops.control_singlestep; + feat->vmfunc = kvm_x86_ops.get_vmfunc_status && + kvm_x86_ops.get_vmfunc_status(); + feat->eptp = kvm_x86_ops.get_eptp_switching_status && + kvm_x86_ops.get_eptp_switching_status(); } bool kvmi_arch_start_singlestep(struct kvm_vcpu *vcpu) diff --g...
2020 Feb 07
0
[RFC PATCH v7 19/78] KVM: x86: add .control_msr_intercept()
.../kvm/vmx/vmx.c | 10 ++++++++++ 3 files changed, 23 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 2136f273645a..d8c61cc301fa 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1060,6 +1060,8 @@ struct kvm_x86_ops { void (*update_bp_intercept)(struct kvm_vcpu *vcpu); int (*get_msr)(struct kvm_vcpu *vcpu, struct msr_data *msr); int (*set_msr)(struct kvm_vcpu *vcpu, struct msr_data *msr); + void (*control_msr_intercept)(struct kvm_vcpu *vcpu, unsigned int msr, + int type, bool enable); bool (*...
2015 Nov 02
1
[kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test
...to have userspace enable KVM_CAP_HYPERV_SYNIC through > KVM_ENABLE_CAP, and modify vmx.c to not use apicv on VMs that have it > enabled. This requires some changes to the callbacks that only work if > enable_apicv or !enable_apicv: > > if (enable_apicv) > kvm_x86_ops->update_cr8_intercept = NULL; > else { > kvm_x86_ops->hwapic_irr_update = NULL; > kvm_x86_ops->hwapic_isr_update = NULL; > kvm_x86_ops->deliver_posted_interrupt = NULL; > kvm_x86_ops->sync_pir_to_i...
2015 Nov 02
1
[kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test
...to have userspace enable KVM_CAP_HYPERV_SYNIC through > KVM_ENABLE_CAP, and modify vmx.c to not use apicv on VMs that have it > enabled. This requires some changes to the callbacks that only work if > enable_apicv or !enable_apicv: > > if (enable_apicv) > kvm_x86_ops->update_cr8_intercept = NULL; > else { > kvm_x86_ops->hwapic_irr_update = NULL; > kvm_x86_ops->hwapic_isr_update = NULL; > kvm_x86_ops->deliver_posted_interrupt = NULL; > kvm_x86_ops->sync_pir_to_i...
2020 Jul 21
0
[PATCH v9 23/84] KVM: x86: add .fault_gla()
...86/kvm/vmx/vmx.c | 9 +++++++++ 4 files changed, 22 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 2530af4420cf..ccf2804f46b9 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1290,6 +1290,8 @@ struct kvm_x86_ops { int (*enable_direct_tlbflush)(struct kvm_vcpu *vcpu); void (*migrate_timers)(struct kvm_vcpu *vcpu); + + u64 (*fault_gla)(struct kvm_vcpu *vcpu); }; struct kvm_x86_nested_ops { diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index cd7de4b401fe..04487eb38b5c 100644 -...
2020 Jul 12
3
[PATCH 2/7] kvm/vfio: detect assigned device via irqbypass manager
...nt kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons, > { > struct kvm_kernel_irqfd *irqfd = > container_of(cons, struct kvm_kernel_irqfd, consumer); > + int ret; > > irqfd->producer = prod; > + kvm_arch_start_assignment(irqfd->kvm); > + ret = kvm_x86_ops.update_pi_irte(irqfd->kvm, > + prod->irq, irqfd->gsi, 1); > + > + if (ret) > + kvm_arch_end_assignment(irqfd->kvm); > > - return kvm_x86_ops.update_pi_irte(irqfd->kvm, > - prod->irq, irqfd->gsi, 1); > + return ret; > } > > voi...
2020 Jul 12
3
[PATCH 2/7] kvm/vfio: detect assigned device via irqbypass manager
...nt kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons, > { > struct kvm_kernel_irqfd *irqfd = > container_of(cons, struct kvm_kernel_irqfd, consumer); > + int ret; > > irqfd->producer = prod; > + kvm_arch_start_assignment(irqfd->kvm); > + ret = kvm_x86_ops.update_pi_irte(irqfd->kvm, > + prod->irq, irqfd->gsi, 1); > + > + if (ret) > + kvm_arch_end_assignment(irqfd->kvm); > > - return kvm_x86_ops.update_pi_irte(irqfd->kvm, > - prod->irq, irqfd->gsi, 1); > + return ret; > } > > voi...
2020 Feb 07
0
[RFC PATCH v7 12/78] KVM: x86: add .cr3_write_intercepted()
...x86/kvm/vmx/vmx.c | 8 ++++++++ 3 files changed, 17 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 9032c996ebdb..d2fe08f44084 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -1070,6 +1070,7 @@ struct kvm_x86_ops { int (*set_cr4)(struct kvm_vcpu *vcpu, unsigned long cr4); void (*control_cr3_intercept)(struct kvm_vcpu *vcpu, int type, bool enable); + bool (*cr3_write_intercepted)(struct kvm_vcpu *vcpu); void (*set_efer)(struct kvm_vcpu *vcpu, u64 efer); void (*get_idt)(struct kvm_vcpu *vcp...
2020 Jul 17
1
[PATCH V2 2/6] kvm: detect assigned device via irqbypass manager
...nt kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons, > { > struct kvm_kernel_irqfd *irqfd = > container_of(cons, struct kvm_kernel_irqfd, consumer); > + int ret; > > irqfd->producer = prod; > + kvm_arch_start_assignment(irqfd->kvm); > + ret = kvm_x86_ops.update_pi_irte(irqfd->kvm, > + prod->irq, irqfd->gsi, 1); > + > + if (ret) > + kvm_arch_end_assignment(irqfd->kvm); > > - return kvm_x86_ops.update_pi_irte(irqfd->kvm, > - prod->irq, irqfd->gsi, 1); > + return ret; > } > > voi...
2016 Dec 19
2
[PATCH v7 08/11] x86, kvm/x86.c: support vcpu preempted check
...pu->arch.st.stime, > + &vcpu->arch.st.steal.preempted, > + offsetof(struct kvm_steal_time, preempted), > + sizeof(vcpu->arch.st.steal.preempted)); > +} > + > void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) > { > + kvm_steal_time_set_preempted(vcpu); > kvm_x86_ops->vcpu_put(vcpu); > kvm_put_guest_fpu(vcpu); > vcpu->arch.last_host_tsc = rdtsc(); You can't call kvm_steal_time_set_preempted in atomic context (neither in sched_out notifier nor in vcpu_put() after preempt_disable)). __copy_to_user in kvm_write_guest_offset_cached schedules an...
2016 Dec 19
2
[PATCH v7 08/11] x86, kvm/x86.c: support vcpu preempted check
...pu->arch.st.stime, > + &vcpu->arch.st.steal.preempted, > + offsetof(struct kvm_steal_time, preempted), > + sizeof(vcpu->arch.st.steal.preempted)); > +} > + > void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) > { > + kvm_steal_time_set_preempted(vcpu); > kvm_x86_ops->vcpu_put(vcpu); > kvm_put_guest_fpu(vcpu); > vcpu->arch.last_host_tsc = rdtsc(); You can't call kvm_steal_time_set_preempted in atomic context (neither in sched_out notifier nor in vcpu_put() after preempt_disable)). __copy_to_user in kvm_write_guest_offset_cached schedules an...
2015 Oct 26
3
[kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test
Hyper-V SynIC is a Hyper-V synthetic interrupt controller. The test runs on every vCPU and performs the following steps: * read from all Hyper-V SynIC MSR's * setup Hyper-V SynIC evt/msg pages * setup SINT's routing * inject SINT's into destination vCPU by 'hyperv-synic-test-device' * wait for SINT's isr's completion * clear Hyper-V SynIC evt/msg pages and destroy
2015 Oct 26
3
[kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test
Hyper-V SynIC is a Hyper-V synthetic interrupt controller. The test runs on every vCPU and performs the following steps: * read from all Hyper-V SynIC MSR's * setup Hyper-V SynIC evt/msg pages * setup SINT's routing * inject SINT's into destination vCPU by 'hyperv-synic-test-device' * wait for SINT's isr's completion * clear Hyper-V SynIC evt/msg pages and destroy