-
Notifications
You must be signed in to change notification settings - Fork 3
/
0001-arm-paravirt-Use-a-single-ops-structure.patch
112 lines (99 loc) · 3.14 KB
/
0001-arm-paravirt-Use-a-single-ops-structure.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
From 9105a8deed4036ed18216f43a65264017ac20734 Mon Sep 17 00:00:00 2001
From: AltArch Kernel <[email protected]>
Date: Tue, 15 Sep 2020 14:34:35 +0800
Subject: [PATCH 01/25] arm/paravirt: Use a single ops structure
euleros inclusion
category: feature
bugzilla: NA
DTS: #231
CVE: NA
--------------------------------
Combine the paravirt ops structure in a single structure, keeping the
original structure as sub-structure.
---
arch/arm/include/asm/paravirt.h | 9 +++++++--
arch/arm/kernel/paravirt.c | 4 ++--
arch/arm64/include/asm/paravirt.h | 9 +++++++--
arch/arm64/kernel/paravirt.c | 4 ++--
drivers/xen/time.c | 4 ++++
5 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/paravirt.h b/arch/arm/include/asm/paravirt.h
index d51e5cd..cdbf02d 100644
--- a/arch/arm/include/asm/paravirt.h
+++ b/arch/arm/include/asm/paravirt.h
@@ -10,11 +10,16 @@
struct pv_time_ops {
unsigned long long (*steal_clock)(int cpu);
};
-extern struct pv_time_ops pv_time_ops;
+
+struct paravirt_patch_template {
+ struct pv_time_ops time;
+};
+
+extern struct paravirt_patch_template pv_ops;
static inline u64 paravirt_steal_clock(int cpu)
{
- return pv_time_ops.steal_clock(cpu);
+ return pv_ops.time.steal_clock(cpu);
}
#endif
diff --git a/arch/arm/kernel/paravirt.c b/arch/arm/kernel/paravirt.c
index 53f371e..75c158b 100644
--- a/arch/arm/kernel/paravirt.c
+++ b/arch/arm/kernel/paravirt.c
@@ -21,5 +21,5 @@
struct static_key paravirt_steal_enabled;
struct static_key paravirt_steal_rq_enabled;
-struct pv_time_ops pv_time_ops;
-EXPORT_SYMBOL_GPL(pv_time_ops);
+struct paravirt_patch_template pv_ops;
+EXPORT_SYMBOL_GPL(pv_ops);
diff --git a/arch/arm64/include/asm/paravirt.h b/arch/arm64/include/asm/paravirt.h
index bb5dcea..799d9dd 100644
--- a/arch/arm64/include/asm/paravirt.h
+++ b/arch/arm64/include/asm/paravirt.h
@@ -10,11 +10,16 @@
struct pv_time_ops {
unsigned long long (*steal_clock)(int cpu);
};
-extern struct pv_time_ops pv_time_ops;
+
+struct paravirt_patch_template {
+ struct pv_time_ops time;
+};
+
+extern struct paravirt_patch_template pv_ops;
static inline u64 paravirt_steal_clock(int cpu)
{
- return pv_time_ops.steal_clock(cpu);
+ return pv_ops.time.steal_clock(cpu);
}
#endif
diff --git a/arch/arm64/kernel/paravirt.c b/arch/arm64/kernel/paravirt.c
index 53f371e..75c158b 100644
--- a/arch/arm64/kernel/paravirt.c
+++ b/arch/arm64/kernel/paravirt.c
@@ -21,5 +21,5 @@
struct static_key paravirt_steal_enabled;
struct static_key paravirt_steal_rq_enabled;
-struct pv_time_ops pv_time_ops;
-EXPORT_SYMBOL_GPL(pv_time_ops);
+struct paravirt_patch_template pv_ops;
+EXPORT_SYMBOL_GPL(pv_ops);
diff --git a/drivers/xen/time.c b/drivers/xen/time.c
index a63fedb..c793dbd 100644
--- a/drivers/xen/time.c
+++ b/drivers/xen/time.c
@@ -107,7 +107,11 @@ void __init xen_time_setup_guest(void)
xen_runstate_remote = !HYPERVISOR_vm_assist(VMASST_CMD_enable,
VMASST_TYPE_runstate_update_flag);
+#ifdef CONFIG_ARM64
+ pv_ops.time.steal_clock = xen_steal_clock;
+#else
pv_time_ops.steal_clock = xen_steal_clock;
+#endif
static_key_slow_inc(¶virt_steal_enabled);
if (xen_runstate_remote)
--
1.8.3.1