diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2015-11-23 05:32:57 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-12-21 09:40:54 -0500 |
commit | 02c2433b3aa6b57313c261c9811bbbe49528101c (patch) | |
tree | 8081453d55ffc7b54560cd99e069a9890ee7ea68 | |
parent | 1fe7c4ef88bd32e039f5f4126537c3f20c340414 (diff) |
arm: introduce CONFIG_PARAVIRT, PARAVIRT_TIME_ACCOUNTING and pv_time_ops
Introduce CONFIG_PARAVIRT and PARAVIRT_TIME_ACCOUNTING on ARM.
The only paravirt interface supported is pv_time_ops.steal_clock, so no
runtime pvops patching needed.
This allows us to make use of steal_account_process_tick for stolen
ticks accounting.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Christopher Covington <cov@codeaurora.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Russell King <linux@arm.linux.org.uk>
-rw-r--r-- | arch/arm/Kconfig | 20 | ||||
-rw-r--r-- | arch/arm/include/asm/paravirt.h | 20 | ||||
-rw-r--r-- | arch/arm/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/kernel/paravirt.c | 25 |
4 files changed, 66 insertions, 0 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 34e1569a11ee..1ab9b98d4c6c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1800,6 +1800,25 @@ config SWIOTLB | |||
1800 | config IOMMU_HELPER | 1800 | config IOMMU_HELPER |
1801 | def_bool SWIOTLB | 1801 | def_bool SWIOTLB |
1802 | 1802 | ||
1803 | config PARAVIRT | ||
1804 | bool "Enable paravirtualization code" | ||
1805 | help | ||
1806 | This changes the kernel so it can modify itself when it is run | ||
1807 | under a hypervisor, potentially improving performance significantly | ||
1808 | over full virtualization. | ||
1809 | |||
1810 | config PARAVIRT_TIME_ACCOUNTING | ||
1811 | bool "Paravirtual steal time accounting" | ||
1812 | select PARAVIRT | ||
1813 | default n | ||
1814 | help | ||
1815 | Select this option to enable fine granularity task steal time | ||
1816 | accounting. Time spent executing other tasks in parallel with | ||
1817 | the current vCPU is discounted from the vCPU power. To account for | ||
1818 | that, there can be a small performance impact. | ||
1819 | |||
1820 | If in doubt, say N here. | ||
1821 | |||
1803 | config XEN_DOM0 | 1822 | config XEN_DOM0 |
1804 | def_bool y | 1823 | def_bool y |
1805 | depends on XEN | 1824 | depends on XEN |
@@ -1813,6 +1832,7 @@ config XEN | |||
1813 | select ARCH_DMA_ADDR_T_64BIT | 1832 | select ARCH_DMA_ADDR_T_64BIT |
1814 | select ARM_PSCI | 1833 | select ARM_PSCI |
1815 | select SWIOTLB_XEN | 1834 | select SWIOTLB_XEN |
1835 | select PARAVIRT | ||
1816 | help | 1836 | help |
1817 | Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. | 1837 | Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. |
1818 | 1838 | ||
diff --git a/arch/arm/include/asm/paravirt.h b/arch/arm/include/asm/paravirt.h new file mode 100644 index 000000000000..8435ff591386 --- /dev/null +++ b/arch/arm/include/asm/paravirt.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _ASM_ARM_PARAVIRT_H | ||
2 | #define _ASM_ARM_PARAVIRT_H | ||
3 | |||
4 | #ifdef CONFIG_PARAVIRT | ||
5 | struct static_key; | ||
6 | extern struct static_key paravirt_steal_enabled; | ||
7 | extern struct static_key paravirt_steal_rq_enabled; | ||
8 | |||
9 | struct pv_time_ops { | ||
10 | unsigned long long (*steal_clock)(int cpu); | ||
11 | }; | ||
12 | extern struct pv_time_ops pv_time_ops; | ||
13 | |||
14 | static inline u64 paravirt_steal_clock(int cpu) | ||
15 | { | ||
16 | return pv_time_ops.steal_clock(cpu); | ||
17 | } | ||
18 | #endif | ||
19 | |||
20 | #endif | ||
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index af9e59bf3831..3e6e93725ca7 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -81,6 +81,7 @@ obj-$(CONFIG_VDSO) += vdso.o | |||
81 | ifneq ($(CONFIG_ARCH_EBSA110),y) | 81 | ifneq ($(CONFIG_ARCH_EBSA110),y) |
82 | obj-y += io.o | 82 | obj-y += io.o |
83 | endif | 83 | endif |
84 | obj-$(CONFIG_PARAVIRT) += paravirt.o | ||
84 | 85 | ||
85 | head-y := head$(MMUEXT).o | 86 | head-y := head$(MMUEXT).o |
86 | obj-$(CONFIG_DEBUG_LL) += debug.o | 87 | obj-$(CONFIG_DEBUG_LL) += debug.o |
diff --git a/arch/arm/kernel/paravirt.c b/arch/arm/kernel/paravirt.c new file mode 100644 index 000000000000..53f371ed4568 --- /dev/null +++ b/arch/arm/kernel/paravirt.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * Copyright (C) 2013 Citrix Systems | ||
12 | * | ||
13 | * Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com> | ||
14 | */ | ||
15 | |||
16 | #include <linux/export.h> | ||
17 | #include <linux/jump_label.h> | ||
18 | #include <linux/types.h> | ||
19 | #include <asm/paravirt.h> | ||
20 | |||
21 | struct static_key paravirt_steal_enabled; | ||
22 | struct static_key paravirt_steal_rq_enabled; | ||
23 | |||
24 | struct pv_time_ops pv_time_ops; | ||
25 | EXPORT_SYMBOL_GPL(pv_time_ops); | ||