s390/cpufeature: allow for facility bits

Allow for facility bits to be used in cpu features.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Link: https://lore.kernel.org/r/20220713125644.16121-3-seiden@linux.ibm.com
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
This commit is contained in:
Heiko Carstens 2022-07-13 14:56:43 +02:00 committed by Alexander Gordeev
parent 0a5f9b382c
commit e2f39c9f54
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,7 @@
enum {
TYPE_HWCAP,
TYPE_FACILITY,
};
struct s390_cpu_feature {
@ -34,6 +35,8 @@ int cpu_have_feature(unsigned int num)
switch (feature->type) {
case TYPE_HWCAP:
return !!(elf_hwcap & BIT(feature->num));
case TYPE_FACILITY:
return test_facility(feature->num);
default:
WARN_ON_ONCE(1);
return 0;