mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

The s390 specific diag288_wdt watchdog driver makes use of the virtual watchdog timer, which is available in most machine configurations. If executing the diagnose instruction with subcode 0x288 results in an exception the watchdog timer is not available, otherwise it is available. In order to allow module autoload of the diag288_wdt module, move the detection of the virtual watchdog timer to early boot code, and provide its availability as a cpu feature. This allows to make use of module_cpu_feature_match() to automatically load the module iff the virtual watchdog timer is available. Suggested-by: Marc Hartmayer <mhartmay@linux.ibm.com> Tested-by: Mete Durlu <meted@linux.ibm.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20250410095036.1525057-1-hca@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
38 lines
983 B
C
38 lines
983 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Module interface for CPU features
|
|
*
|
|
* Copyright IBM Corp. 2015, 2022
|
|
* Author(s): Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
|
|
*/
|
|
|
|
#ifndef __ASM_S390_CPUFEATURE_H
|
|
#define __ASM_S390_CPUFEATURE_H
|
|
|
|
#include <asm/facility.h>
|
|
|
|
enum {
|
|
S390_CPU_FEATURE_MSA,
|
|
S390_CPU_FEATURE_VXRS,
|
|
S390_CPU_FEATURE_UV,
|
|
S390_CPU_FEATURE_D288,
|
|
MAX_CPU_FEATURES
|
|
};
|
|
|
|
#define cpu_feature(feature) (feature)
|
|
|
|
int cpu_have_feature(unsigned int nr);
|
|
|
|
#define cpu_has_bear() test_facility(193)
|
|
#define cpu_has_edat1() test_facility(8)
|
|
#define cpu_has_edat2() test_facility(78)
|
|
#define cpu_has_gs() test_facility(133)
|
|
#define cpu_has_idte() test_facility(3)
|
|
#define cpu_has_nx() test_facility(130)
|
|
#define cpu_has_rdp() test_facility(194)
|
|
#define cpu_has_seq_insn() test_facility(85)
|
|
#define cpu_has_tlb_lc() test_facility(51)
|
|
#define cpu_has_topology() test_facility(11)
|
|
#define cpu_has_vx() test_facility(129)
|
|
|
|
#endif /* __ASM_S390_CPUFEATURE_H */
|