701 Commits

Author SHA1 Message Date
Chen Qun
2b32a865ed target/arm: parse cpu feature related options
The implementation of CPUClass::parse_features only supports CPU
features in "feature=value" format.  However, libvirt maybe send us a
CPU feature string in "+feature/-feature" format.  Hence, we need to
override CPUClass::parse_features to support CPU feature string in both
"feature=value" and "+feature/-feature" format.

The logic of AArch64CPUClass::parse_features is similar to that of
X86CPUClass::parse_features.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Signed-off-by: Dongxu Sun <sundongxu3@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
9604fd9462 target/arm: convert isar regs to array
The isar in ARMCPU is a struct, each field of which represents an ID
register.  It's not convenient for us to support CPU feature in AArch64.
So let's change it to an array first and add an enum as the index of the
array for convenience.  Since we will never access high 32-bits of ID
registers in AArch32, it's harmless to change the ID registers in
AArch32 to 64-bits.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
Signed-off-by: Dongxu Sun <sundongxu3@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
02d6bdafd7 spec: Update patch and changelog with !241 x86 cache透传优化补丁回合 !241
i386: cache passthrough: Update Intel CPUID4.EAX[25:14] based on vCPU topo
i386: cache passthrough: Update AMD 8000_001D.EAX[25:14] based on vCPU topo

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
4cb2eaa9a9 i386: cache passthrough: Update AMD 8000_001D.EAX[25:14] based on vCPU topo
On AMD target, when host cache passthrough is disabled we will
emulate the guest caches with default values and initialize the
shared cpu list of the caches based on vCPU topology. However
when host cache passthrough is enabled, the shared cpu list is
consistent with host regardless what the vCPU topology is.

For example, when cache passthrough is enabled, running a guest
with vThreads=1 on a host with pThreads=2, we will get that there
are every *two* logical vCPUs sharing a L1/L2 cache, which is not
consistent with the vCPU topology (vThreads=1).

So let's reinitialize BITs[25:14] of AMD CPUID 8000_001D.EAX
based on the actual vCPU topology instead of host pCPU topology.

Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
0532b39a49 i386: cache passthrough: Update Intel CPUID4.EAX[25:14] based on vCPU topo
On Intel target, when host cache passthrough is disabled we will
emulate the guest caches with default values and initialize the
shared cpu list of the caches based on vCPU topology. However when
host cache passthrough is enabled, the shared cpu list is consistent
with host regardless what the vCPU topology is.

For example, when cache passthrough is enabled, running a guest
with vThreads=1 on a host with pThreads=2, we will get that there
are every *two* logical vCPUs sharing a L1/L2 cache, which is not
consistent with the vCPU topology (vThreads=1).

So let's reinitialize BITs[25:14] of Intel CPUID 4 based on the
actual vCPU topology instead of host pCPU topology.

Signed-off-by: Jian Wang <wangjian161@huawei.com>
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
9d233e7b1d spec: Update patch and changelog with !233 【6.2.0】IO补丁回合 !233
nbd/server.c: fix invalid read after client was already free
qemu-nbd: make native as the default aio mode
qemu-nbd: set timeout to qemu-nbd socket
qemu-pr: fixed ioctl failed for multipath disk
block: enable cache mode of empty cdrom
block: disallow block jobs when there is a BDRV_O_INACTIVE flag
scsi: cdrom: Fix crash after remote cdrom detached
block: bugfix: disable process AIO when attach scsi disk
block: bugfix: Don't pause vm when NOSPACE EIO happened
scsi: bugfix: fix division by zero

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
f4bc48e577 scsi: bugfix: fix division by zero
Error of PRDM disk may cause divide by zero in
scsi_read_complete(), so add LOG and assert().

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
f9ee5bf0c7 block: bugfix: Don't pause vm when NOSPACE EIO happened
When backend disk is FULL and disk IO type is 'dataplane',
QEMU will pause the vm, and this may cause endless-loop in
QEMU main thread if we do the snapshot merge now.

When backend disk is FULL, only reporting an error rather
than pausing the virtual machine.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
9285ceab91 block: bugfix: disable process AIO when attach scsi disk
When initializing the virtio-scsi disk, hd_geometry_guess() will
be called to process AIO.  At this time, the scsi disk has not
been fully initialized, and some fields in struct SCSIDiskState,
such as vendor and version, are NULL.  If processing AIO at this
time, qemu may crash down.

Add aio_disable_external() before hd_geometry_guess() to disable
processing AIO at that time.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
b92432f462 scsi: cdrom: Fix crash after remote cdrom detached
There is a small window between the twice blk_is_available in
scsi_disk_emulate_command which would cause crash due to the later
assertion if the remote cdrom is detached in this window.

So this patch replaces assertions with return to avoid qemu crash.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
e6eb2724a2 block: disallow block jobs when there is a BDRV_O_INACTIVE flag
Currently, migration will put a BDRV_O_INACTIVE flag
on bs's open_flags until another resume being called. In that case,
any IO from vm or block jobs will cause a qemu crash with an assert
'assert(!(bs->open_flags & BDRV_O_INACTIVE))' failure in bdrv_co_pwritev
function. we hereby disallow block jobs by faking a blocker.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
05acb1318d block: enable cache mode of empty cdrom
enable cache mode even if cdrom is empty

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
95206472cc qemu-pr: fixed ioctl failed for multipath disk
We use ioctl to detect multipath devices.  However, we only set flags in
struct dm_ioctl (the argument to ioctl) and left other fields in random,
which may cause the failure of calling ioctl.  Hence, we set other
fields to 0 to avoid the failure.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
5f9b6047bd qemu-nbd: set timeout to qemu-nbd socket
In case of insufficient memory and kill-9,
the NBD socket cannot be processed and stuck all the time.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
ec87f83a2e qemu-nbd: make native as the default aio mode
When the file system is dealing with multithreading concurrent writing to a file,
the performance will be degraded because of the lock.
At present, the default AIO mode of QEMU NBD is threads. In the case of large blocks,
because IO is divided into small pieces and multiple queues, it will become multithreading
concurrent writing the same file. Due to the file system, the performance will be greatly reduced.
If you change to native mode, this problem will not exist.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
3f9841ed96 nbd/server.c: fix invalid read after client was already free
In the process of NBD equipment pressurization, executing QEMU NBD will
lead to the failure of IO distribution and go to NBD_ Out process of trip().
If two or more IO go to the out process, client NBD will release in nbd_request_put().
The user after free problem that is read again in close().
Through the NBD_ Save the value of client > closing before the out process in trip
to solve the use after free problem.

Signed-off-by: wangjian161 <wangjian161@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
42a3ff7919 Update Release with openeuler !226 !231 !227 !228
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
92f8ca0f24 Update patch and changelog with openeuler !228
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
54733e3d90 Update patch and changelog with openeuler !227
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
baab1dcfbb Update patch and changelog with openeuler !231
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
f0de605f36 Update patch and changelog with openeuler !226
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
Yan Wang
1dfcba926c log: disable qemu_log function for "make check V=1"
Lots of patches will use qemu_log, it will cause "make check V=1"
failure. So disable qemu_log when calling "make check V=1".

Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-03-19 14:42:31 +08:00
Yan Wang
cb1e6efc6e chardev/baum: disable unused brlapi
disable unused brlapi.

Signed-off-by: Yan Wang <wangyan122@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
aca5683fc4 Update with openEuler !230
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
imxcc
6b0777d910 sync from openeuler/pulls/221 and 222
Signed-off-by: imxcc <xingchaochao@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
8dba2ce743 spec: Update release version with !225
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
d52f975c7d spec: Update patch and changelog with !225 回合openEuler CPU model 自研patch Merge pull request !225 from limingwang/qemu-6.2.0 !225
cpu: parse +/- feature to avoid failure
cpu: add Kunpeng-920 cpu support
cpu: add Cortex-A72 processor kvm target support
add Phytium's CPU models: FT-2000+ and Tengyun-S2500.

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
ac48c0f1e8 add Phytium's CPU models: FT-2000+ and Tengyun-S2500.
Signed-off-by: Jiadong Zeng <zengjiadong@phytium.com.cn>
Signed-off-by: Mingwang Li <limingwang@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
a06c9a7f18 cpu: add Cortex-A72 processor kvm target support
The ARM Cortex-A72 is ARMv8-A micro-architecture,
add kvm target to ARM Cortex-A72 processor definition.

Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
Signed-off-by: Mingwang Li <limingwang@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
324e05ef61 cpu: add Kunpeng-920 cpu support
Add the Kunpeng-920 CPU model

Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
Signed-off-by: Mingwang Li <limingwang@huawei.com>
2022-03-19 14:42:31 +08:00
Chen Qun
5f141f43f0 cpu: parse +/- feature to avoid failure
To avoid cpu feature parse failure, +/- feature is added.

Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
Signed-off-by: Mingwang Li <limingwang@huawei.com>
2022-03-19 14:42:31 +08:00
liuxiangdong
db2c567699 qemu-6.2.0 compilation init
add net-dump.c-Suppress-spurious-compiler-warning.patch
2022-03-19 14:34:46 +08:00
liuxiangdong
787ea25064 Package init
Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-03-19 14:31:23 +08:00
openeuler-ci-bot
cff59dc576
!411 Automatically generate code patches with openeuler !208 !213 !211
Merge pull request !411 from KuhnChen/master
2022-01-18 08:41:57 +00:00
Chen Qun
ff7588196f spec: Update release version with !208 !213 !211
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-12-21 21:28:08 +08:00
Chen Qun
e61a706223 spec: Update patch and changelog with !211 add Phytium's CPU models: FT-2000+ and Tengyun-S2500. Merge pull request !211 from 曾佳栋/qemu-4.1.0 !211
add Phytium's CPU models: FT-2000+ and Tengyun-S2500.

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-12-21 21:28:05 +08:00
Chen Qun
8a4ebc892a add Phytium's CPU models: FT-2000+ and Tengyun-S2500.
Signed-off-by: Jiadong Zeng <zengjiadong@phytium.com.cn>
2021-12-21 21:28:05 +08:00
Chen Qun
005d9d40c2 spec: Update patch and changelog with !213 virtio-balloon: apply upstream patch. !213
virtio-balloon: apply upstream patch.

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-12-21 21:28:03 +08:00
Chen Qun
7941e858a5 virtio-balloon: apply upstream patch.
Signed-off-by: Ming Yang <yangming73@huawei.com>
2021-12-21 21:28:03 +08:00
Chen Qun
14a75ddc3c spec: Update patch and changelog with !208 sync from SP1 !208
fix cve-2020-35504
fix cve-2020-35505

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-12-21 21:28:00 +08:00
Chen Qun
da2b6f4f92 fix cve-2020-35505
esp: ensure cmdfifo is not empty and current_dev is non-NULL

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: imxcc <xingchaochao@huawei.com>
2021-12-21 21:28:00 +08:00
Chen Qun
a327e9e928 fix cve-2020-35504
esp: always check current_req is not NULL before use in DMA callbacks

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: imxcc <xingchaochao@huawei.com>
2021-12-21 21:28:00 +08:00
openeuler-ci-bot
774b9773fa !393 修复qemu的3个cve:cve-2021-3592 cve-2021-3593 cve-2021-3595
From: @bobychen
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-10-27 02:38:56 +00:00
bobychen
5a2a43fcb1 fix cve-2021-3592 cve-2021-3593 cve-2021-3595
fix submodule slirp cve-2021-3592 cve-2021-3593 and cve-2021-3595

Signed-off-by: imxcc <xingchaochao@huawei.com>
Signed-off-by: bobychen <boby.chen@huawei.com>
2021-10-27 09:23:26 +08:00
openeuler-ci-bot
867add67af !380 Automatically generate code patches with openeuler !204
From: @kuhnchen18
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-09-26 09:38:47 +00:00
Chen Qun
19a7a3c4d7 spec: Update release version with !204
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-09-26 16:28:48 +08:00
Chen Qun
37d0d9e897 spec: Update patch and changelog with !204 fix CVE-2021-3748 !204
virtio-net: fix use after unmap/free for sg

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-09-26 16:28:36 +08:00
Chen Qun
d22f4b0b0c virtio-net: fix use after unmap/free for sg
When mergeable buffer is enabled, we try to set the num_buffers after
the virtqueue elem has been unmapped. This will lead several issues,
E.g a use after free when the descriptor has an address which belongs
to the non direct access region. In this case we use bounce buffer
that is allocated during address_space_map() and freed during
address_space_unmap().

Fixing this by storing the elems temporarily in an array and delay the
unmap after we set the the num_buffers.

This addresses CVE-2021-3748.

Reported-by: Alexander Bulekov <alxndr@bu.edu>
Fixes: fbe78f4f55c6 ("virtio-net support")
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: imxcc <xingchaochao@huawei.com>
2021-09-26 16:28:35 +08:00
openeuler-ci-bot
9b3e5f5993 !375 Automatically generate code patches with openeuler !199
From: @kuhnchen18
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-09-16 07:13:21 +00:00
Chen Qun
0aee04daf1 spec: Update release version with !199
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-09-16 11:27:46 +08:00