Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\resctrl\ctrlmondata.c Create Date:2022-07-28 08:12:50
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Check whether a cache bit mask is valid. The SDM says:* Please note that all (and only) contiguous '1' combinations* are allowed (e.g. FFFFH, 0FF0H, 003CH, etc.).* Additionally Haswell requires at least two bits set.

Proto:bool cbm_validate_intel(char *buf, unsigned int *data, struct rdt_resource *r)

Type:bool

Parameter:

TypeParameterName
char *buf
unsigned int *data
struct rdt_resource *r
134  cbm_len = cbm_len
137  ret = kstrtoul - convert a string to an unsigned long*@s: The start of the string. The string must be null-terminated, and may also* include a single newline before its terminating null. The first character* may also be a plus sign, but not a minus sign.
138  If ret Then
139  rdt_last_cmd_printf("Non-hex character in the mask %s\n", buf)
140  Return false
143  If val == 0 || val > default_ctrl Then
144  rdt_last_cmd_puts("Mask out of range\n")
145  Return false
148  first_bit = find the first set bit in a memory region( & val, cbm_len)
149  zero_bit = Find the next zero bit in a memory region.
151  If Find the next set bit in a memory region. < cbm_len Then
152  rdt_last_cmd_printf("The mask %lx has non-consecutive 1-bits\n", val)
153  Return false
156  If zero_bit - first_bit < min_cbm_bits Then
157  rdt_last_cmd_printf("Need at least %d bits in the mask\n", min_cbm_bits)
159  Return false
162  data = val
163  Return true