arch/s390/tools/gen_facilities.c

Source file repositories/reference/linux-study-clean/arch/s390/tools/gen_facilities.c

File Facts

System
Linux kernel
Corpus path
arch/s390/tools/gen_facilities.c
Extension
.c
Size
4815 bytes
Lines
176
Domain
Architecture Layer
Bucket
arch/s390
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

struct facility_def {
	char *name;
	int *bits;
};

static struct facility_def facility_defs[] = {
	{
		/*
		 * FACILITIES_ALS contains the list of facilities that are
		 * required to run a kernel that is compiled e.g. with
		 * -march=<machine>.
		 */
		.name = "FACILITIES_ALS",
		.bits = (int[]){
			0,  /* N3 instructions */
			1,  /* z/Arch mode installed */
			3,  /* dat-enhancement 1 */
			18, /* long displacement facility */
			21, /* extended-immediate facility */
			25, /* store clock fast */
			27, /* mvcos */
			32, /* compare and swap and store */
			33, /* compare and swap and store 2 */
			34, /* general instructions extension */
			35, /* execute extensions */
#ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
			45, /* fast-BCR, etc. */
#endif
#ifdef CONFIG_HAVE_MARCH_ZEC12_FEATURES
			49, /* misc-instruction-extensions */
			52, /* interlocked facility 2 */
#endif
#ifdef CONFIG_HAVE_MARCH_Z13_FEATURES
			53, /* load-and-zero-rightmost-byte, etc. */
			129, /* vector */
#endif
#ifdef CONFIG_HAVE_MARCH_Z14_FEATURES
			58, /* miscellaneous-instruction-extension 2 */
#endif
#ifdef CONFIG_HAVE_MARCH_Z15_FEATURES
			61, /* miscellaneous-instruction-extension 3 */
#endif
#ifdef CONFIG_HAVE_MARCH_Z17_FEATURES
			84, /* miscellaneous-instruction-extension 4 */
#endif
			-1 /* END */
		}
	},
	{
		/*
		 * FACILITIES_KVM contains the list of facilities that are part
		 * of the default facility mask and list that are passed to the
		 * initial CPU model. If no CPU model is used, this, together
		 * with the non-hypervisor managed bits, is the maximum list of
		 * guest facilities supported by KVM.
		 */
		.name = "FACILITIES_KVM",
		.bits = (int[]){
			0,  /* N3 instructions */
			1,  /* z/Arch mode installed */
			2,  /* z/Arch mode active */
			3,  /* DAT-enhancement */
			4,  /* idte segment table */
			5,  /* idte region table */
			6,  /* ASN-and-LX reuse */
			7,  /* stfle */
			8,  /* enhanced-DAT 1 */
			9,  /* sense-running-status */
			10, /* conditional sske */
			13, /* ipte-range */
			14, /* nonquiescing key-setting */
			73, /* transactional execution */
			75, /* access-exception-fetch/store indication */
			76, /* msa extension 3 */
			77, /* msa extension 4 */
			78, /* enhanced-DAT 2 */
			130, /* instruction-execution-protection */
			131, /* enhanced-SOP 2 and side-effect */
			139, /* multiple epoch facility */
			146, /* msa extension 8 */
			150, /* enhanced sort */
			151, /* deflate conversion */
			155, /* msa extension 9 */
			-1  /* END */
		}
	},
	{
		/*
		 * FACILITIES_KVM_CPUMODEL contains the list of facilities
		 * that can be enabled by CPU model code if the host supports

Annotation

Implementation Notes