arch/powerpc/include/asm/guest-state-buffer.h

Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/guest-state-buffer.h

File Facts

System
Linux kernel
Corpus path
arch/powerpc/include/asm/guest-state-buffer.h
Extension
.h
Size
28783 bytes
Lines
1020
Domain
Architecture Layer
Bucket
arch/powerpc
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 kvmppc_gs_part_table {
	u64 address;
	u64 ea_bits;
	u64 gpd_size;
};

/**
 * struct kvmppc_gs_proc_table - deserialized process table information element
 * @address: start of the process table
 * @gpd_size: process table size
 */
struct kvmppc_gs_proc_table {
	u64 address;
	u64 gpd_size;
};

/**
 * struct kvmppc_gs_buff_info - deserialized meta guest state buffer information
 * @address: start of the guest state buffer
 * @size: size of the guest state buffer
 */
struct kvmppc_gs_buff_info {
	u64 address;
	u64 size;
};

/**
 * struct kvmppc_gs_header - serialized guest state buffer header
 * @nelem: count of guest state elements in the buffer
 * @data: start of the stream of elements in the buffer
 */
struct kvmppc_gs_header {
	__be32 nelems;
	char data[];
} __packed;

/**
 * struct kvmppc_gs_elem - serialized guest state buffer element
 * @iden: Guest State ID
 * @len: length of data
 * @data: the guest state buffer element's value
 */
struct kvmppc_gs_elem {
	__be16 iden;
	__be16 len;
	char data[];
} __packed;

/**
 * struct kvmppc_gs_buff - a guest state buffer with metadata.
 * @capacity: total length of the buffer
 * @len: current length of the elements and header
 * @guest_id: guest id associated with the buffer
 * @vcpu_id: vcpu_id associated with the buffer
 * @hdr: the serialised guest state buffer
 */
struct kvmppc_gs_buff {
	size_t capacity;
	size_t len;
	unsigned long guest_id;
	unsigned long vcpu_id;
	struct kvmppc_gs_header *hdr;
};

/**
 * struct kvmppc_gs_bitmap - a bitmap for element ids
 * @bitmap: a bitmap large enough for all Guest State IDs
 */
struct kvmppc_gs_bitmap {
	/* private: */
	DECLARE_BITMAP(bitmap, KVMPPC_GSE_IDEN_COUNT);
};

/**
 * struct kvmppc_gs_parser - a map of element ids to locations in a buffer
 * @iterator: bitmap used for iterating
 * @gses: contains the pointers to elements
 *
 * A guest state parser is used for deserialising a guest state buffer.
 * Given a buffer, it then allows looking up guest state elements using
 * a guest state id.
 */
struct kvmppc_gs_parser {
	/* private: */
	struct kvmppc_gs_bitmap iterator;
	struct kvmppc_gs_elem *gses[KVMPPC_GSE_IDEN_COUNT];
};

enum {
	GSM_GUEST_WIDE = 0x1,

Annotation

Implementation Notes