740 Commits

Author SHA1 Message Date
Jinhua Cao
e6b080ac1b qemu-img create: cache paramter only use for reg file image
The paramter 'cache' is invalid for host device(/dev/xxx). If
'qemu-img create' operator performed on host device, the host
device not support 'cache' would result 'qemu-img create excute'
failed.

Signed-off-by: Jinhua Cao <caojinhua1@huawei.com>
2022-03-25 09:42:57 +08:00
openeuler-ci-bot
90ca3e03b4
!506 【6.2.0】增加qemu-hw-usb-host rpm包
From: @sujerry1991 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-03-24 14:13:54 +00:00
Yan Wang
513c8cd566 spec: add hw-usb-host rpm package
Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-03-24 21:27:17 +08:00
openeuler-ci-bot
171bef105c
!498 [sync] PR-492/497: spec: Update release version with !266 and support sw64
From: @yezengruan 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-03-18 12:30:34 +00:00
yezengruan
62e9a21b5b spec: Update release version with !266 and support sw64
Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-03-18 17:33:56 +08:00
jiang-dawei15
0a27da9d7f coro: support live patch for libcare
Description:
For coroutine live patch, we need find all coroutines stack and check them
before patching. There is no structure to manage all coroutines in qemu. So we
add a list which contain all running coroutines to accelerate libcare live
patch.

Signed-off-by: jiang-dawei15 <jiangdawei15@huawei.com>
Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-03-18 17:33:43 +08:00
yezengruan
518ee8d115 add patch for sw64 support
Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-03-18 17:33:24 +08:00
jiang-dawei15
d152a162e9 cflages: add cflags '-ftls-model=initial-exec'
This option changes the thread local storage (TLS) model. Thread-local storage
is a mechanism by which variables are allocated in a way that causes one instance
of the variable per extant thread.

i.global-dynamic

Generates a generic TLS code. The code can be used everywhere and the code can access
variables defined anywhere else. This setting causes the largest size code to be generated
and uses the most run time to produce.

ii.local-dynamic

Generates an optimized TLS code. To use this setting, the thread-local variables must be
defined in the same object in which they are referenced.

iii.initial-exec

Generates a restrictive, optimized TLS code. To use this setting, the thread-local variables
accessed must be defined in one of the modules available to the program.

iv.local-exec

Generates the most restrictive TLS code. To use this setting, the thread-local variables
must be defined in the executable.

Optimize qemu cflags with '-ftls-model=initial-exec' which means we use initial-exec
mode.
2022-03-18 17:33:11 +08:00
openeuler-ci-bot
399a7ea561
!494 spec: Update release version with !265
From: @yezengruan 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-03-17 01:01:58 +00:00
yezengruan
c14470a869 spec: Update release version with !265
Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-03-15 16:08:23 +08:00
yezengruan
2620fe57e4 sw_64: Add sw64 architecture support
Signed-off-by: Lu Feifei <lufeifei@wxiat.com>
Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-03-15 16:08:03 +08:00
openeuler-ci-bot
bd766c1586
!489 [sync] PR-487: qemu.spec: add "--enable-debug" parameter to configure.
From: @openeuler-sync-bot 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-03-14 12:08:39 +00:00
jiang-dawei15
5a7b38619c qemu.spec: add "--enable-debug" parameter to configure.
(cherry picked from commit 64b9ff905211b4a6f318d77e6183bac89873cf59)
2022-03-14 19:40:10 +08:00
openeuler-ci-bot
b32e27ba7b
!485 Automatically generate code patches with openeuler !263 !264
From: @kuhnchen18 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-03-03 10:05:37 +00:00
Chen Qun
807c25274e spec: Update release version with !263 !264
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2022-03-03 14:25:39 +08:00
Chen Qun
8f0f7098a7 spec: Update patch and changelog with !264 tools/virtiofsd: Add rseq syscall to the seccomp allowlist !264
tools/virtiofsd: Add rseq syscall to the seccomp allowlist

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-03 14:25:37 +08:00
Chen Qun
557ed01ca1 tools/virtiofsd: Add rseq syscall to the seccomp allowlist
The virtiofsd currently crashes when used with glibc 2.35.
That is due to the rseq system call being added to every thread
creation [1][2].

[1]: https://www.efficios.com/blog/2019/02/08/linux-restartable-sequences/
[2]: https://sourceware.org/pipermail/libc-alpha/2022-February/136040.html

This happens not at daemon start, but when a guest connects

    /usr/lib/qemu/virtiofsd -f --socket-path=/tmp/testvfsd -o sandbox=chroot \
        -o source=/var/guests/j-virtiofs --socket-group=kvm
    virtio_session_mount: Waiting for vhost-user socket connection...
    # start ok, now guest will connect
    virtio_session_mount: Received vhost-user socket connection
    virtio_loop: Entry
    fv_queue_set_started: qidx=0 started=1
    fv_queue_set_started: qidx=1 started=1
    Bad system call (core dumped)

We have to put rseq on the seccomp allowlist to avoid that the daemon
is crashing in this case.

Reported-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 20220209111456.3328420-1-christian.ehrhardt@canonical.com

[Moved rseq to its alphabetically ordered position in the seccomp
allowlist.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: qinyu <qinyu16@huawei.com>
2022-03-03 14:25:37 +08:00
Chen Qun
662474b374 spec: Update patch and changelog with !263 【6.2.0】修改object_unref导致的abort问题 !263
scsi-bus: fix unmatched object_unref()

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-03 14:25:34 +08:00
Chen Qun
f6bbae170f scsi-bus: fix unmatched object_unref()
Fix commit 391dd8f1("scsi-bus: Refactor the code that retries requests"),
which split scsi_dma_restart_bh(), but the object_unref() belongs to
scsi_dma_restart_bh().
So, we should mv object_unref() from scsi_retry_requests() to
scsi_dma_restart_bh().

Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-03-03 14:25:34 +08:00
openeuler-ci-bot
24fe510dd6
!481 generate code patches with openeuler !220
From: @sujerry1991 
Reviewed-by: @aven6, @imxcc 
Signed-off-by: @imxcc
2022-02-26 08:04:47 +00:00
Yan Wang
d7f970e80c spec: Update release version with !220
increase release version by one

Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 14:35:07 +08:00
Yan Wang
94fd281733 spec: Update patch and changelog with !220
pl011-reset-read-FIFO-when-UARTTIMSC-0-UARTICR-0xfff.patch
qcow2-fix-memory-leak-in-qcow2_read_extensions.patch
scsi-disk-define-props-in-scsi_block_disk-to-avoid-m.patch
pcie-Add-pcie-root-port-fast-plug-unplug-feature.patch
pcie-Compat-with-devices-which-do-not-support-Link-W.patch

Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 14:34:32 +08:00
Yan Wang
ecce9875ab pcie: Compat with devices which do not support Link Width, such as ioh3420
We hack into PCI_EXP_LNKCAP to support device fast plug/unplug
for pcie-root-port. However some devices like ioh3420 does not
suport it, so PCI_EXP_LNKCAP is not set for such devices.

Signed-off-by: Ying Fang <fangying1@huawei.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 14:32:58 +08:00
Yan Wang
f908c5e710 pcie: Add pcie-root-port fast plug/unplug feature
If a device is plugged in the pcie-root-port when VM kernel is
booting, the kernel may wrongly disable the device.
This bug was brought in by two patches of the linux kernel:

https://patchwork.kernel.org/patch/10575355/
https://patchwork.kernel.org/patch/10766219/

VM runtime like kata uses this feature to boot microVM,
so we must fix it up. We hack into the pcie native hotplug
patch so that hotplug/unplug will work under this circumstance.

Signed-off-by: Ying Fang <fangying1@huawei.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 14:32:45 +08:00
Yan Wang
0c448ce33d scsi-disk: define props in scsi_block_disk to avoid memleaks
scsi_block_realize() use scsi_realize() to init some props, but
these props is not defined in scsi_block_disk_properties, so they will
not be freed.

This patch defines these prop in scsi_block_disk_properties to avoid memleaks.

Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 11:29:26 +08:00
Yan Wang
17790cdc2f qcow2: fix memory leak in qcow2_read_extensions
Free feature_table if it is failed in bdrv_pread.

Signed-off-by: fangyi <eric.fangyi@huawei.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 11:29:16 +08:00
Yan Wang
c3bb66e65b pl011: reset read FIFO when UARTTIMSC=0 & UARTICR=0xffff
We can enable ACPI when AArch64 Linux is booted with QEMU and UEFI (AAVMF).
When VM is booting and the SBSA driver has not initialized, writting data
that exceds 32 bytes will cause the read FIFO full and proceeding data will
be lost. The searil port appears to be stuck in this abnormal situation.

A hack to reset read FIFO when UARTTIMSC=0 & UARTICR=0xffff appears to
resolve the issue.

The question is fully discussed at
https://www.spinics.net/lists/linux-serial/msg23163.html

Signed-off-by: Haibin Wang <wanghaibin.wang@huawei.com>
Reviewed-by: Shannon Zhao <shannon.zhaosl@gmail.com>
Reviewed-by: Ying Fang <fangying1@huawei.com>
Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-02-26 11:29:01 +08:00
openeuler-ci-bot
2fd41a5c69
!479 [sync] PR-478: generate code patches with openeuler !257
From: @openeuler-sync-bot 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-02-23 07:25:02 +00:00
Chen Qun
1ce6e87ae1 spec: Update release version with !257
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
(cherry picked from commit 185b204119d6955d15deaba8f441880eacfa3f8f)
2022-02-23 12:55:32 +08:00
Chen Qun
d4adf19f8c spec: Update patch and changelog with !257 add vcpu hotplug feature from 4.1 to 6.2 !257
acpi/madt: Factor out the building of MADT GICC struct
hw/arm/virt: Assign virt_madt_cpu_entry to acpi_ged madt_cpu hook
arm/virt/acpi: Factor out CPPC building from DSDT CPU aml
acpi/cpu: Prepare build_cpus_aml for arm virt
acpi/ged: Extend ACPI GED to support CPU hotplug
arm/cpu: assign arm_get_arch_id handler to get_arch_id hook
tests/acpi/bios-tables-test: Allow changes to virt/DSDT file
arm/virt: Attach ACPI CPU hotplug support to virt
tests/acpi/bios-table-test: Update expected virt/DSDT file
arm/virt: Add CPU hotplug framework
arm/virt: Add CPU topology support
test/numa: Adjust aarch64 numa test
hw/arm/virt: Factor out some CPU init codes to pre_plug hook
hw/arm/boot: Add manually register and trigger of CPU reset
arm/virt/gic: Construct irqs connection from create_gic
intc/gicv3_common: Factor out arm_gicv3_common_cpu_realize
intc/gicv3_cpuif: Factor out gicv3_init_one_cpuif
intc/kvm_gicv3: Factor out kvm_arm_gicv3_cpu_realize
hw/intc/gicv3: Add CPU hotplug realize hook
accel/kvm: Add pre-park vCPU support
intc/gicv3: Add pre-sizing capability to GICv3
acpi/madt: Add pre-sizing capability to MADT GICC struct
arm/virt: Add cpu_hotplug_enabled field
arm/virt/acpi: Extend cpufreq to support max_cpus
arm/virt: Pre-sizing MADT-GICC GICv3 and Pre-park KVM vCPU
arm/virt: Start up CPU hot-plug and cold-plug

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
(cherry picked from commit 9390aa07e450024769ceb3bb3ab481af8911a77b)
2022-02-23 12:55:32 +08:00
Chen Qun
860179a543 arm/virt: Start up CPU hot-plug and cold-plug
All the CPU hotplug facilities are ready. Assemble them
to start up CPU hot-plug capability for arm/virt.

This also adds CPU cold plug support to arm virt machine
board. CPU cold plug means adding CPU by using "-device
xx-arm-cpu" when we bring up Qemu.

Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit d5d118431a64c4202cb28c27bdea0f8667beb5dd)
2022-02-23 12:55:32 +08:00
Chen Qun
26277fa767 arm/virt: Pre-sizing MADT-GICC GICv3 and Pre-park KVM vCPU
Establish all pre-sizing facilities based on cpu_hotplug_enabled
field.

Note: PPTT is constructed for possible_cpus, so it does not need
to pre-sizing it.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit c01cf3e56182eea0b0a469a91ccbfcaf37c4c5e6)
2022-02-23 12:55:32 +08:00
Chen Qun
4bb9171009 arm/virt/acpi: Extend cpufreq to support max_cpus
We will support CPU hotplug soon, so extend memory region size to
allow hotplugged CPU access cpufreq space.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
(cherry picked from commit 53c60486a60b76be9e2afe04e53759cf5475dd57)
2022-02-23 12:55:32 +08:00
Chen Qun
73903a3ef8 arm/virt: Add cpu_hotplug_enabled field
Some conditions must be satisfied to support CPU hotplug, including
ACPI, GED, 64bit CPU, GICv3.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 7550d4ab290a6c114a528b867aacdf80207e211d)
2022-02-23 12:55:32 +08:00
Chen Qun
4486897ff7 acpi/madt: Add pre-sizing capability to MADT GICC struct
The count of possible CPUs is exposed to guest through the count
of MADT GICC struct, so we should pre-sizing MADT GICC too.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 101bb4ff32325cdc374719f006b6c5b24ff63d0d)
2022-02-23 12:55:32 +08:00
Chen Qun
4d7cf30087 intc/gicv3: Add pre-sizing capability to GICv3
Currently GICv3 supports fixed smp_cpus CPUs, and all CPUs are
present always. Now we want to pre-sizing GICv3 to support max_cpus
CPUs and not all of them are present always, so some sizing codes
should be concerned.

GIC irqs, GICR and GICC are pre-created for all possible CPUs at
start, but only smp_cpus CPUs are realize and irqs of smp_cpus CPUs
are connected.

Other code changes are mainly for arm_gicv3, and we do little about
kvm_arm_gicv3 becasue KVM will deal with the sizing information properly.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit cd6ddaa7a22579bd3caaaf323201cad55e1d1407)
2022-02-23 12:55:32 +08:00
Chen Qun
cb290972f1 accel/kvm: Add pre-park vCPU support
For that KVM do not support dynamic adjustment of vCPU count,
we must pre-park all possible vCPU at start.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 000c4a3d545146ee38ea4334fee3a93669c11b28)
2022-02-23 12:55:32 +08:00
Chen Qun
be00fe0fe3 hw/intc/gicv3: Add CPU hotplug realize hook
GICv3 exposes individual CPU realization capability through
this hook. It will be used for hotplugged CPU.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit e376844ee4fefdb6ffabb751d4d08363bc1a4faf)
2022-02-23 12:55:32 +08:00
Chen Qun
971729d5fb intc/kvm_gicv3: Factor out kvm_arm_gicv3_cpu_realize
The CPU object of hotplugged CPU will be defer-created (during
hotplug session), so we must factor out realization code to let
it can be applied to individual CPU.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 7b0dc0a49e5ea43bd4b4d85d3630db2efcbb493b)
2022-02-23 12:55:32 +08:00
Chen Qun
4f562e8fa1 intc/gicv3_cpuif: Factor out gicv3_init_one_cpuif
The CPU object of hotplugged CPU will be defer-created (during
hotplug session), so we must factor out some code to let it can
be applied to individual CPU.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 0583d886a2bfa994a8be64d678a54c333cc5377d)
2022-02-23 12:55:32 +08:00
Chen Qun
494cd14821 intc/gicv3_common: Factor out arm_gicv3_common_cpu_realize
The CPU object of hotplugged CPU will be defer-created (during
hotplug session), so we must factor out realization code to let
it can be applied to individual CPU.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 7e5f5b7ff26bc48205f47d8f29477a8587c71446)
2022-02-23 12:55:32 +08:00
Chen Qun
4a4c8273fc arm/virt/gic: Construct irqs connection from create_gic
Make the irqs can be connected to for individual CPU.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
(cherry picked from commit 6161210e01ad1c757e44b0a31c3424f770c9281a)
2022-02-23 12:55:32 +08:00
Chen Qun
33d00cea88 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-02-23 12:55:32 +08:00
Chen Qun
e6b9178be2 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-02-23 12:55:32 +08:00
Chen Qun
ced81a56f3 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-02-23 12:55:32 +08:00
Chen Qun
8a4141881a 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-02-23 12:55:32 +08:00
Chen Qun
c8668035f6 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-02-23 12:55:32 +08:00
Chen Qun
2f5a5868f6 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-02-23 12:55:32 +08:00
Chen Qun
e290842121 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-02-23 12:55:32 +08:00
Chen Qun
3137876cb9 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-02-23 12:55:32 +08:00