Re: [PATCH] Adding Cédric's repos in MAINTAINERS file.

2021-12-23 Thread Cédric Le Goater
Hello, On 12/8/21 04:52, lagar...@linux.ibm.com wrote: From: Leonardo Garcia Signed-off-by: Leonardo Garcia Here is a description of the branches I have put in place over the years for aspeed and powernv machines on github: - prev stable branch dev branch -

[PULL v2 4/7] iotests.py: add qemu_tool_popen()

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
Split qemu_tool_popen() from qemu_tool_pipe_and_status() to be used separately. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Nikita Lapshin --- tests/qemu-iotests/iotests.py | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/iotest

Re: [PATCH 2/3] scripts/qapi-gen.py: add --add-trace-points option

2021-12-23 Thread Philippe Mathieu-Daudé
On 12/21/21 20:35, Vladimir Sementsov-Ogievskiy wrote: > Add and option to generate trace points. We should generate both trace > points and trace-events files for further trace point code generation. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > scripts/qapi/gen.py | 13 ++---

Re: [PATCH qemu master] hw/misc/aspeed_pwm: fix typo

2021-12-23 Thread Philippe Mathieu-Daudé
On 12/22/21 11:24, Troy Lee wrote: > Typo found during developing. > > Fixes: 70b3f1a34d3c ("hw/misc: Add basic Aspeed PWM model") > Signed-off-by: Troy Lee > --- > hw/misc/aspeed_pwm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/misc/aspeed_pwm.c b/hw/misc/aspee

Re: [PATCH 02/15] ppc: Mark the 'taihu' machine as deprecated

2021-12-23 Thread Philippe Mathieu-Daudé
On 12/6/21 11:36, Cédric Le Goater wrote: > From: Thomas Huth > > The PPC 405 CPU is a system-on-a-chip, so all 405 machines are very similar, > except for some external periphery. However, the periphery of the 'taihu' > machine is hardly emulated at all (e.g. neither the LCD nor the USB part had

Re: [PATCH v2 0/5] hw/qdev: Clarify qdev_connect_gpio_out() documentation

2021-12-23 Thread Philippe Mathieu-Daudé
Hi Peter. Since you reviewed v1, and Ack-by on v2 would be welcomed. Otherwise, if you don't object, I plan to queue this via machine-next tree. Thanks, Phil. On 12/18/21 14:04, Philippe Mathieu-Daudé wrote: > Trivial patches clarifying qdev_connect_gpio_out() use, > basically that the qemu_irq

[PULL v2 0/7] NBD patches

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
The following changes since commit 2bf40d0841b942e7ba12953d515e62a436f0af84: Merge tag 'pull-user-20211220' of https://gitlab.com/rth7680/qemu into staging (2021-12-20 13:20:07 -0800) are available in the Git repository at: https://src.openvz.org/scm/~vsementsov/qemu.git tags/pull-nbd-2021-

Re: [PATCH qemu master] hw/misc/aspeed_pwm: fix typo

2021-12-23 Thread Cédric Le Goater
Hello Troy Lee, On 12/22/21 11:24, Troy Lee wrote: Typo found during developing. Fixes: 70b3f1a34d3c ("hw/misc: Add basic Aspeed PWM model") PWM is not upstream. I will include the fix in a new aspeed-7.0 branch. Thanks, C. Signed-off-by: Troy Lee --- hw/misc/aspeed_pwm.c | 2 +- 1

Re: [PATCH for-6.1?] iotest: Further enhance qemu-img-bitmaps

2021-12-23 Thread Hanna Reitz
On 21.07.21 22:46, Eric Blake wrote: Add a regression test to make sure we detect attempts to use 'qemu-img bitmap' to modify an in-use local file. Suggested-by: Nir Soffer Signed-off-by: Eric Blake --- Sadly, this missed my bitmaps pull request today. If there's any reason to respin that pu

Re: [PATCH 3/3] meson: generate trace points for qmp commands

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
23.12.2021 01:11, Paolo Bonzini wrote: Il mar 21 dic 2021, 20:35 Vladimir Sementsov-Ogievskiy mailto:vsement...@virtuozzo.com>> ha scritto: --- a/trace/meson.build +++ b/trace/meson.build @@ -2,10 +2,14 @@  specific_ss.add(files('control-target.c'))  trace_events_files = [

Re: [PATCH 1/3] block: better document SSH host key fingerprint checking

2021-12-23 Thread Hanna Reitz
On 18.11.21 15:35, Daniel P. Berrangé wrote: The docs still illustrate host key fingerprint checking using the old md5 hashes which are considered insecure and obsolete. Change it to illustrate using a sha256 hash. Also show how to extract the hash value from the known_hosts file. Signed-off-by:

Re: [PATCH 2/3] block: support sha256 fingerprint with pre-blockdev options

2021-12-23 Thread Hanna Reitz
On 18.11.21 15:35, Daniel P. Berrangé wrote: When support for sha256 fingerprint checking was aded in commit bf783261f0aee6e81af3916bff7606d71ccdc153 Author: Daniel P. Berrangé Date: Tue Jun 22 12:51:56 2021 +0100 block/ssh: add support for sha256 host key fingerprints it was

Re: Building QEMU as a shared library

2021-12-23 Thread Philippe Mathieu-Daudé
Hi Peter, On 12/15/21 11:10, Peter Maydell wrote: > On Wed, 15 Dec 2021 at 08:18, Amir Gonnen wrote: >> My goal is to simulate a mixed architecture system. >> >> Today QEMU strongly assumes that the simulated system is a *single >> architecture*. >> Changing this assumption and supporting mixed

Re: [PATCH] acpi: validate hotplug selector on access

2021-12-23 Thread Mauro Matteo Cascella
Hi, On Wed, Dec 22, 2021 at 9:52 PM Michael S. Tsirkin wrote: > > On Wed, Dec 22, 2021 at 09:27:51PM +0100, Philippe Mathieu-Daudé wrote: > > On Wed, Dec 22, 2021 at 9:20 PM Michael S. Tsirkin wrote: > > > On Wed, Dec 22, 2021 at 08:19:41PM +0100, Philippe Mathieu-Daudé wrote: > > > > +Mauro & A

Re: [PATCH 3/3] block: print the server key type and fingerprint on failure

2021-12-23 Thread Hanna Reitz
On 18.11.21 15:35, Daniel P. Berrangé wrote: When validating the server key fingerprint fails, it is difficult for the user to know what they got wrong. The fingerprint accepted by QEMU is received in a different format than openssh displays. There can also be keys for multiple different ciphers

[PATCH v2 0/2] block: Minor vhost-user-blk fixes

2021-12-23 Thread Philippe Mathieu-Daudé
- Add vhost-user-blk help to qemu-storage-daemon, - Do not list vhost-user-blk in BlockExportType when CONFIG_VHOST_USER_BLK_SERVER is disabled. Since v1: - Reword patch 2 description (Markus) - Fix BlockExportOptions enum build failure (Markus) Philippe Mathieu-Daudé (2): qemu-storage-daemon

[PATCH v2 1/2] qemu-storage-daemon: Add vhost-user-blk help

2021-12-23 Thread Philippe Mathieu-Daudé
Add missing vhost-user-blk help: $ qemu-storage-daemon -h ... --export [type=]vhost-user-blk,id=,node-name=, addr.type=unix,addr.path=[,writable=on|off] [,logical-block-size=][,num-queues=] export the specified block node as a

[PATCH v2 2/2] qapi/block: Restrict vhost-user-blk to CONFIG_VHOST_USER_BLK_SERVER

2021-12-23 Thread Philippe Mathieu-Daudé
When building QEMU with --disable-vhost-user and using introspection, query-qmp-schema lists vhost-user-blk even though it's not actually available: { "execute": "query-qmp-schema" } { "return": [ ... { "name": "312", "members": [

[PULL 0/1] "make check" switch to meson test harness

2021-12-23 Thread Paolo Bonzini
The following changes since commit 2bf40d0841b942e7ba12953d515e62a436f0af84: Merge tag 'pull-user-20211220' of https://gitlab.com/rth7680/qemu into staging (2021-12-20 13:20:07 -0800) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream-mtest for yo

[PULL 1/1] build: use "meson test" as the test harness

2021-12-23 Thread Paolo Bonzini
"meson test" starting with version 0.57 is just as capable and easy to use as QEMU's own TAP driver. All existing options for "make check" work. The only required code change involves how to mark "slow" tests; they need to belong to an additional "slow" suite. The rules for .tap output are repla

Re: [PATCH 3/3] block: print the server key type and fingerprint on failure

2021-12-23 Thread Philippe Mathieu-Daudé
On 11/18/21 15:35, Daniel P. Berrangé wrote: > When validating the server key fingerprint fails, it is difficult for > the user to know what they got wrong. The fingerprint accepted by QEMU > is received in a different format than openssh displays. There can also > be keys for multiple different ci

Re: [RFC PATCH v3 18/27] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2021-12-23 Thread Mark Cave-Ayland
On 22/12/2021 02:38, yangxiaojuan wrote: Hi, Mark On 12/18/2021 08:33 AM, Mark Cave-Ayland wrote: On 04/12/2021 12:07, Xiaojuan Yang wrote: This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- hw/intc/Kconfig

Re: [PATCH 1/3] scripts/qapi/commands: gen_commands(): add add_trace_points argument

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
21.12.2021 22:35, Vladimir Sementsov-Ogievskiy wrote: Add possibility to generate trace points for each qmp command. We should generate both trace points and trace-events file, for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/commands.py |

Re: [PATCH 3/3] meson: generate trace points for qmp commands

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
23.12.2021 12:33, Vladimir Sementsov-Ogievskiy wrote: 23.12.2021 01:11, Paolo Bonzini wrote: Il mar 21 dic 2021, 20:35 Vladimir Sementsov-Ogievskiy mailto:vsement...@virtuozzo.com>> ha scritto:     --- a/trace/meson.build     +++ b/trace/meson.build     @@ -2,10 +2,14 @@  specific_ss.add(f

Re: [PATCH qemu] s390x/css: fix PMCW invalid mask

2021-12-23 Thread Halil Pasic
On Wed, 22 Dec 2021 17:46:11 +0100 Cornelia Huck wrote: > On Thu, Dec 16 2021, Nico Boehr wrote: > > > Previously, we required bits 5, 6 and 7 to be zero (0x07 == 0b111). But, > > as per the principles of operation, bit 5 is ignored in MSCH and bits 0, > > 1, 6 and 7 need to be zero. > > > > As

Re: [RFC PATCH v3 22/27] hw/loongarch: Add some devices support for 3A5000.

2021-12-23 Thread Mark Cave-Ayland
On 22/12/2021 08:26, yangxiaojuan wrote: Hi, Mark On 12/18/2021 06:02 PM, Mark Cave-Ayland wrote: On 04/12/2021 12:07, Xiaojuan Yang wrote: 1.Add uart,virtio-net,vga and usb for 3A5000. 2.Add irq set and map for the pci host. Non pci device use irq 0-16, pci device use 16-64. 3.Add some unim

[PATCH v2 0/4] trace qmp commands

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
Hi all! This series aims to add trace points for each qmp command with help of qapi code generator. v2: 01: new 02: use qmp_* naming for new trace-events 03: add Philippe's r-b, thanks! 04: rewrite, so that it works now! Thanks to Paolo for fast help! Vladimir Sementsov-Ogievskiy (4): jobs: dr

[PATCH v2 1/4] jobs: drop qmp_ trace points

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
We are going to implement automatic trace points for qmp commands. These several trace points are in conflict with upcoming ones. So, drop them now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- blockdev.c | 8 job-qmp.c | 6 -- block/trace-events | 9 - t

[PATCH v2 2/4] scripts/qapi/commands: gen_commands(): add add_trace_points argument

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
Add possibility to generate trace points for each qmp command. We should generate both trace points and trace-events file, for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy --- scripts/qapi/commands.py | 84 ++-- 1 file chan

[PATCH v2 3/4] scripts/qapi-gen.py: add --add-trace-points option

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
Add and option to generate trace points. We should generate both trace points and trace-events files for further trace point code generation. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Philippe Mathieu-Daudé --- scripts/qapi/gen.py | 13 ++--- scripts/qapi/main.py | 10 ++

[PATCH v2 4/4] meson: generate trace points for qmp commands

2021-12-23 Thread Vladimir Sementsov-Ogievskiy
1. Use --add-trace-points when generate qmp commands 2. Add corresponding .trace-events files as outputs in qapi_files custom target 3. Define global qapi_trace_events list of .trace-events file targets, to fill in trace/qapi.build and to use in trace/meson.build 4. In trace/meson.build use t

Re: [PATCH qemu] s390x/css: fix PMCW invalid mask

2021-12-23 Thread Cornelia Huck
On Thu, Dec 23 2021, Halil Pasic wrote: > On Wed, 22 Dec 2021 17:46:11 +0100 > Cornelia Huck wrote: > >> On Thu, Dec 16 2021, Nico Boehr wrote: >> >> > Previously, we required bits 5, 6 and 7 to be zero (0x07 == 0b111). But, >> > as per the principles of operation, bit 5 is ignored in MSCH and

Re: [PATCH v10 1/3] migration/dirtyrate: implement vCPU dirtyrate calculation periodically

2021-12-23 Thread Peter Xu
Hi, Yong, On Tue, Dec 14, 2021 at 07:07:32PM +0800, huang...@chinatelecom.cn wrote: > From: Hyman Huang(黄勇) > > Introduce the third method GLOBAL_DIRTY_LIMIT of dirty > tracking for calculate dirtyrate periodly for dirty restraint. > > Implement thread for calculate dirtyrate periodly, which wi

Re: [RFC PATCH v2 05/14] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU

2021-12-23 Thread Emanuele Giuseppe Esposito
On 20/12/2021 11:47, Vladimir Sementsov-Ogievskiy wrote: 20.12.2021 13:34, Emanuele Giuseppe Esposito wrote: On 18/12/2021 12:53, Vladimir Sementsov-Ogievskiy wrote: 04.11.2021 17:53, Emanuele Giuseppe Esposito wrote: Once job lock is used and aiocontext is removed, mirror has to perform

Re: [RFC PATCH v2 11/14] block_job_query: remove atomic read

2021-12-23 Thread Emanuele Giuseppe Esposito
On 18/12/2021 13:07, Vladimir Sementsov-Ogievskiy wrote: 04.11.2021 17:53, Emanuele Giuseppe Esposito wrote: Not sure what the atomic here was supposed to do, since job.busy is protected by the job lock. In block_job_query() it is protected only since previous commit. So, before previous c

[PULL 02/15] meson: reuse common_user_inc when building files specific to user-mode emulators

2021-12-23 Thread Paolo Bonzini
Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index f45ecf31bd..b0af02b805 100644 --- a/meson.build +++ b/meson.build @@ -2897,6 +2897,7 @@ foreach target : target_dirs

[PULL 00/15] Build system and KVM changes for 2021-12-23

2021-12-23 Thread Paolo Bonzini
The following changes since commit 2bf40d0841b942e7ba12953d515e62a436f0af84: Merge tag 'pull-user-20211220' of https://gitlab.com/rth7680/qemu into staging (2021-12-20 13:20:07 -0800) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to f

[PULL 14/15] KVM: use KVM_{GET|SET}_SREGS2 when supported.

2021-12-23 Thread Paolo Bonzini
From: Maxim Levitsky This allows to make PDPTRs part of the migration stream and thus not reload them after migration which is against X86 spec. Signed-off-by: Maxim Levitsky Message-Id: <20211101132300.192584-2-mlevi...@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 3

[PULL 01/15] docker: include bison in debian-tricore-cross

2021-12-23 Thread Paolo Bonzini
Binutils sometimes fail to build if bison is not installed: /bin/sh ./ylwrap `test -f arparse.y || echo ./`arparse.y y.tab.c arparse.c y.tab.h arparse.h y.output arparse.output -- -d ./ylwrap: 109: ./ylwrap: -d: not found (the correct invocation of ylwrap would have "bison -d" after the dou

[PULL 07/15] configure: do not set bsd_user/linux_user early

2021-12-23 Thread Paolo Bonzini
Similar to other optional features, leave the variables empty and compute the actual value later. Use the existence of include or source directories to detect whether an OS or CPU supports respectively bsd-user and linux-user. For now, BSD user-mode emulation is buildable even on TCI-only archite

[PULL 04/15] meson: cleanup common-user/ build

2021-12-23 Thread Paolo Bonzini
It is not necessary to have a separate static_library just for common_user files; using the one that already covers the rest of common_ss is enough unless you need to reuse some source files between emulators and tests. Just place common files for all user-mode emulators in common_ss, similar to wh

[PULL 15/15] KVM: x86: ignore interrupt_bitmap field of KVM_GET/SET_SREGS

2021-12-23 Thread Paolo Bonzini
This is unnecessary, because the interrupt would be retrieved and queued anyway by KVM_GET_VCPU_EVENTS and KVM_SET_VCPU_EVENTS respectively, and it makes the flow more similar to the one for KVM_GET/SET_SREGS2. Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 24 +---

[PULL 03/15] user: move common-user includes to a subdirectory of {bsd, linux}-user/

2021-12-23 Thread Paolo Bonzini
Avoid polluting the compilation of common-user/ with local include files; making an include file available to common-user/ should be a deliberate decision in order to keep a clear interface that can be used by both bsd-user/ and linux-user/. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bon

[PULL 08/15] configure, makefile: remove traces of really old files

2021-12-23 Thread Paolo Bonzini
These files have been removed for more than year in the best case, or for more than ten years for some really old TCG files. Remove any traces of it. Acked-by: Richard Henderson Signed-off-by: Paolo Bonzini --- Makefile | 11 --- configure | 9 - 2 files changed, 4 insertions(

[PULL 05/15] block/file-posix: Simplify the XFS_IOC_DIOINFO handling

2021-12-23 Thread Paolo Bonzini
From: Thomas Huth The handling for the XFS_IOC_DIOINFO ioctl is currently quite excessive: This is not a "real" feature like the other features that we provide with the "--enable-xxx" and "--disable-xxx" switches for the configure script, since this does not influence lots of code (it's only abou

[PULL 06/15] configure: simplify creation of plugin symbol list

2021-12-23 Thread Paolo Bonzini
--dynamic-list is present on all supported ELF (not Windows or Darwin) platforms, since it dates back to 2006; -exported_symbols_list is likewise present on all supported versions of macOS. Do not bother doing a functional test in configure. Remove the file creation from configure as well: for Da

[PULL 10/15] configure: move non-command-line variables away from command-line parsing section

2021-12-23 Thread Paolo Bonzini
This makes it easier to identify candidates for moving to Meson. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- configure | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/configure b/configure index 302d58102b..8eb8e4c2cc 100755 --- a/confi

[PULL 09/15] configure: parse --enable/--disable-strip automatically, flip default

2021-12-23 Thread Paolo Bonzini
Always include the STRIP variable in config-host.mak (it's only used by the s390-ccw firmware build, and it adds a default if configure omitted it), and use meson-buildoptions.sh to turn --enable/--disable-strip into -Dstrip. The default is now not to strip the binaries like for almost every other

[PATCH v2 05/23] dma: Let dma_memory_read/write() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_memory_read() or dma_memory_write(). Patch created mechanically using spatch with this script: @@ expression E1, E2, E3, E4; @@ ( - dma_memory_read(E1, E2, E3, E4) + dma_memory_read(E1, E2, E3, E4, MEMTXATTRS_UNSPECIFIED) |

[PULL 11/15] meson: build contrib/ executables after generated headers

2021-12-23 Thread Paolo Bonzini
This will be needed as soon as config-poison.h moves from configure to a meson custom_target (which is built at "ninja" time). Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- contrib/elf2dmp/meson.build| 2 +- contrib/ivshmem-client/meson.build | 2 +- contrib/ivshm

[PULL 12/15] configure, meson: move config-poison.h to meson

2021-12-23 Thread Paolo Bonzini
This ensures that the file is regenerated properly whenever config-target.h or config-devices.h files change. Signed-off-by: Paolo Bonzini --- Makefile | 2 +- configure | 11 --- meson.build | 12 scripts/make-conf

[PATCH v2 01/23] dma: Let dma_memory_valid() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_memory_valid(). Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Message-Id: <20210702092439.989969-2-phi...@redhat.com> --- include/

[PATCH v2 07/23] dma: Have dma_buf_rw() take a void pointer

2021-12-23 Thread Philippe Mathieu-Daudé
DMA operations are run on any kind of buffer, not arrays of uint8_t. Convert dma_buf_rw() to take a void pointer argument to save us pointless casts to uint8_t *. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- softmmu/dma-helpers.c | 3 ++- 1 file changed, 2 insertions(+),

[PULL 13/15] meson: add comments in the target-specific flags section

2021-12-23 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- meson.build | 5 + 1 file changed, 5 insertions(+) diff --git a/meson.build b/meson.build index a61eb7cee5..3519ed51e3 100644 --- a/meson.build +++ b/meson.build @@ -233,6 +233,7 @@ endif # Target-specific checks and dependencies # #

[PATCH v2 03/23] dma: Let dma_memory_rw_relaxed() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
We will add the MemTxAttrs argument to dma_memory_rw() in the next commit. Since dma_memory_rw_relaxed() is only used by dma_memory_rw(), modify it first in a separate commit to keep the next commit easier to review. Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Igle

[PATCH v2 04/23] dma: Let dma_memory_rw() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_memory_rw(). Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Message-Id: <20210702092439.989969-5-phi...@redhat.com> --- include/hw/

[PATCH v2 00/23] hw: Have DMA APIs take MemTxAttrs arg & propagate MemTxResult (full)

2021-12-23 Thread Philippe Mathieu-Daudé
Hi Peter and Paolo. This series contains all the uncontroversary patches from the "improve DMA situations, avoid re-entrancy issues" earlier series. The rest will be discussed on top. The only operations added are: - take MemTxAttrs argument - propagate MemTxResult All patches are reviewed. If

[PATCH v2 06/23] dma: Let dma_memory_map() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_memory_map(). Patch created mechanically using spatch with this script: @@ expression E1, E2, E3, E4; @@ - dma_memory_map(E1, E2, E3, E4) + dma_memory_map(E1, E2, E3, E4, MEMTXATTRS_UNSPECIFIED) Reviewed-by: Richard Henderson

[PATCH v2 18/23] dma: Let ld*_dma() propagate MemTxResult

2021-12-23 Thread Philippe Mathieu-Daudé
dma_memory_read() returns a MemTxResult type. Do not discard it, return it to the caller. Update the few callers. Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 6 -- include/hw/ppc/spapr_vio.h | 6

[PATCH v2 09/23] dma: Let pci_dma_rw() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling pci_dma_rw(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 10 ++ hw/audio/intel-hda.c | 3 ++- hw/scsi/esp-pci.c| 2 +

[PATCH v2 02/23] dma: Let dma_memory_set() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_memory_set(). Reviewed-by: Richard Henderson Reviewed-by: Li Qiang Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Message-Id: <20210702092439.989969-3-phi...@redhat.com> --- include/hw

[PATCH v2 08/23] dma: Have dma_buf_read() / dma_buf_write() take a void pointer

2021-12-23 Thread Philippe Mathieu-Daudé
DMA operations are run on any kind of buffer, not arrays of uint8_t. Convert dma_buf_read/dma_buf_write functions to take a void pointer argument and save us pointless casts to uint8_t *. Remove this pointless casts in the megasas device model. Reviewed-by: Klaus Jensen Signed-off-by: Philippe M

[PATCH v2 14/23] dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult

2021-12-23 Thread Philippe Mathieu-Daudé
Since the previous commit, dma_buf_rw() returns a MemTxResult type. Do not discard it, return it to the caller. Since both dma_buf_read/dma_buf_write functions were previously returning the QEMUSGList size not consumed, add an extra argument where the unconsummed size can be stored. Update the fe

[PATCH v2 10/23] dma: Let dma_buf_rw() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_buf_rw(). Keep the default MEMTXATTRS_UNSPECIFIED in the 2 callers. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- softmmu/dma-helpers.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --gi

[PATCH v2 17/23] dma: Let st*_dma() propagate MemTxResult

2021-12-23 Thread Philippe Mathieu-Daudé
dma_memory_write() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/dma.h | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) d

[PATCH v2 11/23] dma: Let dma_buf_write() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_buf_write(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/dma.h | 2 +- hw/ide/ahci.c | 6 -- hw/nvme/ctrl.c| 3 ++-

[PATCH v2 20/23] pci: Let st*_pci_dma() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling st*_pci_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 11 ++- hw/audio/intel-hda.c | 10 ++ hw/net/eepro1

[PATCH v2 21/23] pci: Let ld*_pci_dma() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling ld*_pci_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 6 +++--- hw/audio/intel-hda.c | 2 +- hw/net/eepro100.c| 19

[PATCH v2 12/23] dma: Let dma_buf_read() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling dma_buf_read(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/dma.h | 2 +- hw/ide/ahci.c | 4 ++-- hw/nvme/ctrl.c| 2 +-

[PATCH v3 kvm/queue 02/16] mm/memfd: Introduce MFD_INACCESSIBLE flag

2021-12-23 Thread Chao Peng
Introduce a new memfd_create() flag indicating the content of the created memfd is inaccessible from userspace. It does this by force setting F_SEAL_INACCESSIBLE seal when the file is created. It also set F_SEAL_SEAL to prevent future sealing, which means, it can not coexist with MFD_ALLOW_SEALING.

[PATCH v2 22/23] pci: Let st*_pci_dma() propagate MemTxResult

2021-12-23 Thread Philippe Mathieu-Daudé
st*_dma() returns a MemTxResult type. Do not discard it, return it to the caller. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pc

[PATCH v2 13/23] dma: Let dma_buf_rw() propagate MemTxResult

2021-12-23 Thread Philippe Mathieu-Daudé
dma_memory_rw() returns a MemTxResult type. Do not discard it, return it to the caller. Since dma_buf_rw() was previously returning the QEMUSGList size not consumed, add an extra argument where this size can be stored. Update the 2 callers. Reviewed-by: Klaus Jensen Signed-off-by: Philippe Math

[PATCH v3 kvm/queue 03/16] mm/memfd: Introduce MEMFD_OPS

2021-12-23 Thread Chao Peng
From: "Kirill A. Shutemov" The patch introduces new MEMFD_OPS facility around file created by memfd_create() to allow a third kernel component to make use of memory bookmarked in a memfd and gets notifier when the memory in the file is allocated/invalidated. It will be used for KVM to use memfd f

[PATCH v2 23/23] pci: Let ld*_pci_dma() propagate MemTxResult

2021-12-23 Thread Philippe Mathieu-Daudé
ld*_dma() returns a MemTxResult type. Do not discard it, return it to the caller. Update the few callers. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 17 - hw/audio/intel-hda.c | 2 +- hw/net/eepro100.c| 25 ++

[PATCH v2 15/23] dma: Let st*_dma() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling st*_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 3 ++- include/hw/ppc/spapr_vio.h

[PATCH v3 kvm/queue 01/16] mm/shmem: Introduce F_SEAL_INACCESSIBLE

2021-12-23 Thread Chao Peng
From: "Kirill A. Shutemov" Introduce a new seal F_SEAL_INACCESSIBLE indicating the content of the file is inaccessible from userspace in any possible ways like read(),write() or mmap() etc. It provides semantics required for KVM guest private memory support that a file descriptor with this seal

[PATCH v3 kvm/queue 05/16] KVM: Maintain ofs_tree for fast memslot lookup by file offset

2021-12-23 Thread Chao Peng
Similar to hva_tree for hva range, maintain interval tree ofs_tree for offset range of a fd-based memslot so the lookup by offset range can be faster when memslot count is high. Signed-off-by: Chao Peng --- include/linux/kvm_host.h | 2 ++ virt/kvm/kvm_main.c | 17 + 2 file

[PATCH v3 kvm/queue 09/16] KVM: Split out common memory invalidation code

2021-12-23 Thread Chao Peng
When fd-based memory is enabled, there will be two types of memory invalidation: - memory invalidation from native MMU through mmu_notifier callback for hva-based memory, and, - memory invalidation from memfd through memfd_notifier callback for fd-based memory. Some code can be shared

[PATCH v2 16/23] dma: Let ld*_dma() take MemTxAttrs argument

2021-12-23 Thread Philippe Mathieu-Daudé
Let devices specify transaction attributes when calling ld*_dma(). Keep the default MEMTXATTRS_UNSPECIFIED in the few callers. Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater Signed-off-by: Philippe Mathieu-Daudé --- include/hw/pci/pci.h | 3 ++- include/hw/ppc/spapr_vio.h

[PATCH v3 kvm/queue 08/16] KVM: Special handling for fd-based memory invalidation

2021-12-23 Thread Chao Peng
For fd-based guest memory, the memory backend (e.g. the fd provider) should notify KVM to unmap/invalidate the privated memory from KVM secondary MMU when userspace punches hole on the fd (e.g. when userspace converts private memory to shared memory). To support fd-based memory invalidation, exist

[PATCH v3 kvm/queue 11/16] KVM: Add kvm_map_gfn_range

2021-12-23 Thread Chao Peng
This new function establishes the mapping in KVM page tables for a given gfn range. It can be used in the memory fallocate callback for memfd based memory to establish the mapping for KVM secondary MMU when the pages are allocated in the memory backend. Signed-off-by: Yu Zhang Signed-off-by: Chao

[PATCH v3 kvm/queue 06/16] KVM: Implement fd-based memory using MEMFD_OPS interfaces

2021-12-23 Thread Chao Peng
This patch adds the new memfd facility in KVM using MEMFD_OPS to provide guest memory from a file descriptor created in userspace with memfd_create() instead of traditional userspace hva. It mainly provides two kind of functions: - Pair/unpair a fd-based memslot to a memory backend that owns the

[PATCH v3 kvm/queue 13/16] KVM: Add KVM_EXIT_MEMORY_ERROR exit

2021-12-23 Thread Chao Peng
This new exit allows user space to handle memory-related errors. Currently it supports two types (KVM_EXIT_MEM_MAP_SHARED/PRIVATE) of errors which are used for shared memory <-> private memory conversion in memory encryption usage. After private memory is enabled, there are two places in KVM that

[PATCH v2 19/23] hw/scsi/megasas: Use uint32_t for reply queue head/tail values

2021-12-23 Thread Philippe Mathieu-Daudé
While the reply queue values fit in 16-bit, they are accessed as 32-bit: 661:s->reply_queue_head = ldl_le_pci_dma(pcid, s->producer_pa); 662:s->reply_queue_head %= MEGASAS_MAX_FRAMES; 663:s->reply_queue_tail = ldl_le_pci_dma(pcid, s->consumer_pa); 664:s->reply_queue_tail %=

[PATCH v3 kvm/queue 12/16] KVM: Implement fd-based memory fallocation

2021-12-23 Thread Chao Peng
KVM gets notified through memfd_notifier when userspace allocatea space via fallocate() on the fd which is used for guest memory. KVM can set up the mapping in the secondary MMU page tables at this time. This patch adds function in KVM to map pfn to gfn when the page is allocated in the memory back

[PATCH v3 kvm/queue 15/16] KVM: Use kvm_userspace_memory_region_ext

2021-12-23 Thread Chao Peng
Use the new extended memslot structure kvm_userspace_memory_region_ext which includes two additional fd/ofs fields comparing to the current kvm_userspace_memory_region. The fields fd/ofs will be copied from userspace only when KVM_MEM_PRIVATE is set. Internal the KVM we change all existing kvm_use

[PATCH v3 kvm/queue 14/16] KVM: Handle page fault for private memory

2021-12-23 Thread Chao Peng
When a page fault from the secondary page table while the guest is running happens in a memslot with KVM_MEM_PRIVATE, we need go different paths for private access and shared access. - For private access, KVM checks if the page is already allocated in the memory backend, if yes KVM establish

Re: [PATCH v4 18/19] iotests.py: implement unsupported_imgopts

2021-12-23 Thread Hanna Reitz
On 03.12.21 14:07, Vladimir Sementsov-Ogievskiy wrote: We have added support for some addition IMGOPTS in python iotests like in bash iotests. Similarly to bash iotests, we want a way to skip some tests which can't work with specific IMGOPTS. Globally for python iotests we now don't support thin

[PATCH v3 kvm/queue 16/16] KVM: Register/unregister private memory slot to memfd

2021-12-23 Thread Chao Peng
Expose KVM_MEM_PRIVATE flag and register/unregister private memory slot to memfd when userspace sets the flag. KVM_MEM_PRIVATE is disallowed by default but architecture code can turn on it by implementing kvm_arch_private_memory_supported(). Signed-off-by: Yu Zhang Signed-off-by: Chao Peng ---

Re: [PATCH v4 19/19] iotests: specify some unsupported_imgopts for python iotests

2021-12-23 Thread Hanna Reitz
On 03.12.21 14:07, Vladimir Sementsov-Ogievskiy wrote: We support IMGOPTS for python iotests now. Still a lot of tests are unprepared to common IMGOPTS that are used with bash iotests. So we should define corresponding unsupported_imgopts. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests

[PATCH v3 kvm/queue 00/16] KVM: mm: fd-based approach for supporting KVM guest private memory

2021-12-23 Thread Chao Peng
This is the third version of this series which try to implement the fd-based KVM guest private memory. Earlier this week I sent another v3 version at link: https://lore.kernel.org/linux-mm/20211222012223.ga22...@chaop.bj.intel.com/T/ That version is based on the latest TDX codebase. In contrast

Re: [PATCH] Supporting AST2600 HACE engine accumulative mode

2021-12-23 Thread Cédric Le Goater
[ Adding Klaus ] On 12/22/21 03:22, Troy Lee wrote: Accumulative mode will supply a initial state and append padding bit at the end of hash stream. However, the crypto library will padding those bit automatically, so ripped it off from iov array. Signed-off-by: Troy Lee --- hw/misc/aspeed_h

[PATCH v3 kvm/queue 04/16] KVM: Extend the memslot to support fd-based private memory

2021-12-23 Thread Chao Peng
Extend the memslot definition to provide fd-based private memory support by adding two new fields(fd/ofs). The memslot then can maintain memory for both shared and private pages in a single memslot. Shared pages are provided in the existing way by using userspace_addr(hva) field and get_user_pages(

[PATCH v3 kvm/queue 07/16] KVM: Refactor hva based memory invalidation code

2021-12-23 Thread Chao Peng
The purpose of this patch is for fd-based memslot to reuse the same mmu_notifier based guest memory invalidation code for private pages. No functional changes except renaming 'hva' to more neutral 'useraddr' so that it can also cover 'offset' in a fd that private pages live in. Signed-off-by: Yu

[PATCH v3 kvm/queue 10/16] KVM: Implement fd-based memory invalidation

2021-12-23 Thread Chao Peng
KVM gets notified when userspace punches a hole in a fd which is used for guest memory. KVM should invalidate the mapping in the secondary MMU page tables. This is the same logic as MMU notifier invalidation except the fd related information is carried around to indicate the memory range. KVM hence

Re: [PATCH v2] audio: Add sndio backend

2021-12-23 Thread Christian Schoenebeck
On Montag, 20. Dezember 2021 16:41:31 CET Christian Schoenebeck wrote: > On Freitag, 17. Dezember 2021 10:38:32 CET Alexandre Ratchov wrote: > > sndio is the native API used by OpenBSD, although it has been ported to > > other *BSD's and Linux (packages for Ubuntu, Debian, Void, Arch, etc.). > > >

Re: [PATCH] pci: Skip power-off reset when pending unplug

2021-12-23 Thread Michael S. Tsirkin
On Wed, Dec 22, 2021 at 04:10:07PM -0700, Alex Williamson wrote: > On Wed, 22 Dec 2021 15:48:24 -0500 > "Michael S. Tsirkin" wrote: > > > On Wed, Dec 22, 2021 at 12:08:09PM -0700, Alex Williamson wrote: > > > On Tue, 21 Dec 2021 18:40:09 -0500 > > > "Michael S. Tsirkin" wrote: > > > > > > > O

Re: [PATCH] acpi: validate hotplug selector on access

2021-12-23 Thread Michael S. Tsirkin
On Thu, Dec 23, 2021 at 10:58:14AM +0100, Mauro Matteo Cascella wrote: > Hi, > > On Wed, Dec 22, 2021 at 9:52 PM Michael S. Tsirkin wrote: > > > > On Wed, Dec 22, 2021 at 09:27:51PM +0100, Philippe Mathieu-Daudé wrote: > > > On Wed, Dec 22, 2021 at 9:20 PM Michael S. Tsirkin > > > wrote: > > >

Re: [PATCH v1 1/2] hw/misc: Implementating dummy AST2600 I3C model

2021-12-23 Thread Cédric Le Goater
Hello, On 12/22/21 10:23, Troy Lee wrote: Introduce a dummy AST2600 I3C model. Aspeed 2600 SDK enables I3C support by default. The I3C driver will try to reset the device controller and setup through device address table register. This dummy model response these register with default value

Re: [PATCH v1 2/2] hw/arm/aspeed_ast2600: create i3c instance

2021-12-23 Thread Cédric Le Goater
On 12/22/21 10:23, Troy Lee wrote: This patch includes i3c instance in ast2600 soc. Signed-off-by: Troy Lee Looks good but it is based on the QEMU aspeed branch for OpenBMC. You should rebase on upstream. Thanks, C. --- hw/arm/aspeed_ast2600.c | 12 include/hw/arm/aspe

  1   2   3   >