From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: "Sergey Dyasli" <sergey.dyasli@citrix.com>,
"Wei Liu" <wei.liu2@citrix.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
"Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v2 03/13] libx86: generate cpuid-autogen.h in the libx86 include dir
Date: Fri, 13 Jul 2018 21:03:04 +0100 [thread overview]
Message-ID: <1531512194-6865-4-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1531512194-6865-1-git-send-email-andrew.cooper3@citrix.com>
From: Roger Pau Monné <roger.pau@citrix.com>
This avoids all users needing to opencode local generation of the file.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Sergey Dyasli <sergey.dyasli@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
v2:
* Rewrite from scratch
---
.gitignore | 2 +-
tools/include/Makefile | 6 +++++-
tools/libxc/Makefile | 9 ---------
tools/libxc/xc_cpuid_x86.c | 1 -
xen/include/Makefile | 11 +++++------
xen/include/asm-x86/cpufeatures.h | 2 +-
xen/include/xen/libx86/Makefile | 8 ++++++++
xen/include/xen/libx86/cpuid.h | 2 ++
8 files changed, 22 insertions(+), 19 deletions(-)
create mode 100644 xen/include/xen/libx86/Makefile
diff --git a/.gitignore b/.gitignore
index 5b8448d..861f2ea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -311,7 +311,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/
@@ -319,6 +318,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 a2403fc..07162a7 100644
--- a/tools/include/Makefile
+++ b/tools/include/Makefile
@@ -23,7 +23,11 @@ xen/.dir:
ln -sf $(XEN_ROOT)/xen/include/acpi acpi
ifeq ($(CONFIG_X86),y)
ln -sf $(XEN_ROOT)/xen/include/asm-x86 xen/asm
- ln -sf $(XEN_ROOT)/xen/include/xen/libx86 xen/libx86
+ mkdir -p xen/libx86
+ for f in $(filter-out %autogen.h,$(patsubst $(XEN_ROOT)/xen/include/xen/libx86/%,%,Makefile $(wildcard $(XEN_ROOT)/xen/include/xen/libx86/*.h))); do \
+ ln -sf $(XEN_ROOT)/xen/include/xen/libx86/$$f xen/libx86/$$f; \
+ done
+ $(MAKE) -C xen/libx86 all XEN_ROOT=$(XEN_ROOT)
endif
touch $@
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 157553c..ca2b203 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 090e199..d2f85aa 100644
--- a/tools/libxc/xc_cpuid_x86.c
+++ b/tools/libxc/xc_cpuid_x86.c
@@ -31,7 +31,6 @@ enum {
#define XEN_CPUFEATURE(name, value) X86_FEATURE_##name = value,
#include <xen/arch-x86/cpufeatureset.h>
};
-#include "_xc_cpuid_autogen.h"
#include <xen/libx86/cpuid.h>
diff --git a/xen/include/Makefile b/xen/include/Makefile
index 7c5034e..7b4e862 100644
--- a/xen/include/Makefile
+++ b/xen/include/Makefile
@@ -141,14 +141,13 @@ headers++.chk: $(PUBLIC_HEADERS) Makefile
endif
ifeq ($(XEN_TARGET_ARCH),x86_64)
+.PHONY: libx86-all
+libx86-all:
+ $(MAKE) -C xen/libx86 all
-$(BASEDIR)/include/asm-x86/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: libx86-all
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/Makefile b/xen/include/xen/libx86/Makefile
new file mode 100644
index 0000000..408d69c
--- /dev/null
+++ b/xen/include/xen/libx86/Makefile
@@ -0,0 +1,8 @@
+include $(XEN_ROOT)/Config.mk
+
+.PHONY: all
+all: cpuid-autogen.h
+
+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,$@)
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@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-07-13 20:03 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 20:03 [PATCH v2 00/13] x86: CPUID and MSR policy marshalling support Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 01/13] x86/msr: Drop stale comment for vcpu_msrs.spec_ctrl Andrew Cooper
2018-07-16 7:21 ` Jan Beulich
2018-07-16 9:37 ` Roger Pau Monné
2018-07-16 11:02 ` Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 02/13] libx86: Introduce libx86/cpuid.h Andrew Cooper
2018-07-16 9:23 ` Jan Beulich
2018-07-16 10:22 ` Andrew Cooper
2018-07-16 10:51 ` Jan Beulich
2018-07-13 20:03 ` Andrew Cooper [this message]
2018-07-16 9:31 ` [PATCH v2 03/13] libx86: generate cpuid-autogen.h in the libx86 include dir Jan Beulich
2018-07-13 20:03 ` [PATCH v2 04/13] libx86: Share struct cpuid_policy with userspace Andrew Cooper
2018-07-16 9:38 ` Jan Beulich
2018-07-16 9:51 ` Andrew Cooper
2018-07-16 10:04 ` Jan Beulich
2018-07-16 10:16 ` Andrew Cooper
2018-07-16 10:24 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 05/13] libx86: introduce a libx86 shared library Andrew Cooper
2018-07-16 9:02 ` Wei Liu
2018-07-16 10:17 ` Jan Beulich
2018-07-16 10:35 ` Andrew Cooper
2018-07-16 10:52 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 06/13] libx86: Introduce libx86/msr.h and share msr_policy with userspace Andrew Cooper
2018-07-16 9:41 ` Roger Pau Monné
2018-07-16 10:19 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 07/13] libx86: Introduce a helper to serialise cpuid_policy objects Andrew Cooper
2018-07-16 9:18 ` Wei Liu
2018-07-16 9:45 ` Jan Beulich
2018-07-16 10:39 ` Andrew Cooper
2018-07-16 10:55 ` Jan Beulich
2018-07-16 10:45 ` Jan Beulich
2018-07-17 10:02 ` Andrew Cooper
2018-07-17 11:58 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 08/13] libx86: Introduce a helper to serialise msr_policy objects Andrew Cooper
2018-07-16 9:24 ` Wei Liu
2018-07-16 10:47 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 09/13] libx86: Introduce a helper to deserialise cpuid_policy objects Andrew Cooper
2018-07-16 9:57 ` Wei Liu
2018-07-17 10:09 ` Andrew Cooper
2018-07-13 20:03 ` [PATCH v2 10/13] libx86: introduce a helper to deserialise msr_policy objects Andrew Cooper
2018-07-16 10:07 ` Wei Liu
2018-07-16 11:36 ` Jan Beulich
2018-07-17 10:17 ` Andrew Cooper
2018-07-17 12:01 ` Jan Beulich
2018-07-17 16:06 ` Andrew Cooper
2018-07-17 16:23 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 11/13] x86: Introduce struct cpu_policy to refer to a group of individual policies Andrew Cooper
2018-07-16 9:55 ` Roger Pau Monné
2018-07-16 10:32 ` Wei Liu
2018-07-16 12:04 ` Jan Beulich
2018-07-16 12:16 ` Andrew Cooper
2018-07-16 12:29 ` Jan Beulich
2018-07-16 13:15 ` Andrew Cooper
2018-07-16 13:23 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 12/13] x86/sysctl: Implement XEN_SYSCTL_get_cpu_policy Andrew Cooper
2018-07-16 10:16 ` Roger Pau Monné
2018-07-16 10:58 ` Andrew Cooper
2018-07-16 11:04 ` Jan Beulich
2018-07-16 11:54 ` Jan Beulich
2018-07-17 16:50 ` Andrew Cooper
2018-07-18 6:45 ` Jan Beulich
2018-07-13 20:03 ` [PATCH v2 13/13] x86/domctl: Implement XEN_DOMCTL_get_cpu_policy Andrew Cooper
2018-07-16 10:26 ` Roger Pau Monné
2018-07-17 17:08 ` Andrew Cooper
2018-07-16 12:00 ` Jan Beulich
2018-07-30 2:14 ` Chao Gao
2018-08-17 21:22 ` Daniel De Graaf
2018-07-30 2:46 ` [PATCH v2 00/13] x86: CPUID and MSR policy marshalling support Chao Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1531512194-6865-4-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=roger.pau@citrix.com \
--cc=sergey.dyasli@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).