diff --git a/Revert-qmp-add-command-to-query-used-memslots-of-vho.patch b/Revert-qmp-add-command-to-query-used-memslots-of-vho.patch new file mode 100644 index 0000000000000000000000000000000000000000..02f8797078723c92d08fabe7243a9cc1dbdfd5a5 --- /dev/null +++ b/Revert-qmp-add-command-to-query-used-memslots-of-vho.patch @@ -0,0 +1,133 @@ +From 92e9fb334c38cd21652ce8adde9ec01ab4412426 Mon Sep 17 00:00:00 2001 +From: Jinhua Cao +Date: Tue, 15 Feb 2022 15:18:17 +0800 +Subject: [PATCH] Revert "qmp: add command to query used memslots of vhost-net + and vhost-user" + +This reverts commit 1545a60a8b78490c7dc8909b7012bca63dba63cd. + +Signed-off-by: Jinhua Cao +--- + hw/virtio/vhost-backend.c | 2 +- + hw/virtio/vhost-user.c | 2 +- + include/hw/virtio/vhost-backend.h | 2 -- + monitor/qmp-cmds.c | 12 ------------ + qapi/net.json | 18 ------------------ + qapi/pragma.json | 4 +--- + 6 files changed, 3 insertions(+), 37 deletions(-) + +diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c +index d8e1710758..2acfb750fd 100644 +--- a/hw/virtio/vhost-backend.c ++++ b/hw/virtio/vhost-backend.c +@@ -300,7 +300,7 @@ static void vhost_kernel_set_used_memslots(struct vhost_dev *dev) + vhost_kernel_used_memslots = dev->mem->nregions; + } + +-unsigned int vhost_kernel_get_used_memslots(void) ++static unsigned int vhost_kernel_get_used_memslots(void) + { + return vhost_kernel_used_memslots; + } +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index 8f69a3b850..176cae9244 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -2544,7 +2544,7 @@ static void vhost_user_set_used_memslots(struct vhost_dev *dev) + vhost_user_used_memslots = counter; + } + +-unsigned int vhost_user_get_used_memslots(void) ++static unsigned int vhost_user_get_used_memslots(void) + { + return vhost_user_used_memslots; + } +diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h +index 7bbc658161..a64708f456 100644 +--- a/include/hw/virtio/vhost-backend.h ++++ b/include/hw/virtio/vhost-backend.h +@@ -190,6 +190,4 @@ int vhost_backend_handle_iotlb_msg(struct vhost_dev *dev, + + int vhost_user_gpu_set_socket(struct vhost_dev *dev, int fd); + +-unsigned int vhost_kernel_get_used_memslots(void); +-unsigned int vhost_user_get_used_memslots(void); + #endif /* VHOST_BACKEND_H */ +diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c +index a138e7dd4b..d71beace6a 100644 +--- a/monitor/qmp-cmds.c ++++ b/monitor/qmp-cmds.c +@@ -37,7 +37,6 @@ + #include "qapi/qapi-commands-machine.h" + #include "qapi/qapi-commands-misc.h" + #include "qapi/qapi-commands-ui.h" +-#include "qapi/qapi-commands-net.h" + #include "qapi/type-helpers.h" + #include "qapi/qmp/qerror.h" + #include "exec/ramlist.h" +@@ -45,7 +44,6 @@ + #include "hw/acpi/acpi_dev_interface.h" + #include "hw/intc/intc.h" + #include "hw/rdma/rdma.h" +-#include "hw/virtio/vhost-backend.h" + + NameInfo *qmp_query_name(Error **errp) + { +@@ -476,13 +474,3 @@ int64_t qmp_query_rtc_date_diff(Error **errp) + { + return get_rtc_date_diff(); + } +- +-uint32_t qmp_query_vhost_kernel_used_memslots(Error **errp) +-{ +- return vhost_kernel_get_used_memslots(); +-} +- +-uint32_t qmp_query_vhost_user_used_memslots(Error **errp) +-{ +- return vhost_user_get_used_memslots(); +-} +diff --git a/qapi/net.json b/qapi/net.json +index c9ff849eed..7fab2e7cd8 100644 +--- a/qapi/net.json ++++ b/qapi/net.json +@@ -696,21 +696,3 @@ + ## + { 'event': 'FAILOVER_NEGOTIATED', + 'data': {'device-id': 'str'} } +- +-## +-# @query-vhost-kernel-used-memslots: +-# +-# Get vhost-kernel nic used memslots +-# +-# Since: 4.1 +-## +-{ 'command': 'query-vhost-kernel-used-memslots', 'returns': 'uint32' } +- +-## +-# @query-vhost-user-used-memslots: +-# +-# Get vhost-user nic used memslots +-# +-# Since: 4.1 +-## +-{ 'command': 'query-vhost-user-used-memslots', 'returns': 'uint32' } +diff --git a/qapi/pragma.json b/qapi/pragma.json +index d35c897acb..b37f6de445 100644 +--- a/qapi/pragma.json ++++ b/qapi/pragma.json +@@ -27,9 +27,7 @@ + 'query-tpm-models', + 'query-tpm-types', + 'ringbuf-read', +- 'query-rtc-date-diff', +- 'query-vhost-user-used-memslots', +- 'query-vhost-kernel-used-memslots' ], ++ 'query-rtc-date-diff' ], + # Externally visible types whose member names may use uppercase + 'member-name-exceptions': [ # visible in: + 'ACPISlotType', # query-acpi-ospm-status +-- +2.27.0 + diff --git a/i386-cpu-fix-compile-error-in-all-target-configure.patch b/i386-cpu-fix-compile-error-in-all-target-configure.patch new file mode 100644 index 0000000000000000000000000000000000000000..0cadfa1a02feaf82b60c2582d8de35c8d040dafd --- /dev/null +++ b/i386-cpu-fix-compile-error-in-all-target-configure.patch @@ -0,0 +1,69 @@ +From 11498c2d92e703923d373b64ad3f33aec5f383f2 Mon Sep 17 00:00:00 2001 +From: Jiajie Li +Date: Thu, 17 Feb 2022 09:51:13 +0800 +Subject: [PATCH] i386/cpu: fix compile error in all target configure + +When compile with `./configure && make -j`, there will be +error: "unknown type name `ram_addr_t`", fix the error by +adding compilation macro to control it. + +Signed-off-by: Jiajie Li +--- + target/i386/cpu.c | 16 ++++++++-------- + target/i386/cpu.h | 2 ++ + 2 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index a4732a7372..d9dca1dafb 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -6711,14 +6711,6 @@ static bool x86_cpu_get_paging_enabled(const CPUState *cs) + + return cpu->env.cr[0] & CR0_PG_MASK; + } +-#endif /* !CONFIG_USER_ONLY */ +- +-static void x86_cpu_set_pc(CPUState *cs, vaddr value) +-{ +- X86CPU *cpu = X86_CPU(cs); +- +- cpu->env.eip = value; +-} + + /* At present, we check the vm is *LARGE* or not, i.e. whether + * the memory size is more than 4T or not. +@@ -6736,6 +6728,14 @@ void x86_cpu_adjuest_by_ram_size(ram_addr_t ram_size, X86CPU *cpu) + cpu->fill_mtrr_mask = true; + } + } ++#endif /* !CONFIG_USER_ONLY */ ++ ++static void x86_cpu_set_pc(CPUState *cs, vaddr value) ++{ ++ X86CPU *cpu = X86_CPU(cs); ++ ++ cpu->env.eip = value; ++} + + int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request) + { +diff --git a/target/i386/cpu.h b/target/i386/cpu.h +index 6f777fd6ca..d9296a9abc 100644 +--- a/target/i386/cpu.h ++++ b/target/i386/cpu.h +@@ -1842,10 +1842,12 @@ struct X86CPU { + extern const VMStateDescription vmstate_x86_cpu; + #endif + ++#ifndef CONFIG_USER_ONLY + #define DEFAULT_VM_CPU_PHYS_BITS 42 + #define LARGE_VM_CPU_PHYS_BITS 46 + + void x86_cpu_adjuest_by_ram_size(ram_addr_t ram_size, X86CPU *cpu); ++#endif + + int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request); + +-- +2.27.0 + diff --git a/pl031-support-rtc-timer-property-for-pl031.patch b/pl031-support-rtc-timer-property-for-pl031.patch new file mode 100644 index 0000000000000000000000000000000000000000..b57f0e75965a62e7f929b740babe184546efa0c5 --- /dev/null +++ b/pl031-support-rtc-timer-property-for-pl031.patch @@ -0,0 +1,70 @@ +From f8e5f099c5b6665e3ed9f397ddca9283148938a4 Mon Sep 17 00:00:00 2001 +From: Jinhao Gao +Date: Tue, 15 Feb 2022 17:02:08 +0800 +Subject: [PATCH] pl031: support rtc-timer property for pl031 + +This patch adds the rtc-timer property for pl031, we can get the +rtc time (UTC) through qmp command "qom-get date" with this property. + +Signed-off-by: Haibin Wang +Reviewed-by: Shannon Zhao +Reviewed-by: Ying Fang +Signed-off-by: Keqian Zhu +Signed-off-by: Jinhao Gao +--- + hw/rtc/pl031.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c +index da8b061e91..61a2948f77 100644 +--- a/hw/rtc/pl031.c ++++ b/hw/rtc/pl031.c +@@ -63,6 +63,15 @@ static uint32_t pl031_get_count(PL031State *s) + return s->tick_offset + now / NANOSECONDS_PER_SECOND; + } + ++static void pl031_get_date(Object *obj, struct tm *current_tm, Error **errp) ++{ ++ PL031State *s = PL031(obj); ++ time_t ti = pl031_get_count(s); ++ ++ /* Changed to UTC time */ ++ gmtime_r(&ti, current_tm); ++} ++ + static void pl031_set_alarm(PL031State *s) + { + uint32_t ticks; +@@ -201,6 +210,20 @@ static void pl031_init(Object *obj) + qemu_clock_get_ns(rtc_clock) / NANOSECONDS_PER_SECOND; + + s->timer = timer_new_ns(rtc_clock, pl031_interrupt, s); ++ object_property_add_tm(OBJECT(s), "date", pl031_get_date); ++} ++ ++static void pl031_realize(DeviceState *d, Error **errp) ++{ ++ object_property_add_alias(qdev_get_machine(), "rtc-time", ++ OBJECT(d), "date"); ++} ++ ++static void pl031_unrealize(DeviceState *d) ++{ ++ if (object_property_find(qdev_get_machine(), "rtc-time")) { ++ object_property_del(qdev_get_machine(), "rtc-time"); ++ } + } + + static void pl031_finalize(Object *obj) +@@ -337,6 +360,8 @@ static void pl031_class_init(ObjectClass *klass, void *data) + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->vmsd = &vmstate_pl031; ++ dc->realize = pl031_realize; ++ dc->unrealize = pl031_unrealize; + device_class_set_props(dc, pl031_properties); + } + +-- +2.27.0 + diff --git a/qemu.spec b/qemu.spec index 45cb002f33c3b185ee67d2d70b5bb88615a6f020..fb5e2f1bff69a0cd6687de3f331c8d440aaeac52 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,6 +1,6 @@ Name: qemu Version: 6.2.0 -Release: 19 +Release: 20 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 @@ -197,6 +197,10 @@ Patch0183: softmmu-device_tree-Silence-compiler-warning-with-en.patch Patch0184: softmmu-device_tree-Remove-redundant-pointer-assignm.patch Patch0185: hw-arm64-add-vcpu-cache-info-support.patch Patch0186: arm64-Add-the-cpufreq-device-to-show-cpufreq-info-to.patch +Patch0187: Revert-qmp-add-command-to-query-used-memslots-of-vho.patch +Patch0188: target-arm-Fix-some-compile-errors.patch +Patch0189: pl031-support-rtc-timer-property-for-pl031.patch +Patch0190: i386-cpu-fix-compile-error-in-all-target-configure.patch BuildRequires: flex BuildRequires: gcc @@ -644,6 +648,18 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon Feb 21 2022 Chen Qun +- i386/cpu: fix compile error in all target configure + +* Mon Feb 21 2022 Chen Qun +- pl031: support rtc-timer property for pl031 + +* Mon Feb 21 2022 Chen Qun +- target/arm: Fix some compile errors + +* Mon Feb 21 2022 Chen Qun +- Revert "qmp: add command to query used memslots of vhost-net and vhost-user" + * Thu Feb 17 2022 imxcc - qapi/machine.json: Fix incorrect description for die-id - tests/unit/test-smp-parse: Pass machine type as diff --git a/target-arm-Fix-some-compile-errors.patch b/target-arm-Fix-some-compile-errors.patch new file mode 100644 index 0000000000000000000000000000000000000000..2a0e1e9dda1b6552e33a9a5b93806e3c1d0d9305 --- /dev/null +++ b/target-arm-Fix-some-compile-errors.patch @@ -0,0 +1,89 @@ +From 6a5a391c9c6f6c0cd105ce3495acc10868bad884 Mon Sep 17 00:00:00 2001 +From: Dongxu Sun +Date: Tue, 15 Feb 2022 14:40:48 +0800 +Subject: [PATCH] target/arm: Fix some compile errors + +fix compile errors like: + "implicit declaration of function 'kvm_arm_cpu_feature_supported'"; + "undefined reference to 'kvm_arm_get_one_reg'" + "undefined reference to 'kvm_arm_set_one_reg'" + "'kvmval' may be used uninitialized" + "'oldval' may be used uninitialized" + +Signed-off-by: Dongxu Sun +--- + target/arm/helper.c | 4 ++-- + target/arm/kvm_arm.h | 23 ++++++++++++++++++++--- + 2 files changed, 22 insertions(+), 5 deletions(-) + +diff --git a/target/arm/helper.c b/target/arm/helper.c +index 1dd5d64d96..80737a8d7b 100644 +--- a/target/arm/helper.c ++++ b/target/arm/helper.c +@@ -168,8 +168,8 @@ bool write_cpustate_to_list(ARMCPU *cpu, bool kvm_sync) + if (kvm_sync) { + if (is_id_reg(ri)) { + /* Only sync if we can sync to KVM successfully. */ +- uint64_t oldval; +- uint64_t kvmval; ++ uint64_t oldval = 0; ++ uint64_t kvmval = 0; + + if (kvm_arm_get_one_reg(cpu, cpu->cpreg_indexes[i], &oldval)) { + continue; +diff --git a/target/arm/kvm_arm.h b/target/arm/kvm_arm.h +index 82145607ec..8b644b3924 100644 +--- a/target/arm/kvm_arm.h ++++ b/target/arm/kvm_arm.h +@@ -377,6 +377,9 @@ void kvm_arm_pvtime_init(CPUState *cs, uint64_t ipa); + + int kvm_arm_set_irq(int cpu, int irqtype, int irq, int level); + ++int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *target); ++int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *source); ++ + #else + + /* +@@ -403,6 +406,11 @@ static inline bool kvm_arm_steal_time_supported(void) + return false; + } + ++static inline bool kvm_arm_cpu_feature_supported(void) ++{ ++ return false; ++} ++ + /* + * These functions should never actually be called without KVM support. + */ +@@ -451,6 +459,18 @@ static inline void kvm_arm_sve_get_vls(CPUState *cs, unsigned long *map) + g_assert_not_reached(); + } + ++static inline int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, ++ uint64_t *target) ++{ ++ g_assert_not_reached(); ++} ++ ++static inline int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, ++ uint64_t *source) ++{ ++ g_assert_not_reached(); ++} ++ + #endif + + static inline const char *gic_class_name(void) +@@ -535,7 +555,4 @@ static inline const char *its_class_name(void) + } + } + +-int kvm_arm_get_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *target); +-int kvm_arm_set_one_reg(ARMCPU *cpu, uint64_t regidx, uint64_t *source); +- + #endif +-- +2.27.0 +