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

[Xen-devel] [PATCH v12 00/23] 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. It has been enabled
in Linux Kernel.

Besides the L2 CAT implementaion, we refactor the psr.c to make it more
flexible and easily to extend to add new features. 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.git l2_cat_v12

---
Acked and Reviewed list before V12:

a - Acked-by
r - Reviewed-by

  r  patch 1  - docs: create Cache Allocation Technology (CAT) and Code and
                Data Prioritization (CDP) feature document
  a  patch 2  - x86: move cpuid_count_leaf from cpuid.c to processor.h.
  ar patch 3  - x86: refactor psr: remove L3 CAT/CDP codes.
  r  patch 6  - x86: refactor psr: L3 CAT: implement get hw info flow.
  r  patch 18 - x86: L2 CAT: implement get value flow.
  r  patch 19 - x86: L2 CAT: implement set value flow.
  a  patch 20 - tools: L2 CAT: support get HW info for L2 CAT.
  a  patch 21 - tools: L2 CAT: support show cbm for L2 CAT.
  a  patch 22 - tools: L2 CAT: support set cbm for L2 CAT.
  a  patch 23 - docs: add L2 CAT description in docs.

---
V12 change list:

Patch 4:
    - add comment for 'feat_init'.
      (suggested by Jan Beulich)
    - use 'ARRAY_SIZE()' to check array boundary.
      (suggested by Jan Beulich)
    - use 'XENLOG_WARNING' for error message.
      (suggested by Jan Beulich)
    - move 'type[]' assignment for feat_props object into its delcaration
      to make the object be 'const'.
      (suggested by Jan Beulich)
    - remove "L3" and "L2" indication in printk.
      (suggested by Jan Beulich)
    - move position of 'ref_lock' definition.
Patch 5:
    - fix coding style issue.
      (suggested by Jan Beulich)
    - in 'get_max_cos_max', invert the condition and dropping 'continue'.
      (suggested by Jan Beulich)
    - modify 'psr_assoc_cos' to directly return 'reg' value.
      (suggested by Jan Beulich)
    - modify code style.
      (suggested by Jan Beulich)
    - do not break domain creation if 'psr_cos_ids' allocation fails.
      (suggested by Jan Beulich)
Patch 6:
    - use 'ASSERT_UNREACHABLE()' to record bug.
      (suggested by Jan Beulich)
Patch 7:
    - remove 'psr_get_feat_and_type' and implement its functionality in
      'psr_get_val'.
    - use 'ASSERT_UNREACHABLE' to record error.
      (suggested by Jan Beulich)
    - return success only if the 'val' is set in 'psr_get_val'.
      (suggested by Jan Beulich)
Patch 8:
    - remove the memebers position changes in 'psr_socket_info'.
      (suggested by Jan Beulich)
    - rename 'dom_ids' to 'dom_set'.
      (suggested by Jan Beulich)
    - call 'bitmap_zero' to clear bitmap.
      (suggested by Jan Beulich)
    - combine two if()-s in 'psr_ctxt_switch_to' and add comment.
      (suggested by Jan Beulich)
    - remove redundant check in 'psr_get_val'.
      (suggested by Jan Beulich)
    - use 'domain_lock()' to protect 'psr_cos_ids' so that the codes do not
      depend on 'domctl_lock'.
      (suggested by Jan Beulich)
    - adjust codes to avoid cast in 'psr_set_val'.
      (suggested by Jan Beulich)
    - adjust codes to avoid duplication of error paths in 'psr_set_val'.
      (suggested by Jan Beulich)
    - clear the domain bit anyway in 'psr_free_cos'.
      (suggested by Jan Beulich)
    - use the default cos id when getting old_cos in 'psr_set_val'.
Patch 9:
    - use 'ARRAY_SIZE' to calculate array boundary.
      (suggested by Jan Beulich)
    - use 'ASSERT_UNREACHABLE()' to record bug and return error code if feat
      exist but props does not exist.
      (suggested by Jan Beulich)
    - return 0 only when value is set in 'insert_val_into_array'.
      (suggested by Jan Beulich)
Patch 10:
    - use 'ARRAY_SIZE' to calculate array boundary.
      (suggested by Jan Beulich)
    - move same type variables declaration to one line.
      (suggested by Jan Beulich)
    - use 'ASSERT_UNREACHABLE()' to record bug and return error code if feat
      exists but props does not exist.
      (suggested by Jan Beulich)
    - move 'i' definition into the loop to limit its scope.
      (suggested by Jan Beulich)
Patch 11:
    - use 'ASSERT_UNREACHABLE()' to record bug and return error code if feat
      exists but props does not exist.
      (suggested by Jan Beulich)
    - declare same type vairables in one line.
      (suggested by Jan Beulich)
    - use 'ARRAY_SIZE' to calculate array boundary.
      (suggested by Jan Beulich)
Patch 12:
    - declare same type varaibles in one line.
      (suggested by Jan Beulich)
    - replace 'feat_type' to 'props' in 'struct cos_write_info'.
      (suggested by Jan Beulich)
    - assign the 'cos_num' to a local variable.
      (suggested by Jan Beulich)
    - use 'ASSERT_UNREACHABLE()' to record bug and return error code if feat
      exists but props does not exist.
      (suggested by Jan Beulich)
Patch 13:
    - move 'type[]' assignment into l3_cdp_props declaration to make it be
      'const'.
      (suggested by Jan Beulich)
    - remove "L2 CAT" indication in printk.
      (suggested by Jan Beulich)
    - fix coding style issue.
      (suggested by Jan Beulich)
    - change 'val' type to uint64_t.
      (suggested by Jan Beulich)
    - use 1ull.
      (suggested by Jan Beulich)
    - restore mask(0) MSR to default value.
      (suggested by Jan Beulich)
Patch 14:
    - remove input parameter 'info' in 'psr_cbm_type_to_feat_type'. Use
      'feat_props' array to check.
      (suggested by Jan Beulich)
Patch 15:
    - add comment to explain how to deal with the case that user set new val
      for both DATA and CODE at same time.
    - add parameter for 'psr_cbm_type_to_feat_type' to return the feature type
      according to it.
    - use the feature type returned by 'psr_cbm_type_to_feat_type' to check
      if we need insert the new value into all items of the feature value array.
    - use conditional expression for wrmsrl.
      (suggested by Jan Beulich)
Patch 16:
    - move 'type[]' assignment into l2_cat_props declaration to make it be
      'const'.
      (suggested by Jan Beulich)
    - add "L2 CAT" indicator in printk.
      (suggested by Jan Beulich)
    - restore mask(0) MSR to default value.
      (suggested by Jan Beulich)

Yi Sun (23):
  docs: create Cache Allocation Technology (CAT) and Code and Data
    Prioritization (CDP) feature document
  x86: move cpuid_count_leaf from cpuid.c to processor.h.
  x86: refactor psr: remove L3 CAT/CDP codes.
  x86: refactor psr: L3 CAT: implement main data structures, CPU init
    and free flows.
  x86: refactor psr: L3 CAT: implement Domain init/free and schedule
    flows.
  x86: refactor psr: L3 CAT: implement get hw info flow.
  x86: refactor psr: L3 CAT: implement get value flow.
  x86: refactor psr: L3 CAT: set value: implement framework.
  x86: refactor psr: L3 CAT: set value: assemble features value array.
  x86: refactor psr: L3 CAT: set value: implement cos finding flow.
  x86: refactor psr: L3 CAT: set value: implement cos id picking flow.
  x86: refactor psr: L3 CAT: set value: implement write msr flow.
  x86: refactor psr: CDP: implement CPU init flow.
  x86: refactor psr: CDP: implement get hw info flow.
  x86: refactor psr: CDP: implement set value callback function.
  x86: L2 CAT: implement CPU init 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_cat_cdp.pandoc |  461 +++++++++++
 docs/man/xl.pod.1.in                   |   25 +-
 docs/misc/xl-psr.markdown              |   18 +-
 tools/libxc/include/xenctrl.h          |    7 +-
 tools/libxc/xc_psr.c                   |   45 +-
 tools/libxl/libxl.h                    |    9 +
 tools/libxl/libxl_psr.c                |   28 +-
 tools/libxl/libxl_types.idl            |    1 +
 tools/xl/xl_cmdtable.c                 |    6 +-
 tools/xl/xl_psr.c                      |  168 ++--
 xen/arch/x86/cpuid.c                   |    6 -
 xen/arch/x86/domain.c                  |    3 +-
 xen/arch/x86/domctl.c                  |   51 +-
 xen/arch/x86/psr.c                     | 1411 ++++++++++++++++++++++++--------
 xen/arch/x86/sysctl.c                  |   38 +-
 xen/include/asm-x86/msr-index.h        |    1 +
 xen/include/asm-x86/processor.h        |    7 +
 xen/include/asm-x86/psr.h              |   28 +-
 xen/include/public/domctl.h            |    2 +
 xen/include/public/sysctl.h            |    3 +-
 20 files changed, 1876 insertions(+), 442 deletions(-)
 create mode 100644 docs/features/intel_psr_cat_cdp.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®.