[PATCH 4/4] tests/qtest/migration-test: Remove duplicated test_postcopy from the test plan

2022-08-18 Thread Thomas Huth
test_postcopy() is currently run twice - which is just a waste of resources and time. The commit d1a27b169b2d that introduced the duplicate talked about renaming the "postcopy/unix" test, but apparently it forgot to remove the old entry. Let's do that now. Fixes: d1a27b169b ("tests: Add postcopy

[PATCH 3/4] tests/migration/i386: Speed up the i386 migration test (when using TCG)

2022-08-18 Thread Thomas Huth
When KVM is not available, the i386 migration test also runs in a rather slow fashion, since the guest code takes a couple of seconds to print the "B"s on the serial console, and the migration test has to wait for this each time. Let's increase the frequency here, too, so that the delays in the

[PATCH 1/4] tests/qtest/migration-test: Only wait for serial output where migration succeeds

2022-08-18 Thread Thomas Huth
Waiting for the serial output can take a couple of seconds - and since we're doing a lot of migration tests, this time easily sums up to multiple minutes. But if a test is supposed to fail, it does not make much sense to wait for the source to be in the right state first, so we can skip the

[PATCH 0/4] Speed up migration tests

2022-08-18 Thread Thomas Huth
We are currently facing the problem that the "gcov-gprof" CI jobs in the gitlab-CI are running way too long - which happens since the migration-tests have been enabled there recently. These patches now speed up the migration tests, so that the CI job should be fine again. This is how it looked

[PATCH 2/4] tests/migration/aarch64: Speed up the aarch64 migration test

2022-08-18 Thread Thomas Huth
The migration tests spend a lot of time waiting for a sign of live of the guest on the serial console. The aarch64 migration code only outputs "B"s every couple of seconds (at least it takes more than 4 seconds between each characeter on my x86 laptop). There are a lot of migration tests, and if

Re: [PATCH] target/riscv: Use official extension names for AIA CSRs

2022-08-18 Thread Anup Patel
On Fri, Aug 19, 2022 at 10:24 AM Weiwei Li wrote: > > > 在 2022/8/19 上午11:09, Anup Patel 写道: > > The arch review of AIA spec is completed and we now have official > > extension names for AIA: Smaia (M-mode AIA CSRs) and Ssaia (S-mode > > AIA CSRs). > > > > Refer, section 1.6 of the latest AIA

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-18 Thread David Gibson
On Fri, Aug 19, 2022 at 12:11:40PM +1000, Alexey Kardashevskiy wrote: > > > On 05/08/2022 19:39, Daniel Henrique Barboza wrote: > > The pSeries machine never bothered with the common machine->fdt > > attribute. We do all the FDT related work using spapr->fdt_blob. > > > > We're going to

Re: [PATCH] target/riscv: Use official extension names for AIA CSRs

2022-08-18 Thread Weiwei Li
在 2022/8/19 上午11:09, Anup Patel 写道: The arch review of AIA spec is completed and we now have official extension names for AIA: Smaia (M-mode AIA CSRs) and Ssaia (S-mode AIA CSRs). Refer, section 1.6 of the latest AIA v0.3.1 stable specification at

Re: [PATCH v4 4/6] vdpa: Add asid parameter to vhost_vdpa_dma_map/unmap

2022-08-18 Thread Jason Wang
On Wed, Aug 10, 2022 at 1:04 AM Eugenio Perez Martin wrote: > > On Tue, Aug 9, 2022 at 9:21 AM Jason Wang wrote: > > > > On Sat, Aug 6, 2022 at 12:39 AM Eugenio Pérez wrote: > > > > > > So the caller can choose which ASID is destined. > > > > > > No need to update the batch functions as they

Re: [PATCH v8 00/12] NIC vhost-vdpa state restore via Shadow CVQ

2022-08-18 Thread Jason Wang
On Thu, Aug 11, 2022 at 2:57 PM Eugenio Perez Martin wrote: > > On Tue, Aug 9, 2022 at 7:43 PM Eugenio Pérez wrote: > > > > CVQ of net vhost-vdpa devices can be intercepted since the addition of > > x-svq. > > The virtio-net device model is updated. The migration was blocked because > >

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

2022-08-18 Thread Hugh Dickins
On Fri, 19 Aug 2022, Sean Christopherson wrote: > On Thu, Aug 18, 2022, Kirill A . Shutemov wrote: > > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > > On Wed, 6 Jul 2022, Chao Peng wrote: > > > But since then, TDX in particular has forced an effort into preventing > > > (by

[PATCH v6 17/21] accel/tcg: Add fast path for translator_ld*

2022-08-18 Thread Richard Henderson
Cache the translation from guest to host address, so we may use direct loads when we hit on the primary translation page. Look up the second translation page only once, during translation. This obviates another lookup of the second page within tb_gen_code after translation. Fixes a bug in that

[PATCH v6 20/21] target/riscv: Add MAX_INSN_LEN and insn_len

2022-08-18 Thread Richard Henderson
These will be useful in properly ending the TB. Signed-off-by: Richard Henderson --- target/riscv/translate.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 38666ddc91..a719aa6e63 100644 ---

[PATCH v6 16/21] accel/tcg: Add pc and host_pc params to gen_intermediate_code

2022-08-18 Thread Richard Henderson
Pass these along to translator_loop -- pc may be used instead of tb->pc, and host_pc is currently unused. Adjust all targets at one time. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 1 - include/exec/translator.h | 24

[PATCH v6 21/21] target/riscv: Make translator stop before the end of a page

2022-08-18 Thread Richard Henderson
Right now the translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1155 Signed-off-by: Richard Henderson ---

[PATCH v6 08/21] accel/tcg: Properly implement get_page_addr_code for user-only

2022-08-18 Thread Richard Henderson
The current implementation is a no-op, simply returning addr. This is incorrect, because we ought to be checking the page permissions for execution. Make get_page_addr_code inline for both implementations. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 85

[PATCH v6 14/21] accel/tcg: Raise PROT_EXEC exception early

2022-08-18 Thread Richard Henderson
We currently ignore PROT_EXEC on the initial lookup, and defer raising the exception until cpu_ld*_code(). It makes more sense to raise the exception early. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 2 +- 2 files changed, 2 insertions(+),

[PATCH v6 18/21] target/s390x: Make translator stop before the end of a page

2022-08-18 Thread Richard Henderson
From: Ilya Leoshkevich Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. Signed-off-by: Ilya Leoshkevich Reviewed-by: Richard Henderson Message-Id:

[PATCH v6 19/21] target/i386: Make translator stop before the end of a page

2022-08-18 Thread Richard Henderson
From: Ilya Leoshkevich Right now translator stops right *after* the end of a page, which breaks reporting of fault locations when the last instruction of a multi-insn translation block crosses a page boundary. An implementation, like the one arm and s390x have, would require an i386 length

[PATCH v6 13/21] accel/tcg: Add nofault parameter to get_page_addr_code_hostp

2022-08-18 Thread Richard Henderson
Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 10 +- accel/tcg/cputlb.c | 8 accel/tcg/plugin-gen.c | 4 ++-- accel/tcg/user-exec.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/exec/exec-all.h

[PATCH v6 15/21] accel/tcg: Remove translator_ldsw

2022-08-18 Thread Richard Henderson
The only user can easily use translator_lduw and adjust the type to signed during the return. Signed-off-by: Richard Henderson --- include/exec/translator.h | 1 - target/i386/tcg/translate.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/exec/translator.h

[PATCH v6 11/21] accel/tcg: Move qemu_ram_addr_from_host_nofail to physmem.c

2022-08-18 Thread Richard Henderson
The base qemu_ram_addr_from_host function is already in softmmu/physmem.c; move the nofail version to be adjacent. Signed-off-by: Richard Henderson --- include/exec/cpu-common.h | 1 + accel/tcg/cputlb.c| 12 softmmu/physmem.c | 12 3 files changed, 13

[PATCH v6 10/21] accel/tcg: Make tb_htable_lookup static

2022-08-18 Thread Richard Henderson
The function is not used outside of cpu-exec.c. Move it and its subroutines up in the file, before the first use. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 3 - accel/tcg/cpu-exec.c| 122 2 files changed, 61 insertions(+), 64

[PATCH v6 12/21] accel/tcg: Use probe_access_internal for softmmu get_page_addr_code_hostp

2022-08-18 Thread Richard Henderson
Simplify the implementation of get_page_addr_code_hostp by reusing the existing probe_access infrastructure. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 76 -- 1 file changed, 26 insertions(+), 50 deletions(-) diff --git

[PATCH v6 06/21] tests/tcg/i386: Move smc_code2 to an executable section

2022-08-18 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to put this code into a section that is both writable and executable. Note that this test did not run on hardware beforehand either. Signed-off-by: Richard Henderson --- tests/tcg/i386/test-i386.c | 2 +- 1 file changed, 1

[PATCH v6 04/21] linux-user: Honor PT_GNU_STACK

2022-08-18 Thread Richard Henderson
Map the stack executable if required by default or on demand. Signed-off-by: Richard Henderson --- include/elf.h| 1 + linux-user/qemu.h| 1 + linux-user/elfload.c | 19 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/elf.h

[PATCH v6 02/21] linux-user/hppa: Allocate page zero as a commpage

2022-08-18 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark page zero executable. We had been special casing this entirely within translate. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 34 +++--- 1 file changed, 31 insertions(+), 3

[PATCH v6 09/21] accel/tcg: Unlock mmap_lock after longjmp

2022-08-18 Thread Richard Henderson
The mmap_lock is held around tb_gen_code. While the comment is correct that the lock is dropped when tb_gen_code runs out of memory, the lock is *not* dropped when an exception is raised reading code for translation. Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 12 ++--

[PATCH v6 05/21] linux-user: Clear translations and tb_jmp_cache on mprotect()

2022-08-18 Thread Richard Henderson
From: Ilya Leoshkevich Currently it's possible to execute pages that do not have PAGE_EXEC if there is an existing translation block. Fix by clearing tb_jmp_cache and invalidating TBs, which forces recheck of permission bits. Signed-off-by: Ilya Leoshkevich Message-Id:

[PATCH v6 07/21] accel/tcg: Introduce is_same_page()

2022-08-18 Thread Richard Henderson
From: Ilya Leoshkevich Introduce a function that checks whether a given address is on the same page as where disassembly started. Having it improves readability of the following patches. Signed-off-by: Ilya Leoshkevich Message-Id: <20220811095534.241224-3-...@linux.ibm.com> Reviewed-by:

[PATCH v6 03/21] linux-user/x86_64: Allocate vsyscall page as a commpage

2022-08-18 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to the vsyscall page executable. We had been special casing this entirely within translate. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 23 +++ 1 file changed, 23 insertions(+) diff --git

[PATCH v6 01/21] linux-user/arm: Mark the commpage executable

2022-08-18 Thread Richard Henderson
We're about to start validating PAGE_EXEC, which means that we've got to mark the commpage executable. We had been placing the commpage outside of reserved_va, which was incorrect and lead to an abort. Signed-off-by: Richard Henderson --- linux-user/arm/target_cpu.h | 4 ++--

[PATCH v6 00/21] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-18 Thread Richard Henderson
Hi Ilya, After adding support for riscv (similar to s390x, in that we can find the total insn length from the first couple of bits, so, easy), I find that the test case doesn't work without all of the other changes for PROT_EXEC, including the translator_ld changes. Other changes from your v5:

[PATCH] target/riscv: Use official extension names for AIA CSRs

2022-08-18 Thread Anup Patel
The arch review of AIA spec is completed and we now have official extension names for AIA: Smaia (M-mode AIA CSRs) and Ssaia (S-mode AIA CSRs). Refer, section 1.6 of the latest AIA v0.3.1 stable specification at

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

2022-08-18 Thread Hugh Dickins
On Thu, 18 Aug 2022, Kirill A . Shutemov wrote: > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > > > If your memory could be swapped, that would be enough of a good reason > > to make use of shmem.c: but it cannot be swapped; and although there > > are some references in the

RE: [PATCH V4 RESEND] net/colo.c: Fix the pointer issue reported by Coverity.

2022-08-18 Thread Zhang, Chen
> -Original Message- > From: Jason Wang > Sent: Thursday, August 18, 2022 4:04 PM > To: Zhang, Chen > Cc: Peter Maydell ; Li Zhijian > ; qemu-dev > Subject: Re: [PATCH V4 RESEND] net/colo.c: Fix the pointer issue reported by > Coverity. > > On Wed, Aug 17, 2022 at 3:45 PM Zhang, Chen

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-18 Thread Alexey Kardashevskiy
On 05/08/2022 19:39, Daniel Henrique Barboza wrote: The pSeries machine never bothered with the common machine->fdt attribute. We do all the FDT related work using spapr->fdt_blob. We're going to introduce HMP commands to read and save the FDT, which will rely on setting machine->fdt

Re: [Virtio-fs] [PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

2022-08-18 Thread liuyd.f...@fujitsu.com
It works. I tested on RHEL8 Before this fix: ``` # /root/qemu/build/tools/virtiofsd/virtiofsd --socket-path=/tmp/sock -o source=/home/test -d [(null)] [ID: 00133152] virtio_session_mount: Waiting for vhost-user socket connection... ``` After applying this patch ``` #

RE: [PATCH] i386: Disable BTS and PEBS

2022-08-18 Thread Duan, Zhenzhong
>-Original Message- >From: Paolo Bonzini On Behalf Of Paolo Bonzini >Sent: Wednesday, July 20, 2022 2:19 AM >To: Christopherson,, Sean >Cc: Duan, Zhenzhong ; qemu- >de...@nongnu.org; mtosa...@redhat.com; lik...@tencent.com; Ma, >XiangfeiX >Subject: Re: [PATCH] i386: Disable BTS and

Re: [PULL 1/3] linux-user: un-parent OBJECT(cpu) when closing thread

2022-08-18 Thread Richard Henderson
On 8/16/22 05:26, Alex Bennée wrote: While forcing the CPU to unrealize by hand does trigger the clean-up code we never fully free resources because refcount never reaches zero. This is because QOM automatically added objects without an explicit parent to /unattached/, incrementing the refcount.

Re: [PATCH 7/7] target/riscv: Honour -semihosting-config userspace=on and enable=on

2022-08-18 Thread Alistair Francis
On Thu, Aug 18, 2022 at 11:58 PM Peter Maydell wrote: > > On Thu, 18 Aug 2022 at 05:20, Alistair Francis wrote: > > > > On Tue, Aug 16, 2022 at 5:11 AM Peter Maydell > > wrote: > > > > > > The riscv target incorrectly enabled semihosting always, whether the > > > user asked for it or not.

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-18 Thread Leonardo Bras Soares Passos
On Thu, Aug 18, 2022 at 5:05 PM Peter Xu wrote: > > On Tue, Aug 16, 2022 at 06:12:50AM -0400, Emanuele Giuseppe Esposito wrote: > > +static void kvm_memory_region_node_add(KVMMemoryListener *kml, > > + struct kvm_userspace_memory_region > > *mem) > > +{ > >

Re: [PATCH v6 6/8] KVM: Handle page fault for private memory

2022-08-18 Thread Kirill A. Shutemov
On Fri, Jun 17, 2022 at 09:30:53PM +, Sean Christopherson wrote: > > @@ -4088,7 +4144,12 @@ static int direct_page_fault(struct kvm_vcpu *vcpu, > > struct kvm_page_fault *fault > > read_unlock(>kvm->mmu_lock); > > else > > write_unlock(>kvm->mmu_lock); > > -

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

2022-08-18 Thread Sean Christopherson
On Thu, Aug 18, 2022, Kirill A . Shutemov wrote: > On Wed, Aug 17, 2022 at 10:40:12PM -0700, Hugh Dickins wrote: > > On Wed, 6 Jul 2022, Chao Peng wrote: > > But since then, TDX in particular has forced an effort into preventing > > (by flags, seals, notifiers) almost everything that makes it

[PATCH v2] target/arm: Add cortex-a35

2022-08-18 Thread Hao Wu
Add cortex A35 core and enable it for virt board. Signed-off-by: Hao Wu Reviewed-by: Joe Komlodi --- docs/system/arm/virt.rst | 1 + hw/arm/virt.c| 1 + target/arm/cpu64.c | 80 3 files changed, 82 insertions(+) diff --git

[PATCH for-7.2 2/2] ppc/pnv: fix QOM parenting of user creatable root ports

2022-08-18 Thread Daniel Henrique Barboza
User creatable root ports are being parented by the 'peripheral' or the 'peripheral-anon' container. This happens because this is the regular QOM schema for sysbus devices that are added via the command line. Let's make this QOM hierarchy similar to what we have with default root ports, i.e. the

[PATCH for-7.2 1/2] ppc/pnv: consolidate pnv_parent_*_fixup() helpers

2022-08-18 Thread Daniel Henrique Barboza
We have 2 helpers that amends the QOM and parent bus of a given object, repectively. These 2 helpers are called together, and not by accident. Due to QOM internals, doing an object_unparent() will result in the device being removed from its parent bus. This means that changing the QOM parent

[PATCH for-7.2 0/2] ppc/pnv: fix root port QOM parenting

2022-08-18 Thread Daniel Henrique Barboza
Hi, These are a couple of patches that got separated from the main series it belonged to [1] that got already queued for 7.2. Patch 1 is new, patch 2 is a new version of patch 11 of [1]. The patches are based on ppc-7.2 [2]. [1]

[python-qemu-qmp MR #18] New release - v0.0.2

2022-08-18 Thread GitLab Bot
Author: John Snow - https://gitlab.com/jsnow Merge Request: https://gitlab.com/qemu-project/python-qemu-qmp/-/merge_requests/18 ... from: jsnow/python-qemu-qmp:new_release ... into: qemu-project/python-qemu-qmp:main ***If this MR is approved, after merge I will be tagging this commit as

Re: [RFC PATCH 2/2] kvm/kvm-all.c: listener should delay kvm_vm_ioctl to the commit phase

2022-08-18 Thread Peter Xu
On Tue, Aug 16, 2022 at 06:12:50AM -0400, Emanuele Giuseppe Esposito wrote: > +static void kvm_memory_region_node_add(KVMMemoryListener *kml, > + struct kvm_userspace_memory_region > *mem) > +{ > +MemoryRegionNode *node; > + > +node =

Re: [RFC v3 7/8] blkio: implement BDRV_REQ_REGISTERED_BUF optimization

2022-08-18 Thread Stefan Hajnoczi
On Thu, Jul 14, 2022 at 12:13:53PM +0200, Hanna Reitz wrote: > On 08.07.22 06:17, Stefan Hajnoczi wrote: > > Avoid bounce buffers when QEMUIOVector elements are within previously > > registered bdrv_register_buf() buffers. > > > > The idea is that emulated storage controllers will register guest

Re: [RFC PATCH 1/2] softmmu/memory: add missing begin/commit callback calls

2022-08-18 Thread Peter Xu
On Tue, Aug 16, 2022 at 06:12:49AM -0400, Emanuele Giuseppe Esposito wrote: > kvm listeners now need ->commit callback in order to actually send > the ioctl to the hypervisor. Therefore, add missing callers around > address_space_set_flatview(), which in turn calls >

Re: towards a workable O_DIRECT outmigration to a file

2022-08-18 Thread Claudio Fontana
On 8/18/22 20:49, Dr. David Alan Gilbert wrote: > * Claudio Fontana (cfont...@suse.de) wrote: >> On 8/18/22 18:31, Dr. David Alan Gilbert wrote: >>> * Claudio Fontana (cfont...@suse.de) wrote: On 8/18/22 14:38, Dr. David Alan Gilbert wrote: > * Nikolay Borisov (nbori...@suse.com) wrote:

Re: towards a workable O_DIRECT outmigration to a file

2022-08-18 Thread Dr. David Alan Gilbert
* Claudio Fontana (cfont...@suse.de) wrote: > On 8/18/22 18:31, Dr. David Alan Gilbert wrote: > > * Claudio Fontana (cfont...@suse.de) wrote: > >> On 8/18/22 14:38, Dr. David Alan Gilbert wrote: > >>> * Nikolay Borisov (nbori...@suse.com) wrote: > [adding Juan and David to cc as I had missed

Re: [RFC PATCH] pnv/chiptod: Add basic P9 chiptod model

2022-08-18 Thread Daniel Henrique Barboza
On 8/11/22 13:40, Nicholas Piggin wrote: The chiptod is a pervasive facility which can keep a time, synchronise it across multiple chips, and can move that time to or from the core timebase units. This adds a very basic initial emulation of chiptod registers. The interesting thing about

Re: towards a workable O_DIRECT outmigration to a file

2022-08-18 Thread Claudio Fontana
On 8/18/22 20:09, Claudio Fontana wrote: > On 8/18/22 18:31, Dr. David Alan Gilbert wrote: >> * Claudio Fontana (cfont...@suse.de) wrote: >>> On 8/18/22 14:38, Dr. David Alan Gilbert wrote: * Nikolay Borisov (nbori...@suse.com) wrote: > [adding Juan and David to cc as I had missed them. ]

[PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

2022-08-18 Thread Yusuke Okada
From: Yusuke Okada The "%f" specifier in g_date_time_format() is only available in glib 2.65.2 or later. If combined with older glib, the function returns null and the timestamp displayed as "(null)". For backward compatibility, g_date_time_get_microsecond should be used to retrieve subsecond.

[PATCH v2 2/2] tests/tcg/ppc64le: Added an underflow with UE=1 test

2022-08-18 Thread Lucas Mateus Castro(alqotel)
Added a test to see if the adjustment is being made correctly when an underflow occurs and UE is set. Signed-off-by: Lucas Mateus Castro (alqotel) --- This patch will also fail without the underflow with UE set bugfix Message-Id:<20220805141522.412864-3-lucas.ara...@eldorado.org.br> ---

[PATCH v2 1/2] tests/tcg/ppc64le: Added an overflow with OE=1 test

2022-08-18 Thread Lucas Mateus Castro(alqotel)
Added a test to see if the adjustment is being made correctly when an overflow occurs and OE is set. Signed-off-by: Lucas Mateus Castro (alqotel) --- The prctl patch is not ready yet, so this patch does as Richard Henderson suggested and check the fp register in the signal handler This patch

Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-18 Thread Richard Henderson
On 8/18/22 09:55, Vivian Wang wrote: On 8/17/22 23:05, Ilya Leoshkevich wrote: Hi, I noticed that when we get a SEGV due to jumping to non-readable memory, sometimes si_addr and program counter in siginfo_t are slightly off. I tracked this down to the assumption that translators stop before

Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-18 Thread Ilya Leoshkevich
On Fri, 2022-08-19 at 00:55 +0800, Vivian Wang wrote: > Hi, > Could this be related to issue 1155 [1]? On RISC-V, I'm getting > incorrect [m|s]tval/[m|s]epc combinations for page faults in system > emulation and incorrect si_addr and program counter on SIGSEGV in > user emulation. Since it seems

[PATCH] virtiofsd: use g_date_time_get_microsecond to get subsecond

2022-08-18 Thread Yusuke Okada
The "%f" specifier in g_date_time_format() is only available in glib 2.65.2 or later. If combined with older glib, the function returns null and the timestamp displayed as "(null)". For backward compatibility, g_date_time_get_microsecond should be used to retrieve subsecond. In this patch the

Re: towards a workable O_DIRECT outmigration to a file

2022-08-18 Thread Claudio Fontana
On 8/18/22 18:31, Dr. David Alan Gilbert wrote: > * Claudio Fontana (cfont...@suse.de) wrote: >> On 8/18/22 14:38, Dr. David Alan Gilbert wrote: >>> * Nikolay Borisov (nbori...@suse.com) wrote: [adding Juan and David to cc as I had missed them. ] >>> >>> Hi Nikolay, >>> On 11.08.22 г.

Re: towards a workable O_DIRECT outmigration to a file

2022-08-18 Thread Claudio Fontana
On 8/18/22 18:31, Dr. David Alan Gilbert wrote: > * Claudio Fontana (cfont...@suse.de) wrote: >> On 8/18/22 14:38, Dr. David Alan Gilbert wrote: >>> * Nikolay Borisov (nbori...@suse.com) wrote: [adding Juan and David to cc as I had missed them. ] >>> >>> Hi Nikolay, >>> On 11.08.22 г.

Re: [PULL 0/3] Fixes for QEMU 7.1-rc4

2022-08-18 Thread Richard Henderson
On 8/17/22 23:56, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau The following changes since commit c7208a6e0d049f9e8af15df908168a79b1f99685: Update version for v7.1.0-rc3 release (2022-08-16 20:45:19 -0500) are available in the Git repository at:

Re: [PATCH v2 00/31] QOMify PPC4xx devices and minor clean ups

2022-08-18 Thread Daniel Henrique Barboza
On 8/18/22 10:17, Cédric Le Goater wrote: Daniel, On 8/17/22 17:08, BALATON Zoltan wrote: Hello, This is based on gitlab.com/danielhb/qemu/tree/ppc-7.2 This series contains the rest of Cédric's OOM'ify patches modified according my review comments and some other clean ups I've noticed

[PATCH] kvm: fix segfault with query-stats-schemas and -M none

2022-08-18 Thread Paolo Bonzini
-M none creates a guest without a vCPU, causing the following error: $ ./qemu-system-x86_64 -qmp stdio -M none -accel kvm {execute:qmp_capabilities} {"return": {}} {execute: query-stats-schemas} Segmentation fault (core dumped) Fix it by not querying the vCPU stats if first_cpu is NULL.

Re: [PATCH] tests/qtest/migration-test: Only wait for serial output where migration succeeds

2022-08-18 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote: > Waiting for the serial output can take a couple of seconds - and since > we're doing a lot of migration tests, this time easily sums up to > multiple minutes. But if a test is supposed to fail, it does not make > much sense to wait for the source to be in

Re: [PATCH v5 0/4] linux-user: Fix siginfo_t contents when jumping to non-readable pages

2022-08-18 Thread Vivian Wang
On 8/17/22 23:05, Ilya Leoshkevich wrote: > Hi, > > I noticed that when we get a SEGV due to jumping to non-readable > memory, sometimes si_addr and program counter in siginfo_t are slightly > off. I tracked this down to the assumption that translators stop before > the end of a page, while in

Re: [PATCH 4/8] migration: Implement dirty-limit convergence algo

2022-08-18 Thread Hyman
在 2022/8/18 6:09, Peter Xu 写道: On Sat, Jul 23, 2022 at 03:49:16PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration

[qemu-web PATCH] Add signing pubkey for python-qemu-qmp package

2022-08-18 Thread John Snow
Add the pubkey currently used for signing PyPI releases of qemu.qmp to a stable location where it can be referenced by e.g. Fedora RPM specfiles. At present, the key happens to just simply be my own -- but future releases may be signed by a different key. In that case, we can increment '1.txt' to

Re: [PATCH 1/8] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-08-18 Thread Hyman
在 2022/8/18 6:06, Peter Xu 写道: On Sat, Jul 23, 2022 at 03:49:13PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is used to make dirtyrate calculation period configurable. Signed-off-by: Hyman

Re: [PATCH] target/arm: Add cortex-a35

2022-08-18 Thread Hao Wu
Hi, This is used by a new series of Nuvoton SoC (NPCM8XX) which contains 4 Cortex A-35 cores. I'll update the missing fields in a follow-up patch set. On Thu, Aug 18, 2022 at 7:59 AM Peter Maydell wrote: > On Mon, 15 Aug 2022 at 22:35, Hao Wu wrote: > > > > Add cortex A35 core and enable it

Re: [BUG] cxl can not create region

2022-08-18 Thread Jonathan Cameron via
On Wed, 17 Aug 2022 17:16:19 +0100 Jonathan Cameron wrote: > On Thu, 11 Aug 2022 17:46:55 -0700 > Dan Williams wrote: > > > Dan Williams wrote: > > > Bobo WL wrote: > > > > Hi Dan, > > > > > > > > Thanks for your reply! > > > > > > > > On Mon, Aug 8, 2022 at 11:58 PM Dan Williams > >

Re: towards a workable O_DIRECT outmigration to a file

2022-08-18 Thread Dr. David Alan Gilbert
* Claudio Fontana (cfont...@suse.de) wrote: > On 8/18/22 14:38, Dr. David Alan Gilbert wrote: > > * Nikolay Borisov (nbori...@suse.com) wrote: > >> [adding Juan and David to cc as I had missed them. ] > > > > Hi Nikolay, > > > >> On 11.08.22 г. 16:47 ч., Nikolay Borisov wrote: > >>> Hello, > >>>

[PATCH] tests/qtest/migration-test: Only wait for serial output where migration succeeds

2022-08-18 Thread Thomas Huth
Waiting for the serial output can take a couple of seconds - and since we're doing a lot of migration tests, this time easily sums up to multiple minutes. But if a test is supposed to fail, it does not make much sense to wait for the source to be in the right state first, so we can skip the

Re: Using Unicamp's Minicloud for the QEMU CI

2022-08-18 Thread Peter Maydell
On Thu, 18 Aug 2022 at 17:11, Lucas Mateus Martins Araujo e Castro wrote: > Lucas wrote: >> I would like gauge the interest in using Minicloud's infrastructure[1] >> for the CI, talking with some people from there they are interested. >> It has both ppc64 and pp64le images, multiple versions of 4

Re: [PATCH 2/8] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-08-18 Thread Hyman
在 2022/8/18 6:07, Peter Xu 写道: On Sat, Jul 23, 2022 at 03:49:14PM +0800, huang...@chinatelecom.cn wrote: From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two

Re: [PATCH 1/2] tests/tcg/ppc64le: Added an overflow with OE=1 test

2022-08-18 Thread Lucas Mateus Martins Araujo e Castro
On 18/08/2022 12:32, Richard Henderson wrote: On 8/17/22 09:57, Lucas Mateus Castro(alqotel) wrote: +void sigfpe_handler(int sig, siginfo_t *si, void *ucontext) +{ +    uint64_t t; +    uint64_t ch = 0x5fcfffe4965a17e0ull; +    asm ( +    "stfd 2, %0\n\t" +    : "=m"(t) +    : +

Re: Using Unicamp's Minicloud for the QEMU CI

2022-08-18 Thread Lucas Mateus Martins Araujo e Castro
ping Any interest in this? On 12/07/2022 11:51, Lucas Mateus Martins Araujo e Castro wrote: Hi everyone! I would like gauge the interest in using Minicloud's infrastructure[1] for the CI, talking with some people from there they are interested. It has both ppc64 and pp64le images, multiple

Re: [PULL 00/12] pc,virtio: fixes

2022-08-18 Thread Richard Henderson
On 8/17/22 13:05, Michael S. Tsirkin wrote: The following changes since commit c7208a6e0d049f9e8af15df908168a79b1f99685: Update version for v7.1.0-rc3 release (2022-08-16 20:45:19 -0500) are available in the Git repository at: git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git

Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00"

2022-08-18 Thread Richard Henderson
On 8/17/22 19:31, WANG Xuerui wrote: Hmm, I've looked up more context and it is indeed reasonable to generally name the QEMU models after real existing models. But in this case we could face a problem with Loongson's nomenclature: all of Loongson 3A5000, 3C5000 and 3C5000L are LA464, yet they

Re: [PATCH 1/2] tests/tcg/ppc64le: Added an overflow with OE=1 test

2022-08-18 Thread Richard Henderson
On 8/17/22 09:57, Lucas Mateus Castro(alqotel) wrote: +void sigfpe_handler(int sig, siginfo_t *si, void *ucontext) +{ +uint64_t t; +uint64_t ch = 0x5fcfffe4965a17e0ull; +asm ( +"stfd 2, %0\n\t" +: "=m"(t) +: +: "memory", "fr2" +); No, you need to

Re: [PULL 05/10] x86: disable rng seeding via setup_data

2022-08-18 Thread Jason A. Donenfeld
Hi Gerd, Michael, Paolo, On Thu, Aug 18, 2022 at 01:56:14PM +0200, Gerd Hoffmann wrote: > Hi, > > > > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c > > > index 3a35193ff7..2e5dae9a89 100644 > > > --- a/hw/i386/pc_q35.c > > > +++ b/hw/i386/pc_q35.c > > > @@ -376,6 +376,7 @@ static void

[RFC 2/2] virtio: enable f_in_order feature for virtio-net

2022-08-18 Thread Guo Zhi
In order feature is not a transparent feature in QEMU, only specific devices(eg, virtio-net) support it. Signed-off-by: Guo Zhi --- hw/net/virtio-net.c| 1 + include/hw/virtio/virtio.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c

Re: [PATCH v2] hw/i386: place setup_data at fixed place in memory

2022-08-18 Thread Jason A. Donenfeld
Hey Gerd, On Tue, Aug 16, 2022 at 10:55:11AM +0200, Gerd Hoffmann wrote: > Hi, > > > > We can make setup_data chaining work with OVMF, but the whole chain > > > should be located in a GPA range that OVMF dictates. > > > > It sounds like what you describe is pretty OVMF-specific though, > >

[RFC 1/2] virtio: expose used buffers

2022-08-18 Thread Guo Zhi
Follow VIRTIO 1.1 spec, we can only writing out a single used ring for a batch of descriptors, and only notify guest when the batch of descriptors have all been used. We do that batch for tx, because the driver doesn't need to know the length of tx buffer, while for rx, we don't apply the batch

[RFC 0/2] Virtio in order feature support for virtio-net device.

2022-08-18 Thread Guo Zhi
In virtio-spec 1.1, new feature bit VIRTIO_F_IN_ORDER was introduced. When this feature has been negotiated, virtio driver will use descriptors in ring order: starting from offset 0 in the table, and wrapping around at the end of the table. Virtio devices will always use descriptors in the same

[PATCH 9/9] parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD

2022-08-18 Thread Alexander Ivanov
Replace the way we use mutex in parallels_co_check() for simplier and less error prone code. Signed-off-by: Alexander Ivanov --- block/parallels.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index

[PATCH 7/9] parallels: Move check of leaks to a separate function

2022-08-18 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 84 +-- 1 file changed, 52

[PATCH 6/9] parallels: Move check of cluster outside image to a separate function

2022-08-18 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. s->data_end fix relates to out-of-image check so move it to the helper too. Signed-off-by: Alexander Ivanov --- block/parallels.c | 67

[PATCH 5/9] parallels: Move check of unclean image to a separate function

2022-08-18 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 31 +-- 1 file changed, 21 insertions(+), 10

[PATCH 4/9] parallels: Use generic infrastructure for BAT writing in parallels_co_check()

2022-08-18 Thread Alexander Ivanov
BAT is written in the context of conventional operations over the image inside bdrv_co_flush() when it calls parallels_co_flush_to_os() callback. Thus we should not modify BAT array directly, but call parallels_set_bat_entry() helper and bdrv_co_flush() further on. After that there is no need to

[PATCH 8/9] parallels: Move statistic collection to a separate function

2022-08-18 Thread Alexander Ivanov
We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. Signed-off-by: Alexander Ivanov --- block/parallels.c | 53 +++ 1 file changed, 31

[PATCH 3/9] parallels: create parallels_set_bat_entry_helper() to assign BAT value

2022-08-18 Thread Alexander Ivanov
This helper will be reused in next patches during parallels_co_check rework to simplify its code. Signed-off-by: Alexander Ivanov --- block/parallels.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index

[PATCH 2/9] parallels: Fix data_end field value in parallels_co_check()

2022-08-18 Thread Alexander Ivanov
When an image is opened for check there is no error if an offset in the BAT points outside the image. In such a way we can repair the image. Out-of-image offsets are repaired in the check, but data_end field still points outside. Fix this field by file size. Signed-off-by: Alexander Ivanov ---

[PATCH 0/9] parallels: Refactor the code of images checks and fix a bug

2022-08-18 Thread Alexander Ivanov
Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for simplier code. v4 changes: Move s->data_end fixing to parallels_co_check().

[PATCH 1/9] parallels: Out of image offset in BAT leads to image inflation

2022-08-18 Thread Alexander Ivanov
data_end field in BDRVParallelsState is set to the biggest offset present in BAT. If this offset is outside of the image, any further write will create the cluster at this offset and/or the image will be truncated to this offset on close. This is definitely not correct. Raise an error in

[PATCH v1 1/2] i386: reset KVM nested state upon CPU reset

2022-08-18 Thread Vitaly Kuznetsov
Make sure env->nested_state is cleaned up when a vCPU is reset, it may be stale after an incoming migration, kvm_arch_put_registers() may end up failing or putting vCPU in a weird state. Reviewed-by: Maxim Levitsky Signed-off-by: Vitaly Kuznetsov --- target/i386/kvm/kvm.c | 37

Re: [PATCH v2 00/31] QOMify PPC4xx devices and minor clean ups

2022-08-18 Thread BALATON Zoltan
On Thu, 18 Aug 2022, Cédric Le Goater wrote: Daniel, On 8/17/22 17:08, BALATON Zoltan wrote: Hello, This is based on gitlab.com/danielhb/qemu/tree/ppc-7.2 This series contains the rest of Cédric's OOM'ify patches modified according my review comments and some other clean ups I've noticed

  1   2   >