Lines Matching full:segment
78 * get_seg_reg_override_idx() - obtain segment register override index
79 * @insn: Valid instruction with segment override prefixes
81 * Inspect the instruction prefixes in @insn and find segment overrides, if any.
85 * A constant identifying the segment register to use, among CS, SS, DS,
86 * ES, FS, or GS. INAT_SEG_REG_DEFAULT is returned if no segment override
99 /* Look for any segment override prefixes. */ in get_seg_reg_override_idx()
133 /* More than one segment override prefix leads to undefined behavior. */ in get_seg_reg_override_idx()
141 * check_seg_overrides() - check if segment override prefixes are allowed
142 * @insn: Valid instruction with segment override prefixes
146 * segment override prefixes can be used. Specifically, no overrides are allowed
151 * True if segment override prefixes can be used with the register indicated
163 * resolve_default_seg() - resolve default segment register index for an operand
168 * Resolve the default segment register index associated with the instruction
174 * If in protected mode, a constant identifying the segment register to use,
184 * Resolve the default segment register as described in Section 3.7.4 in resolve_default_seg()
230 * resolve_seg_reg() - obtain segment register index
233 * @regoff: Operand offset, in pt_regs, used to determine segment register
235 * Determine the segment register associated with the operands and, if
238 * The segment register associated to an operand used in register-indirect
244 * b) Whether segment override prefixes can be used. Certain instructions and
247 * c) Whether segment overrides prefixes are found in the instruction prefixes.
249 * d) If there are not segment override prefixes or they cannot be used, the
250 * default segment register associated with the operand register is used.
252 * The function checks first if segment override prefixes can be used with the
253 * operand indicated by @regoff. If allowed, obtain such overridden segment
255 * the segment register index to use based on the defaults described in the
256 * Intel documentation. In long mode, all segment register indexes will be
263 * As stated, the main use of this function is to determine the segment register
269 * Please note that this function does not return the value in the segment
270 * register (i.e., the segment selector) but our defined index. The segment
272 * segment register index resolved by this function.
276 * An index identifying the segment register to use, among CS, SS, DS,
286 * In the unlikely event of having to resolve the segment register in resolve_seg_reg()
287 * index for rIP, do it first. Segment override prefixes should not in resolve_seg_reg()
312 * In long mode, segment override prefixes are ignored, except for in resolve_seg_reg()
325 * get_segment_selector() - obtain segment selector
327 * @seg_reg_idx: Segment register index to use
329 * Obtain the segment selector from any of the CS, SS, DS, ES, FS, GS segment
330 * registers. In CONFIG_X86_32, the segment is obtained from either pt_regs or
333 * registers. This done for only for completeness as in CONFIG_X86_64 segment
338 * Value of the segment selector, including null when running in
608 * get_desc() - Obtain contents of a segment descriptor
609 * @out: Segment descriptor contents on success
610 * @sel: Segment selector
612 * Given a segment selector, obtain a pointer to the segment descriptor.
649 * Segment descriptors have a size of 8 bytes. Thus, the index is in get_desc()
651 * from the base of the GDT. As bits [15:3] of the segment selector in get_desc()
665 * insn_get_seg_base() - Obtain base address of segment descriptor.
667 * @seg_reg_idx: Index of the segment register pointing to seg descriptor
669 * Obtain the base address of the segment as indicated by the segment descriptor
670 * pointed by the segment selector. The segment selector is obtained from the
671 * input segment register index @seg_reg_idx.
675 * In protected mode, base address of the segment. Zero in long mode,
676 * except when FS or GS are used. In virtual-8086 mode, the segment
692 * Base is simply the segment selector shifted 4 in insn_get_seg_base()
721 /* In protected mode the segment selector cannot be null. */ in insn_get_seg_base()
732 * get_seg_limit() - Obtain the limit of a segment descriptor
734 * @seg_reg_idx: Index of the segment register pointing to seg descriptor
736 * Obtain the limit of the segment as indicated by the segment descriptor
737 * pointed by the segment selector. The segment selector is obtained from the
738 * input segment register index @seg_reg_idx.
742 * In protected mode, the limit of the segment descriptor in bytes.
743 * In long mode and virtual-8086 mode, segment limits are not enforced. Thus,
744 * limit is returned as -1L to imply a limit-less segment.
770 * not tested when checking the segment limits. In practice, in get_seg_limit()
771 * this means that the segment ends in (limit << 12) + 0xfff. in get_seg_limit()
781 * insn_get_code_seg_params() - Obtain code segment parameters
784 * Obtain address and operand sizes of the code segment. It is obtained from the
786 * address is determined by inspecting the L and D bits of the segment
813 * The most significant byte of the Type field of the segment descriptor in insn_get_code_seg_params()
814 * determines whether a segment contains data or code. If this is a data in insn_get_code_seg_params()
815 * segment, return error. in insn_get_code_seg_params()
896 * get_seg_base_limit() - obtain base address and limit of a segment
899 * @regoff: Operand offset, in pt_regs, used to resolve segment descriptor
900 * @base: Obtained segment base
901 * @limit: Obtained segment limit
903 * Obtain the base address and limit of the segment associated with the operand
905 * different from insn_get_seg_base() as the latter does not resolve the segment
912 * resolved segment, respectively.
954 * such offset can then be used to resolve the segment associated with the
997 * @regoff: Obtained operand offset, in pt_regs, associated with segment
1004 * segment is stored in @regoff, this parameter can later be used to determine
1005 * such segment.
1011 * to resolve the associated segment.
1064 * @regoff: Obtained operand offset, in pt_regs, associated with segment
1071 * the associated segment is stored in @regoff, this parameter can later be used
1072 * to determine such segment.
1078 * to resolve the associated segment.
1119 * registers to obtain the segment selector. The second operand in get_eff_addr_modrm_16()
1121 * will be used to obtain the segment selector. in get_eff_addr_modrm_16()
1132 * @base_offset: Obtained operand offset, in pt_regs, associated with segment
1139 * associated segment is stored in @base_offset; this parameter can later be
1140 * used to determine such segment.
1146 * that can be used to resolve the associated segment.
1224 * segment used as base is determined by either any segment override prefixes in
1225 * @insn or the default segment of the registers involved in the address
1226 * computation. In protected mode, segment limits are enforced.
1265 * is within the limits of the segment. In virtual-8086 mode, segment in get_addr_ref_16()
1266 * limits are not enforced. In such a case, the segment limit is -1L to in get_addr_ref_16()
1289 * displacement bytes and segment base address, as applicable. If in protected
1290 * mode, segment limits are enforced.
1337 * the effective address is within the limits of the segment. in get_addr_ref_32()
1339 * address override prefix is used. In such cases, segment limits are in get_addr_ref_32()
1340 * not enforced. When in virtual-8086 mode, the segment limit is -1L in get_addr_ref_32()
1378 * displacement bytes and segment base address, as applicable.
1436 * displacement bytes, and segment base, as applicable. In protected mode,
1437 * segment limits are enforced.
1470 * If not in user-space long mode, a custom code segment could be in in insn_get_effective_ip()
1564 * in the code segment descriptor. The instruction decoder only sets in insn_decode_from_regs()
1567 * have special cases where, for instance, a 16-bit code segment in insn_decode_from_regs()