diff mbox

[v5,07/16] x86: implement get value interface for MBA

Message ID 1506735566-5706-8-git-send-email-yi.y.sun@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yi Sun Sept. 30, 2017, 1:39 a.m. UTC
This patch implements get value domctl interface for MBA.

Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Chao Peng <chao.p.peng@linux.intel.com>

v5:
    - use newly defined macro to get MBA thrtl.
      (suggested by Roger Pau Monné)
v4:
    - remove 'ALLOC_' from macro names.
      (suggested by Roger Pau Monné)
v3:
    - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'.
      (suggested by Roger Pau Monné)
---
 xen/arch/x86/domctl.c       | 4 ++++
 xen/include/public/domctl.h | 1 +
 2 files changed, 5 insertions(+)
diff mbox

Patch

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index cc09f7d..5fb443f 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1492,6 +1492,10 @@  long arch_do_domctl(
             ret = domctl_psr_get_val(d, domctl, PSR_TYPE_L2_CBM, copyback);
             break;
 
+        case XEN_DOMCTL_PSR_GET_MBA_THRTL:
+            ret = domctl_psr_get_val(d, domctl, PSR_TYPE_MBA_THRTL, copyback);
+            break;
+
         default:
             ret = -EOPNOTSUPP;
             break;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 6ed3c53..1231d37 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1156,6 +1156,7 @@  struct xen_domctl_psr_alloc {
 #define XEN_DOMCTL_PSR_GET_L3_DATA    5
 #define XEN_DOMCTL_PSR_SET_L2_CBM     6
 #define XEN_DOMCTL_PSR_GET_L2_CBM     7
+#define XEN_DOMCTL_PSR_GET_MBA_THRTL  9
     uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_* */
     uint32_t target;    /* IN */
     uint64_t data;      /* IN/OUT */