Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stefano Stabellini and committed by
David Vrabel
02c2433b 1fe7c4ef

+66
+20
arch/arm/Kconfig
··· 1800 1800 config IOMMU_HELPER 1801 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 1822 config XEN_DOM0 1804 1823 def_bool y 1805 1824 depends on XEN ··· 1832 1813 select ARCH_DMA_ADDR_T_64BIT 1833 1814 select ARM_PSCI 1834 1815 select SWIOTLB_XEN 1816 + select PARAVIRT 1835 1817 help 1836 1818 Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. 1837 1819
+20
arch/arm/include/asm/paravirt.h
··· 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
+1
arch/arm/kernel/Makefile
··· 81 81 ifneq ($(CONFIG_ARCH_EBSA110),y) 82 82 obj-y += io.o 83 83 endif 84 + obj-$(CONFIG_PARAVIRT) += paravirt.o 84 85 85 86 head-y := head$(MMUEXT).o 86 87 obj-$(CONFIG_DEBUG_LL) += debug.o
+25
arch/arm/kernel/paravirt.c
··· 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);