[PATCH v2 2/2] hw/riscv: Make CPU config error handling generous (sifive_e/u/opentitan)

2022-05-13 Thread Tsukasa OI
If specified CPU configuration is not valid, not just it prints error message, it aborts and generates core dumps (depends on the operating system). This kind of error handling should be used only when a serious runtime error occurs. This commit makes error handling on CPU configuration more gene

[PATCH v3 0/3] thread-pool: fix performance regression

2022-05-13 Thread Paolo Bonzini
Together, these two patches fix the performance regression induced by QemuSemaphore; individually they don't though. The third patch is a small cleanup on top, that was enabled by the recent introduction of min_threads/max_threads knobs for the thread pool. 6.2: iops: min=58051, max=62

[PATCH v3 0/3] thread-pool: fix performance regression

2022-05-13 Thread Paolo Bonzini
Together, these two patches fix the performance regression induced by QemuSemaphore; individually they don't though. The third patch is a small cleanup on top, that was enabled by the recent introduction of min_threads/max_threads knobs for the thread pool. 6.2: iops: min=58051, max=62

[PATCH v2 1/2] hw/riscv: Make CPU config error handling generous (virt/spike)

2022-05-13 Thread Tsukasa OI
If specified CPU configuration is not valid, not just it prints error message, it aborts and generates core dumps (depends on the operating system). This kind of error handling should be used only when a serious runtime error occurs. This commit makes error handling on CPU configuration more gene

[PATCH v3 3/3] thread-pool: remove stopping variable

2022-05-13 Thread Paolo Bonzini
Just setting the max threads to 0 is enough to stop all workers. Signed-off-by: Paolo Bonzini --- util/thread-pool.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/util/thread-pool.c b/util/thread-pool.c index 6bbf24754a..507c998827 100644 --- a/util/thread-pool.c +++ b

[PATCH v2 0/2] hw/riscv: Make CPU config error handling generous

2022-05-13 Thread Tsukasa OI
c.f. This patchset is functionally equivalent to v1 but fixes commit titles. Tsukasa OI (2): hw/riscv: Make CPU config error handling generous (virt/spike) hw/riscv: Make CPU config error handling generous (sifive_e/

[PATCH] configure: remove duplicate help messages

2022-05-13 Thread Paolo Bonzini
These messages are already emitted by scripts/meson-parse-buildoptions.sh. Signed-off-by: Paolo Bonzini --- configure | 4 1 file changed, 4 deletions(-) diff --git a/configure b/configure index dda25f05bf..0cc8c876f7 100755 --- a/configure +++ b/configure @@ -1043,10 +1043,6 @@ Advanced o

[PATCH] configure: remove duplicate help messages

2022-05-13 Thread Paolo Bonzini
These messages are already emitted by scripts/meson-parse-buildoptions.sh. Signed-off-by: Paolo Bonzini --- configure | 4 1 file changed, 4 deletions(-) diff --git a/configure b/configure index dda25f05bf..0cc8c876f7 100755 --- a/configure +++ b/configure @@ -1043,10 +1043,6 @@ Advanced o

Re: [PATCH] hw/intc: Pass correct hartid while updating mtimecmp

2022-05-13 Thread Anup Patel
On Sat, May 14, 2022 at 3:45 AM Atish Patra wrote: > > timecmp update function should be invoked with hartid for which > timecmp is being updated. The following patch passes the incorrect > hartid to the update function. > > Fixes: e2f01f3c2e13 ("hw/intc: Make RISC-V ACLINT mtime MMIO register >

[PATCH v6 resend 2/4] virtio: get class_id and pci device id by the virtio id

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Add helpers to get the "Transitional PCI Device ID" and "class_id" of the device specified by the "Virtio Device ID". These helpers will be used to build the generic vDPA device later. Signed-off-by: Longpeng --- hw/virtio/virtio-pci.c | 88 +

[PATCH v6 resend 0/4] add generic vDPA device support

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Hi guys, With the generic vDPA device, QEMU won't need to touch the device types any more, such like vfio. We can use the generic vDPA device as follow: -device vhost-vdpa-device-pci,vhostdev=/dev/vhost-vdpa-X Or -M microvm -m 512m -smp 2 -kernel ... -initrd ... -device \

[PATCH v6 resend 3/4] vdpa: add vdpa-dev support

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Supports vdpa-dev, we can use the deivce directly: -M microvm -m 512m -smp 2 -kernel ... -initrd ... -device \ vhost-vdpa-device,vhostdev=/dev/vhost-vdpa-x Signed-off-by: Longpeng --- hw/virtio/Kconfig| 5 + hw/virtio/meson.build| 1 + hw/virtio/vdpa-dev

[PATCH v6 resend 1/4] linux-headers: Update headers to Linux 5.18-rc6

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Update headers to 5.18-rc6. I need latest vhost changes. Signed-off-by: Longpeng --- linux-headers/linux/vhost.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index c998860d7b..5d99e7c242 100644 --- a/linux-h

[PATCH v6 4/4] vdpa: add vdpa-dev-pci support

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Supports vdpa-dev-pci, we can use the device as follow: -device vhost-vdpa-device-pci,vhostdev=/dev/vhost-vdpa-X Reviewed-by: Stefano Garzarella Signed-off-by: Longpeng --- hw/virtio/meson.build| 1 + hw/virtio/vdpa-dev-pci.c | 102 +++

[PATCH v6 resend 4/4] vdpa: add vdpa-dev-pci support

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Supports vdpa-dev-pci, we can use the device as follow: -device vhost-vdpa-device-pci,vhostdev=/dev/vhost-vdpa-X Reviewed-by: Stefano Garzarella Signed-off-by: Longpeng --- hw/virtio/meson.build| 1 + hw/virtio/vdpa-dev-pci.c | 102 +++

[PATCH v6 2/4] virtio: get class_id and pci device id by the virtio id

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Add helpers to get the "Transitional PCI Device ID" and "class_id" of the device specified by the "Virtio Device ID". These helpers will be used to build the generic vDPA device later. Signed-off-by: Longpeng --- hw/virtio/virtio-pci.c | 101

[PATCH v6 1/4] linux-headers: Update headers to Linux 5.18-rc6

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Update headers to 5.18-rc6. I need latest vhost changes. Signed-off-by: Longpeng --- linux-headers/linux/vhost.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h index c998860d7b..5d99e7c242 100644 --- a/linux-h

[PATCH v6 3/4] vdpa: add vdpa-dev support

2022-05-13 Thread Longpeng(Mike)
From: Longpeng Supports vdpa-dev, we can use the deivce directly: -M microvm -m 512m -smp 2 -kernel ... -initrd ... -device \ vhost-vdpa-device,vhostdev=/dev/vhost-vdpa-x Signed-off-by: Longpeng --- hw/virtio/Kconfig| 5 + hw/virtio/meson.build| 1 + hw/virtio/vdpa-dev

[PATCH v6 0/4] add generic vDPA device support

2022-05-13 Thread Longpeng(Mike)
From: Longpeng i guys, With the generic vDPA device, QEMU won't need to touch the device types any more, such like vfio. We can use the generic vDPA device as follow: -device vhost-vdpa-device-pci,vhostdev=/dev/vhost-vdpa-X Or -M microvm -m 512m -smp 2 -kernel ... -initrd ... -device \

Re: [PATCH] hw/intc: Pass correct hartid while updating mtimecmp

2022-05-13 Thread Frank Chang
Reviewed-by: Frank Chang On Sat, May 14, 2022 at 6:15 AM Atish Patra wrote: > timecmp update function should be invoked with hartid for which > timecmp is being updated. The following patch passes the incorrect > hartid to the update function. > > Fixes: e2f01f3c2e13 ("hw/intc: Make RISC-V ACLI

[PATCH] whpx: Added support for saving/restoring VM state

2022-05-13 Thread Ivan Shcherbakov
This patch adds support for the savevm/loadvm commands when using WHPX. It saves the XSAVE state and the relevant internal registers that were not otherwise captured into a separate "whpx/cpustate" object in the snapshot, and restores them when the snapshot is loaded. Note that due to the XSAVE f

[PATCH] whpx: Added support for saving/restoring VM state

2022-05-13 Thread Ivan Shcherbakov
This patch adds support for the savevm/loadvm commands when using WHPX. It saves the XSAVE state and the relevant internal registers that were not otherwise captured into a separate "whpx/cpustate" object in the snapshot, and restores them when the snapshot is loaded. Note that due to the

[PATCH v6 9/9] crypto: Introduce RSA algorithm

2022-05-13 Thread zhenwei pi
There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and

[PATCH v6 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 Thread zhenwei pi
From: Lei He Implement RSA algorithm by hogweed from nettle. Thus QEMU supports a 'real' RSA backend to handle request from guest side. It's important to test RSA offload case without OS & hardware requirement. Signed-off-by: lei he Signed-off-by: zhenwei pi --- crypto/akcipher-nettle.c.inc |

[PATCH v6 8/9] tests/crypto: Add test suite for RSA keys

2022-05-13 Thread zhenwei pi
From: Lei He As Daniel suggested, Add tests suite for rsakey, as a way to prove that we can handle DER errors correctly. Signed-off-by: zhenwei pi Signed-off-by: lei he Reviewed-by: Daniel P. Berrangé --- tests/unit/test-crypto-akcipher.c | 285 +- 1 file changed,

[PATCH v6 6/9] crypto: Implement RSA algorithm by gcrypt

2022-05-13 Thread zhenwei pi
From: Lei He Added gcryt implementation of RSA algorithm, RSA algorithm implemented by gcrypt has a higher priority than nettle because it supports raw padding. Signed-off-by: zhenwei pi Signed-off-by: lei he --- crypto/akcipher-gcrypt.c.inc | 597 +++ crypto/a

[PATCH v6 7/9] test/crypto: Add test suite for crypto akcipher

2022-05-13 Thread zhenwei pi
From: Lei He Add unit test and benchmark test for crypto akcipher. Signed-off-by: lei he Signed-off-by: zhenwei pi Reviewed-by: Daniel P. Berrangé --- tests/bench/benchmark-crypto-akcipher.c | 157 ++ tests/bench/meson.build | 1 + tests/bench/test_akcipher_keys.inc

[PATCH v6 1/9] virtio-crypto: header update

2022-05-13 Thread zhenwei pi
Update header from linux, support akcipher service. Reviewed-by: Daniel P. Berrangé Reviewed-by: Gonglei Signed-off-by: lei he Signed-off-by: zhenwei pi --- .../standard-headers/linux/virtio_crypto.h| 82 ++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/in

[PATCH v6 0/9] Introduce akcipher service for virtio-crypto

2022-05-13 Thread zhenwei pi
v5 -> v6: - Fix build errors and codestyles. - Add parameter 'Error **errp' for qcrypto_akcipher_rsakey_parse. - Report more detailed errors. - Fix buffer length check and return values of akcipher-nettle, allows caller to pass a buffer with larger size than actual needed. A million thanks to Da

[PATCH v6 4/9] crypto: add ASN.1 DER decoder

2022-05-13 Thread zhenwei pi
From: Lei He Add an ANS.1 DER decoder which is used to parse asymmetric cipher keys Signed-off-by: zhenwei pi Signed-off-by: lei he --- crypto/der.c | 189 +++ crypto/der.h | 81 ++ crypto/meson.build | 1 + tests/unit/m

[PATCH v6 2/9] qapi: crypto-akcipher: Introduce akcipher types to qapi

2022-05-13 Thread zhenwei pi
From: Lei He Introduce akcipher types, also include RSA related types. Reviewed-by: Daniel P. Berrangé Signed-off-by: Lei He Signed-off-by: zhenwei pi --- qapi/crypto.json | 64 1 file changed, 64 insertions(+) diff --git a/qapi/crypto.json b

[PATCH v6 3/9] crypto: Introduce akcipher crypto class

2022-05-13 Thread zhenwei pi
Introduce new akcipher crypto class 'QCryptoAkCIpher', which supports basic asymmetric operations: encrypt, decrypt, sign and verify. Suggested by Daniel P. Berrangé, also add autoptr cleanup for the new class. Thanks to Daniel! Co-developed-by: lei he Signed-off-by: lei he Signed-off-by: zhenw

Re:Re: [PATCH v2] qga: add guest-get-diskstats command for Linux guests

2022-05-13 Thread 芦志朋
Thanks.indeed exist memory leak      From: "Konstantin Kostiuk "To: "luzhipeng "CC: "qemu-devel ","Michael Roth ","Marc-André Lureau ","Daniel P . Berrangé ","Michal Privoznik "Sent: 2022-05-13 22:33Subject: Re: [PATCH v2] qga: add guest-get-diskstats command for Linux guests  On Fri, May 1

Re: [PATCH v3] hw: m25p80: allow write_enable latch get/set

2022-05-13 Thread Francisco Iglesias
On [2022 May 12] Thu 22:50:22, Iris Chen via wrote: > The write_enable latch property is not currently exposed. > This commit makes it a modifiable property. > > Signed-off-by: Iris Chen > --- > v3: Addressed comments by Peter and Cedric. > v2: Ran ./scripts/checkpatch.pl on the patch and added a

Re: [PATCH 0/2] hw: aspeed: Init all UART's with serial devices

2022-05-13 Thread Zev Weiss
On Thu, May 12, 2022 at 09:02:18PM PDT, Peter Delevoryas wrote: > CC'ing Zev and OpenBMC since this was motivated by a problem Zev had there: > > https://lore.kernel.org/openbmc/ynzgnwjkydmuu...@hatter.bewilderbeest.net/ > > This series adds all the missing UART's in the Aspeed chips, and initial

[PATCH] hw/intc: Pass correct hartid while updating mtimecmp

2022-05-13 Thread Atish Patra
timecmp update function should be invoked with hartid for which timecmp is being updated. The following patch passes the incorrect hartid to the update function. Fixes: e2f01f3c2e13 ("hw/intc: Make RISC-V ACLINT mtime MMIO register writable") Signed-off-by: Atish Patra --- hw/intc/riscv_aclint.

Re: [PATCH v2 08/26] file-posix: add missing coroutine_fn annotations

2022-05-13 Thread Eric Blake
On Mon, May 09, 2022 at 12:30:01PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > block/file-posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Sparse commit message. > > diff --git a/block/file-posix.c b/block/file-posix.c > index 48cd096624..76eea8d350 100644

Re: [PATCH v2 07/26] block: add missing coroutine_fn annotations

2022-05-13 Thread Eric Blake
On Mon, May 09, 2022 at 12:30:00PM +0200, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini Resuming more of my review... > --- > block/block-backend.c | 18 +- > block/io.c| 24 > 2 files changed, 21 insertions(+), 21 deletions(-) > > dif

Re: [PATCH 2/2] hw: aspeed: Init all UART's with serial devices

2022-05-13 Thread Peter Delevoryas
> On May 12, 2022, at 10:31 PM, Cédric Le Goater wrote: > > On 5/13/22 06:02, Peter Delevoryas wrote: >> Usually, QEMU users just provide one serial device on the command line, >> either through "-nographic" or "-serial stdio -display none", or just using >> VNC and popping up a window. We try

Re: [PULL 06/13] nbd: remove peppering of nbd_client_connected

2022-05-13 Thread Eric Blake
On Thu, May 12, 2022 at 05:16:04PM +0100, Peter Maydell wrote: > On Tue, 26 Apr 2022 at 21:21, Eric Blake wrote: > > > > From: Paolo Bonzini > > > > It is unnecessary to check nbd_client_connected() because every time > > s->state is moved out of NBD_CLIENT_CONNECTED the socket is shut down > > a

Re: [PATCH v4 10/19] migration: Postcopy preemption enablement

2022-05-13 Thread Peter Xu
On Sat, May 14, 2022 at 12:23:44AM +0530, manish.mishra wrote: > > On 12/05/22 9:52 pm, Peter Xu wrote: > > Hi, Manish, > > > > On Wed, May 11, 2022 at 09:24:28PM +0530, manish.mishra wrote: > > > > @@ -1962,9 +2038,17 @@ static bool get_queued_page(RAMState *rs, > > > > PageSearchStatus *pss) >

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 12:50 PM Paolo Bonzini wrote: > On 5/13/22 18:07, Daniel P. Berrangé wrote: > >> e.g. what if I want to require mypy >= 0.900 for testing, but you have a > >> system package that requires mypy < 0.700? > > I would expect us to not require packages that are not present in > >

-blockdev vs -snapshot bug

2022-05-13 Thread Michael Tokarev
Hi! Now here's something.. interesting. I tested -blockdev here with a real image. This way: qemu-system-x86_64 ... -snapshot \ -blockdev qcow2,node-name=q,file.driver=file,file.filename=w.qcow2 \ -device ide-hd,drive=q I always use -snapshot when testing something, not to damage the image.

Re: [PATCH v4 10/19] migration: Postcopy preemption enablement

2022-05-13 Thread manish.mishra
On 12/05/22 9:52 pm, Peter Xu wrote: Hi, Manish, On Wed, May 11, 2022 at 09:24:28PM +0530, manish.mishra wrote: @@ -1962,9 +2038,17 @@ static bool get_queued_page(RAMState *rs, PageSearchStatus *pss) RAMBlock *block; ram_addr_t offset; +again: block = unqueue_page(rs, &

Re: [PULL 0/1] Linux header update to v5.18-rc6

2022-05-13 Thread Richard Henderson
On 5/13/22 08:59, Alex Williamson wrote: The following changes since commit 9de5f2b40860c5f8295e73fea9922df6f0b8d89a: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-05-12 10:52:15 -0700) are available in the Git repository at: https://gitlab.com/alex.will

Re: [PATCH v2 5/8] target/riscv: Don't force update priv spec version to latest

2022-05-13 Thread Atish Patra
On Wed, May 11, 2022 at 7:46 AM Anup Patel wrote: > > The riscv_cpu_realize() sets priv spec verion to v1.12 when it is > when "env->priv_ver == 0" (i.e. default v1.10) because the enum > value of priv spec v1.10 is zero. > > Due to above issue, the sifive_u machine will see priv spec v1.12 > inst

Re: [PATCH v2 7/8] target/riscv: Force disable extensions if priv spec version does not match

2022-05-13 Thread Atish Patra
On Wed, May 11, 2022 at 7:46 AM Anup Patel wrote: > > We should disable extensions in riscv_cpu_realize() if minimum required > priv spec version is not satisfied. This also ensures that machines with > priv spec v1.11 (or lower) cannot enable H, V, and various multi-letter > extensions. > > Fixes

[PATCH v4 3/3] target/riscv: Add vstimecmp support

2022-05-13 Thread Atish Patra
vstimecmp CSR allows the guest OS or to program the next guest timer interrupt directly. Thus, hypervisor no longer need to inject the timer interrupt to the guest if vstimecmp is used. This was ratified as a part of the Sstc extension. Signed-off-by: Atish Patra --- target/riscv/cpu.h |

[PATCH v4 2/3] target/riscv: Add stimecmp support

2022-05-13 Thread Atish Patra
stimecmp allows the supervisor mode to update stimecmp CSR directly to program the next timer interrupt. This CSR is part of the Sstc extension which was ratified recently. Signed-off-by: Atish Patra --- target/riscv/cpu.c | 8 target/riscv/cpu.h | 7 +++ target/riscv/cpu_

[PATCH v4 1/3] hw/intc: Move mtimer/mtimecmp to aclint

2022-05-13 Thread Atish Patra
Historically, The mtime/mtimecmp has been part of the CPU because they are per hart entities. However, they actually belong to aclint which is a MMIO device. Move them to the ACLINT device. This also emulates the real hardware more closely. Reviewed-by: Anup Patel Signed-off-by: Atish Patra ---

[PATCH v4 0/3] Implement Sstc extension

2022-05-13 Thread Atish Patra
This series implements Sstc extension[1] which was ratified recently. The first patch is a prepartory patches while PATCH 2 adds stimecmp support while PATCH 3 adds vstimecmp support. This series is based on on top of upstream commit (faee5441a038). The series can also be found at https://github.

Re: [RFC PATCH v2 0/8] qapi: net: add unix socket type support to netdev backend

2022-05-13 Thread Stefano Brivio
On Thu, 12 May 2022 10:09:24 +0200 Laurent Vivier wrote: > "-netdev socket" only supports inet sockets. > > It's not a complex task to add support for unix sockets, but > the socket netdev parameters are not defined to manage well unix > socket parameters. > > As discussed in: > > "socket.c

[PATCH v3 15/15] test/qga: use g_auto wherever sensible

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- tests/unit/test-qga.c | 121 +++--- 1 file changed, 43 insertions(+), 78 deletions(-) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index ab0b12a2dd..530317044b 100644 --- a/tests/unit

Re: [PATCH v4 4/5] i386/pc: relocate 4g start to 1T where applicable

2022-05-13 Thread Joao Martins
On 5/13/22 16:06, Joao Martins wrote: > On 5/13/22 13:33, Michael S. Tsirkin wrote: >> On Wed, Apr 20, 2022 at 09:11:37PM +0100, Joao Martins wrote: >>> It is assumed that the whole GPA space is available to be DMA >>> addressable, within a given address space limit, expect for a >>> tiny region be

[PATCH v2 1/3] hw/ide/piix: Remove redundant "piix3-ide-xen" device class

2022-05-13 Thread Bernhard Beschow
Commit 0f8445820f11a69154309863960328dda3dc1ad4 'xen: piix reuse pci generic class init function' already resolved redundant code which in turn rendered piix3-ide-xen redundant. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 +-- hw/ide/piix.c | 7 --- 2 files changed, 1 inser

RE: About restoring the state in vhost-vdpa device

2022-05-13 Thread Parav Pandit
Hi Gautam, Please fix your email client to have right response format. Otherwise, it will be confusing for the rest and us to follow the conversation. More below. > From: Gautam Dawar > Sent: Friday, May 13, 2022 1:48 PM > > Our proposal diverge in step 7: Instead of enabling *all* the > > vir

Re: [PATCH v2 6/8] target/riscv: Add dummy mcountinhibit CSR for priv spec v1.11 or higher

2022-05-13 Thread Atish Patra
On Wed, May 11, 2022 at 7:46 AM Anup Patel wrote: > > The mcountinhibit CSR is mandatory for priv spec v1.11 or higher. For > implementation that don't want to implement can simply have a dummy > mcountinhibit which always zero. > > Fixes: a4b2fa433125 ("target/riscv: Introduce privilege version f

[PATCH v3 13/15] qga/wixl: simplify some pre-processing

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Sadly, wixl doesn't have 'elif'. Signed-off-by: Marc-André Lureau Reviewed-by: Konstantin Kostiuk --- qga/installer/qemu-ga.wxs | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.w

[PATCH v2 3/3] include/hw/ide: Unexport pci_piix3_xen_ide_unplug()

2022-05-13 Thread Bernhard Beschow
This function was declared in a generic and public header, implemented in a device-specific source file but only used in xen_platform. Given its 'aux' parameter, this function is more xen-specific than piix-specific. Also, the hardcoded magic constants seem to be generic and related to PCIIDEState

[PATCH v3 12/15] qga/wixl: require Mingw_bin

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau No clear reason to make guesses here. Signed-off-by: Marc-André Lureau Reviewed-by: Konstantin Kostiuk --- qga/installer/qemu-ga.wxs | 9 - 1 file changed, 9 deletions(-) diff --git a/qga/installer/qemu-ga.wxs b/qga/installer/qemu-ga.wxs index 8a19aa1656..651d

Re: [PATCH v2 1/8] target/riscv: Fix csr number based privilege checking

2022-05-13 Thread Atish Patra
On Wed, May 11, 2022 at 7:46 AM Anup Patel wrote: > > When hypervisor and VS CSRs are accessed from VS-mode or VU-mode, > the riscv_csrrw_check() function should generate virtual instruction > trap instead illegal instruction trap. > > Fixes: 0a42f4c44088 (" target/riscv: Fix CSR perm checking for

[PATCH v2 0/3] PIIX3-IDE XEN cleanup

2022-05-13 Thread Bernhard Beschow
v2: * Have pci_xen_ide_unplug() return void (Paul Durrant) * CC Xen maintainers (Michael S. Tsirkin) v1: This patch series first removes the redundant "piix3-ide-xen" device class and then moves a XEN-specific helper function from PIIX3 code to XEN code. The idea is to decouple PIIX3-IDE and XEN a

[PATCH v2 2/3] hw/ide/piix: Add some documentation to pci_piix3_xen_ide_unplug()

2022-05-13 Thread Bernhard Beschow
The comment is based on commit message ae4d2eb273b167dad748ea4249720319240b1ac2 'xen-platform: add missing disk unplug option'. Since it seems to describe design decisions and limitations that still apply it seems worth having. Signed-off-by: Bernhard Beschow --- hw/ide/piix.c | 11 +++

[PATCH v3 09/15] qga: make build_fs_mount_list() return a bool

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Change build_fs_mount_list() to return bool, in accordance with the guidance under = Rules = in include/qapi/error.h Signed-off-by: Marc-André Lureau Suggested-by: Markus Armbruster --- qga/commands-posix.c | 23 ++- 1 file changed, 10 insertions(+)

[PATCH v3 08/15] qga: replace qemu_open_old() with qemu_open_cloexec()

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau qemu_open_old() uses qemu_open_internal() which handles special "/dev/fdset/" path for monitor fd sets, set CLOEXEC, and uses Error reporting (and some O_DIRECT special error casing). The monitor fdset handling is unnecessary for qga, use qemu_open_cloexec() instead. Sig

[PATCH v3 14/15] qga/wixl: replace QEMU_GA_MSI_MINGW_BIN_PATH with glib bindir

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Use more conventional variables to set the location of pre-built DLL/bin. Signed-off-by: Marc-André Lureau Reviewed-by: Konstantin Kostiuk --- configure | 9 ++--- meson.build | 5 - qga/installer/qemu-ga.wxs | 24 ---

[PATCH v3 07/15] qga: throw an Error in ga_channel_open()

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Allow for a single point of error reporting, and further refactoring. Signed-off-by: Marc-André Lureau --- qga/channel-posix.c | 43 ++- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/qga/channel-posix.c b/qga/cha

[PATCH v3 10/15] test/qga: use G_TEST_DIR to locate os-release test file

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau This a more accurate way to lookup the test data, and will allow to move the test in a subproject. Signed-off-by: Marc-André Lureau --- tests/unit/test-qga.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/unit/test-qga.c b/tests/un

[PATCH v3 05/15] osdep: export qemu_open_cloexec()

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Used in the next patch, to simplify qga code. Signed-off-by: Marc-André Lureau --- include/qemu/osdep.h | 1 + util/osdep.c | 10 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 67cc465

[PATCH v3 11/15] qga/wixl: prefer variables over environment

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau No need to setup an environment or to check if the variable is undefined manually. Signed-off-by: Marc-André Lureau Reviewed-by: Konstantin Kostiuk --- qga/installer/qemu-ga.wxs | 30 +- qga/meson.build | 9 - 2 files chan

[PATCH v3 04/15] qga: flatten safe_open_or_create()

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau There is a bit too much nesting in the function, this can be simplified a bit to improve readability. This also helps with the following error handling changes. Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 122 ++-

[PATCH v3 02/15] util/win32: simplify qemu_get_local_state_dir()

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau SHGetFolderPath() is a deprecated API: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha It is a wrapper for SHGetKnownFolderPath() and CSIDL_COMMON_PATH is mapped to FOLDERID_ProgramData: https://docs.microsoft.com/en-us/windo

[PATCH v3 06/15] qga: use qemu_open_cloexec() for safe_open_or_create()

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau The function takes care of setting CLOEXEC, and reporting error. The reported error message will differ, from: "failed to open file 'foo' (mode: 'r')" to: "Failed to open file 'foo'" Signed-off-by: Marc-André Lureau --- qga/commands-posix.c | 13 + 1 fi

[PATCH v3 00/15] Misc cleanups

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Hi, v3: - changed error_report_err() back to g_critical() - added "qga: make build_fs_mount_list() return a bool" - replaced g_clear_pointer() usage by open-coded version - dropped needless g_autoptr(GError) in tests - rebased, (dropped "include: adjust header guards afte

[PATCH v3 03/15] tests: make libqmp buildable for win32

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth --- tests/qtest/libqmp.c | 34 +- tests/qtest/libqmp.h | 2 ++ 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/tests/qtest/libqmp.c b/tests/qtest/libqmp.c index 03

[PATCH v3 01/15] include: move qemu_*_exec_dir() to cutils

2022-05-13 Thread marcandre . lureau
From: Marc-André Lureau The function is required by get_relocated_path() (already in cutils), and used by qemu-ga and may be generally useful. Signed-off-by: Marc-André Lureau --- include/qemu/cutils.h| 7 ++ include/qemu/osdep.h | 8 -- qemu-io.c

[PATCH 5/6] hw/isa/piix4: Factor out SM bus initialization from create() function

2022-05-13 Thread Bernhard Beschow
Initialize the SM bus just like is done for piix3 which modernizes the code. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c| 15 +++ hw/mips/malta.c | 7 ++- include/hw/southbridge/piix.h | 2 +- 3 files changed, 10 insertions(+), 14 deletions(

[PATCH 6/6] hw/isa/piix{3,4}: Inline and remove create() functions

2022-05-13 Thread Bernhard Beschow
During the previous changesets the create() functions became trivial wrappers around more generic functions. Modernize the code. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 6 +- hw/isa/piix3.c| 16 hw/isa/piix4.c| 10

[PATCH 4/6] hw/isa/piix{3, 4}: Factor out ISABus retrieval from create() functions

2022-05-13 Thread Bernhard Beschow
Modernizes the code and even saves a few lines. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 ++- hw/isa/piix3.c| 3 +-- hw/isa/piix4.c| 6 +- hw/mips/malta.c | 3 ++- include/hw/southbridge/piix.h | 4 ++-- 5 files chang

Re: [PULL 03/15] multifd: Make no compression operations into its own structure

2022-05-13 Thread Peter Maydell
Ping! Any opinions, especially from qapi codegen people, on the right thing to do here? On Tue, 12 Apr 2022 at 20:04, Peter Maydell wrote: > > On Fri, 28 Feb 2020 at 09:26, Juan Quintela wrote: > > > > It will be used later. > > > > Signed-off-by: Juan Quintela > > Reviewed-by: Dr. David Alan G

[PATCH 2/6] hw/isa/piix{3, 4}: Move pci_map_irq_fn's near pci_set_irq_fn's

2022-05-13 Thread Bernhard Beschow
The pci_map_irq_fn's were implemented below type_init() which made them inaccessible to QOM functions. So move them up. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 22 +++--- hw/isa/piix4.c | 50 +- 2 files changed, 36 inse

[PATCH 0/6] QOM'ify PIIX southbridge creation

2022-05-13 Thread Bernhard Beschow
The piix3 and piix4 southbridge devices still rely on create() functions which are deprecated. This series resolves these functions piece by piece to modernize the code. Both devices are modified in lockstep where possible to provide more context. Testing done: * `qemu-system-x86_64 -M pc -m 2G -

[PATCH 1/6] include/hw: Move TYPE_PIIX4_PCI_DEVICE to southbridge/piix.h

2022-05-13 Thread Bernhard Beschow
TYPE_PIIX3_PCI_DEVICE resides there as well. Signed-off-by: Bernhard Beschow --- include/hw/isa/isa.h | 2 -- include/hw/southbridge/piix.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 034d706ba1..e9fa2f5cea 100

[PATCH 3/6] hw/isa/piix{3,4}: QOM'ify PCI device creation and wiring

2022-05-13 Thread Bernhard Beschow
PCI interrupt wiring and device creation (piix4 only) were performed in create() functions which are obsolete. Move these tasks into QOM functions to modernize the code. In order to avoid duplicate checking for xen_enabled() the piix3 realize methods are now split. Signed-off-by: Bernhard Beschow

RE: About restoring the state in vhost-vdpa device

2022-05-13 Thread Gautam Dawar
-Original Message- From: Parav Pandit Sent: Friday, May 13, 2022 8:39 PM To: Eugenio Perez Martin ; virtualization ; qemu-level ; Jason Wang ; Cindy Lu ; Gautam Dawar ; virtio-network...@redhat.com; Eli Cohen ; Laurent Vivier ; Stefano Garzarella Subject: RE: About restoring the sta

Re: [PATCH 1/8] qmp: Support for querying stats

2022-05-13 Thread Markus Armbruster
Paolo Bonzini writes: > On 5/13/22 16:35, Markus Armbruster wrote: >> Friday afternoon, worst time for word-smithing... Feel free to ask >> again on Monday:) >> >>> a suggested place? For example, do you think it would fit better in the >>> query-stats or query-stats-schemas documentation? > >

Re: [PATCH v2 3/4] kvm: Introduce a dirty rate calculation method based on dirty ring

2022-05-13 Thread Peter Xu
On Sat, Apr 02, 2022 at 04:59:24PM +0800, Chongyun Wu wrote: > > on 4/2/2022 3:28 PM, Hyman Huang wrote: > > > > > > 在 2022/3/28 9:32, wuc...@chinatelecom.cn 写道: > > > From: Chongyun Wu > > > > > > A new structure KVMDirtyRingDirtyCounter is introduced in > > > KVMDirtyRingReaper to record the

Re: [PATCH] target/ppc: Fix tlbie

2022-05-13 Thread Fabiano Rosas
Leandro Lupori writes: > Commit 74c4912f097bab98 changed check_tlb_flush() to use > tlb_flush_all_cpus_synced() instead of calling tlb_flush() on each > CPU. However, as side effect of this, a CPU executing a ptesync > after a tlbie will have its TLB flushed only after exiting its > current Trans

Re: [PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-13 Thread Philippe Mathieu-Daudé via
On Fri, May 13, 2022 at 6:43 PM Peter Maydell wrote: > > In tpm_tis_mmio_read(), tpm_tis_mmio_write() and > tpm_tis_dump_state(), we calculate a locality index with > tpm_tis_locality_from_addr() and then use it as an index into the > s->loc[] array. In all these cases, the array index can't over

Re: [PATCH v2 1/4] kvm: Dynamically adjust the rate of dirty ring reaper thread

2022-05-13 Thread Peter Xu
On Sat, Apr 02, 2022 at 03:28:13PM +0800, Chongyun Wu wrote: > > > +{ > > > +    float ratio = 0.0; > > > +    uint64_t sleep_time = 100; > > > +    enum KVMDirtyRingReaperRunLevel run_level_want; > > > +    enum KVMDirtyRingReaperSpeedControl speed_control; > > > + > > > +    /* > > > + *

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Paolo Bonzini
On 5/13/22 18:07, Daniel P. Berrangé wrote: e.g. what if I want to require mypy >= 0.900 for testing, but you have a system package that requires mypy < 0.700? I would expect us to not require packages that are not present in the distros implied by https://www.qemu.org/docs/master/about/buil

Re: [PATCH v2 2/4] kvm: Dirty ring autoconverge optmization for kvm_cpu_synchronize_kick_all

2022-05-13 Thread Peter Xu
On Sat, Apr 02, 2022 at 03:22:21PM +0800, Hyman Huang wrote: > 在 2022/3/28 9:32, wuc...@chinatelecom.cn 写道: > > @@ -879,7 +862,9 @@ static void kvm_dirty_ring_flush(void) > >* First make sure to flush the hardware buffers by kicking all > >* vcpus out in a synchronous way. > >

Re: [PATCH qemu v4 02/10] target/riscv: rvv: Add mask agnostic for vector load / store instructions

2022-05-13 Thread Weiwei Li
在 2022/5/14 上午12:09, Weiwei Li 写道: 在 2022/3/17 下午3:47, ~eopxd 写道: From: Yueh-Ting (eop) Chen Signed-off-by: eop Chen Reviewed-by: Frank Chang ---   target/riscv/insn_trans/trans_rvv.c.inc |  5   target/riscv/vector_helper.c    | 35 +   2 files changed,

[PATCH] build: remove useless dependency

2022-05-13 Thread Paolo Bonzini
qemu-plugins.symbols is now processed in Meson. Signed-off-by: Paolo Bonzini --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index e5fd1ebdf6..b842dbccdb 100644 --- a/Makefile +++ b/Makefile @@ -165,10 +165,7 @@ ifneq ($(filter $(ninja-targets), $(ninja-cmd

[PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-13 Thread Peter Maydell
In tpm_tis_mmio_read(), tpm_tis_mmio_write() and tpm_tis_dump_state(), we calculate a locality index with tpm_tis_locality_from_addr() and then use it as an index into the s->loc[] array. In all these cases, the array index can't overflow because the MemoryRegion is sized to be TPM_TIS_NUM_LOCALIT

Re: [PATCH v2 2/2] tests/qtest: use prctl(PR_SET_PDEATHSIG) as fallback to kill QEMU

2022-05-13 Thread Thomas Huth
On 13/05/2022 17.49, Daniel P. Berrangé wrote: Although we register a ABRT handler to kill off QEMU when g_assert() triggers, we want an extra safety net. The QEMU process might be non-functional and thus not have responded to SIGTERM. The test script might also have crashed with SEGV, in which c

Re: [PATCH v2 68/74] hw/rx: Handle a kernel file that is ELF

2022-05-13 Thread Richard Henderson
On 5/13/22 08:48, Richard Henderson wrote: On 5/13/22 08:44, Peter Maydell wrote: On Tue, 3 May 2022 at 21:52, Richard Henderson wrote: Attempt to load the kernel with load_elf.  If this fails with ELF_LOAD_NOT_ELF, continue to treat the kernel as a raw image. This will be handy for running

Re: [PATCH] configure: remove another dead variable

2022-05-13 Thread Richard Henderson
On 5/13/22 09:11, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index c8b5b99532..dda25f05bf 100755 --- a/configure +++ b/configure @@ -1992,7 +1992,6 @@ fi if test "$static" = "yes" ; then echo "

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Daniel P . Berrangé
On Fri, May 13, 2022 at 11:55:18AM -0400, John Snow wrote: > On Fri, May 13, 2022, 6:29 AM Daniel P. Berrangé > wrote: > > > On Fri, May 13, 2022 at 09:35:23AM +0100, Daniel P. Berrangé wrote: > > > On Thu, May 12, 2022 at 08:06:00PM -0400, John Snow wrote: > > > > RFC: This is a very early, crud

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Paolo Bonzini
On 5/13/22 17:39, John Snow wrote: On Fri, May 13, 2022, 6:21 AM Paolo Bonzini > wrote: On 5/13/22 02:06, John Snow wrote: > The only downside I am really frowning at is that I will have to > replicate some "update the venv if it's outdated" logic that i

  1   2   3   >