arch/x86/kernel/cpu/resctrl/internal.h

Source file repositories/reference/linux-study-clean/arch/x86/kernel/cpu/resctrl/internal.h

File Facts

System
Linux kernel
Corpus path
arch/x86/kernel/cpu/resctrl/internal.h
Extension
.h
Size
7652 bytes
Lines
257
Domain
Architecture Layer
Bucket
arch/x86
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 arch_mbm_state {
	u64	chunks;
	u64	prev_msr;
};

/* Setting bit 0 in L3_QOS_EXT_CFG enables the ABMC feature. */
#define ABMC_ENABLE_BIT			0

/*
 * Qos Event Identifiers.
 */
#define ABMC_EXTENDED_EVT_ID		BIT(31)
#define ABMC_EVT_ID			BIT(0)

/* Setting bit 1 in MSR_IA32_L3_QOS_EXT_CFG enables the SDCIAE feature. */
#define SDCIAE_ENABLE_BIT		1

/**
 * struct rdt_hw_ctrl_domain - Arch private attributes of a set of CPUs that share
 *			       a resource for a control function
 * @d_resctrl:	Properties exposed to the resctrl file system
 * @ctrl_val:	array of cache or mem ctrl values (indexed by CLOSID)
 *
 * Members of this structure are accessed via helpers that provide abstraction.
 */
struct rdt_hw_ctrl_domain {
	struct rdt_ctrl_domain		d_resctrl;
	u32				*ctrl_val;
};

/**
 * struct rdt_hw_l3_mon_domain - Arch private attributes of a set of CPUs sharing
 *				 RDT_RESOURCE_L3 monitoring
 * @d_resctrl:		Properties exposed to the resctrl file system
 * @arch_mbm_states:	Per-event pointer to the MBM event's saved state.
 *			An MBM event's state is an array of struct arch_mbm_state
 *			indexed by RMID on x86.
 *
 * Members of this structure are accessed via helpers that provide abstraction.
 */
struct rdt_hw_l3_mon_domain {
	struct rdt_l3_mon_domain	d_resctrl;
	struct arch_mbm_state		*arch_mbm_states[QOS_NUM_L3_MBM_EVENTS];
};

static inline struct rdt_hw_ctrl_domain *resctrl_to_arch_ctrl_dom(struct rdt_ctrl_domain *r)
{
	return container_of(r, struct rdt_hw_ctrl_domain, d_resctrl);
}

static inline struct rdt_hw_l3_mon_domain *resctrl_to_arch_mon_dom(struct rdt_l3_mon_domain *r)
{
	return container_of(r, struct rdt_hw_l3_mon_domain, d_resctrl);
}

/**
 * struct rdt_perf_pkg_mon_domain - CPUs sharing an package scoped resctrl monitor resource
 * @hdr:	common header for different domain types
 */
struct rdt_perf_pkg_mon_domain {
	struct rdt_domain_hdr	hdr;
};

/**
 * struct msr_param - set a range of MSRs from a domain
 * @res:       The resource to use
 * @dom:       The domain to update
 * @low:       Beginning index from base MSR
 * @high:      End index
 */
struct msr_param {
	struct rdt_resource	*res;
	struct rdt_ctrl_domain	*dom;
	u32			low;
	u32			high;
};

/**
 * struct rdt_hw_resource - arch private attributes of a resctrl resource
 * @r_resctrl:		Attributes of the resource used directly by resctrl.
 * @num_closid:		Maximum number of closid this hardware can support,
 *			regardless of CDP. This is exposed via
 *			resctrl_arch_get_num_closid() to avoid confusion
 *			with struct resctrl_schema's property of the same name,
 *			which has been corrected for features like CDP.
 * @msr_base:		Base MSR address for CBMs
 * @msr_update:		Function pointer to update QOS MSRs
 * @mon_scale:		cqm counter * mon_scale = occupancy in bytes
 * @mbm_width:		Monitor width, to detect and correct for overflow.
 * @cdp_enabled:	CDP state of this resource

Annotation

Implementation Notes