[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/3] x86/hvm: Rearange check_segment() to use a switch statement



>>> On 30.06.17 at 17:04, <andrew.cooper3@xxxxxxxxxx> wrote:
> +    case x86_seg_ds:
> +    case x86_seg_es:
> +        if ( (reg->attr.fields.type & 0x8) && !(reg->attr.fields.type & 0x2) 
> )
> +        {
> +            gprintk(XENLOG_ERR, "Non-readable segment provided for DS or 
> ES\n");
> +            return -EINVAL;
> +        }
> +        break;
> +
> +    default: /* -Werror=switch */
> +        break;
>      }

Perhaps better to have

    default:
        ASSERT_UNREACHABLE();
    case x86_seg_tr:
        break;

to make more visible that it is not an oversight that especially FS
and GS aren't being handled here? Either way
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Jan


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.