forked from Minki/linux
05abb595bb
We enable hardware DBM bit in a capable CPU, very early in the boot via __cpu_setup. This doesn't give us a flexibility of optionally disable the feature, as the clearing the bit is a bit costly as the TLB can cache the settings. Instead, we delay enabling the feature until the CPU is brought up into the kernel. We use the feature capability mechanism to handle it. The hardware DBM is a non-conflicting feature. i.e, the kernel can safely run with a mix of CPUs with some using the feature and the others don't. So, it is safe for a late CPU to have this capability and enable it, even if the active CPUs don't. To get this handled properly by the infrastructure, we unconditionally set the capability and only enable it on CPUs which really have the feature. Also, we print the feature detection from the "matches" call back to make sure we don't mislead the user when none of the CPUs could use the feature. Cc: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Dave Martin <dave.martin@arm.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
56 lines
1.8 KiB
C
56 lines
1.8 KiB
C
/*
|
|
* arch/arm64/include/asm/cpucaps.h
|
|
*
|
|
* Copyright (C) 2016 ARM Ltd.
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef __ASM_CPUCAPS_H
|
|
#define __ASM_CPUCAPS_H
|
|
|
|
#define ARM64_WORKAROUND_CLEAN_CACHE 0
|
|
#define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1
|
|
#define ARM64_WORKAROUND_845719 2
|
|
#define ARM64_HAS_SYSREG_GIC_CPUIF 3
|
|
#define ARM64_HAS_PAN 4
|
|
#define ARM64_HAS_LSE_ATOMICS 5
|
|
#define ARM64_WORKAROUND_CAVIUM_23154 6
|
|
#define ARM64_WORKAROUND_834220 7
|
|
#define ARM64_HAS_NO_HW_PREFETCH 8
|
|
#define ARM64_HAS_UAO 9
|
|
#define ARM64_ALT_PAN_NOT_UAO 10
|
|
#define ARM64_HAS_VIRT_HOST_EXTN 11
|
|
#define ARM64_WORKAROUND_CAVIUM_27456 12
|
|
#define ARM64_HAS_32BIT_EL0 13
|
|
#define ARM64_HYP_OFFSET_LOW 14
|
|
#define ARM64_MISMATCHED_CACHE_LINE_SIZE 15
|
|
#define ARM64_HAS_NO_FPSIMD 16
|
|
#define ARM64_WORKAROUND_REPEAT_TLBI 17
|
|
#define ARM64_WORKAROUND_QCOM_FALKOR_E1003 18
|
|
#define ARM64_WORKAROUND_858921 19
|
|
#define ARM64_WORKAROUND_CAVIUM_30115 20
|
|
#define ARM64_HAS_DCPOP 21
|
|
#define ARM64_SVE 22
|
|
#define ARM64_UNMAP_KERNEL_AT_EL0 23
|
|
#define ARM64_HARDEN_BRANCH_PREDICTOR 24
|
|
#define ARM64_HARDEN_BP_POST_GUEST_EXIT 25
|
|
#define ARM64_HAS_RAS_EXTN 26
|
|
#define ARM64_WORKAROUND_843419 27
|
|
#define ARM64_HAS_CACHE_IDC 28
|
|
#define ARM64_HAS_CACHE_DIC 29
|
|
#define ARM64_HW_DBM 30
|
|
|
|
#define ARM64_NCAPS 31
|
|
|
|
#endif /* __ASM_CPUCAPS_H */
|