arm64: cpufeature: Expose CPUID registers by emulation
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Mon, 9 Jan 2017 17:28:31 +0000 (17:28 +0000)
committerWill Deacon <will.deacon@arm.com>
Thu, 12 Jan 2017 12:31:09 +0000 (12:31 +0000)
commit77c97b4ee21290f5f083173d957843b615abbff2
treef808443f1cf7c95776dd62c4047b2257e98a3d96
parentfe4fbdbcddeaab58a4f9b5297f28b8a4babf6f1f
arm64: cpufeature: Expose CPUID registers by emulation

This patch adds the hook for emulating MRS instruction to
export the 'user visible' value of supported system registers.
We emulate only the following id space for system registers:

 Op0=3, Op1=0, CRn=0, CRm=[0, 4-7]

The rest will fall back to SIGILL. This capability is also
advertised via a new HWCAP_CPUID.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
[will: add missing static keyword to enable_mrs_emulation]
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/include/asm/sysreg.h
arch/arm64/include/uapi/asm/hwcap.h
arch/arm64/kernel/cpufeature.c
arch/arm64/kernel/cpuinfo.c