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

Re: [Xen-devel] [PATCH v2] x86/mce: handle reserved domain ID in XEN_MC_msrinject



>>> On 27.05.16 at 14:13, <haozhong.zhang@xxxxxxxxx> wrote:
> --- a/tools/tests/mce-test/tools/xen-mceinj.c
> +++ b/tools/tests/mce-test/tools/xen-mceinj.c
> @@ -317,7 +317,9 @@ static int inject_mci_addr(xc_interface *xc_handle,
>                             domid_t domid)
>  {
>      return add_msr_bank_intpose(xc_handle, cpu_nr,
> -                                MC_MSRINJ_F_INTERPOSE | MC_MSRINJ_F_GPADDR,
> +                                MC_MSRINJ_F_INTERPOSE |
> +                                (domid > DOMID_FIRST_RESERVED ?

Simply by the name of it I would say this ought to be >=. However,
DOMID_FIRST_RESERVED == DOMID_SELF, so the > seems right
here (on the hypervisor side it should be changed though). But for
clarity I would suggest either adding a respective comment or
indeed using

        domid >= DOMID_FIRST_RESERVED && domid != DOMID_SELF

(which I would hope the compiler can fold).

Jan


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

 


Rackspace

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