]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools: use '__i386__' and '__x86_64__' to replace PSR macros
authorYi Sun <yi.y.sun@linux.intel.com>
Mon, 4 Sep 2017 11:01:43 +0000 (19:01 +0800)
committerWei Liu <wei.liu2@citrix.com>
Wed, 6 Sep 2017 16:06:12 +0000 (17:06 +0100)
The libxl interfaces and related functions are not necessary to be included by
'LIBXL_HAVE_PSR_CMT' and 'LIBXL_HAVE_PSR_CAT'. So replace them to common x86
macros. Furthermore, only compile 'xl_psr.c' under x86.

Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Suggested-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl.h
tools/xl/Makefile
tools/xl/xl.h
tools/xl/xl_cmdtable.c
tools/xl/xl_psr.c

index 812b7ea95de0290d9b2364e4d2ebd90f55b6dca6..9e5f99dfd0654e99ceea8308821f6a9a30f06af5 100644 (file)
@@ -2179,7 +2179,7 @@ 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
+#if defined(__i386__) || defined(__x86_64__)
 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);
@@ -2192,9 +2192,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,
@@ -2202,9 +2200,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
index c8688992f30e8e905ed017bc7241bcbb397e9059..ff85d488d0896663d4f2422c0c9f1c2579bbc2fb 100644 (file)
@@ -15,11 +15,12 @@ LDFLAGS += $(PTHREAD_LDFLAGS)
 CFLAGS_XL += $(CFLAGS_libxenlight)
 CFLAGS_XL += -Wshadow
 
-XL_OBJS = xl.o xl_cmdtable.o xl_sxp.o xl_utils.o
+XL_OBJS-$(CONFIG_X86) = xl_psr.o
+XL_OBJS = xl.o xl_cmdtable.o xl_sxp.o xl_utils.o $(XL_OBJS-y)
 XL_OBJS += xl_tmem.o xl_parse.o xl_cpupool.o xl_flask.o
 XL_OBJS += xl_vtpm.o xl_block.o xl_nic.o xl_usb.o
 XL_OBJS += xl_sched.o xl_pci.o xl_vcpu.o xl_cdrom.o xl_mem.o
-XL_OBJS += xl_psr.o xl_info.o xl_console.o xl_misc.o
+XL_OBJS += xl_info.o xl_console.o xl_misc.o
 XL_OBJS += xl_vmcontrol.o xl_saverestore.o xl_migrate.o
 
 $(XL_OBJS): CFLAGS += $(CFLAGS_libxentoollog)
index 5d3d2a4835eb5bfb8d95ad5eff74721f97d74790..01c2af64a6c2bcf1a00d31a91f2ea32db3c61b6b 100644 (file)
@@ -198,13 +198,11 @@ 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
+#if defined(__i386__) || defined(__x86_64__)
 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
index ba0159df676216eccb40950b4f6ab0e9a8305d01..5cfc7e84f51060f9e82b6e28b9ff3f264e1d1f7b 100644 (file)
@@ -522,7 +522,7 @@ 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
+#if defined(__i386__) || defined(__x86_64__)
     { "psr-hwinfo",
       &main_psr_hwinfo, 0, 1,
       "Show hardware information for Platform Shared Resource",
@@ -549,8 +549,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",
@@ -566,7 +564,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,
index 7309d4f46c8b23fc5b138ddb8278a013e22f3d13..544f6f0cc21c70935bc3684a77dee77492406847 100644 (file)
@@ -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