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

[Xen-devel] [PATCH v11 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_v11-3

---
Acked and Reviewed list before V11:

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.
  a  patch 20 - tools: L2 CAT: support get HW info for L2 CAT.
                (Acked for Hypervisor side)
  a  patch 23 - docs: add L2 CAT description in docs.

---
V11 change list:

Patch 1:
    - modify data structure descriptions according to code changes.
    - modify revision.
Patch 4:
    - handle 'feat_init'.
    - merge main data structures implementation into CPU init/free patch,
      including commit messages and change history.
      (suggested by Jan Beulich)
    - remove MSR restore action which is unnecessary.
      (suggested by Jan Beulich)
    - move 'type[]' declaration into this patch.
      (suggested by Jan Beulich)
    - modify comment.
      (suggested by Jan Beulich)
Patch 5:
    - replace 'feat_init_done()' to 'feat_init' flag.
      (suggested by Jan Beulich)
    - adjust parameters positions when calling 'psr_assoc_cos'.
      (suggested by Jan Beulich)
    - add comment to explain why to check 'psr_cos_ids'.
Patch 6:
    - changes about 'cos_max' and 'cbm_len'.
      (suggested by Jan Beulich)
    - change about 'feat_props'.
      (suggested by Jan Beulich)
    - declare 'PSR_SOCKET_FEAT_UNKNOWN' to handle error case.
      (suggested by Jan Beulich)
    - use 'ASSERT' to check data.
      (suggested by Jan Beulich)
    - fix comment of 'get_feat_info'.
      (suggested by Jan Beulich)
    - fix a bug when checking 'feat_type'.
      (suggested by Jan Beulich)
Patch 7:
    - declare a 'switch()' wide variable 'val32' in domctl.
      (suggested by Jan Beulich)
    - remove 'get_val' callback function which is replaced by generic codes.
      (suggested by Jan Beulich)
    - fix coding style issue.
      (suggested by Jan Beulich)
    - do not 'ASSERT' domain pointer.
      (suggested by Jan Beulich)
    - modify commit message.
Patch 8:
    - define 'dom_ids[]' and implement related flows.
    - restore domain cos id to 0 in 'psr_get_val'.
    - rename 'write_psr_msr' to 'write_psr_msrs' and change its parameters to
      handle value array the feature's all MSRs.
    - fix coding style issue.
      (suggested by Jan Beulich)
    - do not need check 'cos' in ASSERT.
      (suggested by Jan Beulich)
    - rename 'insert_val_to_array' to 'insert_val_into_array'.
      (suggested by Jan Beulich)
    - remove 'ref_lock' from parameter list in 'find_cos' and 'pick_avail_cos'.
      (suggested by Jan Beulich)
    - remove ASSERT check to 'ref_lock' in 'find_cos' and 'pick_avail_cos'.
      (suggested by Jan Beulich)
    - fix a bug for checking 'feat_type'.
      (suggested by Jan Beulich)
    - move 'free_array' label.
      (suggested by Jan Beulich)
    - modify comments and commit message.
Patch 9:
    - changes about 'feat_props'.
      (suggested by Jan Beulich)
    - changes about 'get_val'. It is replaced by generic codes.
      (suggested by Jan Beulich)
Patch 10:
    - move 'compare_val' implementation from CDP patch to this.
      (suggested by Jan Beulich)
    - remove 'rc' in 'compare_val' to make codes clearer.
      (suggested by Jan Beulich)
    - changes about 'feat_props'.
      (suggested by Jan Beulich)
    - fix bug.
      (suggested by Jan Beulich)
    - remove unnecessary variable initialization.
      (suggested by Jan Beulich)
    - remove unnecessary comment.
      (suggested by Jan Beulich)
    - adjust array check place prior to using the array.
      (suggested by Jan Beulich)
    - add comment.
Patch 11:
    - remove unnecessary variable initialization.
      (suggested by Jan Beulich)
    - changes about 'feat_props'.
      (suggested by Jan Beulich)
    - replace 'get_val' calling to generic codes.
      (suggested by Jan Beulich)
Patch 12:
    - rename 'write_psr_msr' to 'write_psr_msrs'.
    - rename 'do_write_psr_msr' to 'do_write_psr_msrs'.
    - change parameters and codes of 'write_psr_msrs' to handle value array.
    - add 'feat_type' in 'struct cos_write_info' to handle props array.
    - in 'do_write_psr_msrs', write value array into msrs according to
      'props->type[i]'.
    - move 'feat->cos_reg_val' assignment and value comparison in 'write_msr'
      callback function out as generic codes.
      (suggested by Jan Beulich)
    - move check from 'do_write_psr_msrs' to 'write_psr_msrs'.
      (suggested by Jan Beulich)
    - change about 'cos_max'.
      (suggested by Jan Beulich)
    - change about 'feat_props'.
      (suggested by Jan Beulich)
Patch 13:
    - changes about 'feat_props'.
      (suggested by Jan Beulich)
    - remove MSR restore action which is unnecessary.
      (suggested by Jan Beulich)
    - modify commit message.
Patch 14:
    - modify 'psr_get_info' flow to make it simple to cover CDP case.
Patch 15:
    - move 'feat->cos_reg_val' assignment and value comparison in 'write_msr'
      callback function out as generic codes.
      (suggested by Jan Beulich)
    - changes about setting both CDP DATA and CODE at same time.
    - move 'type[]' declaration into previous patch which introduced 'cos_num'.
      (suggested by Jan Beulich)
    - changes about 'type[]'.
      (suggested by Jan Beulich)
    - move 'compare_val' to previous patch.
      (suggested by Jan Beulich)
    - changes about 'get_val' which has been replace by generic codes.
      (suggested by Jan Beulich)
    - remove 'restore_default_val' which is unnecessary now.
      (suggested by Jan Beulich)
Patch 16:
    - move l2 cat 'type[]' assignement into 'psr_cpu_init'.
    - remove COS MSR restore action in 'cpu_init_feature'.
    - set 'feat_init' to true after CPU init.
    - modify commit message.
Patch 18:
    - remove "get_val' assignment because it has been replaced by generic
      codes.
      (suggested by Jan Beulich)
Patch 19:
    - remove 'domctl->u.psr_cat_op.data' check because it has been moved into
      'psr_set_val'.
      (suggested by Jan Beulich)
    - move 'feat->cos_reg_val' assignment and value comparison in 'write_msr'
      callback function out as generic codes.
      (suggested by Jan Beulich)
Patch 20:
    - acked by Jan for Hypervisor side changes.
Patch 22:
    - revert change in v9 to handle the case to set both CODE and DATA for CDP
      at same time. This must be handled in hypervisor.

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/domctl.c                  |   51 +-
 xen/arch/x86/psr.c                     | 1343 ++++++++++++++++++++++++--------
 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              |   26 +-
 xen/include/public/domctl.h            |    2 +
 xen/include/public/sysctl.h            |    3 +-
 19 files changed, 1807 insertions(+), 438 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®.