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

[Xen-devel] [PATCH v3 00/15] Enable Memory Bandwidth Allocation in Xen



Hi, all,

We plan to bring a new PSR (Platform Shared Resource) feature called
Intel Memory Bandwidth Allocation (MBA) to Xen.

Besides the MBA enabling, we change some interfaces to make them more
general but not only for CAT.

Any comments are welcome!

You can find this series at:
https://github.com/yisun-git/xen_mba mba_v3-1

This v3 series bases on below two patches which are being reviewed now. I may
take one or two weeks leave from tomorrow. So I submit v3 before below patches
are merged and hope not to delay the review progress. Sorry for that.

[PATCH v3 1/2] tools: use '__i386__' and '__x86_64__' to replace PSR macros
https://lists.xen.org/archives/html/xen-devel/2017-09/msg00229.html

[PATCH v3 2/2] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
https://lists.xen.org/archives/html/xen-devel/2017-09/msg00230.html

---
Acked and Reviewed list before V3:

a - Acked-by
r - Reviewed-by

  ar patch 2  - Rename PSR sysctl/domctl interfaces and xsm policy to make them 
be general
  r  patch 3  - x86: rename 'cbm_type' to 'psr_type' to make it general
  r  patch 6  - x86: implement get value interface for MBA
  ar patch 12 - tools: rename 'xc_psr_cat_type' to 'xc_psr_type'
  a  patch 13 - tools: implement new generic get value interface and MBA get 
value command
  a  patch 15 - docs: add MBA description in docs

---
V3 change list:

Patch 1:
    - remove 'closed-loop' related description.
      (suggested by Roger Pau Monné)
    - explain 'linear' and 'non-linear' before mentioning them.
      (suggested by Roger Pau Monné)
    - adjust desription of 'psr-mba-set'.
      (suggested by Roger Pau Monné)
    - explain 'MBA_MAX'.
      (suggested by Roger Pau Monné)
    - remove 'n<64'.
      (suggested by Roger Pau Monné)
    - fix some wordings.
      (suggested by Roger Pau Monné)
    - add context in 'Testing' part to make things more clear.
      (suggested by Roger Pau Monné)
Patch 2:
    - remove 'op/OP' from names and modify some names from 'PSR_CAT' to
      'PSR_ALLOC'.
      (suggested by Roger Pau Monné)
Patch 3:
    - replace 'psr_val_type' to 'psr_type' and remove '_VAL' from the enum
      items.
      (suggested by Roger Pau Monné)
Patch 4:
    - replace 'psr_val_type' to 'psr_type'. Also, change 'PSR_VAL_TYPE_MBA' to
      'PSR_TYPE_MBA_THRTL'.
      (suggested by Roger Pau Monné)
    - replace 'MBA_LINEAR' to 'MBA_LINEAR_MASK' to make the name more clear.
      (suggested by Roger Pau Monné)
    - replase 'cat_info'/'mba_info' to 'cat'/'mba' to make the names shorter.
      (suggested by Roger Pau Monné)
    - change type of 'linear' to 'bool'.
      (suggested by Roger Pau Monné)
    - make format string of printf in one line.
      (suggested by Roger Pau Monné)
Patch 5:
    - replace 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'.
      (suggested by Roger Pau Monné)
Patch 6:
    - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'.
      (suggested by Roger Pau Monné)
Patch 7:
    - modify commit message to make it clear.
      (suggested by Roger Pau Monné)
    - modify functionality of 'check_val' to make it simple to only check value.
      Change the last parameter type from 'unsigned long *' to 'unsigned long'.
      (suggested by Roger Pau Monné)
    - call rdmsrl to get value just written into MSR for MBA. Because HW can
      automatically change input value to what it wants.
      (suggested by Roger Pau Monné)
    - change type of 'write_msr' to 'uint32_t' to return the value actually
      written into MSR. Then, change 'do_write_psr_msrs' to set the returned
      value into 'cos_reg_val[]'
    - move the declaration of 'j' into loop in 'do_write_psr_msrs'.
      (suggested by Roger Pau Monné)
    - change 'mba_info' to 'mba'.
      (suggested by Roger Pau Monné)
    - change 'cat_info' to 'cat'.
      (suggested by Roger Pau Monné)
    - rename 'psr_cat/PSR_CAT' to 'psr_alloc/PSR_ALLOC' and remove 'op/OP'
      from name.
      (suggested by Roger Pau Monné)
    - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'.
      (suggested by Roger Pau Monné)
Patch 8:
    - change 'LIBXL_HAVE_PSR_MBA' to 'LIBXL_HAVE_PSR_GENERIC'.
      (suggested by Roger Pau Monné)
    - 'typedef enum libxl_psr_cbm_type libxl_psr_type;' in libxl.h.
      (suggested by Roger Pau Monné and Wei Liu)
    - change 'libxl_psr_cbm_type' to 'libxl_psr_type' in newly defined
      interfaces.
      (suggested by Roger Pau Monné)
Patch 9:
    - rename 'psr_cat/PSR_CAT' to 'psr_alloc/PSR_ALLOC' and remove 'op/OP'
      from name.
      (suggested by Roger Pau Monné)
    - remove 'info' from 'xc_cat_info' and 'xc_mba_info'.
      (suggested by Roger Pau Monné)
    - set errno in 'xc_psr_get_hw_info'.
      (suggested by Roger Pau Monné)
    - remove 'inline'.
      (suggested by Roger Pau Monné)
    - remove 'psr' from 'libxl__psr_feat_type_to_libxc_psr_feat_type' to make
      function name shorter.
      (suggested by Roger Pau Monné)
    - check 'xc_type' in 'libxl_psr_cat_get_info'.
      (suggested by Roger Pau Monné)
Patch 10:
    - remove casting.
      (suggested by Roger Pau Monné)
    - remove inline.
      (suggested by Roger Pau Monné)
    - change 'libxc__psr_hw_info_to_libxl_psr_hw_info' to
      'libxl__xc_hw_info_to_libxl_hw_info'.
      (suggested by Roger Pau Monné)
    - remove '_hw' from parameter names.
      (suggested by Roger Pau Monné)
    - change some 'LOGE' to 'LOG'.
      (suggested by Roger Pau Monné)
    - check returned 'xc_type' and remove redundant 'lvl' check.
      (suggested by Roger Pau Monné)
Patch 11:
    - change the format string of printf in 'psr_mba_hwinfo'.
      (suggested by Roger Pau Monné)
    - add 'const' for 'opts[]' in 'main_psr_hwinfo'.
      (suggested by Roger Pau Monné)
Patch 12:
    - change 'xc_psr_val_type' to 'xc_psr_type'.
      (suggested by Roger Pau Monné)
Patch 13:
    - replace 'libxl_psr_cbm_type' to 'libxl_psr_type' in newly defined
      interfaces.
      (suggested by Roger Pau Monné)
Patch 14:
    - add 'const' for 'opts[]' in 'main_psr_mba_set'.
      (suggested by Roger Pau Monné)
    - replace 'libxl_psr_cbm_type' to 'libxl_psr_type' for newly defined
      interfaces.
      (suggested by Roger Pau Monné)

Yi Sun (15):
  docs: create Memory Bandwidth Allocation (MBA) feature document
  Rename PSR sysctl/domctl interfaces and xsm policy to make them be
    general
  x86: rename 'cbm_type' to 'psr_type' to make it general
  x86: implement data structure and CPU init flow for MBA
  x86: implement get hw info flow for MBA
  x86: implement get value interface for MBA
  x86: implement set value flow for MBA
  tools: create general interfaces to support psr allocation features
  tools: implement the new libxc get hw info interface
  tools: implement the new libxl get hw info interface
  tools: implement the new xl get hw info interface
  tools: rename 'xc_psr_cat_type' to 'xc_psr_type'
  tools: implement new generic get value interface and  MBA get value
    command
  tools: implement new generic set value interface and MBA set value
    command
  docs: add MBA description in docs

 docs/features/intel_psr_mba.pandoc  | 283 +++++++++++++++++++++++++++++
 docs/man/xl.pod.1.in                |  34 ++++
 docs/misc/xl-psr.markdown           |  63 +++++++
 tools/flask/policy/modules/dom0.te  |   4 +-
 tools/libxc/include/xenctrl.h       |  47 +++--
 tools/libxc/xc_psr.c                | 107 +++++++----
 tools/libxl/libxl.h                 |  33 ++++
 tools/libxl/libxl_psr.c             | 237 ++++++++++++++++++++-----
 tools/libxl/libxl_types.idl         |  22 +++
 tools/xl/xl.h                       |   2 +
 tools/xl/xl_cmdtable.c              |  12 ++
 tools/xl/xl_psr.c                   | 280 +++++++++++++++++++++++------
 xen/arch/x86/domctl.c               |  81 +++++----
 xen/arch/x86/psr.c                  | 345 ++++++++++++++++++++++++++----------
 xen/arch/x86/sysctl.c               |  51 ++++--
 xen/include/asm-x86/msr-index.h     |   1 +
 xen/include/asm-x86/psr.h           |  22 ++-
 xen/include/public/domctl.h         |  30 ++--
 xen/include/public/sysctl.h         |  26 ++-
 xen/xsm/flask/hooks.c               |   8 +-
 xen/xsm/flask/policy/access_vectors |   8 +-
 21 files changed, 1357 insertions(+), 339 deletions(-)
 create mode 100644 docs/features/intel_psr_mba.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®.