|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v8 17/24] x86: L2 CAT: implement CPU init and free flow.
On Wed, Feb 15, 2017 at 04:49:32PM +0800, Yi Sun wrote:
> This patch implements the CPU init and free flow for L2 CAT including
> L2 CAT initialization callback function.
>
> Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx>
> ---
> xen/arch/x86/psr.c | 72
> +++++++++++++++++++++++++++++++++++++++++++++++
> xen/include/asm-x86/psr.h | 1 +
> 2 files changed, 73 insertions(+)
>
> diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c
> index 0a0bab9..4489637 100644
> --- a/xen/arch/x86/psr.c
> +++ b/xen/arch/x86/psr.c
> @@ -98,6 +98,7 @@ struct feat_hw_info {
> union {
> struct psr_cat_hw_info l3_cat_info;
> struct psr_cat_hw_info l3_cdp_info;
> + struct psr_cat_hw_info l2_cat_info;
> };
> };
>
> @@ -235,6 +236,7 @@ static DEFINE_PER_CPU(struct psr_assoc, psr_assoc);
> */
> static struct feat_node *feat_l3_cat;
> static struct feat_node *feat_l3_cdp;
> +static struct feat_node *feat_l2_cat;
>
> /* Common functions. */
> static void free_feature(struct psr_socket_info *info)
> @@ -684,6 +686,53 @@ struct feat_ops l3_cdp_ops = {
> .write_msr = l3_cdp_write_msr,
> };
>
> +/* L2 CAT callback functions implementation. */
> +static void l2_cat_init_feature(struct cpuid_leaf regs,
> + struct feat_node *feat,
> + struct psr_socket_info *info)
This is exactly the same code as l3_cat_init_feature with s/l3/l2/. I think
those two functions can somehow be merged, and I'm sure there's room for other
merges, IMHO L2/L3 CAT implementations should share a bunch of code, there's
too much duplication.
Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |