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

Re: [Xen-devel] [PATCH v6 1/3] x86: Support enable CDP by boot parameter and add get CDP status



> +        if ( (ecx & PSR_CAT_CDP_CAPABILITY) && (opt_psr & PSR_CDP) &&
> +             cdp_socket_enable && !test_bit(socket, cdp_socket_enable) )
> +        {
> +            rdmsrl(MSR_IA32_PSR_L3_QOS_CFG, val);
> +            wrmsrl(MSR_IA32_PSR_L3_QOS_CFG, val | (1 << 
> PSR_L3_QOS_CDP_ENABLE_BIT));
> +
> +            info->cos_to_cbm[0].code = (1ull << info->cbm_len) - 1;
> +            info->cos_to_cbm[0].data = (1ull << info->cbm_len) - 1;
> +
> +            /* We only write mask1 since mask0 is always all ones by 
> default. */
> +            wrmsrl(MSR_IA32_PSR_L3_MASK(1), (1ull << info->cbm_len) - 1);

Although I think it maybe not a big deal here, I'd suggest doing this
before you actually turning CDP on (writing MSR_IA32_PSR_L3_QOS_CFG above)
as strictly speaking before we enabling CDP the data mask(mask1) for cos0
should already be initialised.

> +
> +            /* Cut half of cos_max when CDP is enabled. */
> +            info->cos_max >>= 1;
> +
> +            set_bit(socket, cdp_socket_enable);
> +        }
> +        printk(XENLOG_INFO "CAT: enabled on socket %u, cos_max:%u, 
> cbm_len:%u, CDP:%s\n",
> +               socket, info->cos_max, info->cbm_len,
> +               cdp_is_enabled(socket) ? "on" : "off");
>      }
>  }
>  
> @@ -513,6 +551,7 @@ static void cat_cpu_fini(unsigned int cpu)
>              xfree(info->cos_to_cbm);
>              info->cos_to_cbm = NULL;
>          }
> +        clear_bit(socket, cdp_socket_enable);

Is it possible for cdp_socket_enable to be NULL? e.g. in the case when
CDP failed to initilize. You can check if it works for cat-only mode.

Chao
>          clear_bit(socket, cat_socket_enable);
>      }

_______________________________________________
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®.