879 Commits

Author SHA1 Message Date
Chen Qun
2e230ae712 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 <lijiajie11@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
1baa6d2efe spec: Update patch and changelog with !260 [6.2.0] support date property for pl031 !260
pl031: support rtc-timer property for pl031

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
472d8c2cb0 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 <wanghaibin.wang@huawei.com>
Reviewed-by: Shannon Zhao <shanon.Zhaosl@gmail.com>
Reviewed-by: Ying Fang <fangying1@huawei.com>
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Jinhao Gao <gaojinhao@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
3e2685401c spec: Update patch and changelog with !259 【6.2.0】修复一些编译错误 !259
target/arm: Fix some compile errors

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
804749a374 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 <sundongxu3@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
cbb424f215 spec: Update patch and changelog with !258 Revert "qmp: add command to query used memslots of vhost-net and vhost-user" !258
Revert "qmp: add command to query used memslots of vhost-net and vhost-user"

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
355afc03cf Revert "qmp: add command to query used memslots of vhost-net and vhost-user"
This reverts commit 1545a60a8b78490c7dc8909b7012bca63dba63cd.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
imxcc
8a7a7c9d07 Update patch with openeuler !232
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:32 +08:00
imxcc
65b515392c bios-tables-test: Update expected q35/SSDT.dimmpxm file and add BinDir
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:32 +08:00
liuxiangdong
346bfd1ff3 feature: disable spice protocol
disable spice protocol in openEuler 22.03 TLS
2022-03-19 14:42:32 +08:00
Chen Qun
87f80897ce spec: Update release version with !253 !256
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
8cb8348f2c spec: Update patch and changelog with !256 【6.2.0】删除冗余的qemu_log !256
log: Delete redudant qemu_log

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
5bad885e2d log: Delete redudant qemu_log
Delete redudant qemu_log in qmp_dispatch()

Signed-off-by: Jingyi Wang <wangjingyi11@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
0a858db3c0 spec: Update patch and changelog with !253 qemu-img: add qemu-img direct create !253
qemu-img: add qemu-img direct create

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
1dd60910b1 qemu-img: add qemu-img direct create
Introdue buffer_size while creating raw file, then we
can controll the speed of direct write by:
    qemu-img create -t 'cache' -o buffer_size='num'

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
eillon
86062beb87 seabios: add check to avoid dereference NULL pointer 2022-03-19 14:42:32 +08:00
Chen Qun
f79cd68904 spec: Update release version with !248 !251 !249
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
005b0f92b7 spec: Update patch and changelog with !249 [6.2.0] backport a qemu_irq bugfix !249
bugfix: irq: Avoid covering object refcount of qemu_irq

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
78e85fa40c bugfix: irq: Avoid covering object refcount of qemu_irq
Avoid covering object refcount of qemu_irq, otherwise it may causes
memory leak.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
69b0de9c52 spec: Update patch and changelog with !251 vhost-user/qemu-img/virtio_net/pci/scsi补丁回合 !251
virtio-scsi: bugfix: fix qemu crash for hotplug scsi disk with dataplane
virtio: net-tap: bugfix: del net client if net_init_tap_one failed
virtio: bugfix: clean up callback when del virtqueue
virtio-net: bugfix: do not delete netdev before virtio net
virtio-net: fix max vring buf size when set ring num
virtio: check descriptor numbers
virtio: bugfix: add rcu_read_lock when vring_avail_idx is called
virtio: print the guest virtio_net features that host does not support
virtio: bugfix: check the value of caches before accessing it
virtio-net: set the max of queue size to 4096
virtio-net: update the default and max of rx/tx_queue_size
vhost-user: add unregister_savevm when vhost-user cleanup
qemu-img: block: dont blk_make_zero if discard_zeroes false
vhost-user: Add support reconnect vhost-user socket
vhost-user: Set the acked_features to vm's featrue
vhost-user: add vhost_set_mem_table when vm load_setup at destination
vhost-user: add separate memslot counter for vhost-user
vhost-user: quit infinite loop while used memslots is more than the backend limit
qmp: add command to query used memslots of vhost-net and vhost-user
vhost-user-scsi: add support for SPDK hot upgrade
i6300esb watchdog: bugfix: Add a runstate transition

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
6176fc3be0 i6300esb watchdog: bugfix: Add a runstate transition
QEMU will abort() for the reasons now:

    invalid runstate transition: 'prelaunch' -> 'postmigrate'
    Aborted

This happens when:
  |<- watchdog timeout happened, then sets reset_requested to
  |   SHUTDOWN_CAUSE_GUEST_RESET;
  |<- hot-migration thread sets vm state to RUN_STATE_FINISH_MIGRATE
  |   before the last time of migration;
  |<- main thread gets the change of reset_requested and triggers
  |   reset, then sets vm state to RUN_STATE_PRELAUNCH;
  |<- hot-migration thread sets vm state to RUN_STATE_POSTMIGRATE.

Then 'prelaunch' -> 'postmigrate' runstate transition will happen.
It is legal so add this transition to runstate_transitions_def.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
38cbd1be35 vhost-user-scsi: add support for SPDK hot upgrade
In the hot upgrade scenario, the reconnection mechanism of qemu and SPDK after upgrade

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
6e9963d521 qmp: add command to query used memslots of vhost-net and vhost-user
Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
3b29064bd8 vhost-user: quit infinite loop while used memslots is more than the backend limit
When used memslots is more than the backend limit,
the vhost-user netcard would attach fail and quit
infinite loop.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
ca34c7a2fe vhost-user: add separate memslot counter for vhost-user
Used_memslots is equal to dev->mem->nregions now, it is true for
vhost kernel, but not for vhost user, which uses the memory regions
that have file descriptor. In fact, not all of the memory regions
have file descriptor.
It is usefully in some scenarios, e.g. used_memslots is 8, and only
5 memory slots can be used by vhost user, it is failed to hot plug
a new memory RAM because vhost_has_free_slot just returned false,
but we can hot plug it safely in fact.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
97aa125a10 vhost-user: add vhost_set_mem_table when vm load_setup at destination
When migrate huge vm, packages lost are 90+.

During the load_setup of the destination vm, pass the
vm mem structure to ovs, the netcard could be enabled
when the migration finish state shifting.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
8bcfea21b4 vhost-user: Set the acked_features to vm's featrue
Fix the problem when vm restart, the ovs restart and lead to the net
unreachable. The soluation is set the acked_features to vm's featrue
just the same as guest virtio-net mod load.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
3158fa53b6 vhost-user: Add support reconnect vhost-user socket
Add support reconnect vhost-user socket, the reconnect time
is set to be 3 seconds.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
866997d963 qemu-img: block: dont blk_make_zero if discard_zeroes false
Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
25f5db2839 vhost-user: add unregister_savevm when vhost-user cleanup
Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
2b5d913b53 virtio-net: update the default and max of rx/tx_queue_size
Set the max of tx_queue_size to 4096 even if the backends
are not vhost-user.

Set the default of rx/tx_queue_size to 2048 if the backends
are vhost-user, otherwise to 4096.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
533a0f0fd7 virtio-net: set the max of queue size to 4096
Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
c0e69b781c virtio: bugfix: check the value of caches before accessing it
Vring caches may be NULL in check_vring_avail_num() if
virtio_reset() is called at the same time, such as when
the virtual machine starts.
So check it before accessing it in vring_avail_idx().

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
ca01e036b8 virtio: print the guest virtio_net features that host does not support
Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
16b7f98db0 virtio: bugfix: add rcu_read_lock when vring_avail_idx is called
viring_avail_idx should be called within rcu_read_lock(),
or may get NULL caches in vring_get_region_caches() and
trigger assert().

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
c98857b3fa virtio: check descriptor numbers
Check if the vring num is normal in virtio_save(), and add LOG
the vm push the wrong viring num down through writing IO Port.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
cc847c6023 virtio-net: fix max vring buf size when set ring num
Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
4fb0b966ec virtio-net: bugfix: do not delete netdev before virtio net
For the vhost-user net-card, it is allow to delete its
network backend while the virtio-net device still exists.
However, when the status of the device changes in guest,
QEMU will check whether the network backend exists, otherwise
it will crash.
So do not allowed to delete the network backend directly
without delete virtio-net device.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
c86cebdfb5 virtio: bugfix: clean up callback when del virtqueue
We will access NULL pointer as follow:
1. Start a vm with multiqueue vhost-net
2. then we write VIRTIO_PCI_GUEST_FEATURES in PCI configuration to
   trigger multiqueue disable in this vm which will delete the virtqueue.
   In this step, the tx_bh is deleted but the callback virtio_net_handle_tx_bh
   still exist.
3. Finally, we write VIRTIO_PCI_QUEUE_NOTIFY in PCI configuration to
   notify the deleted virtqueue. In this way, virtio_net_handle_tx_bh
   will be called and qemu will be crashed.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
c7155d3353 virtio: net-tap: bugfix: del net client if net_init_tap_one failed
In net_init_tap_one(), if the net-tap initializes successful
but other actions failed during vhost-net hot-plugging, the
net-tap will remain in the net clients.causing next hot-plug
fails again.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
a55dd0838d virtio-scsi: bugfix: fix qemu crash for hotplug scsi disk with dataplane
The vm will trigger a disk sweep operation after plugging
a controller who's io type is iothread.  If attach a scsi
disk immediately, the sg_inqury request in vm will trigger
the assert in virtio_scsi_ctx_check(), which is called by
virtio_scsi_handle_cmd_req_prepare().

Add judgment in virtio_scsi_handle_cmd_req_prepare() and
return IO Error directly if the device has not been
initialized.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
49f96694c5 spec: Update patch and changelog with !248 【6.2.0】内存泄露及部分IO相关bugfix回合 !248
bugfix: fix some illegal memory access and memory leak
bugfix: fix possible memory leak
bugfix: fix eventfds may double free when vm_id reused in ivshmem
block/mirror: fix file-system went to read-only after block-mirror
bugfix: fix mmio information leak and ehci vm escape 0-day vulnerability
target-i386: Fix the RES memory inc which caused by the coroutine created

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
dcd9c3d752 target-i386: Fix the RES memory inc which caused by the coroutine created
for better performance, change the POOL_BATCH_SIZE from 64 to 128.

Signed-off-by: caojinhua <caojinhua1@huawei.com>
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
e7a1c5d229 bugfix: fix mmio information leak and ehci vm escape 0-day vulnerability
Signed-off-by: Yutao Ai <aiyutao@huawei.com>
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
6bfd0edc7b block/mirror: fix file-system went to read-only after block-mirror
config vm disk with prdm, keep the disk writing data continuously
during block-mirror, the file-system will went to read-only after
block-mirror, fix it.

Signed-off-by: caojinhua <caojinhua1@huawei.com>
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
4dc229df1a bugfix: fix eventfds may double free when vm_id reused in ivshmem
As the ivshmem Server-Client Protol describes, when a
client disconnects from the server, server sends disconnect
notifications to the other clients. And the other clients
will free the eventfds of the disconnected client according
to the client ID. If the client ID is reused, the eventfds
may be double freed.

It will be solved by setting eventfds to NULL after freeing
and allocating memory for it when it's used.

Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
9c3e999acd bugfix: fix possible memory leak
Signed-off-by: caojinhua <caojinhua1@huawei.com>
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
39d3f0f0a3 bugfix: fix some illegal memory access and memory leak
Signed-off-by: yuxiating <yuxiating@huawei.com>
Signed-off-by: jiangdongxu <jiangdongxu1@huawei.com>
2022-03-19 14:42:32 +08:00
imxcc
6e7dfc22ee Update with openeuler !235
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
e6f6fe87dd spec: Update release version with !245 !247 !243
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Signed-off-by: imxcc <xingchaochao@huawei.com>
(cherry picked from commit bfee3ac59d622c963cbbcc9d937baa09de2c3691)
2022-03-19 14:42:32 +08:00