Re: [PATCH v2 1/2] dump: simplify a bit kdump get_next_page()

2022-09-05 Thread Peter Maydell
On Mon, 5 Sept 2022 at 13:57, wrote: > > From: Marc-André Lureau > > This should be functionally equivalent, but slightly easier to read, > with simplified paths and checks at the end of the function. > > The following patch is a major rewrite to get rid of the assert(). > > Signed-off-by: Marc-A

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-05 Thread Andrew Jones
On Thu, Sep 01, 2022 at 03:50:06PM -0700, Tyler Ng wrote: > Fixes a bug in which the index of the interrupt priority is off by 1. > For example, using an IRQ number of 3 with a priority of 1 is supposed to set > plic->source_priority[2] = 1, but instead it sets > plic->source_priority[3] = 1. When

[PATCH v2 0/2] Fix dumping in kdump format with non-aligned memory

2022-09-05 Thread marcandre . lureau
From: Marc-André Lureau Hi, dump.c:get_next_page expects GuestPhysBlock to be page-aligned, and crashes over memory regions such as "tpm-crb-cmd". Teach it to handle non-aligned regions too, by using a caller pre-allocated filled up page as necessary. Fixes: https://bugzilla.redhat.com/show_bug

Re: [PATCH v2 1/2] dump: simplify a bit kdump get_next_page()

2022-09-05 Thread Marc-André Lureau
Hi On Mon, Sep 5, 2022 at 5:28 PM Peter Maydell wrote: > On Mon, 5 Sept 2022 at 13:57, wrote: > > > > From: Marc-André Lureau > > > > This should be functionally equivalent, but slightly easier to read, > > with simplified paths and checks at the end of the function. > > > > The following patc

Re: [PATCH v1 3/8] migration: Introduce dirty-limit capability

2022-09-05 Thread Hyman Huang
在 2022/9/5 17:32, Markus Armbruster 写道: Hyman Huang writes: 在 2022/9/2 16:07, Markus Armbruster 写道: huang...@chinatelecom.cn writes: From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migra

Re: [PATCH v6 14/14] qmp/hmp, device_tree.c: introduce dumpdtb

2022-09-05 Thread Markus Armbruster
Daniel Henrique Barboza writes: > To save the FDT blob we have the '-machine dumpdtb=' property. > With this property set, the machine saves the FDT in and exit. > The created file can then be converted to plain text dts format using > 'dtc'. > > There's nothing particularly sophisticated into s

Re: [PATCH 02/19] target/ppc: Remove unused xer_* macros

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: The macros xer_ov, xer_ca, xer_ov32, and xer_ca32 are both unused and hiding the usage of env. Remove them. Signed-off-by: Víctor Colombo --- Reviewed-by: Daniel Henrique Barboza target/ppc/cpu.h | 4 1 file changed, 4 deletions(-) diff --

Re: [PATCH] coverity: put NUBus under m68k component

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 12:26, Paolo Bonzini wrote: It is only used by the Q800 emulation, so put it under that architecture. Signed-off-by: Paolo Bonzini --- scripts/coverity-scan/COMPONENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/coverity-scan/COMPONENTS.md b/scri

Re: [PATCH v5 01/10] module: qom module support

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 11:17, Claudio Fontana wrote: Hello Gerd, Paolo, this commit from 2020, together with others in the same series, contains a flaw that now comes back to bite. From commit 28457744c345ca4ccb58c984c9552e9c5955a9de ("module: qom module support") : On 6/24/20 15:10, Gerd Hoffmann wrote

Re: [PATCH] smbios: sanitize type from external type before checking have_fields_bitmap

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 12:36, Paolo Bonzini wrote: test_bit uses header->type as an offset; if the file incorrectly specifies a type greater than 127, smbios_entry_add will read garbage. To fix this, just pass the smbios data through, assuming the user knows what to do. Reported by Coverity as CID 1487255.

Re: [PATCH] accel: print an error message and exit if plugin not loaded

2022-09-05 Thread Claudio Fontana
On 9/5/22 14:06, Richard Henderson wrote: > On 9/5/22 11:13, Claudio Fontana wrote: >> If module_load_one, module_load_file fail for any reason >> (permissions, plugin not installed, ...), we need to provide some >> notification >> to the user to understand that this is happening; otherwise the er

[PATCH] 9pfs: use GHashTable for fid table

2022-09-05 Thread Linus Heckemann
The previous implementation would iterate over the fid table for lookup operations, resulting in an operation with O(n) complexity on the number of open files and poor cache locality -- for every open, stat, read, write, etc operation. This change uses a hashtable for this instead, significantly i

Re: [PATCH 2/4] hw/intc: sifive_plic.c: Fix interrupt priority index.

2022-09-05 Thread Philippe Mathieu-Daudé via
On 2/9/22 00:50, Tyler Ng wrote: Fixes a bug in which the index of the interrupt priority is off by 1. For example, using an IRQ number of 3 with a priority of 1 is supposed to set plic->source_priority[2] = 1, but instead it sets plic->source_priority[3] = 1. When an interrupt is claimed to be s

Re: [PATCH v9 01/10] s390x/cpus: Make absence of multithreading clear

2022-09-05 Thread Pierre Morel
On 9/5/22 13:32, Nico Boehr wrote: Quoting Pierre Morel (2022-09-02 09:55:22) S390x do not support multithreading in the guest. Do not let admin falsely specify multithreading on QEMU smp commandline. Signed-off-by: Pierre Morel --- hw/s390x/s390-virtio-ccw.c | 3 +++ 1 file changed, 3 i

Re: [PATCH v2] 9pfs: use GHashTable for fid table

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 17:03, Linus Heckemann wrote: The previous implementation would iterate over the fid table for lookup operations, resulting in an operation with O(n) complexity on the number of open files and poor cache locality -- for every open, stat, read, write, etc operation. This change uses a h

Re: [PATCH] tests: unit: add NULL-pointer check

2022-09-05 Thread Alex Bennée
Paolo Bonzini writes: > In CID 1432593, Coverity complains that the result of qdict_crumple() > might leak if it is not a dictionary. This is not a practical concern > since the test would fail immediately with a NULL pointer dereference > in qdict_size(). > > However, it is not nice to depend

Re: [PATCH v9 01/10] s390x/cpus: Make absence of multithreading clear

2022-09-05 Thread Janis Schoetterl-Glausch
On Mon, 2022-09-05 at 17:10 +0200, Pierre Morel wrote: > > On 9/5/22 13:32, Nico Boehr wrote: > > Quoting Pierre Morel (2022-09-02 09:55:22) > > > S390x do not support multithreading in the guest. > > > Do not let admin falsely specify multithreading on QEMU > > > smp commandline. > > > > > > Sig

Re: [PATCH v9 09/10] s390x/cpu_topology: activating CPU topology

2022-09-05 Thread Pierre Morel
On 9/2/22 09:55, Pierre Morel wrote: Starting with a new machine, s390-virtio-ccw-7.2, the machine property topology-disable is set to false while it is kept to true for older machine. This allows migrating older machine without disabling the ctop CPU feature for older machine, thus keeping ex

Re: [PATCH v9 01/10] s390x/cpus: Make absence of multithreading clear

2022-09-05 Thread Pierre Morel
On 9/5/22 17:23, Janis Schoetterl-Glausch wrote: On Mon, 2022-09-05 at 17:10 +0200, Pierre Morel wrote: On 9/5/22 13:32, Nico Boehr wrote: Quoting Pierre Morel (2022-09-02 09:55:22) S390x do not support multithreading in the guest. Do not let admin falsely specify multithreading on QEMU sm

Re: [PATCH] accel: print an error message and exit if plugin not loaded

2022-09-05 Thread Claudio Fontana
On 9/5/22 16:36, Claudio Fontana wrote: > On 9/5/22 14:06, Richard Henderson wrote: >> On 9/5/22 11:13, Claudio Fontana wrote: >>> If module_load_one, module_load_file fail for any reason >>> (permissions, plugin not installed, ...), we need to provide some >>> notification >>> to the user to unde

Re: [PATCH] tests/tcg/x86_64: add cross-modifying code test

2022-09-05 Thread Ilya Leoshkevich
On Sat, 2022-09-03 at 10:13 +0100, Alex Bennée wrote: > > Ilya Leoshkevich writes: > > > commit f025692c992c ("accel/tcg: Clear PAGE_WRITE before > > translation") > > fixed cross-modifying code handling, but did not add a test. The > > changed code was further improved recently [1], and I was n

Re: [PATCH 1/3] target/ppc: Move fsqrt to decodetree

2022-09-05 Thread Richard Henderson
On 9/5/22 13:37, Víctor Colombo wrote: Signed-off-by: Víctor Colombo --- target/ppc/insn32.decode | 7 +++ target/ppc/translate/fp-impl.c.inc | 29 + target/ppc/translate/fp-ops.c.inc | 1 - 3 files changed, 24 insertions(+), 13 deletions(-) Rev

[PATCH v2] tests/tcg/x86_64: add cross-modifying code test

2022-09-05 Thread Ilya Leoshkevich
commit f025692c992c ("accel/tcg: Clear PAGE_WRITE before translation") fixed cross-modifying code handling, but did not add a test. The changed code was further improved recently [1], and I was not sure whether these modifications were safe (spoiler: they were fine). Add a test to make sure there

Re: [RFC PATCH] hw/acpi: do not let OSPM set pcie native hotplug when acpi hotplug is enabled

2022-09-05 Thread Igor Mammedov
On Mon, 5 Sep 2022 12:55:31 +0530 Ani Sinha wrote: > Possible fix for https://bugzilla.redhat.com/show_bug.cgi?id=2089545 > > Change in AML: > > @@ -47,33 +47,39 @@ > Scope (_SB) > { > Device (PCI0) > { > Name (_HID, EisaId ("PNP0A08") /* PCI Express Bu

Re: [PATCH 2/3] target/ppc: Move fsqrts to decodetree

2022-09-05 Thread Richard Henderson
On 9/5/22 13:37, Víctor Colombo wrote: Signed-off-by: Víctor Colombo --- target/ppc/insn32.decode | 1 + target/ppc/translate/fp-impl.c.inc | 23 +-- target/ppc/translate/fp-ops.c.inc | 1 - 3 files changed, 2 insertions(+), 23 deletions(-) Reviewed-by: Ric

[RFC] module: removed unused function argument "mayfail"

2022-09-05 Thread Claudio Fontana
mayfail is always passed as false for every invocation throughout the program. It controls whether to printf or not to printf an error on g_module_open failure. Remove this unused argument. Signed-off-by: Claudio Fontana --- include/qemu/module.h | 8 softmmu/qtest.c | 2 +- ut

Re: [PATCH 3/3] target/ppc: Merge fsqrt and fsqrts helpers

2022-09-05 Thread Richard Henderson
On 9/5/22 13:37, Víctor Colombo wrote: These two helpers are almost identical, differing only by the softfloat operation it calls. Merge them into one using a macro. Also, take this opportunity to capitalize the helper name as we moved the instruction to decodetree in a previous patch. Signed-of

Re: [PATCH v2] kvm: fix memory leak on failure to read stats descriptors

2022-09-05 Thread Richard Henderson
On 9/5/22 13:39, Paolo Bonzini wrote: Reported by Coverity as CID 1490142. Since the size is constant and the lifetime is the same as the StatsDescriptors struct, embed the struct directly instead of using a separate allocation. Suggested-by: Richard Henderson Signed-off-by: Paolo Bonzini ---

Re: [PATCH] accel: print an error message and exit if plugin not loaded

2022-09-05 Thread Richard Henderson
On 9/5/22 16:43, Claudio Fontana wrote: You might think 'mayfail' can be called by other code as true in some cases, but no, it's always false. I wonder why this "mayfail" argument exists and is propagated at all, when it cannot be anything else than false. I tried to remove the "mayfail" param

Re: [PATCH 3/3] target/ppc: Merge fsqrt and fsqrts helpers

2022-09-05 Thread Víctor Colombo
On 05/09/2022 12:56, Richard Henderson wrote: On 9/5/22 13:37, Víctor Colombo wrote: These two helpers are almost identical, differing only by the softfloat operation it calls. Merge them into one using a macro. Also, take this opportunity to capitalize the helper name as we moved the instructio

Re: [PATCH 3/3] target/ppc: Merge fsqrt and fsqrts helpers

2022-09-05 Thread Richard Henderson
On 9/5/22 17:19, Víctor Colombo wrote: Existing bug, but this is missing to clear fp status to start. Reviewed-by: Richard Henderson r~ Hello Richard, thanks for your review! gen_reset_fpstatus() is called by the inline implementation in do_helper_fsqrt() before calling the helper (patch 1)

Re: [PATCH v3 13/15] virtio-net: support queue reset

2022-09-05 Thread Kangjie Xu
在 2022/9/5 16:30, Jason Wang 写道: 在 2022/8/25 16:08, Kangjie Xu 写道: From: Xuan Zhuo virtio-net and vhost-kernel implement queue reset. Queued packets in the corresponding queue pair are flushed or purged. Signed-off-by: Xuan Zhuo Signed-off-by: Kangjie Xu ---   hw/net/virtio-net.c | 18 ++

Re: [PATCH 3/3] target/ppc: Merge fsqrt and fsqrts helpers

2022-09-05 Thread Víctor Colombo
On 05/09/2022 13:21, Richard Henderson wrote: On 9/5/22 17:19, Víctor Colombo wrote: Existing bug, but this is missing to clear fp status to start. Reviewed-by: Richard Henderson r~ Hello Richard, thanks for your review! gen_reset_fpstatus() is called by the inline implementation in do_hel

[RFC PATCH] docs/system: clean up code escape for riscv virt platform

2022-09-05 Thread Alex Bennée
The example code is rendered slightly mangled due to missing code block. Properly escape the code block and add shell prompt and qemu to fit in with the other examples on the page. Signed-off-by: Alex Bennée --- docs/system/riscv/virt.rst | 13 + 1 file changed, 9 insertions(+), 4 de

Re: [RFC PATCH] hw/acpi: do not let OSPM set pcie native hotplug when acpi hotplug is enabled

2022-09-05 Thread Ani Sinha
On Mon, 5 Sep 2022, Igor Mammedov wrote: > On Mon, 5 Sep 2022 12:55:31 +0530 > Ani Sinha wrote: > > > Possible fix for https://bugzilla.redhat.com/show_bug.cgi?id=2089545 > > > > Change in AML: > > > > @@ -47,33 +47,39 @@ > > Scope (_SB) > > { > > Device (PCI0) > >

Re: [RFC PATCH] hw/acpi: do not let OSPM set pcie native hotplug when acpi hotplug is enabled

2022-09-05 Thread Ani Sinha
On Mon, 5 Sep 2022, Ani Sinha wrote: > > > > > > > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > > > index 0355bd3dda..3dc9379f27 100644 > > > --- a/hw/i386/acpi-build.c > > > +++ b/hw/i386/acpi-build.c > > > @@ -1348,10 +1348,12 @@ static Aml *build_q35_osc_method(bool > > > e

Re: [RFC] module: removed unused function argument "mayfail"

2022-09-05 Thread Richard Henderson
On 9/5/22 16:55, Claudio Fontana wrote: mayfail is always passed as false for every invocation throughout the program. It controls whether to printf or not to printf an error on g_module_open failure. Remove this unused argument. Signed-off-by: Claudio Fontana --- include/qemu/module.h | 8 +

Re: [PATCH 3/3] target/ppc: Merge fsqrt and fsqrts helpers

2022-09-05 Thread Richard Henderson
On 9/5/22 17:31, Víctor Colombo wrote: I have a message bookmarked here ([1]), but I don't know if there is a previous one with a more in depth scheme. There may have been a previous, but that's the one I was thinking of. Anyway, I was also analyzing recently the idea of removing all these re

Re: [PATCH v6 14/14] qmp/hmp, device_tree.c: introduce dumpdtb

2022-09-05 Thread Daniel Henrique Barboza
On 9/5/22 10:41, Markus Armbruster wrote: Daniel Henrique Barboza writes: To save the FDT blob we have the '-machine dumpdtb=' property. With this property set, the machine saves the FDT in and exit. The created file can then be converted to plain text dts format using 'dtc'. There's noth

Re: [PATCH] linux-user: fix bug about missing signum convert of sigqueue

2022-09-05 Thread Richard Henderson
On 8/31/22 05:10, fa...@mail.ustc.edu.cn wrote: From 4ebe8a67ed7c4b1220957b2b67a62ba60e0e80ec Mon Sep 17 00:00:00 2001 From: fanwenjie Date: Wed, 31 Aug 2022 11:55:25 +0800 Subject: [PATCH] linux-user: fix bug about missing signum convert of sigqueue Signed-off-by: fanwenjie Queued to linux

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

2022-09-05 Thread Richard Henderson
On 7/29/22 18:21, Richard Henderson wrote: 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 Queued to linux-user

Re: [PATCH v9 02/10] s390x/cpu topology: core_id sets s390x CPU topology

2022-09-05 Thread Janis Schoetterl-Glausch
On Fri, 2022-09-02 at 09:55 +0200, Pierre Morel wrote: > In the S390x CPU topology the core_id specifies the CPU address > and the position of the core withing the topology. > > Let's build the topology based on the core_id. > > Signed-off-by: Pierre Morel > --- > hw/s390x/cpu-topology.c

Re: [PING PATCH v2] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-09-05 Thread Richard Henderson
On 9/1/22 09:45, Ilya Leoshkevich wrote: +/* + * For linux-user, indicates that the page is mapped with the same semantics + * in both guest and host. + */ +#define PAGE_PASSTHROUGH 0x0800 I would expect a change to PAGE_STICKY in accel/tcg/translate-all.c, so that this bit is preserved across

Re: [PATCH 03/19] target/ppc: Zero second doubleword in DFP instructions

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: Starting at PowerISA v3.1, the second doubleword of the registers used to store results in DFP instructions are supposed to be zeroed. From the ISA, chapter 7.2.1.1 Floating-Point Registers: """ Chapter 4. Floating-Point Facility provides 32 64-bit FPRs

[PATCH V2 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflash

2022-09-05 Thread Sunil V L
This series adds the support to boot S-mode FW like EDK2 from the flash. The S-mode firmware should be kept in pflash unit 1. When -kernel (and -initrd) option is also provided along with the flash, the kernel (and initrd) will be loaded into fw_cfg table and opensbi will branch to the flash addre

Re: [PATCH 04/19] target/ppc: Set result to QNaN for DENBCD when VXCVI occurs

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: According to the ISA, for instruction DENBCD: "If an invalid BCD digit or sign code is detected in the source operand, an invalid-operation exception (VXCVI) occurs." In the Invalid Operation Exception section, there is the situation: "When Invalid Opera

[PATCH V2 1/3] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location

2022-09-05 Thread Sunil V L
load_image_to_fw_cfg() is duplicated by both arm and loongarch. The same function will be required by riscv too. So, it's time to refactor and move this function to a common path. Signed-off-by: Sunil V L --- hw/arm/boot.c | 49 --- hw/loongarch/vi

[PATCH V2 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel

2022-09-05 Thread Sunil V L
To enable both -kernel and -pflash options, the fw_cfg needs to be created prior to loading the kernel. Signed-off-by: Sunil V L --- hw/riscv/virt.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index ff8c0df5cd..b6bbf03f61 1

Re: [PATCH 07/19] target/ppc: Zero second doubleword of VSR registers for FPR insns

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: FPR register are mapped to the first doubleword of the VSR registers. Since PowerISA v3.1, the second doubleword of the target register must be zeroed for FP instructions. This patch does it by writting 0 to the second dw everytime the first dw is being

Re: [PATCH 05/19] target/ppc: Zero second doubleword for VSX madd instructions

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: In 205eb5a89e we updated most VSX instructions to zero the second doubleword, as is requested by PowerISA since v3.1. However, VSX_MADD helper was left behind unchanged, while it is also affected and should be fixed as well. This patch applies the fix fo

Re: [PATCH 19/19] target/ppc: Clear fpstatus flags on VSX_ROUND

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: Fix xsrdpic and other instructions not clearing the flags and saving incorrect values to FPSCR. Signed-off-by: Víctor Colombo --- Reviewed-by: Daniel Henrique Barboza target/ppc/fpu_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH V2 3/3] hw/riscv: virt: Enable booting S-mode firmware from pflash

2022-09-05 Thread Sunil V L
To boot S-mode firmware payload like EDK2 from persistent flash storage, qemu needs to pass the flash address as the next_addr in fw_dynamic_info to the opensbi. When both -kernel and -pflash options are provided in command line, the kernel (and initrd if -initrd) will be copied to fw_cfg table. T

Re: [PATCH 06/19] target/ppc: Set OV32 when OV is set

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: According to PowerISA: "OV32 is set whenever OV is implicitly set, and is set to the same value that OV is defined to be set to in 32-bit mode". This patch changes helper_update_ov_legacy to set/clear ov32 when applicable. Signed-off-by: Víctor Colombo

Re: [PATCH 10/19] target/ppc: Clear fpstatus flags on VSX_CVT_FP_TO_FP

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: Signed-off-by: Víctor Colombo --- IIUC all the changes from patches 8-10 are based on the logic explained in the commit message of patch 08. Problem is that patches 9 and 10 are lacking context per themselves. I'd rather either have patches 9 and 10 s

Re: [PATCH 08/19] target/ppc: Clear fpstatus flags on VSX_CVT_INT_TO_FP_VECTOR

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: Fix xscvsdqp incorrectly not clearing the FI bit. Power ISA states that xscvsdqp should always set FPSCR.FI=0 Right now, QEMU sometimes is incorrectly setting the flag to 1. Signed-off-by: Víctor Colombo --- Reviewed-by: Daniel Henrique Barboza t

Re: [PATCH 18/19] target/ppc: Clear fpstatus flags on VSX_CMP

2022-09-05 Thread Daniel Henrique Barboza
On 9/1/22 10:17, Víctor Colombo wrote: Signed-off-by: Víctor Colombo --- What I mentioned in patch 10 also applies to all patches from 11 to 18 it seems. All changes made in patches 09-18 are based on the explanation gave in patch 08. The problem with this is that it'll be annoying if/when

Re: [PATCH 18/19] target/ppc: Clear fpstatus flags on VSX_CMP

2022-09-05 Thread Víctor Colombo
On 05/09/2022 15:41, Daniel Henrique Barboza wrote: On 9/1/22 10:17, Víctor Colombo wrote: Signed-off-by: Víctor Colombo --- What I mentioned in patch 10 also applies to all patches from 11 to 18 it seems. All changes made in patches 09-18 are based on the explanation gave in patch 08. The p

sphinx-build is really slow, any way to improve that?

2022-09-05 Thread Claudio Fontana
Hi all, when I build qemu, there is a lot of time spent at the end of the build where one cpu goes 100% on sphinx-build. Is there some way to parallelize that? It seems it is the current bottleneck for rebuilds for me.. Thanks, Claudio

[PATCH v3 1/6] accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull

2022-09-05 Thread Richard Henderson
This structure will shortly contain more than just data for accessing MMIO. Rename the 'addr' member to 'xlat_section' to more clearly indicate its purpose. Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h| 22 accel/tcg/cputlb.c | 102 +++--

[PATCH v3 6/6] include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA

2022-09-05 Thread Richard Henderson
Allow the target to cache items from the guest page tables. Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 5e12cc1854..67239b4e5e 100644 --- a/include/exec/cpu-defs.

[PATCH v3 0/6] tcg: Introduce CPUTLBEntryFull

2022-09-05 Thread Richard Henderson
This is split out of two patch sets that I have in flight that allow atomic updates of guest page tables. v3 fixes some trivial conflicts with the current tcg-next PR: https://patchew.org/QEMU/20220904002317.60158-1-richard.hender...@linaro.org/ r~ Richard Henderson (6): accel/tcg: Rename CP

[PATCH v3 3/6] accel/tcg: Suppress auto-invalidate in probe_access_internal

2022-09-05 Thread Richard Henderson
When PAGE_WRITE_INV is set when calling tlb_set_page, we immediately set TLB_INVALID_MASK in order to force tlb_fill to be called on the next lookup. Here in probe_access_internal, we have just called tlb_fill and eliminated true misses, thus the lookup must be valid. This allows us to remove a w

[PATCH v3 2/6] accel/tcg: Drop addr member from SavedIOTLB

2022-09-05 Thread Richard Henderson
This field is only written, not read; remove it. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 1 - accel/tcg/cputlb.c| 7 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 500503da13..9e47184513 100644 -

[PATCH v3 5/6] accel/tcg: Introduce tlb_set_page_full

2022-09-05 Thread Richard Henderson
Now that we have collected all of the page data into CPUTLBEntryFull, provide an interface to record that all in one go, instead of using 4 arguments. This interface allows CPUTLBEntryFull to be extended without having to change the number of arguments. Signed-off-by: Richard Henderson --- incl

[PATCH v3 4/6] accel/tcg: Introduce probe_access_full

2022-09-05 Thread Richard Henderson
Add an interface to return the CPUTLBEntryFull struct that goes with the lookup. The result is not intended to be valid across multiple lookups, so the user must use the results immediately. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 11 ++ accel/tcg/cputlb.c |

[PATCH] build: Regenerate meson-buildoptions.sh

2022-09-05 Thread Richard Henderson
Regeneration was missed by the previous update. Fixes: 2a2359b84407 ("vduse-blk: Implement vduse-blk export") Signed-off-by: Richard Henderson --- scripts/meson-buildoptions.sh | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/meson-buildoptions.sh b/scrip

[PATCH v2] smbios: sanitize type from external type before checking have_fields_bitmap

2022-09-05 Thread Paolo Bonzini
test_bit uses header->type as an offset; if the file incorrectly specifies a type greater than 127, smbios_entry_add will read and write garbage. To fix this, just pass the smbios data through, assuming the user knows what to do. Reported by Coverity as CID 1487255. Signed-off-by: Paolo Bonzini

Re: [RFC v4 11/11] virtio-blk: use BDRV_REQ_REGISTERED_BUF optimization hint

2022-09-05 Thread Stefan Hajnoczi
On Fri, Sep 02, 2022 at 10:06:45AM +0200, David Hildenbrand wrote: > On 30.08.22 22:16, Stefan Hajnoczi wrote: > > On Thu, Aug 25, 2022 at 09:43:16AM +0200, David Hildenbrand wrote: > >> On 23.08.22 21:22, Stefan Hajnoczi wrote: > >>> On Tue, Aug 23, 2022 at 10:01:59AM +0200, David Hildenbrand wrot

Re: [RFC] module: removed unused function argument "mayfail"

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 17:55, Claudio Fontana wrote: mayfail is always passed as false for every invocation throughout the program. It controls whether to printf or not to printf an error on g_module_open failure. Remove this unused argument. Signed-off-by: Claudio Fontana --- include/qemu/module.h | 8

Re: [PATCH] linux-user: fix bug about missing signum convert of sigqueue

2022-09-05 Thread Philippe Mathieu-Daudé via
On 31/8/22 06:10, fa...@mail.ustc.edu.cn wrote: From 4ebe8a67ed7c4b1220957b2b67a62ba60e0e80ec Mon Sep 17 00:00:00 2001 From: fanwenjie Date: Wed, 31 Aug 2022 11:55:25 +0800 Subject: [PATCH] linux-user: fix bug about missing signum convert of sigqueue Signed-off-by: fanwenjie ---  linux-use

Re: [PATCH] build: Regenerate meson-buildoptions.sh

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 22:41, Richard Henderson wrote: Regeneration was missed by the previous update. Fixes: 2a2359b84407 ("vduse-blk: Implement vduse-blk export") Signed-off-by: Richard Henderson --- scripts/meson-buildoptions.sh | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff

Re: [PATCH] build: Regenerate meson-buildoptions.sh

2022-09-05 Thread Stefan Hajnoczi
On Mon, 5 Sept 2022 at 16:41, Richard Henderson wrote: > > Regeneration was missed by the previous update. > > Fixes: 2a2359b84407 ("vduse-blk: Implement vduse-blk export") > Signed-off-by: Richard Henderson > --- > scripts/meson-buildoptions.sh | 13 +++-- > 1 file changed, 7 insertions

Re: [PATCH v3 1/6] accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 22:22, Richard Henderson wrote: This structure will shortly contain more than just data for accessing MMIO. Rename the 'addr' member to 'xlat_section' to more clearly indicate its purpose. Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h| 22 accel/tcg/cp

Re: [PATCH v3 2/6] accel/tcg: Drop addr member from SavedIOTLB

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 22:22, Richard Henderson wrote: This field is only written, not read; remove it. Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 1 - accel/tcg/cputlb.c| 7 +++ 2 files changed, 3 insertions(+), 5 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH v3 4/6] accel/tcg: Introduce probe_access_full

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 22:22, Richard Henderson wrote: Add an interface to return the CPUTLBEntryFull struct that goes with the lookup. The result is not intended to be valid across multiple lookups, so the user must use the results immediately. Signed-off-by: Richard Henderson --- include/exec/exec-all.

Re: [PATCH V2 1/3] hw/arm,loongarch: Move load_image_to_fw_cfg() to common location

2022-09-05 Thread Peter Maydell
On Mon, 5 Sept 2022 at 19:23, Sunil V L wrote: > > load_image_to_fw_cfg() is duplicated by both arm and loongarch. The same > function will be required by riscv too. So, it's time to refactor and > move this function to a common path. > > Signed-off-by: Sunil V L > --- > hw/arm/boot.c

Re: [PATCH v3 5/6] accel/tcg: Introduce tlb_set_page_full

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 22:22, Richard Henderson wrote: Now that we have collected all of the page data into CPUTLBEntryFull, provide an interface to record that all in one go, instead of using 4 arguments. This interface allows CPUTLBEntryFull to be extended without having to change the number of arguments.

Re: sphinx-build is really slow, any way to improve that?

2022-09-05 Thread Peter Maydell
On Mon, 5 Sept 2022 at 20:51, Claudio Fontana wrote: > when I build qemu, there is a lot of time spent at the end of the build where > one cpu goes 100% on sphinx-build. > > Is there some way to parallelize that? It seems it is the current bottleneck > for rebuilds for me.. It's a big fat pytho

Re: [PATCH v3 6/6] include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA

2022-09-05 Thread Philippe Mathieu-Daudé via
On 5/9/22 22:22, Richard Henderson wrote: Allow the target to cache items from the guest page tables. Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index 5e12cc1854..

Re: [PATCH v2] smbios: sanitize type from external type before checking have_fields_bitmap

2022-09-05 Thread Philippe Mathieu-Daudé via
On Mon, Sep 5, 2022 at 10:44 PM Paolo Bonzini wrote: > > test_bit uses header->type as an offset; if the file incorrectly specifies a > type greater than 127, smbios_entry_add will read and write garbage. > > To fix this, just pass the smbios data through, assuming the user knows what > to do. Re

Re: [PATCH v2] kvm: fix memory leak on failure to read stats descriptors

2022-09-05 Thread Philippe Mathieu-Daudé via
On Mon, Sep 5, 2022 at 3:28 PM Paolo Bonzini wrote: > > Reported by Coverity as CID 1490142. Since the size is constant and the > lifetime is the same as the StatsDescriptors struct, embed the struct > directly instead of using a separate allocation. > > Suggested-by: Richard Henderson > Signed-

[PATCH v2] linux-user: Implement stracing madvise()

2022-09-05 Thread Ilya Leoshkevich
The default implementation has several problems: the first argument is not displayed as a pointer, making it harder to grep; the third argument is not symbolized; and there are several extra unused arguments. Signed-off-by: Ilya Leoshkevich --- v1: https://lists.gnu.org/archive/html/qemu-devel/2

Re: [PULL v2 00/20] tcg patch queue

2022-09-05 Thread Stefan Hajnoczi
The tsan (clang) build is broken: https://gitlab.com/qemu-project/qemu/-/jobs/2982480773 clang-10 -m64 -mcx16 -Ilibqemu-x86_64-linux-user.fa.p -I. -I.. -Itarget/i386 -I../target/i386 -I../common-user/host/x86_64 -I../linux-user/include/host/x86_64 -I../linux-user/include -Ilinux-user -I../linux-us

[PULL 0/1] baum: better document usb-braille configuration

2022-09-05 Thread Samuel Thibault
The following changes since commit 3e01455edd5fce06c14e2926b6ef408d9a94c9fb: usb-braille: Better explain that one also has to create a chardev backend (2022-09-06 00:09:50 +0200) are available in the Git repository at: https://people.debian.org/~sthibault/qemu.git tags/samuel-thibault for

[PULL 1/1] usb-braille: Better explain that one also has to create a chardev backend

2022-09-05 Thread Samuel Thibault
Users have reported not to understand the documentation. This completes it to give an explicit example how one is supposed to set up a virtual braille USB device. Signed-off-by: Samuel Thibault --- docs/system/devices/usb.rst | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-

Re: [PATCH v2] linux-user: Implement stracing madvise()

2022-09-05 Thread Ilya Leoshkevich
On Mon, 2022-09-05 at 23:40 +0200, Ilya Leoshkevich wrote: > The default implementation has several problems: the first argument > is > not displayed as a pointer, making it harder to grep; the third > argument is not symbolized; and there are several extra unused > arguments. > > Signed-off-by: I

Re: [PULL 00/11] OpenRISC updates for 7.2.0

2022-09-05 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/7.2 for any user-visible changes. signature.asc Description: PGP signature

[PATCH v3 0/5] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-09-05 Thread Ilya Leoshkevich
Hi, This series is made of patches from [1]. I've added a test and noticed that madvise(MADV_DONTNEED) was broken on alpha, fixing which required adding per-arch MADV_* definitions. This in turn affected the strace patch, so it made sense to make a series out of the results. Patch 1 adds MADV_* c

[PATCH v3 1/5] linux-user: Provide MADV_* definitions

2022-09-05 Thread Ilya Leoshkevich
Provide MADV_* definitions using target_mman.h header, similar to what kernel does. Most architectures use the same values, with the exception of alpha and hppa. Signed-off-by: Ilya Leoshkevich --- linux-user/aarch64/target_mman.h | 1 + linux-user/alpha/target_mman.h | 8 +++ linux-

[PATCH v3 4/5] linux-user: Passthrough MADV_DONTNEED for certain file mappings

2022-09-05 Thread Ilya Leoshkevich
This is a follow-up for commit 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED"), which added passthrough for anonymous mappings. File mappings can be handled in a similar manner. In order to do that, mark pages, for which mmap() was passed through, with PAGE_PASSTHROUGH, and then

[PATCH v3 2/5] linux-user: Fix madvise(MADV_DONTNEED) on alpha

2022-09-05 Thread Ilya Leoshkevich
MADV_DONTNEED has a different value on alpha, compared to all the other architectures. Fix by using TARGET_MADV_DONTNEED instead of MADV_DONTNEED. Fixes: 892a4f6a750a ("linux-user: Add partial support for MADV_DONTNEED") Signed-off-by: Ilya Leoshkevich --- linux-user/mmap.c | 3 ++- 1 file chang

[PATCH v3 3/5] linux-user: Implement stracing madvise()

2022-09-05 Thread Ilya Leoshkevich
The default implementation has several problems: the first argument is not displayed as a pointer, making it harder to grep; the third argument is not symbolized; and there are several extra unused arguments. Signed-off-by: Ilya Leoshkevich --- linux-user/strace.c| 41 +++

[PATCH v3 5/5] tests/tcg/linux-test: Add linux-madvise test

2022-09-05 Thread Ilya Leoshkevich
Add a test that checks madvise(MADV_DONTNEED) behavior with anonymous and file mappings in order to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-madvise.c | 70 +++ 1 file changed, 70 insertions(+) create mode 100644 tests/tcg/mult

[PATCH] tests/vm: update NetBSD to 9.3

2022-09-05 Thread Brad Smith
tests/vm: update NetBSD to 9.3 Signed-off-by: Brad Smith --- tests/vm/netbsd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vm/netbsd b/tests/vm/netbsd index da6773ff59..aa54338dfa 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -22,8 +22,8 @@ class NetBSDVM(

Re: [PATCH v2 0/4] hw/arm/virt: Improve address assignment for high memory regions

2022-09-05 Thread Gavin Shan
Hi Eric, On 8/24/22 6:06 PM, Eric Auger wrote: On 8/24/22 05:29, Gavin Shan wrote: On 8/15/22 4:29 PM, Gavin Shan wrote: There are three high memory regions, which are VIRT_HIGH_REDIST2, VIRT_HIGH_PCIE_ECAM and VIRT_HIGH_PCIE_MMIO. Their base addresses are floating on highest RAM address. Howe

Re: [PATCH v3 13/15] virtio-net: support queue reset

2022-09-05 Thread Kangjie Xu
在 2022/9/5 16:30, Jason Wang 写道: 在 2022/8/25 16:08, Kangjie Xu 写道: From: Xuan Zhuo virtio-net and vhost-kernel implement queue reset. Queued packets in the corresponding queue pair are flushed or purged. Signed-off-by: Xuan Zhuo Signed-off-by: Kangjie Xu ---   hw/net/virtio-net.c | 18 ++

Re: [PATCH V2 1/3] hw/arm,loongarch: Move load_image_to_fw_cfg() to common location

2022-09-05 Thread Sunil V L
On Mon, Sep 05, 2022 at 10:20:40PM +0100, Peter Maydell wrote: > On Mon, 5 Sept 2022 at 19:23, Sunil V L wrote: > > > > load_image_to_fw_cfg() is duplicated by both arm and loongarch. The same > > function will be required by riscv too. So, it's time to refactor and > > move this function to a com

[PATCH V3 1/3] hw/arm, loongarch: Move load_image_to_fw_cfg() to common location

2022-09-05 Thread Sunil V L
load_image_to_fw_cfg() is duplicated by both arm and loongarch. The same function will be required by riscv too. So, it's time to refactor and move this function to a common path. Signed-off-by: Sunil V L --- hw/arm/boot.c | 49 --- hw/loongarch/vi

[PATCH V3 0/3] hw/riscv: virt: Enable booting S-mode firmware from pflash

2022-09-05 Thread Sunil V L
This series adds the support to boot S-mode FW like EDK2 from the flash. The S-mode firmware should be kept in pflash unit 1. When -kernel (and -initrd) option is also provided along with the flash, the kernel (and initrd) will be loaded into fw_cfg table and opensbi will branch to the flash addre

[PATCH V3 2/3] hw/riscv: virt: Move create_fw_cfg() prior to loading kernel

2022-09-05 Thread Sunil V L
To enable both -kernel and -pflash options, the fw_cfg needs to be created prior to loading the kernel. Signed-off-by: Sunil V L --- hw/riscv/virt.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index ff8c0df5cd..b6bbf03f61 1

<    1   2   3   >