tools/testing/selftests/powerpc/dexcr/dexcr.h
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/dexcr/dexcr.h
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/dexcr/dexcr.h- Extension
.h- Size
- 2668 bytes
- Lines
- 107
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdbool.hsys/prctl.hsys/types.hreg.h
Detected Declarations
struct dexcr_aspectenum dexcr_source
Annotated Snippet
struct dexcr_aspect {
const char *name; /* Short display name */
const char *opt; /* Option name for chdexcr */
const char *desc; /* Expanded aspect meaning */
unsigned int index; /* Aspect bit index in DEXCR */
unsigned long prctl; /* 'which' value for get/set prctl */
};
static const struct dexcr_aspect aspects[] = {
{
.name = "SBHE",
.opt = "sbhe",
.desc = "Speculative branch hint enable",
.index = 0,
.prctl = PR_PPC_DEXCR_SBHE,
},
{
.name = "IBRTPD",
.opt = "ibrtpd",
.desc = "Indirect branch recurrent target prediction disable",
.index = 3,
.prctl = PR_PPC_DEXCR_IBRTPD,
},
{
.name = "SRAPD",
.opt = "srapd",
.desc = "Subroutine return address prediction disable",
.index = 4,
.prctl = PR_PPC_DEXCR_SRAPD,
},
{
.name = "NPHIE",
.opt = "nphie",
.desc = "Non-privileged hash instruction enable",
.index = 5,
.prctl = PR_PPC_DEXCR_NPHIE,
},
{
.name = "PHIE",
.opt = "phie",
.desc = "Privileged hash instruction enable",
.index = 6,
.prctl = -1,
},
};
bool dexcr_exists(void);
bool pr_dexcr_aspect_supported(unsigned long which);
bool pr_dexcr_aspect_editable(unsigned long which);
int pr_get_dexcr(unsigned long pr_aspect);
int pr_set_dexcr(unsigned long pr_aspect, unsigned long ctrl);
unsigned int pr_which_to_aspect(unsigned long which);
bool hashchk_triggers(void);
enum dexcr_source {
DEXCR, /* Userspace DEXCR value */
HDEXCR, /* Hypervisor enforced DEXCR value */
EFFECTIVE, /* Bitwise OR of UDEXCR and ENFORCED DEXCR bits */
};
unsigned int get_dexcr(enum dexcr_source source);
void await_child_success(pid_t pid);
void hashst(unsigned long lr, void *sp);
void hashchk(unsigned long lr, void *sp);
void do_bad_hashchk(void);
#endif /* _SELFTESTS_POWERPC_DEXCR_DEXCR_H */
Annotation
- Immediate include surface: `stdbool.h`, `sys/prctl.h`, `sys/types.h`, `reg.h`.
- Detected declarations: `struct dexcr_aspect`, `enum dexcr_source`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.