>>> On 25.10.16 at 20:10, <andrew.coop...@citrix.com> wrote:
> @@ -2994,8 +2978,8 @@ x86_emulate(
>          break;
>  
>      case 0x8e: /* mov r/m,Sreg */
> -        seg = decode_segment(modrm_reg);
> -        generate_exception_if(seg == decode_segment_failed, EXC_UD, -1);
> +        seg = modrm_reg & 7; /* REX.R is ignored. */
> +        generate_exception_if(!is_x86_user_segment(seg), EXC_UD, -1);
>          generate_exception_if(seg == x86_seg_cs, EXC_UD, -1);

Can I talk you into folding these two generate_exception_if()s, as
they logically belong together?

> @@ -5438,6 +5422,17 @@ x86_emulate(
>  #undef override_seg
>  #undef ea
>  
> +static void __init __maybe_unused build_assertions(void)
> +{
> +    /* Check the values against SReg3 encoding in opcode/ModRM bytes. */
> +    BUILD_BUG_ON(x86_seg_es != 0);
> +    BUILD_BUG_ON(x86_seg_cs != 1);
> +    BUILD_BUG_ON(x86_seg_ss != 2);
> +    BUILD_BUG_ON(x86_seg_ds != 3);
> +    BUILD_BUG_ON(x86_seg_fs != 4);
> +    BUILD_BUG_ON(x86_seg_gs != 5);
> +}

So using an inline function in the header did not work out?

In any event,
Reviewed-by: Jan Beulich <jbeul...@suse.com>

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

Reply via email to