check_seg_overrides(9)
β¨ NAME β¨
okay so bestie, this is check_seg_overrides(9) from the Kernel API Manual β the function that literally checks if segment override prefixes are allowed. It's giving tiny-but-iconic kernel helper energy, and we're obsessed. π
π οΈ SYNOPSIS π οΈ
No cap, the signature is exactly this:
bool check_seg_overrides (struct insn *insn , int regoff );
π ARGUMENTS π
insnβ a valid instruction with segment override prefixes. That's the instruction we're checking, and yes it has to be valid, bestie. β¨regoffβ operand offset, inpt_regs, for which the check is performed. It's the exact offset inpt_regswhere the vibe check happens. π«Ά
π DESCRIPTION π
okay so here's the tea: for a particular register used in register-indirect addressing, this function determines if segment override prefixes can be used. Specifically, no overrides are allowed for rDI if used with a string instruction. That's the rule, periodt. π
It returns True if segment override prefixes can be used with the register indicated in regoff. False if otherwise. Literally that simple, iykyk. π
π SEE ALSO π
These related besties live in the Kernel file ./arch/x86/lib/insn-eval.c:
is_string_insn(9)insn_has_rep_prefix(9)get_seg_reg_override_idx(9)resolve_default_seg(9)resolve_seg_reg(9)get_segment_selector(9)get_reg_offset_16(9)get_desc(9)insn_get_seg_base(9)get_seg_limit(9)insn_get_code_seg_params(9)insn_get_modrm_rm_off(9)insn_get_modrm_reg_off(9)insn_get_modrm_reg_ptr(9)get_seg_base_limit(9)get_eff_addr_reg(9)get_eff_addr_modrm(9)get_eff_addr_modrm_16(9)get_eff_addr_sib(9)get_addr_ref_16(9)get_addr_ref_32(9)get_addr_ref_64(9)insn_get_addr_ref(9)insn_fetch_from_user(9)insn_fetch_from_user_inatomic(9)insn_decode_from_regs(9)insn_decode_mmio(9)
π cute sign-off time: source/version is ./arch/x86/lib, date is October 2026, and the manual name is check_seg_overrides(9). stay slay, bestie π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms