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

[Xen-devel] [PATCH RESEND v5 00/24] Enable L2 Cache Allocation Technology & Refactor psr.c



Hi all,

We plan to bring a new PSR (Platform Shared Resource) feature called
Intel L2 Cache Allocation Technology (L2 CAT) to Xen.

Besides the L2 CAT implementaion, we refactor the psr.c to make it more
flexible to add new features and fulfill the principle, open for extension
but closed for modification. We abstract the general operations of all
features and encapsulate them into a structure. Then, the development
of new feature is simple to mainly implement these callback functions.

The patch set can be found at:
https://github.com/yisun-git/xen_l2_cat_v5.git l2_cat_v5

v5:
- patch 3: address Jan's comments.
    - explain CDP more in commit message.
    - remove exact SDM chapter number but only keep title.
    - remove init_feature from callback function ops structure.
- patch 4: address Jan's comments.
    - modify commit message beacuse of code changes.
    - add 'struct cpuid_leaf_regs' to save cpu registers value to reduce
      parameters of init_feature function.
    - modify comments to make them accurate.
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
    - use 'list_for_each_entry_safe' when free features.
    - do not delete 'feat_l3_cat' to make it can be reused when cpu online.
    - use 'current_cpu_data'.
    - clear 'X86_FEATURE_PQE' if cpuid_level is not right.
    - Print socket info when 'opt_cpu_info' is true.
    - remove 'cpu_prepare_work' function and move contents of it into
      'psr_cpu_prepare'.
- patch 5: address Jan's comments.
    - define macro 'PSR_ASSOC_REG_POS' to replace integer 32.
    - rename 'l3_cat_get_max_cos_max' to 'l3_cat_get_cos_max'.
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
- patch 6: address Jan's comments.
    - add function 'psr_cbm_type_to_feat_type' to covert 'cbm_type' to
      'psr_feat_type'. This is part of codes to move type check out from
      callback functions.
    - remove type check from feature callback functions.
    - rename 'dat[]' to 'data[]'
    - check if feature type match in caller of feature callback function.
- patch 7: address Jan's comments.
    - rename 'dat[]' to 'data[]'
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
    - check if feature type match in caller of feature callback function.
- patch 8: address Jan's comments.
    - modify commit message because of function name change.
    - change 'alloc_new_cos' to 'pick_avail_cos' to make name accurate.
    - divide 'get_old_set_new' to two functions, 'assemble_val_array' and
      'set_new_val_to_array'.
    - check feature type when entering 'psr_set_val'.
    - remove cast.
    - use ASSERT to check ref.
    - rename 'dat[]' to 'data[]'
- patch 9: address Jan's comments.
    - modify comments according to changes of codes.
    - change 'bool_t' to 'bool'.
    - modify return value of callback functions because we do not need them
      to return number of entries the feature uses. In caller, we call
      'get_cos_num' to get the number of entries the feature uses.
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
- patch 10: address Jan's comments.
    - modify commit message to provide exact patch name to continue from.
    - remove 'get_cos_max_from_type' because it can be replaced by
      'get_cos_max'.
    - move type check out from callback functions to caller.
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
    - modify comments according to changes of codes.
- patch 11: address Jan's comments.
    - modify commit message to provide exact patch name to continue from.
    - change 'exceeds_cos_max' to 'fits_cos_max' to be accurate.
    - modify comments according to changes of codes.
    - modify return value of callback functions because we do not need them
      to return number of entries the feature uses. In caller, we call
      'get_cos_num' to get the number of entries the feature uses.
    - move type check out from callback functions to caller.
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
- patch 12: address Jan's comments.
    - modify commit message to provide exact patch name to continue from.
    - modify return value of callback functions because we do not need them
      to return number of entries the feature uses. In caller, we call
      'get_cos_num' to get the number of entries the feature uses.
    - move type check out from callback functions to caller.
    - modify variables names to make them better, e.g. 'feat_tmp' to 'feat'.
- patch 13: address Jan's comments.
    - remove 'feat_l3_cdp' free in 'free_feature'.
    - Encapsulate cpuid registers into 'struct cpuid_leaf_regs'.
    - Print socket info when 'opt_cpu_info' is true.
    - rename 'l3_cdp_get_max_cos_max' to 'l3_cdp_get_cos_max'.
    - rename 'dat[]' to 'data[]'
    - move 'cpu_prepare_work' contents into 'psr_cpu_prepare'.
- patch 14: address Jan's comments.
    - rename 'dat[]' to 'data[]'
    - remove type check in callback function.
- patch 15: address Jan's comments.
    - remove type check in callback function.
- patch 16: address Jan's comments.
    - remove type check in callback function.
    - modify return value of callback functions because we do not need them
      to return number of entries the feature uses. In caller, we call
      'get_cos_num' to get the number of entries the feature uses.
    - remove 'l3_cdp_get_cos_max_from_type'.
    - rename 'l3_cdp_exceeds_cos_max' to 'l3_cdp_fits_cos_max'.
- patch 17: address Jan's comments.
    - remove 'feat_l2_cat' free in 'free_feature'.
    - Encapsulate cpuid registers into 'struct cpuid_leaf_regs'.
    - Print socket info when 'opt_cpu_info' is true.
    - rename 'l2_cat_get_max_cos_max' to 'l2_cat_get_cos_max'.
    - rename 'dat[]' to 'data[]'
    - move 'cpu_prepare_work' contents into 'psr_cpu_prepare'.
- patch 18: address Jan's comments.
    - rename 'dat[]' to 'data[]'
    - remove type check in callback function.
- patch 19: address Jan's comments.
    - remove type check in callback function.
- patch 20: address Jan's comments.
    - remove type check in callback function.
    - modify return value of callback functions because we do not need them
      to return number of entries the feature uses. In caller, we call
      'get_cos_num' to get the number of entries the feature uses.
    - remove 'l2_cat_get_cos_max_from_type'.
    - rename 'l2_cat_exceeds_cos_max' to 'l2_cat_fits_cos_max'.
- patch 21: address Wei and Jan's comments.
    - modify commit message to remove error log.
    - replace unnecessary 'return' to 'break'.
    - restore 'libxl_psr_cat_get_l3_info' to keep interface backward compatible
      but change codes in it to call new function to get hw info.
    - add 'L2_CBM' into 'psr_cbm_type' because it is interface change which
      should be in same patch with new 'LIBXL_HAVE_' macro.
    - addjust logs sentence to make unnecessary error logs not show.
- patch 22: address Wei and Jan's comments.
    - remove 'L2_CBM' in idl because it has been moved to patch 21.

Yi Sun (24):
  docs: create L2 Cache Allocation Technology (CAT) feature document
  x86: refactor psr: remove L3 CAT/CDP codes.
  x86: refactor psr: implement main data structures.
  x86: refactor psr: implement CPU init and free flow.
  x86: refactor psr: implement Domain init/free and schedule flows.
  x86: refactor psr: implement get hw info flow.
  x86: refactor psr: implement get value flow.
  x86: refactor psr: set value: implement framework.
  x86: refactor psr: set value: assemble features value array.
  x86: refactor psr: set value: implement cos finding flow.
  x86: refactor psr: set value: implement cos id picking flow.
  x86: refactor psr: set value: implement write msr flow.
  x86: refactor psr: implement CPU init and free flow for CDP.
  x86: refactor psr: implement get hw info flow for CDP.
  x86: refactor psr: implement get value flow for CDP.
  x86: refactor psr: implement set value callback functions for CDP.
  x86: L2 CAT: implement CPU init and free flow.
  x86: L2 CAT: implement get hw info flow.
  x86: L2 CAT: implement get value flow.
  x86: L2 CAT: implement set value flow.
  tools: L2 CAT: support get HW info for L2 CAT.
  tools: L2 CAT: support show cbm for L2 CAT.
  tools: L2 CAT: support set cbm for L2 CAT.
  docs: add L2 CAT description in docs.

 docs/features/intel_psr_l2_cat.pandoc |  347 +++++++
 docs/man/xl.pod.1.in                  |   25 +-
 docs/misc/xl-psr.markdown             |   10 +-
 tools/libxc/include/xenctrl.h         |    7 +-
 tools/libxc/xc_psr.c                  |   46 +-
 tools/libxl/libxl.h                   |    9 +
 tools/libxl/libxl_psr.c               |   19 +-
 tools/libxl/libxl_types.idl           |    1 +
 tools/libxl/xl_cmdimpl.c              |  162 ++--
 tools/libxl/xl_cmdtable.c             |    4 +-
 xen/arch/x86/domctl.c                 |   49 +-
 xen/arch/x86/psr.c                    | 1593 +++++++++++++++++++++++++++------
 xen/arch/x86/sysctl.c                 |   45 +-
 xen/include/asm-x86/msr-index.h       |    1 +
 xen/include/asm-x86/psr.h             |   19 +-
 xen/include/public/domctl.h           |    2 +
 xen/include/public/sysctl.h           |    6 +
 17 files changed, 1951 insertions(+), 394 deletions(-)
 create mode 100644 docs/features/intel_psr_l2_cat.pandoc

-- 
1.9.1


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