aboutsummaryrefslogtreecommitdiff
path: root/target-s390x/Makefile.objs
diff options
context:
space:
mode:
authorMichael Mueller <mimu@linux.vnet.ibm.com>2016-09-05 10:52:19 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-09-06 17:06:49 +0200
commitdced7eec3c60154408296dda8641ecc54978f5d6 (patch)
tree1f42ee95bb08b98d25fe5ef7b5715949c36ad943 /target-s390x/Makefile.objs
parent782417446279717aa85320191a519b51f6d5dd31 (diff)
s390x/cpumodel: generate CPU feature lists for CPU models
This patch introduces the helper "gen-features" which allows to generate feature list definitions at compile time. Its flexibility is better and the error-proneness is lower when compared to static programming time added statements. The helper includes "target-s390x/cpu_features.h" to be able to use named facility bits instead of numbers. The generated defines will be used for the definition of CPU models. We generate feature lists for each HW generation and GA for EC models. BC models are always based on a EC version and have no separate definitions. Base features: Features we expect to be always available in sane setups. Migration safe - will never change. Can be seen as "minimum features required for a CPU model". Default features: Features we expect to be stable and around in latest setups (e.g. having KVM support) - not migration safe. Max features: All supported features that are theoretically allowed for a CPU model. Exceeding these features could otherwise produce problems with IBC (instruction blocking controls) in KVM. Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> [generate base, default and models. renaming and cleanup] Message-Id: <20160905085244.99980-6-dahi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'target-s390x/Makefile.objs')
-rw-r--r--target-s390x/Makefile.objs20
1 files changed, 20 insertions, 0 deletions
diff --git a/target-s390x/Makefile.objs b/target-s390x/Makefile.objs
index 4266c87008..4329d39c13 100644
--- a/target-s390x/Makefile.objs
+++ b/target-s390x/Makefile.objs
@@ -3,3 +3,23 @@ obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o
obj-y += gdbstub.o cpu_models.o cpu_features.o
obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o arch_dump.o mmu_helper.o
obj-$(CONFIG_KVM) += kvm.o
+
+# build and run feature list generator
+feat-src = $(SRC_PATH)/target-$(TARGET_BASE_ARCH)/
+feat-dst = $(BUILD_DIR)/$(TARGET_DIR)
+ifneq ($(MAKECMDGOALS),clean)
+GENERATED_HEADERS += $(feat-dst)gen-features.h
+endif
+
+$(feat-dst)gen-features.h: $(feat-dst)gen-features.h-timestamp
+ @cmp $< $@ >/dev/null 2>&1 || cp $< $@
+$(feat-dst)gen-features.h-timestamp: $(feat-dst)gen-features
+ $(call quiet-command,$< >$@," GEN $(TARGET_DIR)gen-features.h")
+
+$(feat-dst)gen-features: $(feat-src)gen-features.c
+ $(call quiet-command,$(HOST_CC) $(QEMU_INCLUDES) -o $@ $<," CC $(TARGET_DIR)gen-features")
+
+clean-target:
+ rm -f gen-features.h-timestamp
+ rm -f gen-features.h
+ rm -f gen-features