Skip to content

Commit c0b92c3

Browse files
committed
Update patches for v5.7 and v5.8
KVMM is able to run without major changes in KVM source code. Still there are some needed symbols that have to be exported. The new patches just export KVM and memory related needed functions. Signed-off-by: Charalampos Mainas <[email protected]>
1 parent 9086cba commit c0b92c3

7 files changed

+149
-1662
lines changed

v5.7-rc5/0001-Export-KVM-symbols-for-KVMM.patch renamed to v5.7/0001-Export-KVM-symbols-for-KVMM.patch

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
From 4b80edabc3923bd1edb3b2ec5e131fd27035d690 Mon Sep 17 00:00:00 2001
1+
From 6cd98c6fed819b18f6bc6d24ae5e33dcc1b69ee8 Mon Sep 17 00:00:00 2001
22
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
44
Subject: [PATCH 1/2] Export KVM symbols for KVMM
55

66
Expose a set of KVM functions to the kernel, in order to be
@@ -37,7 +37,7 @@ Signed-off-by: Anastassios Nanos <[email protected]>
3737
Signed-off-by: Charalampos Mainas <[email protected]>
3838
Signed-off-by: Konstantinos Papazafeiropoulos <[email protected]>
3939
Signed-off-by: Stratos Psomadakis <[email protected]>
40-
40+
---
4141
arch/arm64/include/asm/kvm_host.h | 6 ++++
4242
arch/arm64/kvm/fpsimd.c | 6 ++++
4343
arch/arm64/kvm/guest.c | 48 +++++++++++++++++++++++++++++++
@@ -238,10 +238,10 @@ index 901cd1fde..c7d2071da 100644
238238
u32 function, u32 index)
239239
{
240240
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
241-
index d786c7d27..0a5706bf5 100644
241+
index c17e6eb9a..8fdd13bdf 100644
242242
--- a/arch/x86/kvm/x86.c
243243
+++ 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)
245245
return r;
246246
}
247247

@@ -255,7 +255,7 @@ index d786c7d27..0a5706bf5 100644
255255
static void __get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
256256
{
257257
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)
259259
vcpu_put(vcpu);
260260
return 0;
261261
}
@@ -268,7 +268,7 @@ index d786c7d27..0a5706bf5 100644
268268

269269
static void __set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
270270
{
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)
272272
vcpu_put(vcpu);
273273
return 0;
274274
}
@@ -281,7 +281,7 @@ index d786c7d27..0a5706bf5 100644
281281

282282
void kvm_get_cs_db_l_bits(struct kvm_vcpu *vcpu, int *db, int *l)
283283
{
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,
285285
vcpu_put(vcpu);
286286
return 0;
287287
}
@@ -294,7 +294,7 @@ index d786c7d27..0a5706bf5 100644
294294

295295
int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
296296
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,
298298
vcpu_put(vcpu);
299299
return ret;
300300
}
@@ -308,10 +308,10 @@ index d786c7d27..0a5706bf5 100644
308308
int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
309309
struct kvm_guest_debug *dbg)
310310
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
311-
index 01276e3d0..6cbdc1119 100644
311+
index 131cc1527..d63eeca3d 100644
312312
--- a/include/linux/kvm_host.h
313313
+++ 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,
315315

316316
#ifdef CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE
317317
int kvm_arch_vcpu_run_pid_change(struct kvm_vcpu *vcpu);
@@ -328,7 +328,7 @@ index 01276e3d0..6cbdc1119 100644
328328
#endif /* CONFIG_HAVE_KVM_VCPU_RUN_PID_CHANGE */
329329

330330
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,
332332
uintptr_t data, const char *name,
333333
struct task_struct **thread_ptr);
334334

@@ -405,10 +405,10 @@ index 00c747dbc..ad7e540dc 100644
405405
{
406406
if (kvm->coalesced_mmio_ring)
407407
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
408-
index 74bdb7bf3..dcbecc2ab 100644
408+
index 731c1e517..b1ed23094 100644
409409
--- a/virt/kvm/kvm_main.c
410410
+++ 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)
412412
mmdrop(current->mm);
413413
return ERR_PTR(r);
414414
}
@@ -420,7 +420,7 @@ index 74bdb7bf3..dcbecc2ab 100644
420420

421421
static void kvm_destroy_devices(struct kvm *kvm)
422422
{
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)
424424
mmdrop(mm);
425425
}
426426

@@ -433,7 +433,7 @@ index 74bdb7bf3..dcbecc2ab 100644
433433
void kvm_get_kvm(struct kvm *kvm)
434434
{
435435
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,
437437

438438
return kvm_set_memory_region(kvm, mem);
439439
}
@@ -446,7 +446,7 @@ index 74bdb7bf3..dcbecc2ab 100644
446446

447447
#ifndef CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT
448448
/**
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)
450450
return r;
451451
}
452452

0 commit comments

Comments
 (0)