arch/s390/include/asm/kvm_host_types.h

Source file repositories/reference/linux-study-clean/arch/s390/include/asm/kvm_host_types.h

File Facts

System
Linux kernel
Corpus path
arch/s390/include/asm/kvm_host_types.h
Extension
.h
Size
8665 bytes
Lines
348
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 esca_entry {
	union esca_sigp_ctrl sigp_ctrl;
	__u16	reserved1[3];
	__u64	sda;
	__u64	reserved2[6];
};

struct bsca_entry {
	__u8	reserved0;
	union bsca_sigp_ctrl	sigp_ctrl;
	__u16	reserved[3];
	__u64	sda;
	__u64	reserved2[2];
};

union ipte_control {
	unsigned long val;
	struct {
		unsigned long k  : 1;
		unsigned long kh : 31;
		unsigned long kg : 32;
	};
};

/*
 * Utility is defined as two bytes but having it four bytes wide
 * generates more efficient code. Since the following bytes are
 * reserved this makes no functional difference.
 */
union sca_utility {
	__u32 val;
	struct {
		__u32 mtcr : 1;
		__u32	   : 31;
	};
};

struct bsca_block {
	union ipte_control ipte_control;
	__u64	reserved[5];
	__u64	mcn;
	union sca_utility utility;
	__u8	reserved2[4];
	struct bsca_entry cpu[KVM_S390_BSCA_CPU_SLOTS];
};

struct esca_block {
	union ipte_control ipte_control;
	__u64	reserved1[6];
	union sca_utility utility;
	__u8	reserved2[4];
	__u64	mcn[4];
	__u64	reserved3[20];
	struct esca_entry cpu[KVM_S390_ESCA_CPU_SLOTS];
};

/*
 * This struct is used to store some machine check info from lowcore
 * for machine checks that happen while the guest is running.
 * This info in host's lowcore might be overwritten by a second machine
 * check from host when host is in the machine check's high-level handling.
 * The size is 24 bytes.
 */
struct mcck_volatile_info {
	__u64 mcic;
	__u64 failing_storage_address;
	__u32 ext_damage_code;
	__u32 reserved;
};

#define CR0_INITIAL_MASK (CR0_UNUSED_56 | CR0_INTERRUPT_KEY_SUBMASK | \
			  CR0_MEASUREMENT_ALERT_SUBMASK)
#define CR14_INITIAL_MASK (CR14_UNUSED_32 | CR14_UNUSED_33 | \
			   CR14_EXTERNAL_DAMAGE_SUBMASK)

#define SIDAD_SIZE_MASK		0xff
#define sida_addr(sie_block) phys_to_virt((sie_block)->sidad & PAGE_MASK)
#define sida_size(sie_block) \
	((((sie_block)->sidad & SIDAD_SIZE_MASK) + 1) * PAGE_SIZE)

#define CPUSTAT_STOPPED    0x80000000
#define CPUSTAT_WAIT	   0x10000000
#define CPUSTAT_ECALL_PEND 0x08000000
#define CPUSTAT_STOP_INT   0x04000000
#define CPUSTAT_IO_INT	   0x02000000
#define CPUSTAT_EXT_INT    0x01000000
#define CPUSTAT_RUNNING    0x00800000
#define CPUSTAT_RETAINED   0x00400000
#define CPUSTAT_TIMING_SUB 0x00020000
#define CPUSTAT_SIE_SUB    0x00010000

Annotation

Implementation Notes