Let virt/DSDT as the expected file allowed to be changed.
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit d160f3e1e3737c47558c1f7908ddbd6cf188b3ff)
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)
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)
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)
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)
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)
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)
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>