Lines Matching full:segment

80  * get_seg_reg_override_idx() - obtain segment register override index
81 * @insn: Valid instruction with segment override prefixes
83 * Inspect the instruction prefixes in @insn and find segment overrides, if any.
87 * A constant identifying the segment register to use, among CS, SS, DS,
88 * ES, FS, or GS. INAT_SEG_REG_DEFAULT is returned if no segment override
101 /* Look for any segment override prefixes. */ in get_seg_reg_override_idx()
135 /* More than one segment override prefix leads to undefined behavior. */ in get_seg_reg_override_idx()
143 * check_seg_overrides() - check if segment override prefixes are allowed
144 * @insn: Valid instruction with segment override prefixes
148 * segment override prefixes can be used. Specifically, no overrides are allowed
153 * True if segment override prefixes can be used with the register indicated
165 * resolve_default_seg() - resolve default segment register index for an operand
170 * Resolve the default segment register index associated with the instruction
176 * If in protected mode, a constant identifying the segment register to use,
186 * Resolve the default segment register as described in Section 3.7.4 in resolve_default_seg()
232 * resolve_seg_reg() - obtain segment register index
235 * @regoff: Operand offset, in pt_regs, used to determine segment register
237 * Determine the segment register associated with the operands and, if
240 * The segment register associated to an operand used in register-indirect
246 * b) Whether segment override prefixes can be used. Certain instructions and
249 * c) Whether segment overrides prefixes are found in the instruction prefixes.
251 * d) If there are not segment override prefixes or they cannot be used, the
252 * default segment register associated with the operand register is used.
254 * The function checks first if segment override prefixes can be used with the
255 * operand indicated by @regoff. If allowed, obtain such overridden segment
257 * the segment register index to use based on the defaults described in the
258 * Intel documentation. In long mode, all segment register indexes will be
265 * As stated, the main use of this function is to determine the segment register
271 * Please note that this function does not return the value in the segment
272 * register (i.e., the segment selector) but our defined index. The segment
274 * segment register index resolved by this function.
278 * An index identifying the segment register to use, among CS, SS, DS,
288 * In the unlikely event of having to resolve the segment register in resolve_seg_reg()
289 * index for rIP, do it first. Segment override prefixes should not in resolve_seg_reg()
314 * In long mode, segment override prefixes are ignored, except for in resolve_seg_reg()
327 * get_segment_selector() - obtain segment selector
329 * @seg_reg_idx: Segment register index to use
331 * Obtain the segment selector from any of the CS, SS, DS, ES, FS, GS segment
332 * registers. In CONFIG_X86_32, the segment is obtained from either pt_regs or
335 * registers. This done for only for completeness as in CONFIG_X86_64 segment
340 * Value of the segment selector, including null when running in
586 * get_desc() - Obtain contents of a segment descriptor
587 * @out: Segment descriptor contents on success
588 * @sel: Segment selector
590 * Given a segment selector, obtain a pointer to the segment descriptor.
627 * Segment descriptors have a size of 8 bytes. Thus, the index is in get_desc()
629 * from the base of the GDT. As bits [15:3] of the segment selector in get_desc()
643 * insn_get_seg_base() - Obtain base address of segment descriptor.
645 * @seg_reg_idx: Index of the segment register pointing to seg descriptor
647 * Obtain the base address of the segment as indicated by the segment descriptor
648 * pointed by the segment selector. The segment selector is obtained from the
649 * input segment register index @seg_reg_idx.
653 * In protected mode, base address of the segment. Zero in long mode,
654 * except when FS or GS are used. In virtual-8086 mode, the segment
670 * Base is simply the segment selector shifted 4 in insn_get_seg_base()
699 /* In protected mode the segment selector cannot be null. */ in insn_get_seg_base()
710 * get_seg_limit() - Obtain the limit of a segment descriptor
712 * @seg_reg_idx: Index of the segment register pointing to seg descriptor
714 * Obtain the limit of the segment as indicated by the segment descriptor
715 * pointed by the segment selector. The segment selector is obtained from the
716 * input segment register index @seg_reg_idx.
720 * In protected mode, the limit of the segment descriptor in bytes.
721 * In long mode and virtual-8086 mode, segment limits are not enforced. Thus,
722 * limit is returned as -1L to imply a limit-less segment.
748 * not tested when checking the segment limits. In practice, in get_seg_limit()
749 * this means that the segment ends in (limit << 12) + 0xfff. in get_seg_limit()
759 * insn_get_code_seg_params() - Obtain code segment parameters
762 * Obtain address and operand sizes of the code segment. It is obtained from the
764 * address is determined by inspecting the L and D bits of the segment
791 * The most significant byte of the Type field of the segment descriptor in insn_get_code_seg_params()
792 * determines whether a segment contains data or code. If this is a data in insn_get_code_seg_params()
793 * segment, return error. in insn_get_code_seg_params()
854 * get_seg_base_limit() - obtain base address and limit of a segment
857 * @regoff: Operand offset, in pt_regs, used to resolve segment descriptor
858 * @base: Obtained segment base
859 * @limit: Obtained segment limit
861 * Obtain the base address and limit of the segment associated with the operand
863 * different from insn_get_seg_base() as the latter does not resolve the segment
870 * resolved segment, respectively.
912 * such offset can then be used to resolve the segment associated with the
955 * @regoff: Obtained operand offset, in pt_regs, associated with segment
962 * segment is stored in @regoff, this parameter can later be used to determine
963 * such segment.
969 * to resolve the associated segment.
1022 * @regoff: Obtained operand offset, in pt_regs, associated with segment
1029 * the associated segment is stored in @regoff, this parameter can later be used
1030 * to determine such segment.
1036 * to resolve the associated segment.
1077 * registers to obtain the segment selector. The second operand in get_eff_addr_modrm_16()
1079 * will be used to obtain the segment selector. in get_eff_addr_modrm_16()
1090 * @regoff: Obtained operand offset, in pt_regs, associated with segment
1097 * associated segment is stored in @regoff, this parameter can later be used to
1098 * determine such segment.
1104 * that can be used to resolve the associated segment.
1182 * segment used as base is determined by either any segment override prefixes in
1183 * @insn or the default segment of the registers involved in the address
1184 * computation. In protected mode, segment limits are enforced.
1223 * is within the limits of the segment. In virtual-8086 mode, segment in get_addr_ref_16()
1224 * limits are not enforced. In such a case, the segment limit is -1L to in get_addr_ref_16()
1247 * displacement bytes and segment base address, as applicable. If in protected
1248 * mode, segment limits are enforced.
1295 * the effective address is within the limits of the segment. in get_addr_ref_32()
1297 * address override prefix is used. In such cases, segment limits are in get_addr_ref_32()
1298 * not enforced. When in virtual-8086 mode, the segment limit is -1L in get_addr_ref_32()
1336 * displacement bytes and segment base address, as applicable.
1394 * displacement bytes, and segment base, as applicable. In protected mode,
1395 * segment limits are enforced.
1425 * If not in user-space long mode, a custom code segment could be in in insn_get_effective_ip()
1519 * in the code segment descriptor. The instruction decoder only sets in insn_decode_from_regs()
1522 * have special cases where, for instance, a 16-bit code segment in insn_decode_from_regs()