>>> On 30.01.18 at 16:56, <[email protected]> wrote:
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -1935,36 +1935,67 @@ load_seg(
>      return rc;
>  }
>  
> +/* Map GPRs by ModRM encoding to their offset within struct cpu_user_regs. */
> +static const uint8_t cpu_user_regs_gpr_offsets[] = {
> +    offsetof(struct cpu_user_regs, r(ax)),
> +    offsetof(struct cpu_user_regs, r(cx)),
> +    offsetof(struct cpu_user_regs, r(dx)),
> +    offsetof(struct cpu_user_regs, r(bx)),
> +    offsetof(struct cpu_user_regs, r(sp)),
> +    offsetof(struct cpu_user_regs, r(bp)),
> +    offsetof(struct cpu_user_regs, r(si)),
> +    offsetof(struct cpu_user_regs, r(di)),
> +#ifdef __x86_64__
> +    offsetof(struct cpu_user_regs, r8),
> +    offsetof(struct cpu_user_regs, r9),
> +    offsetof(struct cpu_user_regs, r10),
> +    offsetof(struct cpu_user_regs, r11),
> +    offsetof(struct cpu_user_regs, r12),
> +    offsetof(struct cpu_user_regs, r13),
> +    offsetof(struct cpu_user_regs, r14),
> +    offsetof(struct cpu_user_regs, r15),
> +#endif
> +};
> +
>  void *
>  decode_register(
>      uint8_t modrm_reg, struct cpu_user_regs *regs, int highbyte_regs)
>  {
> -    void *p;
> +    static const uint8_t byteop_offsets[] = {

byte_reg_offsets[] ?

With that (or a suitable other name not using "op" when registers
are meant)
Reviewed-by: Jan Beulich <[email protected]>

Jan


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to