diff mbox

[v1,06/13] x86: implement get value interface for MBA

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

Commit Message

Yi Sun Aug. 9, 2017, 7:41 a.m. UTC
This patch implements get value domctl interface for MBA.

Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
---
 xen/arch/x86/domctl.c       | 7 +++++++
 xen/include/public/domctl.h | 1 +
 2 files changed, 8 insertions(+)

Comments

Chao Peng Aug. 16, 2017, 6:38 a.m. UTC | #1
On Wed, 2017-08-09 at 15:41 +0800, Yi Sun wrote:
> This patch implements get value domctl interface for MBA.
> 
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
> ---

...

> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -1144,6 +1144,7 @@ struct xen_domctl_psr_alloc_op {
>  #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA    5
>  #define XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM     6
>  #define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM     7
> +#define XEN_DOMCTL_PSR_MBA_OP_GET_THRTL      9

Why use 9 instead of 8?

Chao
Yi Sun Aug. 16, 2017, 6:43 a.m. UTC | #2
On 17-08-16 14:38:28, Chao Peng wrote:
> On Wed, 2017-08-09 at 15:41 +0800, Yi Sun wrote:
> > This patch implements get value domctl interface for MBA.
> > 
> > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
> > ---
> 
> ...
> 
> > --- a/xen/include/public/domctl.h
> > +++ b/xen/include/public/domctl.h
> > @@ -1144,6 +1144,7 @@ struct xen_domctl_psr_alloc_op {
> >  #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA    5
> >  #define XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM     6
> >  #define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM     7
> > +#define XEN_DOMCTL_PSR_MBA_OP_GET_THRTL      9
> 
> Why use 9 instead of 8?
> 
8 is reserved for SET_THRTL. Follow the convention of CAT/CDP above. :)

> Chao
Chao Peng Aug. 17, 2017, 7:51 a.m. UTC | #3
On Wed, 2017-08-16 at 14:43 +0800, Yi Sun wrote:
> On 17-08-16 14:38:28, Chao Peng wrote:
> > 
> > On Wed, 2017-08-09 at 15:41 +0800, Yi Sun wrote:
> > > 
> > > This patch implements get value domctl interface for MBA.
> > > 
> > > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
> > > ---
> > 
> > ...
> > 
> > > 
> > > --- a/xen/include/public/domctl.h
> > > +++ b/xen/include/public/domctl.h
> > > @@ -1144,6 +1144,7 @@ struct xen_domctl_psr_alloc_op {
> > >  #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA    5
> > >  #define XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM     6
> > >  #define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM     7
> > > +#define XEN_DOMCTL_PSR_MBA_OP_GET_THRTL      9
> > 
> > Why use 9 instead of 8?
> > 
> 8 is reserved for SET_THRTL. Follow the convention of CAT/CDP above.
> :)

Understand. Then probably SET_THRTL patch should come first.

Chao
diff mbox

Patch

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 850742a..fa5e6d4 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1496,6 +1496,13 @@  long arch_do_domctl(
             copyback = true;
             break;
 
+        case XEN_DOMCTL_PSR_MBA_OP_GET_THRTL:
+            ret = psr_get_val(d, domctl->u.psr_alloc_op.target,
+                              &val32, PSR_VAL_TYPE_MBA);
+            domctl->u.psr_alloc_op.data = val32;
+            copyback = true;
+            break;
+
         default:
             ret = -EOPNOTSUPP;
             break;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 4bb4399..a577a3e 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -1144,6 +1144,7 @@  struct xen_domctl_psr_alloc_op {
 #define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA    5
 #define XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM     6
 #define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM     7
+#define XEN_DOMCTL_PSR_MBA_OP_GET_THRTL      9
     uint32_t cmd;       /* IN: XEN_DOMCTL_PSR_CAT_OP_* */
     uint32_t target;    /* IN */
     uint64_t data;      /* IN/OUT */