695 Commits

Author SHA1 Message Date
Chen Qun
c78f79898b hw/arm/boot: Add manually register and trigger of CPU reset
We need to register and trigger CPU reset manually for hotplugged
CPU. Besides, we gather CPU reset handlers of all CPUs because CPU
reset should happen before GIC reset.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit e38ab50a87d6f581d282e606ac12db5e8238c1e1)
2022-03-19 14:42:32 +08:00
Chen Qun
714d5e6ecc hw/arm/virt: Factor out some CPU init codes to pre_plug hook
The init path of hotplugged CPU is pre_plug/realize/plug, so we
must move these init code in machvirt_init to pre_plug hook, to
let them be shared by all CPUs.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 3587e6e0654962090fdfbae30485c0355f1a9faf)
2022-03-19 14:42:32 +08:00
Chen Qun
e764a80376 test/numa: Adjust aarch64 numa test
We have supported topology for arm/virt in previous patch, which
changes the meaning of "thread-id", so we must modify test case.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit 61bc7026130c63f054fa97f59b48e068f0210b79)
2022-03-19 14:42:32 +08:00
Chen Qun
c15025d5ed arm/virt: Add CPU topology support
The CPU topology specified by user (through -smp options) is used in
ACPI PPTT. Now we will use this information to locate which CPU to
plug or unplug.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit f53ccf3efe6b1894a4a38dd5acae724b9036cbda)
2022-03-19 14:42:32 +08:00
Chen Qun
cfbdd7e3d7 arm/virt: Add CPU hotplug framework
Establish the CPU hotplug framework for arm/virt, we will add
necessary code legs to this framework gradually to realize CPU
hotplug finally.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 9dfe0cc4e9970f93b817068efd0bd6e0d98ca0b2)
2022-03-19 14:42:32 +08:00
Chen Qun
5d3abd0f50 tests/acpi/bios-table-test: Update expected virt/DSDT file
Update DSDT binary and empty bios-tables-test-allowd-diff.h

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit 3a8ad66a61be0eb162e34929698c3a040b515f51)
2022-03-19 14:42:32 +08:00
Chen Qun
faf4d53197 arm/virt: Attach ACPI CPU hotplug support to virt
Attach cpus aml building and GED support for CPU hotplug to
arm/virt, but currently we make it diabled by not add CPU
hotplug event to GED.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit dc9cea17499b378bde70f3854786ba56daf6a09a)
2022-03-19 14:42:32 +08:00
Chen Qun
898cc2ace9 tests/acpi/bios-tables-test: Allow changes to virt/DSDT file
Let virt/DSDT as the expected file allowed to be changed.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit d160f3e1e3737c47558c1f7908ddbd6cf188b3ff)
2022-03-19 14:42:32 +08:00
Chen Qun
cae9c05f75 arm/cpu: assign arm_get_arch_id handler to get_arch_id hook
This hook will be called in get_cpu_status, which is called
during cpu hotplug.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit dc4b675a897d6094b60ef462482e03b2905e1737)
2022-03-19 14:42:32 +08:00
Chen Qun
4403220eda acpi/ged: Extend ACPI GED to support CPU hotplug
This adds a new GED event called ACPI_GED_CPU_HOTPLUG_EVT.
The basic workflow is that: GED sends this event to guest,
then ACPI driver in guest will call _EVT method of GED aml,
then _EVT will call CSCN method in cpus aml to get status of
all cpus.

The status of cpus is maintained by CPUHotplugState in GED and
is made accessable to guest through memory region.

This also adds migration support to CPUHotplugState.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit a072cbe5beab53e9328c2fe6576e755e88b2c40a)
2022-03-19 14:42:32 +08:00
Chen Qun
4ff4e11676 acpi/cpu: Prepare build_cpus_aml for arm virt
We will reuse build_cpus_aml to build DSDT cpus aml in arm/virt
ACPI to realize cpu hotplug. Three points are added.

1. Make ACPI IO address space configurable, because ARM64 platforms
   don't use port IO for ACPI IO space.
2. Add GICC struct building support in _MAT of cpu aml.
3. Let the hotplug method parameter can be NULL, because ACPI GED
   will realize it.

Besides, CPU CPPC building is injected.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 4d7c437b4d1a8ac175e7b9224a9e402b619d6cd3)
2022-03-19 14:42:32 +08:00
Chen Qun
93d916fe7d arm/virt/acpi: Factor out CPPC building from DSDT CPU aml
When CPU hotplug is enabled, we will use build_cpus_aml instead of
acpi_dsdt_add_cpus, so factor out CPPC building and we can reuse it
in build_cpus_aml.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit c6b2e91699e31e3473e94d86d9c8db767f0ebb59)
2022-03-19 14:42:32 +08:00
Chen Qun
1906aad039 hw/arm/virt: Assign virt_madt_cpu_entry to acpi_ged madt_cpu hook
In build_cpus_aml, we will invoke this hook to build _MAT
aml mehtod for cpus.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 80bcd0313ba67d5c4439030c96c26aee1d9288f9)
2022-03-19 14:42:32 +08:00
Chen Qun
e207f53959 acpi/madt: Factor out the building of MADT GICC struct
To realize CPU hotplug, the cpus aml within ACPI DSDT should contain
_MAT mathod, which is equal to the GICC struct in ACPI MADT. Factor
out the GICC building code from ACPI MADT and reuse it in build_cpus_aml.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit f2b68e8adc98f8db20b1edc84b8f485975ed987c)
2022-03-19 14:42:32 +08:00
Chen Qun
e9c6f6222c spec: Update release version with !258 !259 !260 !261
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
Chen Qun
041f275d36 spec: Update patch and changelog with !261 【内存相关补丁】修复全平台编译报错 !261
i386/cpu: fix compile error in all target configure

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:32 +08:00
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