1
- From 4b80edabc3923bd1edb3b2ec5e131fd27035d690 Mon Sep 17 00:00:00 2001
1
+ From 6cd98c6fed819b18f6bc6d24ae5e33dcc1b69ee8 Mon Sep 17 00:00:00 2001
2
2
From: Charalampos Mainas <
[email protected] >
3
- Date: Tue, 8 Jun 2021 07:39:21 +0000
3
+ Date: Tue, 15 Jun 2021 10:29:47 +0000
4
4
Subject: [PATCH 1/2] Export KVM symbols for KVMM
5
5
6
6
Expose a set of KVM functions to the kernel, in order to be
37
37
Signed-off-by: Charalampos Mainas <
[email protected] >
38
38
Signed-off-by: Konstantinos Papazafeiropoulos <
[email protected] >
39
39
Signed-off-by: Stratos Psomadakis <
[email protected] >
40
-
40
+ ---
41
41
arch/arm64/include/asm/kvm_host.h | 6 ++++
42
42
arch/arm64/kvm/fpsimd.c | 6 ++++
43
43
arch/arm64/kvm/guest.c | 48 +++++++++++++++++++++++++++++++
@@ -238,10 +238,10 @@ index 901cd1fde..c7d2071da 100644
238
238
u32 function, u32 index)
239
239
{
240
240
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
241
- index d786c7d27..0a5706bf5 100644
241
+ index c17e6eb9a..8fdd13bdf 100644
242
242
--- a/arch/x86/kvm/x86.c
243
243
+++ b/arch/x86/kvm/x86.c
244
- @@ -8781 ,6 +8781 ,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
244
+ @@ -8796 ,6 +8796 ,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
245
245
return r;
246
246
}
247
247
@@ -255,7 +255,7 @@ index d786c7d27..0a5706bf5 100644
255
255
static void __get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
256
256
{
257
257
if (vcpu->arch.emulate_regs_need_sync_to_vcpu) {
258
- @@ -8824 ,6 +8831 ,12 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
258
+ @@ -8839 ,6 +8846 ,12 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
259
259
vcpu_put(vcpu);
260
260
return 0;
261
261
}
@@ -268,7 +268,7 @@ index d786c7d27..0a5706bf5 100644
268
268
269
269
static void __set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
270
270
{
271
- @@ -8864 ,6 +8877 ,12 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
271
+ @@ -8879 ,6 +8892 ,12 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
272
272
vcpu_put(vcpu);
273
273
return 0;
274
274
}
@@ -281,7 +281,7 @@ index d786c7d27..0a5706bf5 100644
281
281
282
282
void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
283
283
{
284
- @@ -8919 ,6 +8938 ,12 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
284
+ @@ -8934 ,6 +8953 ,12 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
285
285
vcpu_put(vcpu);
286
286
return 0;
287
287
}
@@ -294,7 +294,7 @@ index d786c7d27..0a5706bf5 100644
294
294
295
295
int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
296
296
struct kvm_mp_state *mp_state)
297
- @@ -9118 ,6 +9143 ,12 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
297
+ @@ -9133 ,6 +9158 ,12 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
298
298
vcpu_put(vcpu);
299
299
return ret;
300
300
}
@@ -308,10 +308,10 @@ index d786c7d27..0a5706bf5 100644
308
308
int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
309
309
struct kvm_guest_debug *dbg)
310
310
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
311
- index 01276e3d0..6cbdc1119 100644
311
+ index 131cc1527..d63eeca3d 100644
312
312
--- a/include/linux/kvm_host.h
313
313
+++ b/include/linux/kvm_host.h
314
- @@ -1408 ,11 +1408 ,16 @@ int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
314
+ @@ -1411 ,11 +1411 ,16 @@ int kvm_arch_mmu_notifier_invalidate_range(struct kvm *kvm,
315
315
316
316
#ifdef CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE
317
317
int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu);
@@ -328,7 +328,7 @@ index 01276e3d0..6cbdc1119 100644
328
328
#endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */
329
329
330
330
typedef int (*kvm_vm_thread_fn_t)(struct kvm *kvm, uintptr_t data);
331
- @@ -1421 ,4 +1426 ,15 @@ int kvm_vm_create_worker_thread(struct kvm *kvm, kvm_vm_thread_fn_t thread_fn,
331
+ @@ -1424 ,4 +1429 ,15 @@ int kvm_vm_create_worker_thread(struct kvm *kvm, kvm_vm_thread_fn_t thread_fn,
332
332
uintptr_t data, const char *name,
333
333
struct task_struct **thread_ptr);
334
334
@@ -405,10 +405,10 @@ index 00c747dbc..ad7e540dc 100644
405
405
{
406
406
if (kvm->coalesced_mmio_ring)
407
407
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
408
- index 74bdb7bf3..dcbecc2ab 100644
408
+ index 731c1e517..b1ed23094 100644
409
409
--- a/virt/kvm/kvm_main.c
410
410
+++ b/virt/kvm/kvm_main.c
411
- @@ -761 ,6 +761 ,11 @@ static struct kvm *kvm_create_vm(unsigned long type)
411
+ @@ -769 ,6 +769 ,11 @@ static struct kvm *kvm_create_vm(unsigned long type)
412
412
mmdrop(current->mm);
413
413
return ERR_PTR(r);
414
414
}
@@ -420,7 +420,7 @@ index 74bdb7bf3..dcbecc2ab 100644
420
420
421
421
static void kvm_destroy_devices(struct kvm *kvm)
422
422
{
423
- @@ -816 ,6 +821 ,12 @@ static void kvm_destroy_vm(struct kvm *kvm)
423
+ @@ -824 ,6 +829 ,12 @@ static void kvm_destroy_vm(struct kvm *kvm)
424
424
mmdrop(mm);
425
425
}
426
426
@@ -433,7 +433,7 @@ index 74bdb7bf3..dcbecc2ab 100644
433
433
void kvm_get_kvm(struct kvm *kvm)
434
434
{
435
435
refcount_inc(&kvm->users_count);
436
- @@ -1332 ,6 +1343 ,12 @@ static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
436
+ @@ -1340 ,6 +1351 ,12 @@ static int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
437
437
438
438
return kvm_set_memory_region(kvm, mem);
439
439
}
@@ -446,7 +446,7 @@ index 74bdb7bf3..dcbecc2ab 100644
446
446
447
447
#ifndef CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
448
448
/**
449
- @@ -3078 ,6 +3095 ,12 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
449
+ @@ -3086 ,6 +3103 ,12 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
450
450
return r;
451
451
}
452
452
0 commit comments