>>> On 17.10.17 at 17:05, <andrew.coop...@citrix.com> wrote:
> @@ -16,4 +17,14 @@ static inline int pv_emul_is_mem_write(const struct 
> x86_emulate_state *state,
>                                                : X86EMUL_UNHANDLEABLE;
>  }
>  
> +/* Return a pointer to the GDT/LDT descriptor referenced by sel. */
> +static inline const struct desc_struct *gdt_ldt_desc_ptr(unsigned int sel)

I guess returning a pointer to const here is on the assumption that
you hope we would never have a need to fiddle with the descriptor?

> +{
> +    const struct vcpu *curr = current;
> +    const struct desc_struct *tbl = (void *)
> +        ((sel & X86_XEC_TI) ? LDT_VIRT_START(curr) : GDT_VIRT_START(curr));

While the two happen to match, using an error code related
constant with something named "selector" doesn't look to be
really correct. But given the match, I don't mind it being this
way.

Acked-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