diff --git a/add-Phytium-s-CPU-models-FT-2000-and-Tengyun-S2500.patch b/add-Phytium-s-CPU-models-FT-2000-and-Tengyun-S2500.patch new file mode 100644 index 0000000000000000000000000000000000000000..d60205b9f325388508434a7fb1e55ed8caa14e91 --- /dev/null +++ b/add-Phytium-s-CPU-models-FT-2000-and-Tengyun-S2500.patch @@ -0,0 +1,73 @@ +From 3a3ed44feeb4f17530cd87c77e13dc4dd5aa1ebc Mon Sep 17 00:00:00 2001 +From: Jiadong Zeng +Date: Thu, 11 Nov 2021 14:25:38 +0800 +Subject: [PATCH] add Phytium's CPU models: FT-2000+ and Tengyun-S2500. + +Signed-off-by: Jiadong Zeng +--- + hw/arm/virt.c | 2 ++ + target/arm/cpu64.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 30 insertions(+) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 133d36a400..f816d64575 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -194,6 +194,8 @@ static const char *valid_cpus[] = { + ARM_CPU_TYPE_NAME("cortex-a57"), + ARM_CPU_TYPE_NAME("cortex-a72"), + ARM_CPU_TYPE_NAME("Kunpeng-920"), ++ ARM_CPU_TYPE_NAME("FT-2000+"), ++ ARM_CPU_TYPE_NAME("Tengyun-S2500"), + ARM_CPU_TYPE_NAME("host"), + ARM_CPU_TYPE_NAME("max"), + }; +diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c +index a1649f8844..4cf5b89db0 100644 +--- a/target/arm/cpu64.c ++++ b/target/arm/cpu64.c +@@ -327,6 +327,32 @@ static void cpu_max_set_sve_vq(Object *obj, Visitor *v, const char *name, + error_propagate(errp, err); + } + ++static void aarch64_max_ft2000plus_initfn(Object *obj) ++{ ++ ARMCPU *cpu = ARM_CPU(obj); ++ ++ if (kvm_enabled()) { ++ kvm_arm_set_cpu_features_from_host(cpu); ++ kvm_arm_add_vcpu_properties(obj); ++ } else { ++ aarch64_a72_initfn(obj); ++ cpu->midr = 0x70186622; ++ } ++} ++ ++static void aarch64_max_tengyun_s2500_initfn(Object *obj) ++{ ++ ARMCPU *cpu = ARM_CPU(obj); ++ ++ if (kvm_enabled()) { ++ kvm_arm_set_cpu_features_from_host(cpu); ++ kvm_arm_add_vcpu_properties(obj); ++ } else { ++ aarch64_a72_initfn(obj); ++ cpu->midr = 0x70186632; ++ } ++} ++ + /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); + * otherwise, a CPU with as many features enabled as our emulation supports. + * The version of '-cpu max' for qemu-system-arm is defined in cpu.c; +@@ -442,6 +468,8 @@ static const ARMCPUInfo aarch64_cpus[] = { + { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, + { .name = "cortex-a72", .initfn = aarch64_a72_initfn }, + { .name = "Kunpeng-920", .initfn = aarch64_kunpeng_920_initfn }, ++ { .name = "FT-2000+", .initfn = aarch64_max_ft2000plus_initfn }, ++ { .name = "Tengyun-S2500", .initfn = aarch64_max_tengyun_s2500_initfn }, + { .name = "max", .initfn = aarch64_max_initfn }, + { .name = NULL } + }; +-- +2.27.0 + diff --git a/qemu.spec b/qemu.spec index 0e02dbe14b2a4c959fd0369f8969be355e756ca0..a83412b58a5f933b444dd2a0387ec1879dec7fbd 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,6 +1,6 @@ Name: qemu Version: 4.1.0 -Release: 62 +Release: 63 Epoch: 2 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY-SA-4.0 @@ -343,6 +343,7 @@ Patch0330: tftp-introduce-a-header-structure.patch Patch0331: fix-cve-2020-35504.patch Patch0332: fix-cve-2020-35505.patch Patch0333: virtio-balloon-apply-upstream-patch.patch +Patch0334: add-Phytium-s-CPU-models-FT-2000-and-Tengyun-S2500.patch BuildRequires: flex BuildRequires: bison @@ -740,6 +741,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Dec 21 2021 imxcc +- add Phytium's CPU models: FT-2000+ and Tengyun-S2500 + * Fri Dec 03 2021 Chen Qun - virtio-balloon: apply upstream patch.