Skip to content

Commit 209b842

Browse files
cmainasananos
authored andcommitted
Add patch to export kvm_ioctl_irq_line function in Hedge
Signed-off-by: Matias Ezequiel Vara Larsen <[email protected]> Signed-off-by: Charalampos Mainas <[email protected]> Reviewed-by: Anastassios Nanos <[email protected]> Approved-by: Anastassios Nanos <[email protected]> PR: #72
1 parent 45edc87 commit 209b842

File tree

2 files changed

+134
-0
lines changed

2 files changed

+134
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 2d803a84d9eccad2adadc99c9559b75a852f19c3 Mon Sep 17 00:00:00 2001
2+
From: Charalampos Mainas <[email protected]>
3+
Date: Tue, 12 Dec 2023 17:34:10 +0200
4+
Subject: [PATCH] Export kvm_vm_ioctl_irq_line
5+
6+
A small patch to export the kvm_vm_ioctl_irq_line function, in order to
7+
allow Hedge to use it.
8+
This function is required for serial console.
9+
10+
Signed-off-by: Matias Ezequiel Vara Larsen <[email protected]>
11+
Signed-off-by: Charalampos Mainas <[email protected]>
12+
---
13+
arch/x86/kvm/x86.c | 7 +++++++
14+
include/linux/kvm_host.h | 2 ++
15+
virt/kvm/arm/arm.c | 7 +++++++
16+
3 files changed, 16 insertions(+)
17+
18+
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
19+
index 8ea73933e..e0f63ab04 100644
20+
--- a/arch/x86/kvm/x86.c
21+
+++ b/arch/x86/kvm/x86.c
22+
@@ -4820,6 +4820,13 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
23+
return 0;
24+
}
25+
26+
+int hedge_kvm_arch_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
27+
+ bool line_status)
28+
+{
29+
+ return kvm_vm_ioctl_irq_line(kvm, irq_event, line_status);
30+
+}
31+
+EXPORT_SYMBOL(hedge_kvm_arch_vm_ioctl_irq_line);
32+
+
33+
int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
34+
struct kvm_enable_cap *cap)
35+
{
36+
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
37+
index 37e1c57a9..06cff0c5b 100644
38+
--- a/include/linux/kvm_host.h
39+
+++ b/include/linux/kvm_host.h
40+
@@ -1440,4 +1440,6 @@ int hedge_kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *r
41+
int hedge_kvm_coalesced_mmio_init(struct kvm *kvm);
42+
int hedge_kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
43+
struct kvm_userspace_memory_region *mem);
44+
+int hedge_kvm_arch_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
45+
+ bool line_status);
46+
#endif
47+
diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c
48+
index 2436dddf9..613906230 100644
49+
--- a/virt/kvm/arm/arm.c
50+
+++ b/virt/kvm/arm/arm.c
51+
@@ -935,6 +935,13 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
52+
return -EINVAL;
53+
}
54+
55+
+int hedge_kvm_arch_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
56+
+ bool line_status)
57+
+{
58+
+ return kvm_vm_ioctl_irq_line(kvm, irq_event, line_status);
59+
+}
60+
+EXPORT_SYMBOL(hedge_kvm_arch_vm_ioctl_irq_line);
61+
+
62+
static int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
63+
const struct kvm_vcpu_init *init)
64+
{
65+
--
66+
2.40.1
67+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 3813cbba7fe44c7d98ef9036639d40f573f080b9 Mon Sep 17 00:00:00 2001
2+
From: Charalampos Mainas <[email protected]>
3+
Date: Tue, 12 Dec 2023 17:32:13 +0200
4+
Subject: [PATCH] Export kvm_vm_ioctl_irq_line
5+
6+
A small patch to export the kvm_vm_ioctl_irq_line function, in order to
7+
allow Hedge to use it.
8+
This function is required for serial console.
9+
10+
Signed-off-by: Matias Ezequiel Vara Larsen <[email protected]>
11+
Signed-off-by: Charalampos Mainas <[email protected]>
12+
---
13+
arch/arm64/kvm/arm.c | 7 +++++++
14+
arch/x86/kvm/x86.c | 7 +++++++
15+
include/linux/kvm_host.h | 2 ++
16+
3 files changed, 16 insertions(+)
17+
18+
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
19+
index b1a0181b0..c2d200f00 100644
20+
--- a/arch/arm64/kvm/arm.c
21+
+++ b/arch/arm64/kvm/arm.c
22+
@@ -934,6 +934,13 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
23+
return -EINVAL;
24+
}
25+
26+
+int hedge_kvm_arch_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
27+
+ bool line_status)
28+
+{
29+
+ return kvm_vm_ioctl_irq_line(kvm, irq_event, line_status);
30+
+}
31+
+EXPORT_SYMBOL(hedge_kvm_arch_vm_ioctl_irq_line);
32+
+
33+
static int kvm_vcpu_set_target(struct kvm_vcpu *vcpu,
34+
const struct kvm_vcpu_init *init)
35+
{
36+
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
37+
index 8c17063a4..9b9ed9523 100644
38+
--- a/arch/x86/kvm/x86.c
39+
+++ b/arch/x86/kvm/x86.c
40+
@@ -4920,6 +4920,13 @@ int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
41+
return 0;
42+
}
43+
44+
+int hedge_kvm_arch_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
45+
+ bool line_status)
46+
+{
47+
+ return kvm_vm_ioctl_irq_line(kvm, irq_event, line_status);
48+
+}
49+
+EXPORT_SYMBOL(hedge_kvm_arch_vm_ioctl_irq_line);
50+
+
51+
int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
52+
struct kvm_enable_cap *cap)
53+
{
54+
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
55+
index 9508cb5ef..bca063db8 100644
56+
--- a/include/linux/kvm_host.h
57+
+++ b/include/linux/kvm_host.h
58+
@@ -1455,4 +1455,6 @@ int hedge_kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *r
59+
int hedge_kvm_coalesced_mmio_init(struct kvm *kvm);
60+
int hedge_kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
61+
struct kvm_userspace_memory_region *mem);
62+
+int hedge_kvm_arch_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_event,
63+
+ bool line_status);
64+
#endif
65+
--
66+
2.40.1
67+

0 commit comments

Comments
 (0)