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

[Xen-devel] [PATCH 02/13] libx86: generate cpuid-autogen.h in the libx86 include dir



From: Roger Pau Monné <roger.pau@xxxxxxxxxx>

This prevents having to generate it inside the libxc folder.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
CC: Sergey Dyasli <sergey.dyasli@xxxxxxxxxx>
CC: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

RFC - I'm not sure a parallel build of Xen and the tools works.
---
 .gitignore                        |  2 +-
 tools/include/Makefile            | 11 +++++++++++
 tools/libxc/Makefile              |  9 ---------
 tools/libxc/xc_cpuid_x86.c        |  1 -
 xen/include/Makefile              |  6 +++---
 xen/include/asm-x86/cpufeatures.h |  2 +-
 xen/include/xen/libx86/cpuid.h    |  2 ++
 7 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/.gitignore b/.gitignore
index 7004349..9c41d6c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -310,7 +310,6 @@ xen/arch/*/efi/runtime.c
 xen/include/headers*.chk
 xen/include/asm
 xen/include/asm-*/asm-offsets.h
-xen/include/asm-x86/cpuid-autogen.h
 xen/include/compat/*
 xen/include/config/
 xen/include/generated/
@@ -318,6 +317,7 @@ xen/include/public/public
 xen/include/xen/*.new
 xen/include/xen/acm_policy.h
 xen/include/xen/compile.h
+xen/include/xen/libx86/cpuid-autogen.h
 xen/test/livepatch/config.h
 xen/test/livepatch/xen_bye_world.livepatch
 xen/test/livepatch/xen_hello_world.livepatch
diff --git a/tools/include/Makefile b/tools/include/Makefile
index 568012d..fc99da9 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -26,6 +26,17 @@ ifeq ($(CONFIG_X86),y)
 endif
        touch $@
 
+ifeq ($(CONFIG_X86),y)
+$(XEN_ROOT)/xen/include/xen/libx86/cpuid-autogen.h: 
$(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h 
$(XEN_ROOT)/xen/tools/gen-cpuid.py FORCE
+       $(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $< -o $@.new
+       $(call move-if-changed,$@.new,$@)
+
+all: $(XEN_ROOT)/xen/include/xen/libx86/cpuid-autogen.h
+# NB: Use a FORCE target to always rebuild the autogenerated cpuid header
+FORCE:
+.PHONY: FORCE
+endif
+
 # Not xen/xsm as that clashes with link to
 # $(XEN_ROOT)/xen/include/public/xsm above.
 xen-xsm/.dir: $(XEN_ROOT)/xen/xsm/flask/policy/mkflask.sh \
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index d26bf8d..0ee0813 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -147,15 +147,6 @@ $(eval $(genpath-target))
 
 xc_private.h: _paths.h
 
-ifeq ($(CONFIG_X86),y)
-
-_xc_cpuid_autogen.h: $(XEN_ROOT)/xen/include/public/arch-x86/cpufeatureset.h 
$(XEN_ROOT)/xen/tools/gen-cpuid.py
-       $(PYTHON) $(XEN_ROOT)/xen/tools/gen-cpuid.py -i $^ -o $@.new
-       $(call move-if-changed,$@.new,$@)
-
-build: _xc_cpuid_autogen.h
-endif
-
 $(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) \
 $(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS): xc_private.h
 
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c
index 6fbf915..06f104d 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -33,7 +33,6 @@ enum {
 #define XEN_CPUFEATURE(name, value) X86_FEATURE_##name = value,
 #include <xen/arch-x86/cpufeatureset.h>
 };
-#include "_xc_cpuid_autogen.h"
 
 #define bitmaskof(idx)      (1u << ((idx) & 31))
 #define featureword_of(idx) ((idx) >> 5)
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 7c5034e..dd18316 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -142,13 +142,13 @@ endif
 
 ifeq ($(XEN_TARGET_ARCH),x86_64)
 
-$(BASEDIR)/include/asm-x86/cpuid-autogen.h: 
$(BASEDIR)/include/public/arch-x86/cpufeatureset.h 
$(BASEDIR)/tools/gen-cpuid.py FORCE
+$(BASEDIR)/include/xen/libx86/cpuid-autogen.h: 
$(BASEDIR)/include/public/arch-x86/cpufeatureset.h 
$(BASEDIR)/tools/gen-cpuid.py FORCE
        $(PYTHON) $(BASEDIR)/tools/gen-cpuid.py -i $< -o $@.new
        $(call move-if-changed,$@.new,$@)
 
-all: $(BASEDIR)/include/asm-x86/cpuid-autogen.h
+all: $(BASEDIR)/include/xen/libx86/cpuid-autogen.h
 endif
 
 clean::
        rm -rf compat config generated headers*.chk
-       rm -f $(BASEDIR)/include/asm-x86/cpuid-autogen.h
+       rm -f $(BASEDIR)/include/xen/libx86/cpuid-autogen.h
diff --git a/xen/include/asm-x86/cpufeatures.h 
b/xen/include/asm-x86/cpufeatures.h
index 8e5cc53..b7ceb20 100644
--- a/xen/include/asm-x86/cpufeatures.h
+++ b/xen/include/asm-x86/cpufeatures.h
@@ -2,7 +2,7 @@
  * Explicitly intended for multiple inclusion.
  */
 
-#include <asm/cpuid-autogen.h>
+#include <xen/libx86/cpuid-autogen.h>
 
 #define FSCAPINTS FEATURESET_NR_ENTRIES
 
diff --git a/xen/include/xen/libx86/cpuid.h b/xen/include/xen/libx86/cpuid.h
index 3ccc68e..8f101ba 100644
--- a/xen/include/xen/libx86/cpuid.h
+++ b/xen/include/xen/libx86/cpuid.h
@@ -2,6 +2,8 @@
 #ifndef XEN_LIBX86_CPUID_H
 #define XEN_LIBX86_CPUID_H
 
+#include <xen/libx86/cpuid-autogen.h>
+
 struct cpuid_leaf
 {
     uint32_t a, b, c, d;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.