[PULL 02/25] edid: edid_desc_next

2021-05-10 Thread Gerd Hoffmann
Add helper function to find the next free desc block. Needed when we start to use the dta descriptor entries. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20210427150824.638359-1-kra...@redhat.com Message-Id: <20210427150824.638359-3-kra...@redhat.com> --- hw/display/

[PULL 04/25] edid: use dta extension block descriptors

2021-05-10 Thread Gerd Hoffmann
When the 4 descriptors in the base edid block are filled, jump to the dta extension block. This allows for more than four descriptors. Happens for example when generating an edid blob with a serial number (qemu-edid -s $serial). Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Messag

[PULL 06/25] edid: move timing generation into a separate function

2021-05-10 Thread Gerd Hoffmann
From: Konstantin Nazarov The timing generation is currently performed inside the function that fills in the DTD. The DisplayID generation needs it as well, so moving it out to a separate function. Based-on: <20210303152948.59943-2-akihiko.od...@gmail.com> Signed-off-by: Konstantin Nazarov Messa

[PULL 01/25] qemu-edid: use qemu_edid_size()

2021-05-10 Thread Gerd Hoffmann
So we only write out that part of the edid blob which has been filled with data. Also use a larger buffer for the blob. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-André Lureau Message-id: 20210427150824.638359-1-kra...@redhat.com Message-Id: <20210427150824.638359-2-kra...@redhat.com> --- q

[PULL 00/25] Vga 20210510 patches

2021-05-10 Thread Gerd Hoffmann
The following changes since commit d90f154867ec0ec22fd719164b88716e8fd48672: Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.1-20210504' into staging (2021-05-05 20:29:14 +0100) are available in the Git repository at: git://git.kraxel.org/qemu tags/vga-20210510-pu

Re: [PATCH v6 00/12] qcow2: fix parallel rewrite and discard (lockless)

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
Hi! Kevin, what do think on this now? Do you think "[PATCH v4 0/3] qcow2: fix parallel rewrite and discard (rw-lock)" still worth to update to cover reads and resend? (consider also my replies to "[PATCH v4 0/3] qcow2: fix parallel rewrite and discard (rw-lock)" branch) 22.04.2021 19:30, Vladi

[PULL v2 1/1] sphinx: adopt kernel readthedoc theme

2021-05-10 Thread marcandre . lureau
From: Marc-André Lureau The default "alabaster" sphinx theme has a couple shortcomings: - the navbar moves along the page - the search bar is not always at the same place - it lacks some contrast and colours The "rtd" theme from readthedocs.org is a popular third party theme used notably by the

[PULL v2 0/1] readthedoc theme patch

2021-05-10 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit d90f154867ec0ec22fd719164b88716e8fd48672: Merge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.1-20210504' into staging (2021-05-05 20:29:14 +0100) are available in the Git repository at: g...@gitlab.com:marcandre.lureau

Re: [PATCH 03/72] qemu/host-utils: Add wrappers for carry builtins

2021-05-10 Thread Alex Bennée
Richard Henderson writes: > These builtins came in clang 3.8, but are not present in gcc through > version 11. Even in clang the optimization is not ideal except for > x86_64, but no worse than the hand-coding that we currently do. Given this statement > +/** > + * uadd64_carry - additi

Re: [PATCH 04/72] accel/tcg: Use add/sub overflow routines in tcg-runtime-gvec.c

2021-05-10 Thread Alex Bennée
Richard Henderson writes: > Obvious uses of the new functions. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PULL 0/3] xen queue 2021-05-10

2021-05-10 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210510125340.903323-1-anthony.per...@citrix.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210510125340.903323-1-anthony.per...@citrix.com Subject: [PULL 0/3] xen queue 20

[PULL 1/3] xen-mapcache: avoid a race on memory map while using MAP_FIXED

2021-05-10 Thread Anthony PERARD via
From: Igor Druzhinin When we're replacing the existing mapping there is possibility of a race on memory map with other threads doing mmap operations - the address being unmapped/re-mapped could be occupied by another thread in between. Linux mmap man page recommends keeping the existing mappings

[PULL 3/3] xen-block: Use specific blockdev driver

2021-05-10 Thread Anthony PERARD via
... when a xen-block backend instance is created via xenstore. Following 8d17adf34f50 ("block: remove support for using "file" driver with block/char devices"), using the "file" blockdev driver for everything doesn't work anymore, we need to use the "host_device" driver when the disk image is a bl

[PULL 2/3] xen: Free xenforeignmemory_resource at exit

2021-05-10 Thread Anthony PERARD via
Because Coverity complains about it and this is one leak that Valgrind reports. Signed-off-by: Anthony PERARD Acked-by: Paul Durrant Message-Id: <20210430163742.469739-1-anthony.per...@citrix.com> Signed-off-by: Anthony PERARD --- hw/i386/xen/xen-hvm.c | 9 ++--- include/hw/xen/xen_c

[PULL 0/3] xen queue 2021-05-10

2021-05-10 Thread Anthony PERARD via
emu-dm.git tags/pull-xen-20210510 for you to fetch changes up to 1898293990702c5601e225dac9afd2402fc46e2d: xen-block: Use specific blockdev driver (2021-05-10 13:43:58 +0100) Xen patches - Avoid mmap race involving Xen's

[PATCH v2] hw/arm/smmuv3: Another range invalidation fix

2021-05-10 Thread Eric Auger
6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") failed to completely fix misalignment issues with range invalidation. For instance invalidations patterns like "invalidate 32 4kB pages starting from 0xff395000 are not correctly handled" due to the fact the previous fix onl

[PULL 26/26] hw/arm/xlnx: Fix PHY address for xilinx-zynq-a9

2021-05-10 Thread Peter Maydell
From: Guenter Roeck Commit dfc388797cc4 ("hw/arm: xlnx: Set all boards' GEM 'phy-addr' property value to 23") configured the PHY address for xilinx-zynq-a9 to 23. When trying to boot xilinx-zynq-a9 with zynq-zc702.dtb or zynq-zc706.dtb, this results in the following error message when trying to u

[PULL 23/26] hw/misc/mps2-scc: Add "QEMU interface" comment

2021-05-10 Thread Peter Maydell
The MPS2 SCC device doesn't have any documentation of its properties; add a "QEMU interface" format comment describing them. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20210504120912.23094-2-peter.mayd...@linaro.org --- include/hw/misc/mps2-scc.h | 12

[PULL 24/26] hw/misc/mps2-scc: Support using CFG0 bit 0 for remapping

2021-05-10 Thread Peter Maydell
On some boards, SCC config register CFG0 bit 0 controls whether parts of the board memory map are remapped. Support this with: * a device property scc-cfg0 so the board can specify the initial value of the CFG0 register * an outbound GPIO line which tracks bit 0 and which the board can wire

[PULL 21/26] include/disas/dis-asm.h: Handle being included outside 'extern "C"'

2021-05-10 Thread Peter Maydell
Make dis-asm.h handle being included outside an 'extern "C"' block; this allows us to remove the 'extern "C"' blocks that our two C++ files that include it are using. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/disas/dis-asm.h | 12 ++-- disas/arm-a64.cc

[PULL 18/26] hw/sd/omap_mmc: Use device_cold_reset() instead of device_legacy_reset()

2021-05-10 Thread Peter Maydell
The omap_mmc_reset() function resets its SD card via device_legacy_reset(). We know that the SD card does not have a qbus of its own, so the new device_cold_reset() function (which resets both the device and its child buses) is equivalent here to device_legacy_reset() and we can just switch to the

[PULL 19/26] osdep: Make os-win32.h and os-posix.h handle 'extern "C"' themselves

2021-05-10 Thread Peter Maydell
Both os-win32.h and os-posix.h include system header files. Instead of having osdep.h include them inside its 'extern "C"' block, make these headers handle that themselves, so that we don't include the system headers inside 'extern "C"'. This doesn't fix any current problems, but it's conceptually

[PULL 25/26] hw/arm/mps2-tz: Implement AN524 memory remapping via machine property

2021-05-10 Thread Peter Maydell
The AN524 FPGA image supports two memory maps, which differ in where the QSPI and BRAM are. In the default map, the BRAM is at 0x_, and the QSPI at 0x2800_. In the second map, they are the other way around. In hardware, the initial mapping can be selected by the user by writing eithe

[PULL 20/26] include/qemu/bswap.h: Handle being included outside extern "C" block

2021-05-10 Thread Peter Maydell
Make bswap.h handle being included outside an 'extern "C"' block: all system headers are included first, then all declarations are put inside an 'extern "C"' block. This requires a little rearrangement as currently we have an ifdef ladder that has some system includes and some local declarations o

[PULL 17/26] target/arm: Make WFI a NOP for userspace emulators

2021-05-10 Thread Peter Maydell
The WFI insn is not system-mode only, though it doesn't usually make a huge amount of sense for userspace code to execute it. Currently if you try it in qemu-arm then the helper function will raise an EXCP_HLT exception, which is not covered by the switch in cpu_loop() and results in an abort: qe

[PULL 12/26] target/arm: Move vfp_reg_ptr() to translate-neon.c.inc

2021-05-10 Thread Peter Maydell
The function vfp_reg_ptr() is used only in translate-neon.c.inc; move it there. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-10-peter.mayd...@linaro.org --- target/arm/translate.c | 7 --- target/a

[PULL 22/26] hw/arm/imx25_pdk: Fix error message for invalid RAM size

2021-05-10 Thread Peter Maydell
From: Philippe Mathieu-Daudé The i.MX25 PDK board has 2 banks for SDRAM, each can address up to 256 MiB. So the total RAM usable for this board is 512M. When we ask for more we get a misleading error message: $ qemu-system-arm -M imx25-pdk -m 513M qemu-system-arm: Invalid RAM size, should be

[PULL 09/26] target/arm: Move vfp_{load, store}_reg{32, 64} to translate-vfp.c.inc

2021-05-10 Thread Peter Maydell
The functions vfp_load_reg32(), vfp_load_reg64(), vfp_store_reg32() and vfp_store_reg64() are used only in translate-vfp.c.inc. Move them to that file. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-7-peter.mayd..

[PULL 15/26] target/arm: Make functions used by translate-neon global

2021-05-10 Thread Peter Maydell
Make the remaining functions needed by the translate-neon code global. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-13-peter.mayd...@linaro.org --- target/arm/translate-a32.h | 8 target/arm/translate

[PULL 14/26] target/arm: Move NeonGenThreeOpEnvFn typedef to translate.h

2021-05-10 Thread Peter Maydell
Move the NeonGenThreeOpEnvFn typedef to translate.h together with the other similar typedefs. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210430132740.10391-12-peter.mayd...@linaro.org --- target/arm/translate.h | 2 ++ target/a

[PULL 16/26] target/arm: Make translate-neon.c.inc its own compilation unit

2021-05-10 Thread Peter Maydell
Switch translate-neon.c.inc from being #included into translate.c to being its own compilation unit. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-14-peter.mayd...@linaro.org --- target/arm/translate-a32.h

[PULL 04/26] target/arm: Move constant expanders to translate.h

2021-05-10 Thread Peter Maydell
Some of the constant expanders defined in translate.c are generically useful and will be used by the separate C files for VFP and Neon once they are created; move the expander definitions to translate.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Hender

[PULL 11/26] target/arm: Make translate-vfp.c.inc its own compilation unit

2021-05-10 Thread Peter Maydell
Switch translate-vfp.c.inc from being #included into translate.c to being its own compilation unit. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-9-peter.mayd...@linaro.org --- target/arm/translate-a32.h

[PULL 10/26] target/arm: Make functions used by translate-vfp global

2021-05-10 Thread Peter Maydell
Make the remaining functions which are needed by translate-vfp.c.inc global. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-8-peter.mayd...@linaro.org --- target/arm/translate-a32.h | 18 ++ targe

[PULL 13/26] target/arm: Delete unused typedef

2021-05-10 Thread Peter Maydell
The VFPGenFixPointFn typedef is unused; delete it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20210430132740.10391-11-peter.mayd...@linaro.org --- target/arm/translate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target

[PULL 08/26] target/arm: Move gen_aa32 functions to translate-a32.h

2021-05-10 Thread Peter Maydell
Move the various gen_aa32* functions and macros out of translate.c and into translate-a32.h. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20210430132740.10391-6-peter.mayd...@linaro.org --- target/arm/translate-a32.h | 53 +

[PULL 00/26] target-arm queue

2021-05-10 Thread Peter Maydell
.git tags/pull-target-arm-20210510 for you to fetch changes up to 8f96812baa53005f32aece3e30b140826c20aa19: hw/arm/xlnx: Fix PHY address for xilinx-zynq-a9 (2021-05-10 13:24:09 +0100) target-arm queue: * docs: fix link in sbsa d

[PULL 07/26] target/arm: Split m-nocp trans functions into their own file

2021-05-10 Thread Peter Maydell
Currently the trans functions for m-nocp.decode all live in translate-vfp.inc.c; move them out into their own translation unit, translate-m-nocp.c. The trans_* functions here are pure code motion with no changes. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 2021043013

[PULL 06/26] target/arm: Make functions used by m-nocp global

2021-05-10 Thread Peter Maydell
We want to split out the .c.inc files which are currently included into translate.c so they are separate compilation units. To do this we need to make some functions which are currently file-local to translate.c have global scope; create a translate-a32.h paralleling the existing translate-a64.h a

[PULL 05/26] target/arm: Share unallocated_encoding() and gen_exception_insn()

2021-05-10 Thread Peter Maydell
The unallocated_encoding() function is the same in both translate-a64.c and translate.c; make the translate.c function global and drop the translate-a64.c version. To do this we need to also share gen_exception_insn(), which currently exists in two slightly different versions for A32 and A64: merg

[PULL 02/26] linux-user/aarch64: Enable hwcap for RND, BTI, and MTE

2021-05-10 Thread Peter Maydell
From: Richard Henderson These three features are already enabled by TCG, but are missing their hwcap bits. Update HWCAP2 from linux v5.12. Cc: qemu-sta...@nongnu.org (for 6.0.1) Buglink: https://bugs.launchpad.net/bugs/1926044 Signed-off-by: Richard Henderson Message-id: 20210427214108.88503-1

[PULL 03/26] target/arm: Fix tlbbits calculation in tlbi_aa64_vae2is_write()

2021-05-10 Thread Peter Maydell
In tlbi_aa64_vae2is_write() the calculation bits = tlbbits_for_regime(env, secure ? ARMMMUIdx_E2 : ARMMMUIdx_SE2, pageaddr) has the two arms of the ?: expression reversed. Fix the bug. Fixes: b6ad6062f1e5 Reported-by: Rebecca Cran Signed-off-by: Peter Maydell Revie

[PULL 01/26] docs: fix link in sbsa description

2021-05-10 Thread Peter Maydell
From: Alex Bennée A trailing _ makes all the difference to the rendered link. Signed-off-by: Alex Bennée Message-id: 20210428131316.31390-1-alex.ben...@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- docs/system/arm/sbsa.rst | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH] ppc/spapr: advertise secure boot in the guest device tree

2021-05-10 Thread Daniel Axtens
The ibm,secure-boot property of the / node determines how firmware and the operating system should enforce secure boot. The meaning of the various values are: 0 - secure boot is disabled 1 - secure boot in log-only mode 2 - secure boot enabled and enforced 3-9 - secure boot enabled and e

Re: [PATCH 6/6] aiopool: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: Divide the fields in AioTaskPool in IN and Status, and introduce a CoQueue instead of .wait to take care of suspending and resuming the calling coroutine, and a lock to protect the busy_tasks counter accesses and the AioTask .ret field. "and"

[PATCH v8 15/15] hmp: Print "reserve" property of memory backends with "info memdev"

2021-05-10 Thread David Hildenbrand
Let's print the new property. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Eduardo Habkost Reviewed-by: Markus Armbruster Acked-by: Eduardo Habkost for memory backend and machine core Cc: Markus Armbruster Cc: Eric Blake Cc: Igor Mammedov Signed-off

[PATCH v8 13/15] hmp: Print "share" property of memory backends with "info memdev"

2021-05-10 Thread David Hildenbrand
Let's print the property. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Eduardo Habkost Reviewed-by: Markus Armbruster Acked-by: Eduardo Habkost for memory backend and machine core Cc: Markus Armbruster Cc: Eric Blake Cc: Igor Mammedov Signed-off-by:

Re: [PATCH] hw/arm/smmuv3: Another range invalidation fix

2021-05-10 Thread Auger Eric
Hi Peter, On 5/10/21 1:31 PM, Peter Maydell wrote: > On Wed, 21 Apr 2021 at 18:29, Eric Auger wrote: >> >> 6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") >> failed to completely fix misalignment issues with range >> invalidation. For instance invalidations patterns lik

[PATCH v8 12/15] qmp: Include "share" property of memory backends

2021-05-10 Thread David Hildenbrand
Let's include the property, which can be helpful when debugging, for example, to spot misuse of MAP_PRIVATE which can result in some ugly corner cases (e.g., double-memory consumption on shmem). Use the same description we also use for describing the property. Reviewed-by: Philippe Mathieu-Daudé

[PATCH v8 10/15] hostmem: Wire up RAM_NORESERVE via "reserve" property

2021-05-10 Thread David Hildenbrand
Let's provide a way to control the use of RAM_NORESERVE via memory backends using the "reserve" property which defaults to true (old behavior). Only Linux currently supports clearing the flag (and support is checked at runtime, depending on the setting of "/proc/sys/vm/overcommit_memory"). Windows

[PATCH v8 08/15] memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap()

2021-05-10 Thread David Hildenbrand
Let's introduce RAM_NORESERVE, allowing mmap'ing with MAP_NORESERVE. The new flag has the following semantics: " RAM is mmap-ed with MAP_NORESERVE. When set, reserving swap space (or huge pages if applicable) is skipped: will bail out if not supported. When not set, the OS will do the reservation,

[PATCH v8 09/15] util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESERVE under Linux

2021-05-10 Thread David Hildenbrand
Let's support RAM_NORESERVE via MAP_NORESERVE on Linux. The flag has no effect on most shared mappings - except for hugetlbfs and anonymous memory. Linux man page: "MAP_NORESERVE: Do not reserve swap space for this mapping. When swap space is reserved, one has the guarantee that it is possible

[PATCH v8 07/15] util/mmap-alloc: Pass flags instead of separate bools to qemu_ram_mmap()

2021-05-10 Thread David Hildenbrand
Let's pass flags instead of bools to prepare for passing other flags and update the documentation of qemu_ram_mmap(). Introduce new QEMU_MAP_ flags that abstract the mmap() PROT_ and MAP_ flag handling and simplify it. We expose only flags that are currently supported by qemu_ram_mmap(). Maybe, we

[PATCH v8 14/15] qmp: Include "reserve" property of memory backends

2021-05-10 Thread David Hildenbrand
Let's include the new property. Instead of relying on CONFIG_LINUX, let's try to unconditionally grab the property and treat errors as "does not exist". Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Eduardo Habkost Reviewed-by: Markus Armbruster Acked-by: Eduardo Habkost for memory backend

[PATCH v8 11/15] qmp: Clarify memory backend properties returned via query-memdev

2021-05-10 Thread David Hildenbrand
We return information on the currently configured memory backends and don't configure them, so decribe what the currently set properties express. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Eduardo Habkost Reviewed-by: Markus Armbruster Suggested-by: Markus Armbruster Acked-by: Eduardo Ha

[PATCH v8 05/15] softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate()

2021-05-10 Thread David Hildenbrand
Let's forward ram_flags instead, renaming memory_region_init_ram_shared_nomigrate() into memory_region_init_ram_flags_nomigrate(). Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Acked-by: Eduardo Habkost for memory backend and machine core Signed-off-by: David Hildenbrand --- back

[PATCH v8 06/15] softmmu/memory: Pass ram_flags to qemu_ram_alloc() and qemu_ram_alloc_internal()

2021-05-10 Thread David Hildenbrand
Let's pass ram_flags to qemu_ram_alloc() and qemu_ram_alloc_internal(), preparing for passing additional flags. Reviewed-by: Philippe Mathieu-Daudé Acked-by: Eduardo Habkost for memory backend and machine core Signed-off-by: David Hildenbrand --- include/exec/ram_addr.h | 2 +- softmmu/memor

[PATCH v8 03/15] util/mmap-alloc: Factor out activating of memory to mmap_activate()

2021-05-10 Thread David Hildenbrand
We want to activate memory within a reserved memory region, to make it accessible. Let's factor that out. Reviewed-by: Richard Henderson Acked-by: Murilo Opsfelder Araujo Reviewed-by: Peter Xu Acked-by: Eduardo Habkost for memory backend and machine core Signed-off-by: David Hildenbrand ---

[PATCH v8 04/15] softmmu/memory: Pass ram_flags to qemu_ram_alloc_from_fd()

2021-05-10 Thread David Hildenbrand
Let's pass in ram flags just like we do with qemu_ram_alloc_from_file(), to clean up and prepare for more flags. Simplify the documentation of passed ram flags: Looking at our documentation of RAM_SHARED and RAM_PMEM is sufficient, no need to be repetitive. Reviewed-by: Philippe Mathieu-Daudé Re

[PATCH v8 02/15] util/mmap-alloc: Factor out reserving of a memory region to mmap_reserve()

2021-05-10 Thread David Hildenbrand
We want to reserve a memory region without actually populating memory. Let's factor that out. Reviewed-by: Igor Kotrasinski Acked-by: Murilo Opsfelder Araujo Reviewed-by: Richard Henderson Reviewed-by: Peter Xu Acked-by: Eduardo Habkost for memory backend and machine core Signed-off-by: Davi

[PATCH v8 01/15] util/mmap-alloc: Factor out calculation of the pagesize for the guard page

2021-05-10 Thread David Hildenbrand
Let's factor out calculating the size of the guard page and rename the variable to make it clearer that this pagesize only applies to the guard page. Reviewed-by: Peter Xu Acked-by: Murilo Opsfelder Araujo Acked-by: Eduardo Habkost for memory backend and machine core Cc: Igor Kotrasinski Sign

[PATCH v8 00/15] RAM_NORESERVE, MAP_NORESERVE and hostmem "reserve" property

2021-05-10 Thread David Hildenbrand
Based-on: 20210406080126.24010-1-da...@redhat.com Some cleanups previously sent in other context (resizeable allocations), followed by RAM_NORESERVE, implementing it under Linux using MAP_NORESERVE, and letting users configure it for memory backens using the "reserve" property (default: true). MA

Re: [PATCH 5/6] co-shared-resource: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: co-shared-resource is currently not thread-safe, as also reported in co-shared-resource.h. Add a QemuMutex because co_try_get_from_shres can also be invoked from non-coroutine context. But it doesn't. It's called only from co_get_from_shres().

Re: [PULL v2 00/11] Misc patches for 2021-04-30 (incl. NVMM accelerator)

2021-05-10 Thread Peter Maydell
On Tue, 4 May 2021 at 14:33, Paolo Bonzini wrote: > > The following changes since commit e93d8bcf9dbd5b8dd3b9ddbb1ece6a37e608f300: > > Merge remote-tracking branch 'remotes/philmd/tags/mips-20210502' into > staging (2021-05-03 12:05:12 +0100) > > are available in the Git repository at: > > ht

Re: [PATCH] hw/arm/smmuv3: Another range invalidation fix

2021-05-10 Thread Peter Maydell
On Wed, 21 Apr 2021 at 18:29, Eric Auger wrote: > > 6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") > failed to completely fix misalignment issues with range > invalidation. For instance invalidations patterns like "invalidate 32 > 4kB pages starting from 0xff395000 are

Re: [PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: Progressmeter is protected by the AioContext mutex, which is taken by the block jobs and their caller (like blockdev). We would like to remove the dependency of block layer code on the AioContext mutex, since most drivers and the core I/O code

Re: [PATCH] hw/arm/xlnx: Fix PHY address for xilinx-zynq-a9

2021-05-10 Thread Peter Maydell
On Tue, 4 May 2021 at 13:41, Guenter Roeck wrote: > > Commit dfc388797cc4 ("hw/arm: xlnx: Set all boards' GEM 'phy-addr' > property value to 23") configured the PHY address for xilinx-zynq-a9 > to 23. When trying to boot xilinx-zynq-a9 with zynq-zc702.dtb or > zynq-zc706.dtb, this results in the f

Re: [PATCH 3/6] blockjob: let ratelimit handle a speed of 0

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/blockjob.c b/blockjob.c index dc1d9e0e46..046c1bcd6

Re: [PATCH 2/6] block-copy: let ratelimit handle a speed of 0

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/block/block-copy.c b/bloc

Re: [PATCH 1/6] ratelimit: treat zero speed as unlimited

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Both users of RateLimit, block-copy.c and blockjob.c, treat a speed of zero as unlimited, while RateLimit treats it as "as slow as possible". The latter is nicer from the code point of view but pretty useless, so disable r

Re: [PATCH 0/6] block-copy: make helper APIs thread safe

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
10.05.2021 11:59, Emanuele Giuseppe Esposito wrote: This serie of patches bring thread safety to the smaller APIs used by block-copy, namely ratelimit, progressmeter, co-shared-resource and aiotask. The end goal is to reduce the usage of the global AioContexlock in block-copy, by introducing smal

Re: [PATCH 6/6] coroutine-sleep: introduce qemu_co_sleep

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:25, Paolo Bonzini wrote: Allow using QemuCoSleep to sleep forever until woken by qemu_co_sleep_wake. This makes the logic of qemu_co_sleep_ns_wakeable easy to understand. In the future we could introduce an API that can work even if the sleep and wake happen from different threads.

Re: [PATCH 5/6] coroutine-sleep: replace QemuCoSleepState pointer with struct in the API

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:25, Paolo Bonzini wrote: Right now, users of qemu_co_sleep_ns_wakeable are passing a pointer to QemuCoSleepState by reference to the function, but QemuCoSleepState really is just a Coroutine*. Making the content of the struct public is just as efficient and lets us skip the user_st

Re: qemu.org server bandwidth report (May 2021)

2021-05-10 Thread Daniel P . Berrangé
On Mon, May 10, 2021 at 10:49:19AM +0100, Stefan Hajnoczi wrote: > qemu.org bandwidth usage has been as follows: > - Jan: 12.56 TB > - Feb: 10.55 TB > - Mar: 10.28 TB > - Apr: 7.62 TB > > In May qemu.org has averaged 232.25 GB/day so far putting it on track > for 7 TB total this month. That decr

Re: [PATCH 02/72] qemu/host-utils: Add wrappers for overflow builtins

2021-05-10 Thread Alex Bennée
Richard Henderson writes: > These builtins came in with gcc 5 and clang 3.8, which are > slightly newer than our supported minimum compiler versions. > > Signed-off-by: Richard Henderson > --- > include/qemu/host-utils.h | 225 ++ > 1 file changed, 225 inse

Re: [PATCH 4/6] coroutine-sleep: move timer out of QemuCoSleepState

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:25, Paolo Bonzini wrote: This simplification is enabled by the previous patch. Now aio_co_wake will only be called once, therefore we do not care about a spurious firing of the timer after a qemu_co_sleep_wake. Signed-off-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogievsk

Re: [PATCH 3/6] coroutine-sleep: allow qemu_co_sleep_wake that wakes nothing

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:25, Paolo Bonzini wrote: All callers of qemu_co_sleep_wake are checking whether they are passing a NULL argument inside the pointer-to-pointer: do the check in qemu_co_sleep_wake itself. As a side effect, qemu_co_sleep_wake can be called more than once and it will only wake the cor

Re: [PATCH] util: fix fd leak in qemu_write_pidfile()

2021-05-10 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210510095708.950474-1-wangji...@huawei.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210510095708.950474-1-wangji...@huawei.com Subject: [PATCH] util: fix fd leak in qemu

Re: [PATCH 1/6] coroutine-sleep: use a stack-allocated timer

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:25, Paolo Bonzini wrote: The lifetime of the timer is well-known (it cannot outlive qemu_co_sleep_ns_wakeable, because it's deleted by the time the coroutine resumes), so it is not necessary to place it on the heap. Signed-off-by: Paolo Bonzini Reviewed-by: Vladimir Sementsov-Ogi

Re: [PATCH 2/6] coroutine-sleep: disallow NULL QemuCoSleepState** argument

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
03.05.2021 14:25, Paolo Bonzini wrote: Simplify the code by removing conditionals. qemu_co_sleep_ns can simply use point the argument to an on-stack temporary. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h| 5 +++-- util/qemu-coroutine-sleep.c | 18 +- 2 fi

Re: [PATCH v1 01/20] softfloat: Implement float128_(min|minnum|minnummag|max|maxnum|maxnummag)

2021-05-10 Thread David Hildenbrand
On 10.05.21 11:57, Alex Bennée wrote: David Hildenbrand writes: On 01.10.20 15:15, Alex Bennée wrote: David Hildenbrand writes: On 30.09.20 18:10, Alex Bennée wrote: David Hildenbrand writes: Implementation inspired by minmax_floats(). Unfortuantely, we don't have any tests we can si

Re: [PATCH trivial] qapi: spelling fix (addtional)

2021-05-10 Thread Kevin Wolf
Am 08.05.2021 um 11:33 hat Michael Tokarev geschrieben: > Fixes: 3d0d3c30ae3a259bff176f85a3efa2d0816695af > Signed-off-by: Michael Tokarev Reviewed-by: Kevin Wolf I'm also applying this to my block branch because this is how the patch that introduced it was merged, but if qemu-trivial merges fi

[PATCH] util: fix fd leak in qemu_write_pidfile()

2021-05-10 Thread Jie Wang
if execute qemu_open success, have no branch to free the fd, so unlink it inadvance, let it free by process exit. Signed-off-by: Jie Wang --- util/oslib-posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 36820fec16..30bf39bf4f 100644 --- a/u

Re: [PATCH 01/72] qemu/host-utils: Use __builtin_bitreverseN

2021-05-10 Thread Alex Bennée
Richard Henderson writes: > Clang has added some builtins for these operations; > use them if available. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée

Re: [PATCH v1 01/20] softfloat: Implement float128_(min|minnum|minnummag|max|maxnum|maxnummag)

2021-05-10 Thread Alex Bennée
David Hildenbrand writes: > On 01.10.20 15:15, Alex Bennée wrote: >> David Hildenbrand writes: >> >>> On 30.09.20 18:10, Alex Bennée wrote: David Hildenbrand writes: > Implementation inspired by minmax_floats(). Unfortuantely, we don't have > any tests we can simply ad

Re: [PATCH v3 2/2] ui/cocoa: add option to swap Option and Command, enable by default

2021-05-10 Thread 'Gerd Hoffmann '
On Tue, May 04, 2021 at 08:32:32PM -0300, gust...@noronha.eti.br wrote: > From: Gustavo Noronha Silva > > On Mac OS X the Option key maps to Alt and Command to Super/Meta. This change > swaps them around so that Alt is the key closer to the space bar and > Meta/Super > is between Control and Alt

Re: [PATCH v3 1/2] ui/cocoa: capture all keys and combos when mouse is grabbed

2021-05-10 Thread 'Gerd Hoffmann '
On Tue, May 04, 2021 at 08:32:31PM -0300, gust...@noronha.eti.br wrote: > From: Gustavo Noronha Silva > > Applications such as Gnome may use Alt-Tab and Super-Tab for different > purposes, some use Ctrl-arrows so we want to allow qemu to handle > everything when it captures the mouse/keyboard. >

Re: [PATCH] ratelimit: protect with a mutex

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
13.04.2021 15:55, Paolo Bonzini wrote: Right now, rate limiting is protected by the AioContext mutex, which is taken for example both by the block jobs and by qmp_block_job_set_speed (via find_block_job). We would like to remove the dependency of block layer code on the AioContext mutex, since m

qemu.org server bandwidth report (May 2021)

2021-05-10 Thread Stefan Hajnoczi
Hi, A few months ago qemu.org hit network bandwidth limits and incurred costs for exceeding them. Since then we have implemented several changes to make continuous integration systems more bandwidth-efficient and reduce the biggest sources of traffic to qemu.org. During the Mar-Apr billing cycle q

Re: [PATCH trivial] vnc: spelling fix (enable->enabled)

2021-05-10 Thread Gerd Hoffmann
On Sat, May 08, 2021 at 12:25:58PM +0300, Michael Tokarev wrote: > Signed-off-by: Michael Tokarev > > diff --git a/ui/vnc.c b/ui/vnc.c > index 456db47d71..2bea46b2b3 100644 > --- a/ui/vnc.c > +++ b/ui/vnc.c > @@ -598,3 +598,3 @@ bool vnc_display_reload_certs(const char *id, Error > **errp) >

Re: [PATCH v4 2/6] block: Allow changing bs->file on reopen

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
07.05.2021 17:09, Kevin Wolf wrote: Am 07.05.2021 um 09:11 hat Vladimir Sementsov-Ogievskiy geschrieben: 17.03.2021 20:15, Alberto Garcia wrote: When the x-blockdev-reopen was added it allowed reconfiguring the graph by replacing backing files, but changing the 'file' option was forbidden. Beca

Re: [PATCH v3 5/8] block/write-threshold: don't use aio context lock

2021-05-10 Thread Vladimir Sementsov-Ogievskiy
07.05.2021 16:45, Paolo Bonzini wrote: On 06/05/21 11:06, Vladimir Sementsov-Ogievskiy wrote:   void bdrv_write_threshold_check_write(BlockDriverState *bs, int64_t offset,     int64_t bytes)   {   int64_t end = offset + bytes; -    uint64_t wtr = bs->write

Re: [PATCH 06/23] hw/block/dataplane/virtio-blk: Avoid dynamic stack allocation

2021-05-10 Thread Stefan Hajnoczi
On Thu, May 06, 2021 at 05:19:31PM +0200, Philippe Mathieu-Daudé wrote: > > Can we eliminate bitmap[] entirely by using bitops.h APIs on > > s->batch_notify_vqs instead? > > You meant the bitmap.h API I assume, OK, better idea! I did mean include/qemu/bitops.h. Not sure I see a suitable bitmap.h

[PATCH 5/6] co-shared-resource: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
co-shared-resource is currently not thread-safe, as also reported in co-shared-resource.h. Add a QemuMutex because co_try_get_from_shres can also be invoked from non-coroutine context. Signed-off-by: Emanuele Giuseppe Esposito --- util/qemu-co-shared-resource.c | 26 ++ 1

Re: [PATCH v3 26/26] virtiofsd: Ask qemu to drop CAP_FSETID if client asked for it

2021-05-10 Thread Stefan Hajnoczi
On Thu, May 06, 2021 at 12:02:23PM -0400, Vivek Goyal wrote: > On Thu, May 06, 2021 at 04:37:04PM +0100, Stefan Hajnoczi wrote: > > On Wed, Apr 28, 2021 at 12:01:00PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: Vivek Goyal > > > > > > If qemu guest asked to drop CAP_FSETID upon wr

[PATCH 3/6] blockjob: let ratelimit handle a speed of 0

2021-05-10 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/blockjob.c b/blockjob.c index dc1d9e0e46..046c1bcd66 100644 --- a/blockjob.c +++ b/blockjob.c @@ -300,10 +3

[PATCH 6/6] aiopool: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
Divide the fields in AioTaskPool in IN and Status, and introduce a CoQueue instead of .wait to take care of suspending and resuming the calling coroutine, and a lock to protect the busy_tasks counter accesses and the AioTask .ret field. Signed-off-by: Emanuele Giuseppe Esposito --- block/aio_tas

[PATCH 4/6] progressmeter: protect with a mutex

2021-05-10 Thread Emanuele Giuseppe Esposito
Progressmeter is protected by the AioContext mutex, which is taken by the block jobs and their caller (like blockdev). We would like to remove the dependency of block layer code on the AioContext mutex, since most drivers and the core I/O code are already not relying on it. The simplest thing to

[PATCH 2/6] block-copy: let ratelimit handle a speed of 0

2021-05-10 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Emanuele Giuseppe Esposito --- block/block-copy.c | 28 ++-- 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/block/block-copy.c b/block/block-copy.c index c2e5090412..7e9467d48a 100644 --- a

[PATCH 1/6] ratelimit: treat zero speed as unlimited

2021-05-10 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Both users of RateLimit, block-copy.c and blockjob.c, treat a speed of zero as unlimited, while RateLimit treats it as "as slow as possible". The latter is nicer from the code point of view but pretty useless, so disable rate limiting if a speed of zero is provided. Signed-o

<    1   2   3   4   >