xen/arm: cpufeature: Add helper to check constant caps
authorJulien Grall <julien.grall@arm.com>
Mon, 1 Oct 2018 12:46:37 +0000 (13:46 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Mon, 1 Oct 2018 20:45:15 +0000 (13:45 -0700)
commit579401fb8e5f33dda461d872bf5a711072662d59
treecbde231315d16792be74c28a127c02ab09e50ea7
parent0daec62e9df569bd9e90499e41c1a9c3c348aa96
xen/arm: cpufeature: Add helper to check constant caps

Some capababilities are set right during boot and will never change
afterwards. At the moment, the function cpu_have_caps will check whether
the cap is enabled from the memory.

It is possible to avoid the load from the memory by using an
ALTERNATIVE. With that the check is just reduced to 1 instruction.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/cpufeature.h