[PATCH v3 3/3] dump: use jobs framework for dump guest memory

2022-07-29 Thread Hogan Wang via
There's no way to cancel the current executing dump process, lead to the virtual machine manager daemon((e.g. libvirtd) cannot restore the dump job after daemon restart. When caller pass the 'job-id' argument, create a job for dump process. And then caller can use job-cancel QMP command to cancel

[PATCH v3 2/3] job: introduce dump guest memory job

2022-07-29 Thread Hogan Wang via
There's no way to cancel the current executing dump process, lead to the virtual machine manager daemon((e.g. libvirtd) cannot restore the dump job after daemon restart. Introduce dump guest memory job type, and add an optional 'job-id' argument for dump-guest-memory QMP to make use of jobs framew

[PATCH v3 1/3] dump: support cancel dump process

2022-07-29 Thread Hogan Wang via
Break saving pages or dump iterate when dump job in cancel state, make sure dump process exits as soon as possible. Signed-off-by: Hogan Wang --- dump/dump.c | 23 +++ include/sysemu/dump.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/dump/dump.c b/dump/

[PATCH] target/mips: Advance pc after semihosting exception

2022-07-29 Thread Richard Henderson
Delay generating the exception until after we know the insn length, and record that length in env->error_code. Fixes: 8ec7e3c53d4 ("target/mips: Use an exception for semihosting") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1126 Signed-off-by: Richard Henderson --- target/mips/tcg/tr

[PULL 0/2] minor loongarch cleanups

2022-07-29 Thread Richard Henderson
As this is a new target this release, and these patches are so minor, I'm applying these as a bug fix. r~ Xiaojuan Yang (2): hw/loongarch: Rename file 'loongson3.XXX' to 'virt.XXX' hw/loongarch: Change macro name 'LS7A_XXX' to 'VIRT_XXX' include/hw/loongarch/virt.h | 8 ++-- inclu

Re: [PULL 0/2] minor loongarch cleanups

2022-07-29 Thread Richard Henderson
On 7/29/22 17:37, Richard Henderson wrote: As this is a new target this release, and these patches are so minor, I'm applying these as a bug fix. r~ Dangit, impatience https://gitlab.com/rth7680/qemu.git pull-la-20220729 r~ Xiaojuan Yang (2): hw/loongarch: Rename file 'loo

[PULL 2/2] hw/loongarch: Change macro name 'LS7A_XXX' to 'VIRT_XXX'

2022-07-29 Thread Richard Henderson
From: Xiaojuan Yang Change macro name 'LS7A_XXX' to 'VIRT_XXX', as the loongarch virt machinue use the GPEX bridge instead of LS7A bridge. So the macro name should keep consistency. Signed-off-by: Xiaojuan Yang Message-Id: <20220729073018.27037-3-yangxiaoj...@loongson.cn> Signed-off-by: Richard

Re: [PATCH v1 0/2] Change 'loongson3.XXX' file name and 'LS7A_XXX' macro name

2022-07-29 Thread Richard Henderson
On 7/29/22 00:30, Xiaojuan Yang wrote: This series change 'loongson3.XXX' file name and 'LS7A_XXX' macro name. Changes for v1: 1. Rename 'loongson3.c' to 'virt.c' and change the meson.build file. 2. Rename 'loongson3.rst' to 'virt.rst'. 3. Change macro name 'LS7A_XXX' to 'VIRT_XXX'. Xiaojuan Ya

[PULL 1/2] hw/loongarch: Rename file 'loongson3.XXX' to 'virt.XXX'

2022-07-29 Thread Richard Henderson
From: Xiaojuan Yang 1. Rename 'loongson3.c' to 'virt.c' and change the meson.build file. 2. Rename 'loongson3.rst' to 'virt.rst'. Signed-off-by: Xiaojuan Yang Message-Id: <20220729073018.27037-2-yangxiaoj...@loongson.cn> Signed-off-by: Richard Henderson --- hw/loongarch/{loongson3.c => virt.c

Re: [PATCH v3 08/11] target/openrisc: Enable MTTCG

2022-07-29 Thread Richard Henderson
On 7/29/22 16:01, Stafford Horne wrote: This patch enables multithread TCG for OpenRISC. Since the or1k shared syncrhonized timer can be updated from each vCPU via helpers we use a mutex to synchronize updates. Signed-off-by: Stafford Horne --- Since v2: - Removed cpu_openrisc_timer_has_advan

Re: [PATCH v3 06/11] hw/openrisc: Initialize timer time at startup

2022-07-29 Thread Richard Henderson
On 7/29/22 16:01, Stafford Horne wrote: The last_clk time was initialized at zero, this means when we calculate the first delta we will calculate 0 vs current time which could cause unnecessary hops. This patch moves timer initialization to the cpu reset. There are two resets registered here:

Re: [PATCH v3 03/11] goldfish_rtc: Add big-endian property

2022-07-29 Thread Richard Henderson
On 7/29/22 16:01, Stafford Horne wrote: Add a new property "big-endian" to allow configuring the RTC as either little or big endian, the default is little endian. Currently overriding the default to big endian is only used by the m68k virt platform. New platforms should prefer to use little end

[PATCH v3 11/11] docs/system: openrisc: Add OpenRISC documentation

2022-07-29 Thread Stafford Horne
Reviewed-by: Richard Henderson Signed-off-by: Stafford Horne --- Since v2; - Added Reviewed-by docs/system/openrisc/cpu-features.rst | 15 ++ docs/system/openrisc/emulation.rst| 17 +++ docs/system/openrisc/or1k-sim.rst | 43 docs/system/openrisc/virt.rst

[PATCH v3 08/11] target/openrisc: Enable MTTCG

2022-07-29 Thread Stafford Horne
This patch enables multithread TCG for OpenRISC. Since the or1k shared syncrhonized timer can be updated from each vCPU via helpers we use a mutex to synchronize updates. Signed-off-by: Stafford Horne --- Since v2: - Removed cpu_openrisc_timer_has_advanced lock optimization, measuring revealed

[PATCH v3 03/11] goldfish_rtc: Add big-endian property

2022-07-29 Thread Stafford Horne
Add a new property "big-endian" to allow configuring the RTC as either little or big endian, the default is little endian. Currently overriding the default to big endian is only used by the m68k virt platform. New platforms should prefer to use little endian and not set this. Cc: Laurent Vivier

[PATCH v3 10/11] hw/openrisc: virt: pass random seed to fdt

2022-07-29 Thread Stafford Horne
From: "Jason A. Donenfeld" If the FDT contains /chosen/rng-seed, then the Linux RNG will use it to initialize early. Set this using the usual guest random number generation function. This is confirmed to successfully initialize the RNG on Linux 5.19-rc2. Signed-off-by: Jason A. Donenfeld Review

[PATCH v3 07/11] target/openrisc: Add interrupted CPU to log

2022-07-29 Thread Stafford Horne
When we are tracing it's helpful to know which CPU's are getting interrupted, add that detail to the log line. Reviewed-by: Richard Henderson Signed-off-by: Stafford Horne --- Since v2: - Added Reviewed-by target/openrisc/interrupt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) d

[PATCH v3 05/11] hw/openrisc: Add PCI bus support to virt

2022-07-29 Thread Stafford Horne
This is mostly borrowed from xtensa and riscv as examples. The create_pcie_irq_map swizzle function is almost and exact copy but here we use a single cell interrupt, possibly we can make this generic. Signed-off-by: Stafford Horne --- Since v2: - No changes hw/openrisc/Kconfig | 3 + hw/ope

[PATCH v3 02/11] target/openrisc: Fix memory reading in debugger

2022-07-29 Thread Stafford Horne
In commit f0655423ca ("target/openrisc: Reorg tlb lookup") data and instruction TLB reads were combined. This, broke debugger reads where we first tried to map using the data tlb then fall back to the instruction tlb. This patch replicates this logic by first requesting a PAGE_READ protection map

[PATCH v3 01/11] hw/openrisc: Split re-usable boot time apis out to boot.c

2022-07-29 Thread Stafford Horne
These will be shared with the virt platform. Reviewed-by: Richard Henderson Signed-off-by: Stafford Horne --- Since v2: - No changes hw/openrisc/boot.c | 117 + hw/openrisc/meson.build| 1 + hw/openrisc/openrisc_sim.c | 106 ++-

[PATCH v3 09/11] target/openrisc: Interrupt handling fixes

2022-07-29 Thread Stafford Horne
When running SMP systems we sometimes were seeing lockups where IPI interrupts were being raised by never handled. This looks to be caused by 2 issues in the openrisc interrupt handling logic. 1. After clearing an interrupt the openrisc_cpu_set_irq handler will always clear PICSR. This is n

[PATCH v3 06/11] hw/openrisc: Initialize timer time at startup

2022-07-29 Thread Stafford Horne
The last_clk time was initialized at zero, this means when we calculate the first delta we will calculate 0 vs current time which could cause unnecessary hops. This patch moves timer initialization to the cpu reset. There are two resets registered here: 1. Per cpu timer mask (ttmr) reset. 2. G

[PATCH v3 04/11] hw/openrisc: Add the OpenRISC virtual machine

2022-07-29 Thread Stafford Horne
This patch adds the OpenRISC virtual machine 'virt' for OpenRISC. This platform allows for a convenient CI platform for toolchain, software ports and the OpenRISC linux kernel port. Much of this has been sourced from the m68k and riscv virt platforms. The platform provides: - OpenRISC SMP with

[PATCH v3 00/11] OpenRISC Virtual Machine

2022-07-29 Thread Stafford Horne
Hello, This is the OpenRISC Virtual Machine plaform which we are now using for OpenRISC CI such as the wireguard testing that Jason has been working on. I also have recently used it to test glibc 2.36 and it worked well. Previous glibc testsuite runs on my FPGA board took about 3 days, running on

Re: [PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Richard Henderson
On 7/29/22 14:19, Rainer Müller wrote: On 29/07/2022 18.01, Richard Henderson wrote: On 7/29/22 08:49, Rainer Müller wrote: +    /* create temporary file to map stat to */ +    tmpdir = getenv("TMPDIR"); +    if (!tmpdir) +    tmpdir = "/tmp"; +    sn

Re: [PATCH for-7.1? 0/2] Re-enable ppc32 as a linux-user host

2022-07-29 Thread Richard Henderson
On 7/29/22 13:44, Daniel Henrique Barboza wrote: The last Debian that supports ppc32 was Debian 8: https://www.debian.org/ports/powerpc/#powerpc "Debian on 32-bit PowerPC (powerpc) It first became an official release architecture with Debian GNU/Linux 2.2 (potato) and had retained that status u

Re: [PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Rainer Müller
On 29/07/2022 18.01, Richard Henderson wrote: > On 7/29/22 08:49, Rainer Müller wrote: >> +    /* create temporary file to map stat to */ >> +    tmpdir = getenv("TMPDIR"); >> +    if (!tmpdir) >> +    tmpdir = "/tmp"; >> +    snprintf(filename, sizeof(fi

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

2022-07-29 Thread Sean Christopherson
On Wed, Jul 06, 2022, Chao Peng wrote: > 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 o

Re: [PATCH for-7.1? 0/2] Re-enable ppc32 as a linux-user host

2022-07-29 Thread Daniel Henrique Barboza
On 7/29/22 14:21, Richard Henderson wrote: This is, technically, a regression from 6.2, so it's not implausible to apply before rc1. Thoughts? In gitlab #1097 the author comments that: https://gitlab.com/qemu-project/qemu/-/issues/1097#note_1044810483 "there are several distributions sti

[PATCH for-7.1?] linux-user/riscv: Align signal frame to 16 bytes

2022-07-29 Thread Richard Henderson
Follow the kernel's alignment, as we already noted. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1093 Signed-off-by: Richard Henderson --- linux-user/riscv/signal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux-user/riscv/signal.c b/linux-user/riscv/sign

[PATCH] linux-user: Implement faccessat2

2022-07-29 Thread Richard Henderson
Split out do_faccessat2 helper, and use it for accessat and faccessat as well. Signed-off-by: Richard Henderson --- Will we ever have a system libc for which __NR_faccessat2 is present, but faccessat() does not try faccessat2 first? r~ --- linux-user/syscall.c | 44 +

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

2022-07-29 Thread Sean Christopherson
On Mon, Jul 25, 2022, Chao Peng wrote: > On Thu, Jul 21, 2022 at 05:58:50PM +, Sean Christopherson wrote: > > On Thu, Jul 21, 2022, Chao Peng wrote: > > > On Thu, Jul 21, 2022 at 03:34:59PM +0800, Wei Wang wrote: > > > > > > > > > > > > On 7/21/22 00:21, Sean Christopherson wrote: > > > > May

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

2022-07-29 Thread Sean Christopherson
On Wed, Jul 06, 2022, Chao Peng wrote: > @@ -1332,9 +1332,18 @@ yet and must be cleared on entry. > __u64 userspace_addr; /* start of the userspace allocated memory */ >}; > > + struct kvm_userspace_memory_region_ext { > + struct kvm_userspace_memory_region region; > + __u64 pr

Re: [PATCH v4 11/17] dump/dump: Add section string table support

2022-07-29 Thread Janis Schoetterl-Glausch
On 7/26/22 11:22, Janosch Frank wrote: > As sections don't have a type like the notes do we need another way to Having a string table seems like a good idea to me, as we don't know the requirements any architecture might have, but sections do have sh_type. Could we use one of those, e.g. one of th

Re: [PATCH v2] ci: Upgrade msys2 release to 20220603

2022-07-29 Thread Richard Henderson
On 7/28/22 13:04, Yonggang Luo wrote: Signed-off-by: Yonggang Luo --- .cirrus.yml | 2 +- .gitlab-ci.d/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) Thanks. Applied to master as a hot-fix. r~

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

2022-07-29 Thread Sean Christopherson
On Wed, Jul 06, 2022, Chao Peng wrote: > 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 intr

Re: [PATCH v4 10/17] dump: Swap segment and section header locations

2022-07-29 Thread Janis Schoetterl-Glausch
You swapped the headers in patch 8, you just fixing up the elf header in this patch, right? Also I don't understand the reason for swapping the headers. And the comment diagram in dump_begin still reflects the old ordering. On 7/26/22 11:22, Janosch Frank wrote: > For the upcoming string table an

Re: [PATCH v4 05/17] dump: Cleanup and annotate guest memory related DumpState struct members

2022-07-29 Thread Janis Schoetterl-Glausch
On 7/26/22 11:22, Janosch Frank wrote: > We can safely remove next_block and start as both of them aren't used > anymore due to the block iteration re-work. > > Also we add comments to the remaining guest memory related struct > members and a comment on top to group them. > > Signed-off-by: Janos

Re: [PATCH v4 07/17] dump: Allocate header

2022-07-29 Thread Janis Schoetterl-Glausch
On 7/26/22 11:22, Janosch Frank wrote: > Allocating the header lets us write it at a later time and hence also > allows us to change section and segment table offsets until we > finally write it. > Where are you making use of this? You set e_shstrndx in prepare_elf_section_hdrs, but that is not re

Re: [PATCH 1/1] block: add missed block_acct_setup with new block device init procedure

2022-07-29 Thread Kevin Wolf
Am 29.07.2022 um 14:36 hat Denis V. Lunev geschrieben: > On 29.07.2022 11:13, Kevin Wolf wrote: > > Am 28.07.2022 um 21:27 hat Denis V. Lunev geschrieben: > > > On 28.07.2022 16:42, Vladimir Sementsov-Ogievskiy wrote: > > > > On 7/11/22 14:07, Denis V. Lunev wrote: > > > > > Commit 5f76a7aac156ca75

Re: [PATCH] hw/intc: Handle software disabling of APIC correctly

2022-07-29 Thread Jay Khandkar
On Fri, Jul 29, 2022 at 06:09:01PM +0100, Peter Maydell wrote: > On Tue, 12 Jul 2022 at 19:38, Jay Khandkar wrote: > > > > When the local APIC is in a software disabled state, all local interrupt > > sources must be masked and all attempts to unmask them should be > > ignored. Currently, we don't

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-07-29 Thread Peter Delevoryas
On Fri, Jul 29, 2022 at 03:25:55PM +0200, Cédric Le Goater wrote: > Hello Iris, > > On 7/29/22 01:23, Iris Chen wrote: > > Hey everyone, > > > > I have been working on a project to add support for SPI-based TPMs in QEMU. > > Currently, most of our vboot platforms using a SPI-based TPM use the Lin

Re: [PULL 0/6] Fixes for QEMU 7.1-rc1

2022-07-29 Thread Richard Henderson
On 7/29/22 08:04, Paolo Bonzini wrote: The following changes since commit 7b17a1a841fc2336eba53afade9cadb14bd3dd9a: Update version for v7.1.0-rc0 release (2022-07-26 18:03:16 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to

[PATCH 1/2] common-user/host/ppc: Implement safe-syscall.inc.S

2022-07-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- common-user/host/ppc/safe-syscall.inc.S | 107 1 file changed, 107 insertions(+) create mode 100644 common-user/host/ppc/safe-syscall.inc.S diff --git a/common-user/host/ppc/safe-syscall.inc.S b/common-user/host/ppc/safe-syscall.inc

[PATCH 2/2] linux-user: Implment host/ppc/host-signal.h

2022-07-29 Thread Richard Henderson
This commit re-enables ppc32 as a linux-user host, as existance of the directory is noted by configure. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1097 Signed-off-by: Richard Henderson --- linux-user/include/host/ppc/host-signal.h | 39 +++ 1 file changed, 39 ins

[PATCH for-7.1? 0/2] Re-enable ppc32 as a linux-user host

2022-07-29 Thread Richard Henderson
This is, technically, a regression from 6.2, so it's not implausible to apply before rc1. Thoughts? r~ Richard Henderson (2): common-user/host/ppc: Implement safe-syscall.inc.S linux-user: Implment host/ppc/host-signal.h linux-user/include/host/ppc/host-signal.h | 39 common-us

Re: [PATCH v4 09/17] dump: Reorder struct DumpState

2022-07-29 Thread Janis Schoetterl-Glausch
On 7/26/22 11:22, Janosch Frank wrote: > Let's move ELF related members into one block and guest memory related > ones into another to improve readability. > > Signed-off-by: Janosch Frank > Reviewed-by: Richard Henderson > Reviewed-by: Marc-André Lureau > --- > include/sysemu/dump.h | 16

Re: [PATCH v4 08/17] dump: Split write of section headers and data and add a prepare step

2022-07-29 Thread Janis Schoetterl-Glausch
On 7/26/22 11:22, Janosch Frank wrote: > By splitting the writing of the section headers and (future) section > data we prepare for the addition of a string table section and > architecture sections. > > At the same time we move the writing of the section to the end of the > dump process. This all

Re: [PATCH] hw/intc: Handle software disabling of APIC correctly

2022-07-29 Thread Peter Maydell
On Tue, 12 Jul 2022 at 19:38, Jay Khandkar wrote: > > When the local APIC is in a software disabled state, all local interrupt > sources must be masked and all attempts to unmask them should be > ignored. Currently, we don't do either. Fix this by handling it > correctly in apic_mem_write(). > > S

Re: [PATCH 2/3] Hexagon (tests/tcg/hexagon) Fix alignment in load_unpack.c

2022-07-29 Thread Richard Henderson
On 7/18/22 16:03, Taylor Simpson wrote: The increment used in :brev tests was causing unaligned addresses Change the increment and the relevant expected values Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/load_unpack.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(

Re: [PATCH 3/3] Hexagon (tests/tcg/hexagon) reference file for float_convd

2022-07-29 Thread Richard Henderson
On 7/18/22 16:03, Taylor Simpson wrote: The test is in tests/tcg/multiarch/float_convd.c Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/float_convd.ref | 988 ++ 1 file changed, 988 insertions(+) create mode 100644 tests/tcg/hexagon/float_convd.ref Acked-b

Re: [PATCH 1/3] Hexagon (target/hexagon) make VyV operands use a unique temp

2022-07-29 Thread Richard Henderson
On 7/18/22 16:03, Taylor Simpson wrote: VyV operand is only used in the vshuff and vdeal instructions. These instructions write to both VyV and VxV operands. In the case where both operands are the same register, we need a separate location for VyV. We use the existing vtmp field in CPUHexagon

Re: [PATCH] hw/intc: Handle software disabling of APIC correctly

2022-07-29 Thread Jay Khandkar
Ping? On Tue, 12 Jul 2022, 19:49 Jay Khandkar, wrote: > When the local APIC is in a software disabled state, all local interrupt > sources must be masked and all attempts to unmask them should be > ignored. Currently, we don't do either. Fix this by handling it > correctly in apic_mem_write(). >

Re: [PATCH RESEND] tests/tcg/linux-test: Fix random hangs in test_socket

2022-07-29 Thread Thomas Huth
On 25/07/2022 16.42, Ilya Leoshkevich wrote: test_socket hangs randomly in connect(), especially when run without qemu. Apparently the reason is that linux started treating backlog value of 0 literally instead of rounding it up since v4.4 (commit ef547f2ac16b). So set it to 1 instead. Signed-of

Re: [PATCH 12/15] ipmi: Add an SMBus IPMI interface

2022-07-29 Thread Peter Maydell
On Fri, 29 Jul 2022 at 16:56, Corey Minyard wrote: > > On Tue, Jun 28, 2022 at 05:21:44PM +0100, Peter Maydell wrote: > > On Thu, 19 Sept 2019 at 22:39, wrote: > > > > > > From: Corey Minyard > > > > > > Signed-off-by: Corey Minyard > > > --- > > > > Thank you for the ping. Comments inline...

[PATCH] hyperv: fix SynIC SINT assertion failure on guest reset

2022-07-29 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Resetting a guest that has Hyper-V VMBus support enabled triggers a QEMU assertion failure: hw/hyperv/hyperv.c:131: synic_reset: Assertion `QLIST_EMPTY(&synic->sint_routes)' failed. This happens both on normal guest reboot or when using "system_reset" HMP command. T

Re: [PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Richard Henderson
On 7/29/22 08:49, Rainer Müller wrote: +/* create temporary file to map stat to */ +tmpdir = getenv("TMPDIR"); +if (!tmpdir) +tmpdir = "/tmp"; +snprintf(filename, sizeof(filename), "%s/qemu-open.XX", tmpdir); +fd = m

[PATCH] hw/net/rocker: Avoid undefined shifts with more than 31 ports

2022-07-29 Thread Peter Maydell
In rocker_port_phys_link_status() and rocker_port_phys_enable_read() we construct a 64-bit value with one bit per front-panel port. However we accidentally do the shift as 32-bit arithmetic, which means that if there are more than 31 front-panel ports this is undefined behaviour. Fix the problem b

Re: [PATCH 12/15] ipmi: Add an SMBus IPMI interface

2022-07-29 Thread Corey Minyard
On Tue, Jun 28, 2022 at 05:21:44PM +0100, Peter Maydell wrote: > On Thu, 19 Sept 2019 at 22:39, wrote: > > > > From: Corey Minyard > > > > Signed-off-by: Corey Minyard > > --- > Thank you for the ping. Comments inline... > Very old patch, but Coverity has decided it doesn't like something >

Re: [PULL 02/60] semihosting: Return failure from softmmu-uaccess.h functions

2022-07-29 Thread Richard Henderson
On 7/29/22 07:31, Peter Maydell wrote: On Tue, 28 Jun 2022 at 05:54, Richard Henderson wrote: We were reporting unconditional success for these functions; pass on any failure from cpu_memory_rw_debug. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson So, this commit makes us che

[PATCH v2] linux-user: Use memfd for open syscall emulation

2022-07-29 Thread Rainer Müller
For certain paths in /proc, the open syscall is intercepted and the returned file descriptor points to a temporary file with emulated contents. If TMPDIR is not accessible or writable for the current user (for example in a read-only mounted chroot or container) tools such as ps from procps may fai

[PATCH v1] dirtylimit: Fix overflow when computing MB

2022-07-29 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

Re: [PULL 00/13] testing, semihosting and doc fixes

2022-07-29 Thread Richard Henderson
On 7/29/22 02:19, Alex Bennée wrote: The following changes since commit cc42559ab129a15554cc485ea9265e34dde7ab5b: Merge tag 'pull-ppc-20220728' of https://gitlab.com/danielhb/qemu into staging (2022-07-28 15:06:42 -0700) are available in the Git repository at: https://github.com/stsquad

Re: [PATCH 12/15] ipmi: Add an SMBus IPMI interface

2022-07-29 Thread Peter Maydell
On Tue, 28 Jun 2022 at 17:21, Peter Maydell wrote: > > On Thu, 19 Sept 2019 at 22:39, wrote: > > > > From: Corey Minyard > > > > Signed-off-by: Corey Minyard > > --- > > Very old patch, but Coverity has decided it doesn't like something > in this function that's still basically the same in the

Re: [PATCH v4 08/17] dump: Split write of section headers and data and add a prepare step

2022-07-29 Thread Janis Schoetterl-Glausch
On 7/26/22 11:22, Janosch Frank wrote: > By splitting the writing of the section headers and (future) section > data we prepare for the addition of a string table section and > architecture sections. > > At the same time we move the writing of the section to the end of the > dump process. This all

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

2022-07-29 Thread Peter Maydell
On Wed, 6 Jul 2022 at 11:18, Xie Yongji wrote: > > 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,

Re: [PATCH] dirtylimit: Fix overflow when computing MB

2022-07-29 Thread Peter Maydell
On Fri, 29 Jul 2022 at 16:17, wrote: > > From: Hyman Huang(黄勇) > > Coverity points out a overflow problem when computing MB, > dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, > multiplication will be done as a 32-bit operation, which > could overflow. Simplify the formula. > > Meanwhile, f

[PATCH] dirtylimit: Fix overflow when computing MB

2022-07-29 Thread huangy81
From: Hyman Huang(黄勇) Coverity points out a overflow problem when computing MB, dirty_ring_size and TARGET_PAGE_SIZE are both 32 bits, multiplication will be done as a 32-bit operation, which could overflow. Simplify the formula. Meanwhile, fix spelling mistake of variable name. Reported-by: Pe

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-07-29 Thread Cédric Le Goater
On 7/29/22 16:38, Patrick Williams wrote: On Fri, Jul 29, 2022 at 03:25:55PM +0200, Cédric Le Goater wrote: Hello Iris, On 7/29/22 01:23, Iris Chen wrote: Currently, most of our vboot platforms using a SPI-based TPM use the Linux SPI-GPIO driver to "bit-bang" the SPI protocol. This is because

Re: [PULL 06/30] softmmu/dirtylimit: Implement virtual CPU throttle

2022-07-29 Thread Hyman
在 2022/7/29 22:14, Richard Henderson 写道: On 7/29/22 06:31, Peter Maydell wrote: On Wed, 20 Jul 2022 at 12:30, Dr. David Alan Gilbert (git) wrote: From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_

[PULL 3/6] stubs: update replay-tools to match replay.h types

2022-07-29 Thread Paolo Bonzini
From: Claudio Fontana detected with GCC 13 [-Werror=enum-int-mismatch] Solves Issue #1096. Signed-off-by: Claudio Fontana Cc: Pavel Dovgalyuk Reviewed-by: Thomas Huth Message-Id: <20220704075832.31537-1-cfont...@suse.de> Signed-off-by: Paolo Bonzini --- stubs/replay-tools.c | 9 +

[PULL 5/6] kvm: don't use perror() without useful errno

2022-07-29 Thread Paolo Bonzini
From: Cornelia Huck perror() is designed to append the decoded errno value to a string. This, however, only makes sense if we called something that actually sets errno prior to that. For the callers that check for split irqchip support that is not the case, and we end up with confusing error mes

[PULL 0/6] Fixes for QEMU 7.1-rc1

2022-07-29 Thread Paolo Bonzini
The following changes since commit 7b17a1a841fc2336eba53afade9cadb14bd3dd9a: Update version for v7.1.0-rc0 release (2022-07-26 18:03:16 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fetch changes up to ebc55f523c2f406e30ec8fa

[PULL 6/6] configure: pass correct cflags to container-based cross compilers

2022-07-29 Thread Paolo Bonzini
probe_target_compiler returns nonempty $target_cc for installed toolchains and $container_cross_cc for container-based toolchains. In both cases however the flags (coming from $cross_cc_cflags_${target_arch}) must be in $target_cflags. Therefore, do not clear them prior to returning from probe_ta

[PULL 4/6] configure: Fix ppc container_cross_cc substitution

2022-07-29 Thread Paolo Bonzini
From: Richard Henderson When moving this code out of probe_target_compiler(), we failed to adjust the variable in which the target is located, resulting in e.g. powerpc64-linux-user-linux-gnu-gcc-10 Fixes: cd362defbbd ("tests/tcg: merge configure.sh back into main configure script") Signed-off-

[PULL 1/6] ui: dbus-display requires CONFIG_GBM

2022-07-29 Thread Paolo Bonzini
Without CONFIG_GBM, compiling dbus-display fails with ../ui/dbus.c: In function ‘dbus_create_context’: ../ui/dbus.c:47:20: error: ‘qemu_egl_rn_ctx’ undeclared (first use in this function); did you mean ‘qemu_egl_init_ctx’? 47 |qemu_egl_rn_ctx); |^~

[PULL 2/6] vga: fix incorrect line height in 640x200x2 mode

2022-07-29 Thread Paolo Bonzini
When in CGA modes, QEMU wants to ignore the maximum scan field (bits 0..4) of the maximum scan length register in the CRTC. It is not clear why this is needed---for example, Bochs ignores bit 7 instead. The issue is that the CGA modes are not detected correctly, and in particular mode 6 results i

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-07-29 Thread Patrick Williams
On Fri, Jul 29, 2022 at 03:25:55PM +0200, Cédric Le Goater wrote: > Hello Iris, > > On 7/29/22 01:23, Iris Chen wrote: > > MOSI pin in spi_gpio: the mosi pin is not included and we poll the realtime > > value > > of the gpio for input bits to prevent bugs with caching the mosi value. It > > was

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-07-29 Thread Patrick Williams
On Fri, Jul 29, 2022 at 03:25:55PM +0200, Cédric Le Goater wrote: > Hello Iris, > > On 7/29/22 01:23, Iris Chen wrote: > > Currently, most of our vboot platforms using a SPI-based TPM use the Linux > > SPI-GPIO driver to "bit-bang" the SPI protocol. This is because the Aspeed > > SPI controller (m

Re: [PULL 02/60] semihosting: Return failure from softmmu-uaccess.h functions

2022-07-29 Thread Peter Maydell
On Tue, 28 Jun 2022 at 05:54, Richard Henderson wrote: > > We were reporting unconditional success for these functions; > pass on any failure from cpu_memory_rw_debug. > > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson So, this commit makes us check the cpu_memory_rw_debug() retu

Re: [PATCH] disas/nanomips: Convert nanoMIPS disassembler to C

2022-07-29 Thread Peter Maydell
On Fri, 29 Jul 2022 at 15:13, Milica Lazarevic wrote: > > C++ features like class, exception handling and function overloading > have been removed and replaced with equivalent C code. > > Signed-off-by: Milica Lazarevic > --- > Please see the discussion about why converting it here: > https://lis

Re: [PULL 06/30] softmmu/dirtylimit: Implement virtual CPU throttle

2022-07-29 Thread Richard Henderson
On 7/29/22 06:31, Peter Maydell wrote: On Wed, 20 Jul 2022 at 12:30, Dr. David Alan Gilbert (git) wrote: From: Hyman Huang(黄勇) Setup a negative feedback system when vCPU thread handling KVM_EXIT_DIRTY_RING_FULL exit by introducing throttle_us_per_full field in struct CPUState. Sleep throttle

Re: [PULL V2 19/25] vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs

2022-07-29 Thread Peter Maydell
On Wed, 20 Jul 2022 at 10:04, Jason Wang wrote: > > From: Eugenio Pérez > > To know the device features is needed for CVQ SVQ, so SVQ knows if it > can handle all commands or not. Extract from > vhost_vdpa_get_max_queue_pairs so we can reuse it. > > Signed-off-by: Eugenio Pérez > Acked-by: Jason

Re: virtio: why no full reset on virtio_set_status 0 ?

2022-07-29 Thread Claudio Fontana
On 7/29/22 15:21, Alex Bennée wrote: > > Claudio Fontana writes: > >> On 7/29/22 12:13, Michael S. Tsirkin wrote: >>> On Fri, Jul 29, 2022 at 11:46:05AM +0200, Claudio Fontana wrote: >> @@ -2025,7 +2031,6 @@ void virtio_reset(void *opaque) >> VirtioDeviceClass *k = VIRTIO_DEVICE_GET

Re: [PULL V2 25/25] net/colo.c: fix segmentation fault when packet is not parsed correctly

2022-07-29 Thread Peter Maydell
On Wed, 20 Jul 2022 at 10:04, Jason Wang wrote: > > From: Zhang Chen > > When COLO use only one vnet_hdr_support parameter between > filter-redirector and filter-mirror(or colo-compare), COLO will crash > with segmentation fault. Back track as follow: > > Thread 1 "qemu-system-x86" received signa

Re: [RFC 0/3] Add Generic SPI GPIO model

2022-07-29 Thread Cédric Le Goater
Hello Iris, On 7/29/22 01:23, Iris Chen wrote: Hey everyone, I have been working on a project to add support for SPI-based TPMs in QEMU. Currently, most of our vboot platforms using a SPI-based TPM use the Linux SPI-GPIO driver to "bit-bang" the SPI protocol. This is because the Aspeed SPI cont

Re: [PATCH v10 05/21] job.c: add job_lock/unlock while keeping job.h intact

2022-07-29 Thread Kevin Wolf
Am 25.07.2022 um 09:38 hat Emanuele Giuseppe Esposito geschrieben: > With "intact" we mean that all job.h functions implicitly > take the lock. Therefore API callers are unmodified. > > This means that: > - many static functions that will be always called with job lock held > become _locked, and

[Bug 1921664] Re: Coroutines are racy for risc64 emu on arm64 - crash on Assertion

2022-07-29 Thread Thomas Huth
Upstream QEMU bugs are now tracked on https://gitlab.com/qemu- project/qemu/-/issues - so if you can reproduce it with the latest version from upstream QEMU, please report it there. ** No longer affects: qemu -- You received this bug notification because you are a member of qemu- devel-ml, which

Re: [PULL 06/30] softmmu/dirtylimit: Implement virtual CPU throttle

2022-07-29 Thread Peter Maydell
On Wed, 20 Jul 2022 at 12:30, Dr. David Alan Gilbert (git) wrote: > > From: Hyman Huang(黄勇) > > Setup a negative feedback system when vCPU thread > handling KVM_EXIT_DIRTY_RING_FULL exit by introducing > throttle_us_per_full field in struct CPUState. Sleep > throttle_us_per_full microseconds to t

Re: [PATCH] linux-user: Do not treat madvise()'s advice as a bitmask

2022-07-29 Thread Laurent Vivier
Le 25/07/2022 à 15:41, Ilya Leoshkevich a écrit : Advice is enum, not flags. Doing (advice & MADV_DONTNEED) also matches e.g. MADV_MERGEABLE. Signed-off-by: Ilya Leoshkevich --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/mmap.c b/linux-us

Re: [PATCH v2] ci: Upgrade msys2 release to 20220603

2022-07-29 Thread Alex Bennée
Yonggang Luo writes: > Signed-off-by: Yonggang Luo > --- > .cirrus.yml | 2 +- > .gitlab-ci.d/windows.yml | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Queued to testing/next, thanks. -- Alex Bennée

Re: virtio: why no full reset on virtio_set_status 0 ?

2022-07-29 Thread Alex Bennée
Claudio Fontana writes: > On 7/29/22 12:13, Michael S. Tsirkin wrote: >> On Fri, Jul 29, 2022 at 11:46:05AM +0200, Claudio Fontana wrote: > @@ -2025,7 +2031,6 @@ void virtio_reset(void *opaque) > VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); > int i; > >

[RFC v2 10/10] Fix some calls from coroutine_fn to no_coroutine_fn

2022-07-29 Thread Alberto Faria
These calls were found by static-analyzer.py. Not all occurrences of this problem were fixed. Signed-off-by: Alberto Faria --- block/commit.c | 2 +- block/io.c | 4 ++-- block/mirror.c | 4 ++-- block/parallels.c | 28 ++-- block/qcow

[RFC v2 08/10] Fix some bad coroutine_fn indirect calls and pointer assignments

2022-07-29 Thread Alberto Faria
These problems were found by static-analyzer.py. Not all occurrences of these problems were fixed. Signed-off-by: Alberto Faria --- block/backup.c | 2 +- include/block/block_int-common.h | 12 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/block/

[PATCH] virtiofsd: Disable killpriv_v2 by default

2022-07-29 Thread Vivek Goyal
We are having bunch of issues with killpriv_v2 enabled by default. First of all it relies on clearing suid/sgid bits as needed by dropping capability CAP_FSETID. This does not work for remote filesystems like NFS (and possibly others). Secondly, we are noticing other issues related to clearing of

[RFC v2 07/10] static-analyzer: Enforce coroutine_fn restrictions on function pointers

2022-07-29 Thread Alberto Faria
Extend static-analyzer.py's "coroutine_fn" check to enforce coroutine_fn restrictions on function pointer operations. Invalid operations include assigning a coroutine_fn value to a non-coroutine_fn function pointer, and invoking a coroutine_fn function pointer from a non-coroutine_fn function. Si

[RFC v2 09/10] block: Add no_coroutine_fn marker

2022-07-29 Thread Alberto Faria
When applied to a function, it advertises that it should not be called from coroutine_fn functions. Make generated_co_wrapper evaluate to no_coroutine_fn, as coroutine_fn functions should instead directly call the coroutine_fn that backs the generated_co_wrapper. Add a "no_coroutine_fn" check to

[RFC v2 06/10] Fix some direct calls from non-coroutine_fn to coroutine_fn

2022-07-29 Thread Alberto Faria
In some cases we need to use a different function, in others we need to make the caller a coroutine_fn, and in others still we need to wrap calls to coroutines in __allow_coroutine_fn_call(). Also fix coroutine_fn annotation disagreements between several declarations of the same function. These p

[RFC v2 05/10] static-analyzer: Enforce coroutine_fn restrictions for direct calls

2022-07-29 Thread Alberto Faria
Add a "coroutine_fn" check to static-analyzer.py that ensures that non-coroutine_fn functions don't perform direct calls to coroutine_fn functions. For the few cases where this must happen, introduce an __allow_coroutine_fn_call() macro that wraps offending calls and overrides the static analyzer.

[RFC v2 04/10] static-analyzer: Avoid reanalyzing unmodified translation units

2022-07-29 Thread Alberto Faria
For each translation unit, run each check only if any of the translation unit's files has been modified since the last time the check ran and passed without reporting problems. Signed-off-by: Alberto Faria --- static-analyzer.py | 240 - 1 file changed

  1   2   >