* [PATCH 2/2] tools: remove unnecessary PSR macros
@ 2017-08-31 8:08 Yi Sun
2017-08-31 9:07 ` Roger Pau Monné
` (4 more replies)
0 siblings, 5 replies; 17+ messages in thread
From: Yi Sun @ 2017-08-31 8:08 UTC (permalink / raw)
To: xen-devel; +Cc: ian.jackson, wei.liu2, Yi Sun, roger.pau
Per Roger Pau's coment, the libxl interfaces and related functions are not
necessary to be included by 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'.
So remove them.
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
---
tools/libxl/libxl.h | 6 ------
tools/xl/xl_cmdtable.c | 5 -----
tools/xl/xl_psr.c | 5 -----
3 files changed, 16 deletions(-)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 229e289..a0185b9 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -2166,7 +2166,6 @@ bool libxl_ms_vm_genid_is_zero(const libxl_ms_vm_genid *id);
void libxl_ms_vm_genid_copy(libxl_ctx *ctx, libxl_ms_vm_genid *dst,
const libxl_ms_vm_genid *src);
-#ifdef LIBXL_HAVE_PSR_CMT
int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid);
int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid);
int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid);
@@ -2179,9 +2178,7 @@ int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx,
uint32_t domid,
uint32_t socketid,
uint32_t *l3_cache_occupancy);
-#endif
-#ifdef LIBXL_HAVE_PSR_MBM
int libxl_psr_cmt_type_supported(libxl_ctx *ctx, libxl_psr_cmt_type type);
int libxl_psr_cmt_get_sample(libxl_ctx *ctx,
uint32_t domid,
@@ -2189,9 +2186,7 @@ int libxl_psr_cmt_get_sample(libxl_ctx *ctx,
uint64_t scope,
uint64_t *sample_r,
uint64_t *tsc_r);
-#endif
-#ifdef LIBXL_HAVE_PSR_CAT
/*
* Function to set a domain's cbm. It operates on a single or multiple
* target(s) defined in 'target_map'. The definition of 'target_map' is
@@ -2219,7 +2214,6 @@ int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int *nr);
void libxl_psr_cat_info_list_free(libxl_psr_cat_info *list, int nr);
-#endif
/* misc */
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 2c71a9f..045f640 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -517,7 +517,6 @@ struct cmd_spec cmd_table[] = {
"-F Run in the foreground.\n"
"-p, --pidfile [FILE] Write PID to pidfile when daemonizing.",
},
-#ifdef LIBXL_HAVE_PSR_CMT
{ "psr-hwinfo",
&main_psr_hwinfo, 0, 1,
"Show hardware information for Platform Shared Resource",
@@ -544,8 +543,6 @@ struct cmd_spec cmd_table[] = {
"\"total-mem-bandwidth\": Show total memory bandwidth(KB/s)\n"
"\"local-mem-bandwidth\": Show local memory bandwidth(KB/s)\n",
},
-#endif
-#ifdef LIBXL_HAVE_PSR_CAT
{ "psr-cat-set",
&main_psr_cat_cbm_set, 0, 1,
"Set cache capacity bitmasks(CBM) for a domain",
@@ -561,8 +558,6 @@ struct cmd_spec cmd_table[] = {
"[options] <Domain>",
"-l <level> Specify the cache level to process, otherwise L3 cache is processed\n"
},
-
-#endif
{ "usbctrl-attach",
&main_usbctrl_attach, 0, 1,
"Create a virtual USB controller for a domain",
diff --git a/tools/xl/xl_psr.c b/tools/xl/xl_psr.c
index 7309d4f..544f6f0 100644
--- a/tools/xl/xl_psr.c
+++ b/tools/xl/xl_psr.c
@@ -25,7 +25,6 @@
#include "xl_utils.h"
#include "xl_parse.h"
-#ifdef LIBXL_HAVE_PSR_CMT
static int psr_cmt_hwinfo(void)
{
int rc;
@@ -292,9 +291,7 @@ int main_psr_cmt_show(int argc, char **argv)
return ret;
}
-#endif
-#if defined(LIBXL_HAVE_PSR_CAT) || defined(LIBXL_HAVE_PSR_L2_CAT)
static int psr_l3_cat_hwinfo(void)
{
int rc, nr;
@@ -626,8 +623,6 @@ int main_psr_hwinfo(int argc, char **argv)
return ret;
}
-#endif
-
/*
* Local variables:
* mode: C
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] tools: remove unnecessary PSR macros
2017-08-31 8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
@ 2017-08-31 9:07 ` Roger Pau Monné
2017-09-01 6:59 ` [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info' Yi Sun
` (3 subsequent siblings)
4 siblings, 0 replies; 17+ messages in thread
From: Roger Pau Monné @ 2017-08-31 9:07 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, wei.liu2, ian.jackson
On Thu, Aug 31, 2017 at 04:08:06PM +0800, Yi Sun wrote:
> Per Roger Pau's coment, the libxl interfaces and related functions are not
> necessary to be included by 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'.
> So remove them.
No need to mention me in the commit message, just add a:
Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-08-31 8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
2017-08-31 9:07 ` Roger Pau Monné
@ 2017-09-01 6:59 ` Yi Sun
2017-09-01 9:07 ` Roger Pau Monné
2017-09-01 15:43 ` Wei Liu
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
` (2 subsequent siblings)
4 siblings, 2 replies; 17+ messages in thread
From: Yi Sun @ 2017-09-01 6:59 UTC (permalink / raw)
To: xen-devel; +Cc: wei.liu2, ian.jackson, Yi Sun, roger.pau
Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
this and does related changes.
Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
---
- This patch depends on patch 'tools: remove unnecessary PSR macros'.
---
tools/libxl/libxl.h | 2 +-
tools/libxl/libxl_psr.c | 6 ++++--
tools/xl/xl_psr.c | 9 ++++-----
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a0185b9..0c90c41 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -2210,7 +2210,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
* and the length in 'nr'.
*/
int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
- int *nr, unsigned int lvl);
+ unsigned int *nr, unsigned int lvl);
int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int *nr);
void libxl_psr_cat_info_list_free(libxl_psr_cat_info *list, int nr);
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index f55ba1e..7366481 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -362,7 +362,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
}
int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
- int *nr, unsigned int lvl)
+ unsigned int *nr, unsigned int lvl)
{
GC_INIT(ctx);
int rc;
@@ -410,8 +410,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int *nr)
{
int rc;
+ unsigned int num;
- rc = libxl_psr_cat_get_info(ctx, info, nr, 3);
+ rc = libxl_psr_cat_get_info(ctx, info, &num, 3);
+ *nr = num;
return rc;
}
diff --git a/tools/xl/xl_psr.c b/tools/xl/xl_psr.c
index 544f6f0..ef00048 100644
--- a/tools/xl/xl_psr.c
+++ b/tools/xl/xl_psr.c
@@ -294,8 +294,8 @@ int main_psr_cmt_show(int argc, char **argv)
static int psr_l3_cat_hwinfo(void)
{
- int rc, nr;
- unsigned int i;
+ int rc;
+ unsigned int i, nr;
uint32_t l3_cache_size;
libxl_psr_cat_info *info;
@@ -424,7 +424,7 @@ static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info,
static int psr_cat_show(uint32_t domid, unsigned int lvl)
{
- int i, nr;
+ unsigned int i, nr;
int rc;
libxl_psr_cat_info *info;
@@ -453,8 +453,7 @@ out:
static int psr_l2_cat_hwinfo(void)
{
int rc;
- unsigned int i;
- int nr;
+ unsigned int i, nr;
libxl_psr_cat_info *info;
rc = libxl_psr_cat_get_info(ctx, &info, &nr, 2);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-09-01 6:59 ` [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info' Yi Sun
@ 2017-09-01 9:07 ` Roger Pau Monné
2017-09-01 15:43 ` Wei Liu
1 sibling, 0 replies; 17+ messages in thread
From: Roger Pau Monné @ 2017-09-01 9:07 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, ian.jackson, wei.liu2
On Fri, Sep 01, 2017 at 02:59:23PM +0800, Yi Sun wrote:
> @@ -410,8 +410,10 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
> int *nr)
> {
> int rc;
> + unsigned int num;
>
> - rc = libxl_psr_cat_get_info(ctx, info, nr, 3);
> + rc = libxl_psr_cat_get_info(ctx, info, &num, 3);
In order to avoid leaking stack data, I would rather do:
if (!rc)
*nr = num;
The rest LGTM.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-08-31 8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
2017-08-31 9:07 ` Roger Pau Monné
2017-09-01 6:59 ` [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info' Yi Sun
@ 2017-09-01 12:15 ` Yi Sun
2017-09-01 14:33 ` Roger Pau Monné
` (2 more replies)
2017-09-01 15:42 ` [PATCH 2/2] tools: remove unnecessary PSR macros Wei Liu
2017-09-04 3:08 ` [PATCH v2] " Yi Sun
4 siblings, 3 replies; 17+ messages in thread
From: Yi Sun @ 2017-09-01 12:15 UTC (permalink / raw)
To: xen-devel; +Cc: wei.liu2, ian.jackson, Yi Sun, roger.pau
Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
this and does related changes.
Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
---
- This patch depends on patch 'tools: remove unnecessary PSR macros'.
v2:
- assign 'num' to '*nr' if return value is success.
(suggested by Roger Pau Monné)
---
tools/libxl/libxl.h | 2 +-
tools/libxl/libxl_psr.c | 7 +++++--
tools/xl/xl_psr.c | 9 ++++-----
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a0185b9..0c90c41 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -2210,7 +2210,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
* and the length in 'nr'.
*/
int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
- int *nr, unsigned int lvl);
+ unsigned int *nr, unsigned int lvl);
int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int *nr);
void libxl_psr_cat_info_list_free(libxl_psr_cat_info *list, int nr);
diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c
index f55ba1e..197505a 100644
--- a/tools/libxl/libxl_psr.c
+++ b/tools/libxl/libxl_psr.c
@@ -362,7 +362,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid,
}
int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
- int *nr, unsigned int lvl)
+ unsigned int *nr, unsigned int lvl)
{
GC_INIT(ctx);
int rc;
@@ -410,8 +410,11 @@ int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int *nr)
{
int rc;
+ unsigned int num;
- rc = libxl_psr_cat_get_info(ctx, info, nr, 3);
+ rc = libxl_psr_cat_get_info(ctx, info, &num, 3);
+ if (!rc)
+ *nr = num;
return rc;
}
diff --git a/tools/xl/xl_psr.c b/tools/xl/xl_psr.c
index 544f6f0..ef00048 100644
--- a/tools/xl/xl_psr.c
+++ b/tools/xl/xl_psr.c
@@ -294,8 +294,8 @@ int main_psr_cmt_show(int argc, char **argv)
static int psr_l3_cat_hwinfo(void)
{
- int rc, nr;
- unsigned int i;
+ int rc;
+ unsigned int i, nr;
uint32_t l3_cache_size;
libxl_psr_cat_info *info;
@@ -424,7 +424,7 @@ static int psr_cat_print_socket(uint32_t domid, libxl_psr_cat_info *info,
static int psr_cat_show(uint32_t domid, unsigned int lvl)
{
- int i, nr;
+ unsigned int i, nr;
int rc;
libxl_psr_cat_info *info;
@@ -453,8 +453,7 @@ out:
static int psr_l2_cat_hwinfo(void)
{
int rc;
- unsigned int i;
- int nr;
+ unsigned int i, nr;
libxl_psr_cat_info *info;
rc = libxl_psr_cat_get_info(ctx, &info, &nr, 2);
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
@ 2017-09-01 14:33 ` Roger Pau Monné
2017-09-01 15:50 ` Wei Liu
2017-09-04 9:08 ` Wei Liu
2 siblings, 0 replies; 17+ messages in thread
From: Roger Pau Monné @ 2017-09-01 14:33 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, ian.jackson, wei.liu2
On Fri, Sep 01, 2017 at 08:15:05PM +0800, Yi Sun wrote:
> Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
> is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
> this and does related changes.
>
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] tools: remove unnecessary PSR macros
2017-08-31 8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
` (2 preceding siblings ...)
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
@ 2017-09-01 15:42 ` Wei Liu
2017-09-04 3:25 ` Yi Sun
2017-09-04 3:08 ` [PATCH v2] " Yi Sun
4 siblings, 1 reply; 17+ messages in thread
From: Wei Liu @ 2017-09-01 15:42 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, wei.liu2, ian.jackson, roger.pau
On Thu, Aug 31, 2017 at 04:08:06PM +0800, Yi Sun wrote:
> Per Roger Pau's coment, the libxl interfaces and related functions are not
> necessary to be included by 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'.
> So remove them.
>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
(without reading the patch)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-09-01 6:59 ` [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info' Yi Sun
2017-09-01 9:07 ` Roger Pau Monné
@ 2017-09-01 15:43 ` Wei Liu
1 sibling, 0 replies; 17+ messages in thread
From: Wei Liu @ 2017-09-01 15:43 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, ian.jackson, wei.liu2, roger.pau
On Fri, Sep 01, 2017 at 02:59:23PM +0800, Yi Sun wrote:
> Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
> is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
> this and does related changes.
>
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Please say in the commit message that this is OK because the function in
question is never released.
Otherwise you need to define a LIBXL_HAVE
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
2017-09-01 14:33 ` Roger Pau Monné
@ 2017-09-01 15:50 ` Wei Liu
2017-09-02 15:01 ` Yi Sun
2017-09-04 9:08 ` Wei Liu
2 siblings, 1 reply; 17+ messages in thread
From: Wei Liu @ 2017-09-01 15:50 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, ian.jackson, wei.liu2, roger.pau
On Fri, Sep 01, 2017 at 08:15:05PM +0800, Yi Sun wrote:
> Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
> is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
> this and does related changes.
>
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
If you confirm the code changed is not released I can modify the commit
message while committing -- no need to resend.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-09-01 15:50 ` Wei Liu
@ 2017-09-02 15:01 ` Yi Sun
0 siblings, 0 replies; 17+ messages in thread
From: Yi Sun @ 2017-09-02 15:01 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, ian.jackson, roger.pau
On 17-09-01 16:50:39, Wei Liu wrote:
> On Fri, Sep 01, 2017 at 08:15:05PM +0800, Yi Sun wrote:
> > Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
> > is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
> > this and does related changes.
> >
> > Suggested-by: Roger Pau Monn? <roger.pau@citrix.com>
> > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
>
> If you confirm the code changed is not released I can modify the commit
> message while committing -- no need to resend.
Thank you! Yes, the 'libxl_psr_cat_get_info' is introduced by L2 CAT patch
set which was merged into Xen 4.10 unstable branch recently. So, it has not
been released yet.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2] tools: remove unnecessary PSR macros
2017-08-31 8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
` (3 preceding siblings ...)
2017-09-01 15:42 ` [PATCH 2/2] tools: remove unnecessary PSR macros Wei Liu
@ 2017-09-04 3:08 ` Yi Sun
2017-09-04 8:49 ` Wei Liu
4 siblings, 1 reply; 17+ messages in thread
From: Yi Sun @ 2017-09-04 3:08 UTC (permalink / raw)
To: xen-devel; +Cc: wei.liu2, ian.jackson, Yi Sun, roger.pau
The libxl interfaces and related functions are not necessary to be included by
'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'. So remove them.
Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
---
v2:
- remove the macros in xl.h.
---
tools/libxl/libxl.h | 6 ------
tools/xl/xl.h | 4 ----
tools/xl/xl_cmdtable.c | 5 -----
tools/xl/xl_psr.c | 5 -----
4 files changed, 20 deletions(-)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 229e289..a0185b9 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -2166,7 +2166,6 @@ bool libxl_ms_vm_genid_is_zero(const libxl_ms_vm_genid *id);
void libxl_ms_vm_genid_copy(libxl_ctx *ctx, libxl_ms_vm_genid *dst,
const libxl_ms_vm_genid *src);
-#ifdef LIBXL_HAVE_PSR_CMT
int libxl_psr_cmt_attach(libxl_ctx *ctx, uint32_t domid);
int libxl_psr_cmt_detach(libxl_ctx *ctx, uint32_t domid);
int libxl_psr_cmt_domain_attached(libxl_ctx *ctx, uint32_t domid);
@@ -2179,9 +2178,7 @@ int libxl_psr_cmt_get_cache_occupancy(libxl_ctx *ctx,
uint32_t domid,
uint32_t socketid,
uint32_t *l3_cache_occupancy);
-#endif
-#ifdef LIBXL_HAVE_PSR_MBM
int libxl_psr_cmt_type_supported(libxl_ctx *ctx, libxl_psr_cmt_type type);
int libxl_psr_cmt_get_sample(libxl_ctx *ctx,
uint32_t domid,
@@ -2189,9 +2186,7 @@ int libxl_psr_cmt_get_sample(libxl_ctx *ctx,
uint64_t scope,
uint64_t *sample_r,
uint64_t *tsc_r);
-#endif
-#ifdef LIBXL_HAVE_PSR_CAT
/*
* Function to set a domain's cbm. It operates on a single or multiple
* target(s) defined in 'target_map'. The definition of 'target_map' is
@@ -2219,7 +2214,6 @@ int libxl_psr_cat_get_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int libxl_psr_cat_get_l3_info(libxl_ctx *ctx, libxl_psr_cat_info **info,
int *nr);
void libxl_psr_cat_info_list_free(libxl_psr_cat_info *list, int nr);
-#endif
/* misc */
diff --git a/tools/xl/xl.h b/tools/xl/xl.h
index aa95b77..67d6f37 100644
--- a/tools/xl/xl.h
+++ b/tools/xl/xl.h
@@ -197,16 +197,12 @@ int main_loadpolicy(int argc, char **argv);
int main_remus(int argc, char **argv);
#endif
int main_devd(int argc, char **argv);
-#ifdef LIBXL_HAVE_PSR_CMT
int main_psr_hwinfo(int argc, char **argv);
int main_psr_cmt_attach(int argc, char **argv);
int main_psr_cmt_detach(int argc, char **argv);
int main_psr_cmt_show(int argc, char **argv);
-#endif
-#ifdef LIBXL_HAVE_PSR_CAT
int main_psr_cat_cbm_set(int argc, char **argv);
int main_psr_cat_show(int argc, char **argv);
-#endif
int main_qemu_monitor_command(int argc, char **argv);
void help(const char *command);
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 2c71a9f..045f640 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -517,7 +517,6 @@ struct cmd_spec cmd_table[] = {
"-F Run in the foreground.\n"
"-p, --pidfile [FILE] Write PID to pidfile when daemonizing.",
},
-#ifdef LIBXL_HAVE_PSR_CMT
{ "psr-hwinfo",
&main_psr_hwinfo, 0, 1,
"Show hardware information for Platform Shared Resource",
@@ -544,8 +543,6 @@ struct cmd_spec cmd_table[] = {
"\"total-mem-bandwidth\": Show total memory bandwidth(KB/s)\n"
"\"local-mem-bandwidth\": Show local memory bandwidth(KB/s)\n",
},
-#endif
-#ifdef LIBXL_HAVE_PSR_CAT
{ "psr-cat-set",
&main_psr_cat_cbm_set, 0, 1,
"Set cache capacity bitmasks(CBM) for a domain",
@@ -561,8 +558,6 @@ struct cmd_spec cmd_table[] = {
"[options] <Domain>",
"-l <level> Specify the cache level to process, otherwise L3 cache is processed\n"
},
-
-#endif
{ "usbctrl-attach",
&main_usbctrl_attach, 0, 1,
"Create a virtual USB controller for a domain",
diff --git a/tools/xl/xl_psr.c b/tools/xl/xl_psr.c
index 7309d4f..544f6f0 100644
--- a/tools/xl/xl_psr.c
+++ b/tools/xl/xl_psr.c
@@ -25,7 +25,6 @@
#include "xl_utils.h"
#include "xl_parse.h"
-#ifdef LIBXL_HAVE_PSR_CMT
static int psr_cmt_hwinfo(void)
{
int rc;
@@ -292,9 +291,7 @@ int main_psr_cmt_show(int argc, char **argv)
return ret;
}
-#endif
-#if defined(LIBXL_HAVE_PSR_CAT) || defined(LIBXL_HAVE_PSR_L2_CAT)
static int psr_l3_cat_hwinfo(void)
{
int rc, nr;
@@ -626,8 +623,6 @@ int main_psr_hwinfo(int argc, char **argv)
return ret;
}
-#endif
-
/*
* Local variables:
* mode: C
--
1.9.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 2/2] tools: remove unnecessary PSR macros
2017-09-01 15:42 ` [PATCH 2/2] tools: remove unnecessary PSR macros Wei Liu
@ 2017-09-04 3:25 ` Yi Sun
0 siblings, 0 replies; 17+ messages in thread
From: Yi Sun @ 2017-09-04 3:25 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, ian.jackson, roger.pau
On 17-09-01 16:42:38, Wei Liu wrote:
> On Thu, Aug 31, 2017 at 04:08:06PM +0800, Yi Sun wrote:
> > Per Roger Pau's coment, the libxl interfaces and related functions are not
> > necessary to be included by 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'.
> > So remove them.
> >
> > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
>
> Acked-by: Wei Liu <wei.liu2@citrix.com>
>
> (without reading the patch)
Sorry that I missed the removal in xl.h. V2 patch is sent out. Please review.
Thanks!
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: remove unnecessary PSR macros
2017-09-04 3:08 ` [PATCH v2] " Yi Sun
@ 2017-09-04 8:49 ` Wei Liu
2017-09-04 9:10 ` Yi Sun
2017-09-04 9:14 ` Roger Pau Monné
0 siblings, 2 replies; 17+ messages in thread
From: Wei Liu @ 2017-09-04 8:49 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, ian.jackson, wei.liu2, roger.pau
On Mon, Sep 04, 2017 at 11:08:56AM +0800, Yi Sun wrote:
> The libxl interfaces and related functions are not necessary to be included by
> 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'. So remove them.
>
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Thinking about this a bit more, it is not that simple.
LIBXL_HAVE_PSR_CMT is enclosed by __i386__ and __x86_64__, libxl_psr.o
is only built on x86.
I'm afraid we do need these macros in libxl and xl otherwise arm build
is going to be broken.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: change the type of '*nr' in 'libxl_psr_cat_get_info'
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
2017-09-01 14:33 ` Roger Pau Monné
2017-09-01 15:50 ` Wei Liu
@ 2017-09-04 9:08 ` Wei Liu
2 siblings, 0 replies; 17+ messages in thread
From: Wei Liu @ 2017-09-04 9:08 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, ian.jackson, wei.liu2, roger.pau
On Fri, Sep 01, 2017 at 08:15:05PM +0800, Yi Sun wrote:
> Due to historical reason, type of parameter '*nr' in 'libxl_psr_cat_get_info'
> is 'int'. But this is not right. It should be 'unsigned int'. This patch fixes
> this and does related changes.
>
> Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
> ---
> - This patch depends on patch 'tools: remove unnecessary PSR macros'.
I suppose you want to resend this patch because its dependence should be
dropped?
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: remove unnecessary PSR macros
2017-09-04 8:49 ` Wei Liu
@ 2017-09-04 9:10 ` Yi Sun
2017-09-04 9:13 ` Wei Liu
2017-09-04 9:14 ` Roger Pau Monné
1 sibling, 1 reply; 17+ messages in thread
From: Yi Sun @ 2017-09-04 9:10 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, ian.jackson, roger.pau
On 17-09-04 09:49:40, Wei Liu wrote:
> On Mon, Sep 04, 2017 at 11:08:56AM +0800, Yi Sun wrote:
> > The libxl interfaces and related functions are not necessary to be included by
> > 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'. So remove them.
> >
> > Suggested-by: Roger Pau Monn? <roger.pau@citrix.com>
> > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
>
> Thinking about this a bit more, it is not that simple.
>
> LIBXL_HAVE_PSR_CMT is enclosed by __i386__ and __x86_64__, libxl_psr.o
> is only built on x86.
>
> I'm afraid we do need these macros in libxl and xl otherwise arm build
> is going to be broken.
Good point. Shall we use '#if defined(__i386__) || defined(__x86_64__)' to
include all PSR interfaces?
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: remove unnecessary PSR macros
2017-09-04 9:10 ` Yi Sun
@ 2017-09-04 9:13 ` Wei Liu
0 siblings, 0 replies; 17+ messages in thread
From: Wei Liu @ 2017-09-04 9:13 UTC (permalink / raw)
To: Yi Sun; +Cc: xen-devel, Wei Liu, ian.jackson, roger.pau
On Mon, Sep 04, 2017 at 05:10:21PM +0800, Yi Sun wrote:
> On 17-09-04 09:49:40, Wei Liu wrote:
> > On Mon, Sep 04, 2017 at 11:08:56AM +0800, Yi Sun wrote:
> > > The libxl interfaces and related functions are not necessary to be included by
> > > 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'. So remove them.
> > >
> > > Suggested-by: Roger Pau Monn? <roger.pau@citrix.com>
> > > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
> >
> > Thinking about this a bit more, it is not that simple.
> >
> > LIBXL_HAVE_PSR_CMT is enclosed by __i386__ and __x86_64__, libxl_psr.o
> > is only built on x86.
> >
> > I'm afraid we do need these macros in libxl and xl otherwise arm build
> > is going to be broken.
>
> Good point. Shall we use '#if defined(__i386__) || defined(__x86_64__)' to
> include all PSR interfaces?
Yes. There is no arm counterpart as far as I can tell.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v2] tools: remove unnecessary PSR macros
2017-09-04 8:49 ` Wei Liu
2017-09-04 9:10 ` Yi Sun
@ 2017-09-04 9:14 ` Roger Pau Monné
1 sibling, 0 replies; 17+ messages in thread
From: Roger Pau Monné @ 2017-09-04 9:14 UTC (permalink / raw)
To: Wei Liu; +Cc: xen-devel, Yi Sun, ian.jackson
On Mon, Sep 04, 2017 at 09:49:40AM +0100, Wei Liu wrote:
> On Mon, Sep 04, 2017 at 11:08:56AM +0800, Yi Sun wrote:
> > The libxl interfaces and related functions are not necessary to be included by
> > 'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'. So remove them.
> >
> > Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
> > Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
>
> Thinking about this a bit more, it is not that simple.
>
> LIBXL_HAVE_PSR_CMT is enclosed by __i386__ and __x86_64__, libxl_psr.o
> is only built on x86.
>
> I'm afraid we do need these macros in libxl and xl otherwise arm build
> is going to be broken.
OK, I though ARM would have it's own empty stubs. Maybe it would be
cleaner to simply don't compile xl_psr on ARM, rather than having a
bunch of defines in the file which basically renders it empty when
compiled on ARM.
In any case, this would not be much better than what we have now, so I
guess we should leave it as-is. Sorry for the miss-guidance.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2017-09-04 9:14 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-31 8:08 [PATCH 2/2] tools: remove unnecessary PSR macros Yi Sun
2017-08-31 9:07 ` Roger Pau Monné
2017-09-01 6:59 ` [PATCH] tools: change the type of '*nr' in 'libxl_psr_cat_get_info' Yi Sun
2017-09-01 9:07 ` Roger Pau Monné
2017-09-01 15:43 ` Wei Liu
2017-09-01 12:15 ` [PATCH v2] " Yi Sun
2017-09-01 14:33 ` Roger Pau Monné
2017-09-01 15:50 ` Wei Liu
2017-09-02 15:01 ` Yi Sun
2017-09-04 9:08 ` Wei Liu
2017-09-01 15:42 ` [PATCH 2/2] tools: remove unnecessary PSR macros Wei Liu
2017-09-04 3:25 ` Yi Sun
2017-09-04 3:08 ` [PATCH v2] " Yi Sun
2017-09-04 8:49 ` Wei Liu
2017-09-04 9:10 ` Yi Sun
2017-09-04 9:13 ` Wei Liu
2017-09-04 9:14 ` Roger Pau Monné
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.