Searching for Known System Errors

Software is not the only thing that has bugs — mishaps also occur when implementing processors and, as a result, chips do not function as they should. Fortunately, most error situations can be remedied with workarounds. However, before workarounds can be put in place, the kernel needs to know whether a particular processor does, in fact, have any bugs. This can be established using the architecture-specific check_bugs function.

For instance, the following code is available for IA-32 systems:

arch/x86/kernel/cpu/bugs.c static void _init check_bugs(void)

identify_boot_cpu();

check_config(); check_fpu(); check_hlt(); check_popad();

init_utsname()->machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); alternative_instructions();

The last statement (alternative_instructions) also invokes a function that replaces certain assembler instructions — depending on processor type — with faster, more modern alternatives. This enables distributors to create kernel images that are capable of running on a wide variety of machines without having to forgo more recent features.

For comparison of the CPU quality, here is the check_bugs routine of S390, Alpha, Extensa, H8300, v850, FRV, Blackfin, Cris, PA-RISC, and PPC64:

static void check_bugs(void)

The S390 kernel is among the most confident ones, as you can see in the following code:

include/asm-s390/bugs.h static inline void check_bugs(void) {

Continue reading here: Idle and init Thread

Was this article helpful?

0 0