Re: [PATCH] scsi/lsi53c895a: fix use-after-free in lsi_do_msgout (CVE-2022-0216)

2022-07-06 Thread Thomas Huth
On 05/07/2022 22.05, Mauro Matteo Cascella wrote: Set current_req->req to NULL to prevent reusing a free'd buffer in case of repeated SCSI cancel requests. Thanks to Thomas Huth for suggesting the patch. Fixes: CVE-2022-0216 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972 Signed-off-

[PATCH v6 11/13] qemu-sockets: move and rename SocketAddress_to_str()

2022-07-06 Thread Laurent Vivier
Rename SocketAddress_to_str() to socket_uri() and move it to util/qemu-sockets.c close to socket_parse(). socket_uri() generates a string from a SocketAddress while socket_parse() generates a SocketAddress from a string. Signed-off-by: Laurent Vivier --- include/qemu/sockets.h | 2 +- monitor/

Re: [PATCH v2] io_uring: fix short read slow path

2022-07-06 Thread Stefan Hajnoczi
On Tue, 5 Jul 2022 at 20:26, Jens Axboe wrote: > > On 7/5/22 7:28 AM, Stefan Hajnoczi wrote: > > On Fri, Jul 01, 2022 at 07:52:31AM +0900, Dominique Martinet wrote: > >> Stefano Garzarella wrote on Thu, Jun 30, 2022 at 05:49:21PM +0200: > so when we ask for more we issue an extra short reads,

Re: [PATCH v2] io_uring: fix short read slow path

2022-07-06 Thread Stefan Hajnoczi
On Tue, 5 Jul 2022 at 23:53, Dominique Martinet wrote: > > Stefan Hajnoczi wrote on Tue, Jul 05, 2022 at 02:28:08PM +0100: > > > The older kernel I have installed right now is 5.16 and that can > > > reproduce it -- I'll give my laptop some work over the weekend to test > > > still maintained sta

Re: [PATCH v2 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread Marc-André Lureau
Hi On Wed, Jul 6, 2022 at 7:09 AM zhenwei pi wrote: > On 7/4/22 16:00, zhenwei pi wrote: > > > > > >> +## > >> +# @GuestOsType: > >> +# > >> +# An enumeration of OS type > >> +# > >> +# Since: 7.1 > >> +## > >> +{ 'enum': 'GuestOsType', > >> + 'data': [ 'linu

Re: [PATCH] scsi/lsi53c895a: fix use-after-free in lsi_do_msgout (CVE-2022-0216)

2022-07-06 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH v2] io_uring: fix short read slow path

2022-07-06 Thread Dominique Martinet
Stefan Hajnoczi wrote on Wed, Jul 06, 2022 at 08:17:42AM +0100: > Great! I've already queued your fix. Thanks! > Do you want to send a follow-up that updates the comment? I don't think I'd add much value at this point, leaving it to you unless you really would prefer me to send it. Cheers, --

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Thomas Huth
On 05/07/2022 17.37, Vladimir Sementsov-Ogievskiy wrote: strerror() represents ETIMEDOUT a bit different in Linux and macOS / FreeBSD. Let's support the latter too. Fixes: 9d05a87b77 ("iotests: copy-before-write: add cases for cbw-timeout option") Signed-off-by: Vladimir Sementsov-Ogievskiy --

Re: [PATCH 2/3] Revert "main-loop: Disable block backend global state assertion on Cocoa"

2022-07-06 Thread Emanuele Giuseppe Esposito
Am 06/07/2022 um 04:13 schrieb Akihiko Odaki: > This reverts commit 47281859f66bdab1974fb122cab2cbb4a1c9af7f. > > Signed-off-by: Akihiko Odaki > --- > include/qemu/main-loop.h | 13 - > 1 file changed, 13 deletions(-) Reviewed-by: Emanuele Giuseppe Esposito

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Thomas Huth
On 05/07/2022 19.22, Richard Henderson wrote: On 7/5/22 21:07, Vladimir Sementsov-Ogievskiy wrote: strerror() represents ETIMEDOUT a bit different in Linux and macOS / FreeBSD. Let's support the latter too. Fixes: 9d05a87b77 ("iotests: copy-before-write: add cases for cbw-timeout option") Sig

Re: [PATCH 2/9] target/ppc: add errp to kvmppc_read_int_cpu_dt()

2022-07-06 Thread Cédric Le Goater
On 7/5/22 08:57, Cédric Le Goater wrote: On 7/5/22 08:51, Mark Cave-Ayland wrote: On 04/07/2022 18:34, Cédric Le Goater wrote: On 7/2/22 15:34, Daniel Henrique Barboza wrote: On 7/2/22 03:24, Cédric Le Goater wrote: On 6/30/22 21:42, Daniel Henrique Barboza wrote: The function can't just

Re: Re: [PATCH v2 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
On 7/6/22 15:20, Marc-André Lureau wrote: Hi On Wed, Jul 6, 2022 at 7:09 AM zhenwei pi > wrote: On 7/4/22 16:00, zhenwei pi wrote: > > >>     +## >>     +# @GuestOsType: >>     +# >>     +# An enumeration of OS type >>  

Re: [PATCH v2] io_uring: fix short read slow path

2022-07-06 Thread Stefan Hajnoczi
On Wed, Jul 06, 2022 at 04:26:59PM +0900, Dominique Martinet wrote: > Stefan Hajnoczi wrote on Wed, Jul 06, 2022 at 08:17:42AM +0100: > > Great! I've already queued your fix. > > Thanks! > > > Do you want to send a follow-up that updates the comment? > > I don't think I'd add much value at this

Re: [PATCH v2 1/9] hw/i2c/pca954x: Add method to get channels

2022-07-06 Thread Peter Delevoryas
On Wed, Jul 06, 2022 at 08:06:34AM +0200, Cédric Le Goater wrote: > On 7/5/22 23:44, Peter Delevoryas wrote: > > On Tue, Jul 05, 2022 at 02:40:32PM -0700, Peter Delevoryas wrote: > > > On Tue, Jul 05, 2022 at 03:06:24PM -0500, Corey Minyard wrote: > > > > On Tue, Jul 05, 2022 at 12:13:52PM -0700, P

Re: [PATCH v2 9/9] docs: aspeed: Add fby35 multi-SoC machine section

2022-07-06 Thread Peter Delevoryas
On Wed, Jul 06, 2022 at 07:58:44AM +0200, Cédric Le Goater wrote: > On 7/5/22 21:14, Peter Delevoryas wrote: > > Signed-off-by: Peter Delevoryas > > Reviewed-by: Cédric Le Goater > > I fixed inline the URL links and moved the section at the end of the file. > > Thanks, > > C. Thanks for that

Re: [PATCH RESEND] python/machine: Fix AF_UNIX path too long on macOS

2022-07-06 Thread Daniel P . Berrangé
On Tue, Jul 05, 2022 at 02:46:59PM -0700, Peter Delevoryas wrote: > I noticed that I can't run any avocado tests on macOS because the QMP > unix socket path is too long: > I think the path limit for unix sockets on macOS might be 104 [1] All platforms have a very limited path limit, so it isn't

[PATCH] block/io_uring: clarify that short reads can happen

2022-07-06 Thread Stefan Hajnoczi
Jens Axboe has confirmed that short reads are rare but can happen: https://lore.kernel.org/io-uring/YsU%2FCGkl9ZXUI+Tj@stefanha-x1.localdomain/T/#m729963dc577d709b709c191922e98ec79d7eef54 The luring_resubmit_short_read() comment claimed they were only due to a specific io_uring bug that was fixed

Re: [PATCH v2 9/9] docs: aspeed: Add fby35 multi-SoC machine section

2022-07-06 Thread Joel Stanley
On Tue, 5 Jul 2022 at 19:14, Peter Delevoryas wrote: > > Signed-off-by: Peter Delevoryas Reviewed-by: Joel Stanley > --- > docs/system/arm/aspeed.rst | 48 ++ > 1 file changed, 48 insertions(+) > > diff --git a/docs/system/arm/aspeed.rst b/docs/system/arm/a

[PATCH v7 01/14] mm: Add F_SEAL_AUTO_ALLOCATE seal to memfd

2022-07-06 Thread Chao Peng
Normally, a write to unallocated space of a file or the hole of a sparse file automatically causes space allocation, for memfd, this equals to memory allocation. This new seal prevents such automatically allocating, either this is from a direct write() or a write on the previously mmap-ed area. The

[PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-07-06 Thread Chao Peng
This is the v7 of this series which tries to implement the fd-based KVM guest private memory. The patches are based on latest kvm/queue branch commit: b9b71f43683a (kvm/queue) KVM: x86/mmu: Buffer nested MMU split_desc_cache only by default capacity Introduction In general this pat

[PATCH v5 01/45] target/arm: Handle SME in aarch64_cpu_dump_state

2022-07-06 Thread Richard Henderson
Dump SVCR, plus use the correct access check for Streaming Mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ae6dca2f01..9c58be8b1

Re: [PATCH v8 06/20] job.h: define functions called without job lock held

2022-07-06 Thread Emanuele Giuseppe Esposito
Am 05/07/2022 um 12:54 schrieb Vladimir Sementsov-Ogievskiy: > To subject: hmm, the commit don't define any function.. > mark functions called without job lock held?

[PATCH v5 03/45] target/arm: Trap non-streaming usage when Streaming SVE is active

2022-07-06 Thread Richard Henderson
This new behaviour is in the ARM pseudocode function AArch64.CheckFPAdvSIMDEnabled, which applies to AArch32 via AArch32.CheckAdvSIMDOrFPEnabled when the EL to which the trap would be delivered is in AArch64 mode. Given that ARMv9 drops support for AArch32 outside EL0, the trap EL detection ought

Re: [PATCH v8 06/20] job.h: define functions called without job lock held

2022-07-06 Thread Emanuele Giuseppe Esposito
Am 05/07/2022 um 12:53 schrieb Vladimir Sementsov-Ogievskiy: > On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote: >> These functions don't need a _locked() counterpart, since >> they are all called outside job.c and take the lock only >> internally. >> >> Update also the comments in blockjob.c

[PATCH v7 02/14] selftests/memfd: Add tests for F_SEAL_AUTO_ALLOCATE

2022-07-06 Thread Chao Peng
Add tests to verify sealing memfds with the F_SEAL_AUTO_ALLOCATE works as expected. Signed-off-by: Chao Peng --- tools/testing/selftests/memfd/memfd_test.c | 166 + 1 file changed, 166 insertions(+) diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/sel

[PATCH v7 03/14] mm: Introduce memfile_notifier

2022-07-06 Thread Chao Peng
This patch introduces memfile_notifier facility so existing memory file subsystems (e.g. tmpfs/hugetlbfs) can provide memory pages to allow a third kernel component to make use of memory bookmarked in the memory file and gets notified when the pages in the memory file become invalidated. It will b

[PATCH v5 09/45] target/arm: Mark SMMLA, UMMLA, USMMLA as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 1 - target/arm/translate-sve.c | 12 ++-- 2 files changed, 6 insertions(+),

[PATCH v5 00/45] target/arm: Scalable Matrix Extension

2022-07-06 Thread Richard Henderson
Changes for v5: * Use macros for vertical tile slice addressing. * Other misc adjustments per review. Patches without r-b: 03-target-arm-Trap-non-streaming-usage-when-Streamin.patch 07-target-arm-Mark-PMULL-FMMLA-as-non-streaming.patch 19-target-arm-Implement-SME-MOVA.patch 20-target-a

[PATCH v7 04/14] mm/shmem: Support memfile_notifier

2022-07-06 Thread Chao Peng
From: "Kirill A. Shutemov" Implement shmem as a memfile_notifier backing store. Essentially it interacts with the memfile_notifier feature flags for userspace access/page migration/page reclaiming and implements the necessary memfile_backing_store callbacks. Signed-off-by: Kirill A. Shutemov Si

[PATCH v5 08/45] target/arm: Mark FTSMUL, FTMAD, FADDA as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 3 --- target/arm/translate-sve.c | 15 +++ 2 files changed, 11 insertion

[PATCH v5 02/45] target/arm: Add infrastructure for disas_sme

2022-07-06 Thread Richard Henderson
This includes the build rules for the decoder, and the new file for translation, but excludes any instructions. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 1 + target/arm/sme.decode | 20 target/arm/translate-a64.c |

[PATCH v5 04/45] target/arm: Mark ADR as non-streaming

2022-07-06 Thread Richard Henderson
Mark ADR as a non-streaming instruction, which should trap if full a64 support is not enabled in streaming mode. Removing entries from sme-fa64.decode is an easy way to see what remains to be done. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.h | 7 +

[PATCH v5 07/45] target/arm: Mark PMULL, FMMLA as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 2 -- target/arm/translate-sve.c | 24 +++- 2 files changed, 15 insertions(+), 11 deletions(-

[PATCH v5 05/45] target/arm: Mark RDFFR, WRFFR, SETFFR as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 2 -- target/arm/translate-sve.c | 9 ++--- 2 files changed, 6 insertions(+), 5 de

[PATCH v5 14/45] target/arm: Mark LD1RO as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 3 --- target/arm/translate-sve.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletion

[PATCH v7 05/14] mm/memfd: Introduce MFD_INACCESSIBLE flag

2022-07-06 Thread Chao Peng
Introduce a new memfd_create() flag indicating the content of the created memfd is inaccessible from userspace through ordinary MMU access (e.g., read/write/mmap). However, the file content can be accessed via a different mechanism (e.g. KVM MMU) indirectly. It provides semantics required for KVM

[PATCH v5 15/45] target/arm: Add SME enablement checks

2022-07-06 Thread Richard Henderson
These functions will be used to verify that the cpu is in the correct state for a given instruction. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 21 + target/arm/translate-a64.c | 34 ++ 2 files

[PATCH v5 11/45] target/arm: Mark gather/scatter load/store as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 9 - target/arm/translate-sve.c | 6 ++ 2 files changed, 6 insertions(+),

[PATCH v5 13/45] target/arm: Mark LDFF1 and LDNF1 as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 2 -- target/arm/translate-sve.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions

[PATCH v5 06/45] target/arm: Mark BDEP, BEXT, BGRP, COMPACT, FEXPA, FTSSEL as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 3 --- target/arm/translate-sve.c | 22 -- 2 files changed, 12 in

[PATCH v5 10/45] target/arm: Mark string/histo/crypto as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 1 - target/arm/translate-sve.c | 35 ++- 2 files chang

[PATCH v5 12/45] target/arm: Mark gather prefetch as non-streaming

2022-07-06 Thread Richard Henderson
Mark these as a non-streaming instructions, which should trap if full a64 support is not enabled in streaming mode. In this case, introduce PRF_ns (prefetch non-streaming) to handle the checks. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme-fa64.decode | 3 ---

[PATCH v5 16/45] target/arm: Handle SME in sve_access_check

2022-07-06 Thread Richard Henderson
The pseudocode for CheckSVEEnabled gains a check for Streaming SVE mode, and for SME present but SVE absent. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/tar

[PATCH v5 18/45] target/arm: Implement SME ZERO

2022-07-06 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v4: Fix ZA[] comment in helper_sme_zero. --- target/arm/helper-sme.h| 2 ++ target/arm/sme.decode | 4 target/arm/sme_helper.c| 25 + target/arm/translate-sme.c | 13 + 4 files

[PATCH v5 17/45] target/arm: Implement SME RDSVL, ADDSVL, ADDSPL

2022-07-06 Thread Richard Henderson
These SME instructions are nominally within the SVE decode space, so we add them to sve.decode and translate-sve.c. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- v4: Add streaming_{vec,pred}_reg_size. --- target/arm/translate-a64.h | 12 target/arm/sve.decode

[PATCH v7 07/14] KVM: Use gfn instead of hva for mmu_notifier_retry

2022-07-06 Thread Chao Peng
Currently in mmu_notifier validate path, hva range is recorded and then checked in the mmu_notifier_retry_hva() from page fault path. However for the to be introduced private memory, a page fault may not have a hva associated, checking gfn(gpa) makes more sense. For existing non private memory case

[PATCH v5 24/45] target/arm: Implement FMOPA, FMOPS (non-widening)

2022-07-06 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/helper-sme.h| 5 +++ target/arm/sme.decode | 9 ++ target/arm/sme_helper.c| 63 ++ target/arm/translate-sme.c | 32 +++ 4 files changed, 109 insertions(+) diff --git a/target/ar

[PATCH v7 06/14] KVM: Rename KVM_PRIVATE_MEM_SLOTS to KVM_INTERNAL_MEM_SLOTS

2022-07-06 Thread Chao Peng
KVM_INTERNAL_MEM_SLOTS better reflects the fact those slots are not exposed to userspace and avoids confusion to real private slots that is going to be added. Signed-off-by: Chao Peng --- arch/mips/include/asm/kvm_host.h | 2 +- arch/x86/include/asm/kvm_host.h | 2 +- include/linux/kvm_host.h

[PATCH v5 21/45] target/arm: Export unpredicated ld/st from translate-sve.c

2022-07-06 Thread Richard Henderson
Add a TCGv_ptr base argument, which will be cpu_env for SVE. We will reuse this for SME save and restore array insns. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate-a64.h | 3 +++ target/arm/translate-sve.c | 48 -- 2 fi

[PATCH v5 23/45] target/arm: Implement SME ADDHA, ADDVA

2022-07-06 Thread Richard Henderson
Signed-off-by: Richard Henderson --- v4: Drop restrict. --- target/arm/helper-sme.h| 5 +++ target/arm/sme.decode | 11 + target/arm/sme_helper.c| 90 ++ target/arm/translate-sme.c | 31 + 4 files changed, 137 insertions(+) diff -

[PATCH v7 09/14] KVM: Extend the memslot to support fd-based private memory

2022-07-06 Thread Chao Peng
Extend the memslot definition to provide guest private memory through a file descriptor(fd) instead of userspace_addr(hva). Such guest private memory(fd) may never be mapped into userspace so no userspace_addr(hva) can be used. Instead add another two new fields (private_fd/private_offset), plus th

[PATCH v5 20/45] target/arm: Implement SME LD1, ST1

2022-07-06 Thread Richard Henderson
We cannot reuse the SVE functions for LD[1-4] and ST[1-4], because those functions accept only a Zreg register number. For SME, we want to pass a pointer into ZA storage. Signed-off-by: Richard Henderson --- target/arm/helper-sme.h| 82 + target/arm/sme.decode | 9 + target/arm/s

[PATCH v5 27/45] target/arm: Implement SME integer outer product

2022-07-06 Thread Richard Henderson
This is SMOPA, SUMOPA, USMOPA_s, UMOPA, for both Int8 and Int16. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper-sme.h| 16 target/arm/sme.decode | 10 + target/arm/sme_helper.c| 82 ++ target/arm/tr

[PATCH v5 30/45] target/arm: Implement SCLAMP, UCLAMP

2022-07-06 Thread Richard Henderson
This is an SVE instruction that operates using the SVE vector length but that it is present only if SME is implemented. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper.h| 18 +++ target/arm/sve.decode | 5 ++ target/arm/translate-sve.c | 102

[PATCH v5 19/45] target/arm: Implement SME MOVA

2022-07-06 Thread Richard Henderson
We can reuse the SVE functions for implementing moves to/from horizontal tile slices, but we need new ones for moves to/from vertical tile slices. Signed-off-by: Richard Henderson --- target/arm/helper-sme.h| 12 +++ target/arm/helper-sve.h| 2 + target/arm/translate-a64.h | 8 ++ t

[PATCH v5 26/45] target/arm: Implement FMOPA, FMOPS (widening)

2022-07-06 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/helper-sme.h| 2 ++ target/arm/sme.decode | 1 + target/arm/sme_helper.c| 68 ++ target/arm/translate-sme.c | 1 + 4 files changed, 72 insertions(+) diff --git a/target/arm/helper-sme.h b/target/a

[PATCH v5 22/45] target/arm: Implement SME LDR, STR

2022-07-06 Thread Richard Henderson
We can reuse the SVE functions for LDR and STR, passing in the base of the ZA vector and a zero offset. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sme.decode | 7 +++ target/arm/translate-sme.c | 24 2 files changed, 31 insertio

[PATCH v5 28/45] target/arm: Implement PSEL

2022-07-06 Thread Richard Henderson
This is an SVE instruction that operates using the SVE vector length but that it is present only if SME is implemented. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/sve.decode | 20 + target/arm/translate-sve.c | 57

[PATCH v7 13/14] KVM: Enable and expose KVM_MEM_PRIVATE

2022-07-06 Thread Chao Peng
Register private memslot to fd-based memory backing store and handle the memfile notifiers to zap the existing mappings. Currently the register is happened at memslot creating time and the initial support does not include page migration/swap. KVM_MEM_PRIVATE is not exposed by default, architectur

[PATCH v7 10/14] KVM: Add KVM_EXIT_MEMORY_FAULT exit

2022-07-06 Thread Chao Peng
This new KVM exit allows userspace to handle memory-related errors. It indicates an error happens in KVM at guest memory range [gpa, gpa+size). The flags includes additional information for userspace to handle the error. Currently bit 0 is defined as 'private memory' where '1' indicates error happe

[PATCH v7 08/14] KVM: Rename mmu_notifier_*

2022-07-06 Thread Chao Peng
The sync mechanism between mmu_notifier and page fault handler employs fields mmu_notifier_seq/count and mmu_notifier_range_start/end. For the to be added private memory, there is the same mechanism needed but not rely on mmu_notifier (It uses new introduced memfile_notifier). This patch renames th

[PATCH v5 32/45] target/arm: Enable SME for -cpu max

2022-07-06 Thread Richard Henderson
Note that SME remains effectively disabled for user-only, because we do not yet set CPACR_EL1.SMEN. This needs to wait until the kernel ABI is implemented. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- docs/system/arm/emulation.rst | 4 target/arm/cpu64.c| 1

[PATCH v5 44/45] target/arm: Enable SME for user-only

2022-07-06 Thread Richard Henderson
Enable SME, TPIDR2_EL0, and FA64 if supported by the cpu. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 9b54443843..5de7e097e9 100644 --- a/target/arm/cp

[PATCH v5 35/45] linux-user/aarch64: Add SM bit to SVE signal context

2022-07-06 Thread Richard Henderson
Make sure to zero the currently reserved fields. Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c index 7da0e36c6d..3cef2f44cf 100644 --- a/linux-

[PATCH v5 25/45] target/arm: Implement BFMOPA, BFMOPS

2022-07-06 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/helper-sme.h| 2 ++ target/arm/sme.decode | 2 ++ target/arm/sme_helper.c| 52 ++ target/arm/translate-sme.c | 30 ++ 4 files changed, 86 insertions(+) diff --git a/target/arm/h

[PATCH v7 11/14] KVM: Register/unregister the guest private memory regions

2022-07-06 Thread Chao Peng
If CONFIG_HAVE_KVM_PRIVATE_MEM=y, userspace can register/unregister the guest private memory regions through KVM_MEMORY_ENCRYPT_{UN,}REG_REGION ioctls. The patch reuses existing SEV ioctl but differs that the address in the region for private memory is gpa while SEV case it's hva. The private memo

[PATCH v5 38/45] linux-user/aarch64: Verify extra record lock succeeded

2022-07-06 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-user/aarch64/signal.c b/linux-user/aarch64/signal.c index 8fbe98d72f..9ff79da4be 100644 --- a/linux-user/aarch64/signal.c +++ b/linux-user/aarc

[PATCH v5 29/45] target/arm: Implement REVD

2022-07-06 Thread Richard Henderson
This is an SVE instruction that operates using the SVE vector length but that it is present only if SME is implemented. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper-sve.h| 2 ++ target/arm/sve.decode | 1 + target/arm/sve_helper.c| 16

[PATCH v7 12/14] KVM: Handle page fault for private memory

2022-07-06 Thread Chao Peng
A page fault can carry the private/shared information for KVM_MEM_PRIVATE memslot, this can be filled by architecture code(like TDX code). To handle page fault for such access, KVM maps the page only when this private property matches the host's view on the page. For a successful match, private pf

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 08:39, Thomas Huth wrote: > Many of the iotests rely on output text matching. It's very fragile, always > has been and always will be (unless we rewrite the whole test suite to not > use output text matching anymore). Maybe you could have a pre-pass over the "expected result

[PATCH v5 39/45] linux-user/aarch64: Move sve record checks into restore

2022-07-06 Thread Richard Henderson
Move the checks out of the parsing loop and into the restore function. This more closely mirrors the code structure in the kernel, and is slightly clearer. Reject rather than silently skip incorrect VL and SVE record sizes, bringing our checks in to line with those the kernel does. Reviewed-by:

Re: Re: [PATCH v2 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread Marc-André Lureau
Hi On Wed, Jul 6, 2022 at 11:49 AM zhenwei pi wrote: > > > On 7/6/22 15:20, Marc-André Lureau wrote: > > Hi > > > > On Wed, Jul 6, 2022 at 7:09 AM zhenwei pi > > wrote: > > > > On 7/4/22 16:00, zhenwei pi wrote: > > > > > > > > >> +## > >

[PATCH v7 14/14] memfd_create.2: Describe MFD_INACCESSIBLE flag

2022-07-06 Thread Chao Peng
Signed-off-by: Chao Peng --- man2/memfd_create.2 | 13 + 1 file changed, 13 insertions(+) diff --git a/man2/memfd_create.2 b/man2/memfd_create.2 index 89e9c4136..2698222ae 100644 --- a/man2/memfd_create.2 +++ b/man2/memfd_create.2 @@ -101,6 +101,19 @@ meaning that no other seals can

[PATCH v5 31/45] target/arm: Reset streaming sve state on exception boundaries

2022-07-06 Thread Richard Henderson
We can handle both exception entry and exception return by hooking into aarch64_sve_change_el. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/helper.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/ar

[PATCH v5 40/45] linux-user/aarch64: Implement SME signal handling

2022-07-06 Thread Richard Henderson
Set the SM bit in the SVE record on signal delivery, create the ZA record. Restore SM and ZA state according to the records present on return. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 167 +--- 1 file changed,

[PATCH v5 41/45] linux-user: Rename sve prctls

2022-07-06 Thread Richard Henderson
Add "sve" to the sve prctl functions, to distinguish them from the coming "sme" prctls with similar names. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_prctl.h | 8 linux-user/syscall.c | 12 ++-- 2 files changed, 10 in

[PATCH v5 33/45] linux-user/aarch64: Clear tpidr2_el0 if CLONE_SETTLS

2022-07-06 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_cpu.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux-user/aarch64/target_cpu.h b/linux-user/aarch64/target_cpu.h index 97a477bd3e..f90359faf2 100644 --- a/linux-user/aarch64/t

[PATCH v5 34/45] linux-user/aarch64: Reset PSTATE.SM on syscalls

2022-07-06 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/cpu_loop.c | 9 + 1 file changed, 9 insertions(+) diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index f7ef36cd9f..9875d609a9 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/l

[PATCH v5 45/45] linux-user/aarch64: Add SME related hwcap entries

2022-07-06 Thread Richard Henderson
Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/elfload.c | 20 1 file changed, 20 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 1de77c7959..ce902dbd56 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@

Re: [RFC PATCH v2 4/8] qapi: golang: Generate qapi's union types in Go

2022-07-06 Thread Andrea Bolognani
On Tue, Jul 05, 2022 at 05:35:26PM +0100, Daniel P. Berrangé wrote: > On Tue, Jul 05, 2022 at 08:45:30AM -0700, Andrea Bolognani wrote: > > All this string manipulation looks sketchy. Is there some reason that > > I'm not seeing preventing you for doing something like the untested > > code below? >

Re: [PATCH v2 17/18] block: Reorganize some declarations in block-backend-io.h

2022-07-06 Thread Hanna Reitz
On 05.07.22 18:15, Alberto Faria wrote: Keep generated_co_wrapper and coroutine_fn pairs together. This should make it clear that each I/O function has these two versions. Also move blk_co_{pread,pwrite}()'s implementations out of the header file for consistency. Signed-off-by: Alberto Faria R

Re: [PATCH v2 01/18] block: Make blk_{pread,pwrite}() return 0 on success

2022-07-06 Thread Hanna Reitz
On 05.07.22 18:15, Alberto Faria wrote: They currently return the value of their 'bytes' parameter on success. Make them return 0 instead, for consistency with other I/O functions and in preparation to implement them using generated_co_wrapper. This also makes it clear that short reads/writes ar

Re: [RFC PATCH v2 4/8] qapi: golang: Generate qapi's union types in Go

2022-07-06 Thread Daniel P . Berrangé
On Wed, Jul 06, 2022 at 04:28:16AM -0500, Andrea Bolognani wrote: > On Tue, Jul 05, 2022 at 05:35:26PM +0100, Daniel P. Berrangé wrote: > > On Tue, Jul 05, 2022 at 08:45:30AM -0700, Andrea Bolognani wrote: > > > All this string manipulation looks sketchy. Is there some reason that > > > I'm not see

[PATCH v5 36/45] linux-user/aarch64: Tidy target_restore_sigframe error return

2022-07-06 Thread Richard Henderson
Fold the return value setting into the goto, so each point of failure need not do both. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/linux-user/aarch64

[PATCH v5 37/45] linux-user/aarch64: Do not allow duplicate or short sve records

2022-07-06 Thread Richard Henderson
In parse_user_sigframe, the kernel rejects duplicate sve records, or records that are smaller than the header. We were silently allowing these cases to pass, dropping the record. Signed-off-by: Richard Henderson --- linux-user/aarch64/signal.c | 5 - 1 file changed, 4 insertions(+), 1 delet

Re: [PATCH v2 00/18] Make block-backend-io.h API more consistent

2022-07-06 Thread Hanna Reitz
On 05.07.22 18:15, Alberto Faria wrote: Adjust existing pairs of non-coroutine and coroutine functions to share the same calling convention, and add non-coroutine/coroutine counterparts where they don't exist. Also make the non-coroutine versions generated_co_wrappers. This series sits on top o

Re: [PATCH v8 06/20] job.h: define functions called without job lock held

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 11:22, Emanuele Giuseppe Esposito wrote: Am 05/07/2022 um 12:53 schrieb Vladimir Sementsov-Ogievskiy: On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote: These functions don't need a _locked() counterpart, since they are all called outside job.c and take the lock only internally. U

Re: [PATCH v2] m68k: virt: pass RNG seed via bootinfo block

2022-07-06 Thread Geert Uytterhoeven
On Sun, Jun 26, 2022 at 1:18 PM Jason A. Donenfeld wrote: > This commit wires up bootinfo's RNG seed attribute so that Linux VMs can > have their RNG seeded from the earliest possible time in boot, just like > the "rng-seed" device tree property on those platforms. The link > contains the correspo

[PATCH v5 42/45] linux-user/aarch64: Implement PR_SME_GET_VL, PR_SME_SET_VL

2022-07-06 Thread Richard Henderson
These prctl set the Streaming SVE vector length, which may be completely different from the Normal SVE vector length. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- linux-user/aarch64/target_prctl.h | 48 +++ linux-user/syscall.c | 16 ++

Re: [RFC PATCH v2 4/8] qapi: golang: Generate qapi's union types in Go

2022-07-06 Thread Daniel P . Berrangé
On Wed, Jul 06, 2022 at 10:37:54AM +0100, Daniel P. Berrangé wrote: > On Wed, Jul 06, 2022 at 04:28:16AM -0500, Andrea Bolognani wrote: > > On Tue, Jul 05, 2022 at 05:35:26PM +0100, Daniel P. Berrangé wrote: > > > On Tue, Jul 05, 2022 at 08:45:30AM -0700, Andrea Bolognani wrote: > > > > All this st

Re: [RFC 0/8] Introduce an extensible static analyzer

2022-07-06 Thread Alberto Faria
On Tue, Jul 5, 2022 at 5:12 PM Daniel P. Berrangé wrote: > On Tue, Jul 05, 2022 at 12:28:55PM +0100, Alberto Faria wrote: > > On Tue, Jul 5, 2022 at 8:16 AM Daniel P. Berrangé > > wrote: > > > for i in `git ls-tree --name-only -r HEAD:` > > > do > > > clang-tidy $i 1>/dev/null

[PATCH v5 43/45] target/arm: Only set ZEN in reset if SVE present

2022-07-06 Thread Richard Henderson
There's no reason to set CPACR_EL1.ZEN if SVE disabled. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 9c58be8b14..9b54443843 100644 --- a/targe

Re: [PATCH v3 00/14] scsi: add quirks and features to support m68k Macs

2022-07-06 Thread Mark Cave-Ayland
On 22/06/2022 11:53, Mark Cave-Ayland wrote: Here are the next set of patches from my ongoing work to allow the q800 machine to boot MacOS related to SCSI devices. Patch 1 adds a new quirks bitmap to SCSIDiskState to allow buggy and/or legacy features to enabled on an individual device basis. O

[PATCH v3 0/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
v2 -> v3: - Rename 'GuestOsType' to 'GuestCpuStatsType'. - Add 'linux' into polluted_words, rename 'linuxos' to 'linux'. Remove 'windows' from 'GuestCpuStatsType', because currently we don't use it. v1 -> v2: - Konstantin & Marc-André pointed out that the structure 'GuestCpuStats' is too *linu

Re: [PATCH v8 13/20] jobs: group together API calls under the same job lock

2022-07-06 Thread Stefan Hajnoczi
On Tue, Jul 05, 2022 at 04:22:41PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 7/5/22 16:01, Emanuele Giuseppe Esposito wrote: > > > > > > Am 05/07/2022 um 10:17 schrieb Emanuele Giuseppe Esposito: > > > > > > > > > Am 05/07/2022 um 10:14 schrieb Stefan Hajnoczi: > > > > On Wed, Jun 29, 202

[PATCH v2 0/3] Fix some coverity issues on VDUSE

2022-07-06 Thread Xie Yongji
This series fixes some issues reported by coverity. Patch 1 fixes a incorrect function name. Patch 2 fixes Coverity CID 1490224. Patch 3 fixes Coverity CID 1490226, 1490223. V1 to V2: - Drop the patch to fix Coverity CID 1490222, 1490227 [Markus] - Add some commit log to explain why we don't us

Re: [PATCH v8 06/20] job.h: define functions called without job lock held

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 11:23, Emanuele Giuseppe Esposito wrote: Am 05/07/2022 um 12:54 schrieb Vladimir Sementsov-Ogievskiy: To subject: hmm, the commit don't define any function.. mark functions called without job lock held? Yes, that's better) -- Best regards, Vladimir

Re: [RFC 0/8] Introduce an extensible static analyzer

2022-07-06 Thread Daniel P . Berrangé
On Wed, Jul 06, 2022 at 10:54:51AM +0100, Alberto Faria wrote: > On Tue, Jul 5, 2022 at 5:12 PM Daniel P. Berrangé wrote: > > On Tue, Jul 05, 2022 at 12:28:55PM +0100, Alberto Faria wrote: > > > On Tue, Jul 5, 2022 at 8:16 AM Daniel P. Berrangé > > > wrote: > > > > Overall I think a libclang bas

[PATCH v3 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread zhenwei pi
A vCPU thread always reaches 100% utilization when: - guest uses idle=poll - disable HLT vm-exit - enable MWAIT Add new guest agent command 'guest-get-cpustats' to get guest CPU statistics, we can know the guest workload and how busy the CPU is. To avoid compiling error like: qga/qga-qapi-types.h

Re: [RFC 0/8] Introduce an extensible static analyzer

2022-07-06 Thread Alberto Faria
On Tue, Jul 5, 2022 at 5:13 PM Daniel P. Berrangé wrote: > FWIW, after applying this series 'make check' throws lots of failures > and hangs for me in the block I/O tests, so something appears not quite > correct here. I didn't bother to investigate/debug since you marked this > as just an RFC Th

  1   2   3   >