Re: Better alternative to strncpy in QEMU.

2021-04-13 Thread Paolo Bonzini
On 12/04/21 06:51, Thomas Huth wrote: I think this is pretty much the same as g_strlcpy() from the glib: https://developer.gnome.org/glib/2.66/glib-String-Utility-Functions.html#g-strlcpy So I guess Paolo had something different in mind when adding this task? Yes, I did. strncpy is used

Re: [PATCH v2 0/2] docs/devel/qgraph: add troubleshooting information

2021-04-13 Thread Paolo Bonzini
On 12/04/21 16:34, Stefan Hajnoczi wrote: v2: * Fix "will unavailable" typo [Thomas] I recently needed to troubleshoot a case where qos-test terminated immediately with no output. In other words, qos-test decided that no tests are runnable. After lots of head scratching and some help from Ema

Re: [PATCH] docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document

2021-04-13 Thread Paolo Bonzini
On 07/04/21 17:42, Kevin Wolf wrote: +* Publishing other's private information, such as physical or electronic +addresses, without explicit permission Yes, it's pretty clear that I'm not publishing new information about people when I'm keeping them in Cc: when replying to a thread, or even when

Re: [PATCH 1/4] target/ppc: Code motion required to build disabling tcg

2021-04-13 Thread David Gibson
On Mon, Apr 12, 2021 at 12:05:31PM +, Bruno Piazera Larsen wrote: > > A general advice for this whole series is: make sure you add in some > > words explaining why you decided to make a particular change. It will be > > much easier to review if we know what were the logical steps leading to > >

Re: [PATCH 2/4] target/ppc: added solutions for building with disable-tcg

2021-04-13 Thread David Gibson
On Mon, Apr 12, 2021 at 08:40:47AM -0700, Richard Henderson wrote: > On 4/11/21 10:08 PM, David Gibson wrote: > > Not directly related to what you're trying to accomplish here, but the > > whole vscr_sat thing looks really weird. I have no idea why we're > > splitting out the storage of VSCR[SAT]

Re: [PATCH 4/5] blkdebug: do not suspend in the middle of QLIST_FOREACH_SAFE

2021-04-13 Thread Paolo Bonzini
On 08/04/21 17:59, Emanuele Giuseppe Esposito wrote: Perhaps insert here: That would be unsafe in case a rule other than the current one is removed while the coroutine has yielded. Keep FOREACH_SAFE because suspend_request deletes the current rule. After this patch, *all* matching rules are

Re: [PATCH 0/5] blkdebug: fix racing condition when iterating on

2021-04-13 Thread Paolo Bonzini
On 08/04/21 17:59, Emanuele Giuseppe Esposito wrote: When qemu_coroutine_enter is executed in a loop (even QEMU_FOREACH_SAFE), the new routine can modify the list, for example removing an element, causing problem when control is given back to the caller that continues iterating on the same list.

Re: [PATCH RFC RESEND v2 3/6] hw/pci: Add pci_root_bus_max_bus

2021-04-13 Thread Auger Eric
Hi Xingang, On 3/25/21 8:22 AM, Wang Xingang wrote: > From: Xingang Wang > > This helps to find max bus number of a root bus. s/max bus number of a root bus/highest bus number of a bridge hierarchy? > > Signed-off-by: Xingang Wang > Signed-off-by: Jiahui Cen > --- > hw/pci/pci.c | 34

[RFC PATCH v2 3/6] hw/arm/virt-acpi-build: Distinguish possible and present cpus

2021-04-13 Thread Yanan Wang
From: Ying Fang When building ACPI tables regarding CPUs we should always build them for the number of possible CPUs, not the number of present CPUs. We then ensure only the present CPUs are enabled in MADT. Furthermore, it is also needed if we are going to support CPU hotplug in the future. Thi

[RFC PATCH v2 0/6] hw/arm/virt: Introduce cpu topology support

2021-04-13 Thread Yanan Wang
Hi, This series is a new version of [0] recently posted by Ying Fang to introduce cpu topology support for ARM platform. I have taken over his work about this now, thanks for his contribution. Description: An accurate cpu topology may help improve the cpu scheduler's decision making when dealing

[RFC PATCH v2 2/6] hw/arm/virt: DT: Add cpu-map

2021-04-13 Thread Yanan Wang
From: Andrew Jones Support device tree CPU topology descriptions. Signed-off-by: Andrew Jones Signed-off-by: Yanan Wang --- hw/arm/virt.c | 41 - include/hw/arm/virt.h | 1 + 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/hw/arm

[RFC PATCH v2 4/6] hw/acpi/aml-build: Add processor hierarchy node structure

2021-04-13 Thread Yanan Wang
Add a generic API to build Processor Hierarchy Node Structure(Type 0), which is strictly consistent with descriptions in ACPI 6.3: 5.2.29.1. This function will be used to build ACPI PPTT table for cpu topology. Signed-off-by: Ying Fang Signed-off-by: Henglong Fan Signed-off-by: Yanan Wang ---

[RFC PATCH v2 1/6] device_tree: Add qemu_fdt_add_path

2021-04-13 Thread Yanan Wang
From: Andrew Jones qemu_fdt_add_path() works like qemu_fdt_add_subnode(), except it also adds any missing subnodes in the path. We also tweak an error message of qemu_fdt_add_subnode(). We'll make use of this new function in a coming patch. Signed-off-by: Andrew Jones Signed-off-by: Yanan Wang

[RFC PATCH v2 6/6] hw/arm/virt: Replace smp_parse with one that prefers cores

2021-04-13 Thread Yanan Wang
From: Andrew Jones The virt machine type has never used the CPU topology parameters, other than number of online CPUs and max CPUs. When choosing how to allocate those CPUs the default has been to assume cores. In preparation for using the other CPU topology parameters let's use an smp_parse that

[RFC PATCH v2 5/6] hw/arm/virt-acpi-build: Add PPTT table

2021-04-13 Thread Yanan Wang
Add the Processor Properties Topology Table (PPTT) to present CPU topology information to ACPI guests. Note, while a DT boot Linux guest with a non-flat CPU topology will see socket and core IDs being sequential integers starting from zero, e.g. with -smp 4,sockets=2,cores=2,threads=1 a DT boot pr

[PATCH-for-6.1] exec: Remove accel/tcg/ from include paths

2021-04-13 Thread Philippe Mathieu-Daudé
When TCG is enabled, the accel/tcg/ include path is added to the project global include search list. This accel/tcg/ directory contains a header named "internal.h" which, while intented to be internal to accel/tcg/, is accessible by all files compiled when TCG is enabled. This might lead to problem

Re: [PATCH v2 2/3] qom: move user_creatable_add_opts logic to vl.c and QAPIfy it

2021-04-13 Thread David Hildenbrand
On 13.04.21 06:41, Markus Armbruster wrote: David Hildenbrand writes: On 12.03.21 18:35, Paolo Bonzini wrote: Emulators are currently using OptsVisitor (via user_creatable_add_opts) to parse the -object command line option. This has one extra feature, compared to keyval, which is automatic c

Re: [PATCH-for-6.1] exec: Remove accel/tcg/ from include paths

2021-04-13 Thread Claudio Fontana
Reviewed-by: Claudio Fontana Ciao, Claudio On 4/13/21 10:10 AM, Philippe Mathieu-Daudé wrote: > When TCG is enabled, the accel/tcg/ include path is added to the > project global include search list. This accel/tcg/ directory > contains a header named "internal.h" which, while intented to > be i

[RFC PATCH v2 1/4] vl.c: Add -smp, clusters=* command line support for ARM cpu

2021-04-13 Thread Yanan Wang
A cluster means a group of cores that share some resources (e.g. cache) among them under the LLC. For example, ARM64 server chip Kunpeng 920 has 6 or 8 clusters in each NUMA, and each cluster has 4 cores. All clusters share L3 cache data while cores within each cluster share the L2 cache. The cach

[RFC PATCH v2 0/4] hw/arm/virt: Introduce cluster cpu topology support

2021-04-13 Thread Yanan Wang
Hi, This series is a new version of [0] posted to introduce the cluster cpu topology support for ARM platform, besides now existing sockets, cores, and threads. And the code has been rewriten based on patch series [1]. [0] https://patchwork.kernel.org/project/qemu-devel/cover/20210331095343.12172

[RFC PATCH v2 3/4] hw/arm/virt-acpi-build: Add cluster level for PPTT table

2021-04-13 Thread Yanan Wang
Add a Processor Hierarchy Node of cluster level between core level and package level for ARM PPTT table. Signed-off-by: Yanan Wang --- hw/arm/virt-acpi-build.c | 55 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/hw/arm/virt-acpi-build.c

[RFC PATCH v2 4/4] hw/arm/virt: Add cluster level for device tree

2021-04-13 Thread Yanan Wang
Add a cluster level between core level and package level for ARM device tree. Signed-off-by: Yanan Wang --- hw/arm/virt.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 51797628db..4468a4734b 100644 --- a/hw/arm/virt.c +++ b/h

Re: [PATCH v2 2/3] qom: move user_creatable_add_opts logic to vl.c and QAPIfy it

2021-04-13 Thread David Hildenbrand
On 13.04.21 10:13, David Hildenbrand wrote: On 13.04.21 06:41, Markus Armbruster wrote: David Hildenbrand writes: On 12.03.21 18:35, Paolo Bonzini wrote: Emulators are currently using OptsVisitor (via user_creatable_add_opts) to parse the -object command line option. This has one extra feat

Re: [RFC v12 27/65] target/arm: split a15 cpu model and 32bit class functions to cpu32.c

2021-04-13 Thread Claudio Fontana
On 4/8/21 12:23 PM, Claudio Fontana wrote: > On 3/28/21 6:18 PM, Richard Henderson wrote: >> On 3/26/21 1:36 PM, Claudio Fontana wrote: >>> provide helper functions there to initialize 32bit models, >>> and export the a15 cpu model. >>> >>> We still need to keep around a15 until we sort out the boa

[RFC PATCH v2 2/4] hw/arm/virt: Parse -smp cluster parameter in virt_smp_parse

2021-04-13 Thread Yanan Wang
There is a separate function virt_smp_parse() in hw/virt/arm.c used to parse cpu topology for the ARM machines. So add parsing of -smp cluster parameter in it, then total number of logical cpus will be calculated like: max_cpus = sockets * clusters * cores * threads. In virt_smp_parse(), the compu

Re: trace_FOO_tcg bit-rotted?

2021-04-13 Thread Stefan Hajnoczi
On Mon, Apr 12, 2021 at 08:06:57PM +0100, Alex Bennée wrote: > > Stefan Hajnoczi writes: > > > On Fri, Apr 09, 2021 at 05:29:08PM +0100, Alex Bennée wrote: > >> > >> Laurent Vivier writes: > >> > >> > Le 06/04/2021 à 18:00, Alex Bennée a écrit : > >> >> Hi, > >> >> > >> >> It's been awhile s

[Bug 1923583] [NEW] colo: pvm flush failed after svm killed

2021-04-13 Thread meeho yuen
Public bug reported: Hi, Primary vm flush failed after killing svm, which leads primary vm guest filesystem unavailable. qemu versoin: 5.2.0 host/guest os: CentOS Linux release 7.6.1810 (Core) Reproduce steps: 1. create colo vm following https://github.com/qemu/qemu/blob/master/docs/COLO-FT

Re: [Bug 1923583] [NEW] colo: pvm flush failed after svm killed

2021-04-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/161830261172.29345.7866671962411605196.malone...@wampee.canonical.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 161830261172.29345.7866671962411605196.malone...@wampee.canon

Re: [PATCH] vhost-user-fs: fix features handling

2021-04-13 Thread Stefan Hajnoczi
On Thu, Apr 08, 2021 at 10:55:34PM +0300, Anton Kuchin wrote: > Make virtio-fs take into account server capabilities. > > Just returning requested features assumes they all of then are implemented > by server and results in setting unsupported configuration if some of them > are absent. > > Signe

Re: [PATCH 2/2] Support monitor chardev hotswap with QMP

2021-04-13 Thread Li Zhang
On Tue, Apr 13, 2021 at 8:41 AM Markus Armbruster wrote: > > Li Zhang writes: > > > From: Li Zhang > > > > For some scenarios, it needs to hot-add a monitor device. > > But QEMU doesn't support hotplug yet. It also works by adding > > a monitor with null backend by default and then change its >

Re: [Virtio-fs] [PATCH] vhost-user-fs: fix features handling

2021-04-13 Thread Stefan Hajnoczi
On Mon, Apr 12, 2021 at 02:43:16PM -0400, Vivek Goyal wrote: > On Sun, Apr 11, 2021 at 09:21:54AM +0300, Anton Kuchin wrote: > > > > On 09/04/2021 18:56, Vivek Goyal wrote: > > > On Thu, Apr 08, 2021 at 10:55:34PM +0300, Anton Kuchin wrote: > > > > Make virtio-fs take into account server capabilit

Re: [PATCH 2/2] Support monitor chardev hotswap with QMP

2021-04-13 Thread Daniel P . Berrangé
On Tue, Apr 13, 2021 at 08:40:59AM +0200, Markus Armbruster wrote: > Li Zhang writes: > > > From: Li Zhang > > > > For some scenarios, it needs to hot-add a monitor device. > > But QEMU doesn't support hotplug yet. It also works by adding > > a monitor with null backend by default and then chang

Re: [Bug 1923497] [NEW] bios_linker_loader_add_checksum: Assertion `start_offset < file->blob->len' failed

2021-04-13 Thread Igor Mammedov
On Mon, 12 Apr 2021 20:29:04 - Ed Davison <1923...@bugs.launchpad.net> wrote: > Public bug reported: > > Trying boot/start a Windows 10 VM. Worked until recently when this > error started showing up. > > I have the following installed on Fedora 33: > qemu-kvm-5.1.0-9.fc33.x86_64 Could you

Re: [PATCH RFC RESEND v2 4/6] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-04-13 Thread Auger Eric
Hi Xingang, On 3/25/21 8:22 AM, Wang Xingang wrote: > From: Xingang Wang > > The idmap of smmuv3 and root complex covers the whole RID space for now, > this patch add explicit idmap info according to root bus number range. > This add smmuv3 idmap for certain bus which has enabled the iommu prope

[PATCH v5 00/14] RAM_NORESERVE, MAP_NORESERVE and hostmem "reserve" property

2021-04-13 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

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

2021-04-13 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 Cc: Igor Kotrasinski Signed-off-by: David Hildenbrand --- util/mmap-alloc.c | 31 ++

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

2021-04-13 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 Signed-off-by: David Hildenbrand --- util/mmap-alloc.c | 58 +

[PATCH v5 06/14] util/mmap-alloc: Pass flags instead of separate bools to qemu_ram_mmap()

2021-04-13 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 v5 03/14] util/mmap-alloc: Factor out activating of memory to mmap_activate()

2021-04-13 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 Signed-off-by: David Hildenbrand --- util/mmap-alloc.c | 94 +---

[PATCH v5 05/14] softmmu/memory: Pass ram_flags to memory_region_init_ram_shared_nomigrate()

2021-04-13 Thread David Hildenbrand
Let's forward ram_flags instead, renaming memory_region_init_ram_shared_nomigrate() into memory_region_init_ram_flags_nomigrate(). Forward flags to qemu_ram_alloc() and qemu_ram_alloc_internal(). Reviewed-by: Peter Xu Signed-off-by: David Hildenbrand --- backends/hostmem-ram.c

[PATCH v5 04/14] softmmu/memory: Pass ram_flags to qemu_ram_alloc_from_fd()

2021-04-13 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: Peter Xu Signed-off-by: D

[PATCH v5 09/14] hostmem: Wire up RAM_NORESERVE via "reserve" property

2021-04-13 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 v5 13/14] qmp: Include "reserve" property of memory backends

2021-04-13 Thread David Hildenbrand
Let's include the new property. Cc: Eric Blake Cc: Markus Armbruster Cc: Igor Mammedov Signed-off-by: David Hildenbrand --- hw/core/machine-qmp-cmds.c | 1 + qapi/machine.json | 4 2 files changed, 5 insertions(+) diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cm

[PATCH v5 07/14] memory: Introduce RAM_NORESERVE and wire it up in qemu_ram_mmap()

2021-04-13 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 v5 08/14] util/mmap-alloc: Support RAM_NORESERVE via MAP_NORESERVE under Linux

2021-04-13 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 v5 14/14] hmp: Print "reserve" property of memory backends with "info memdev"

2021-04-13 Thread David Hildenbrand
Let's print the new property. Reviewed-by: Dr. David Alan Gilbert Cc: Markus Armbruster Cc: Eric Blake Cc: Igor Mammedov Signed-off-by: David Hildenbrand --- hw/core/machine-hmp-cmds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds

[PATCH v5 12/14] hmp: Print "share" property of memory backends with "info memdev"

2021-04-13 Thread David Hildenbrand
Let's print the property. Cc: Markus Armbruster Cc: Eric Blake Cc: Igor Mammedov Signed-off-by: David Hildenbrand --- hw/core/machine-hmp-cmds.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/core/machine-hmp-cmds.c b/hw/core/machine-hmp-cmds.c index 58248cffa3..004a92b3d6 100644 --

[PATCH v5 10/14] qmp: Clarify memory backend properties returned via query-memdev

2021-04-13 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. Suggested-by: Markus Armbruster Cc: Eric Blake Cc: Markus Armbruster Cc: Igor Mammedov Signed-off-by: David Hildenbrand --- qapi/machine.json | 6

Re: [PATCH 0/1] sphinx: qapidoc: Wrap "If" section body in a paragraph node

2021-04-13 Thread Peter Maydell
On Wed, 7 Apr 2021 at 10:41, Markus Armbruster wrote: > > Peter, do you intend to merge this yourself? I have nothing else queued > right now. If you want me to do a pull request for this patch, let me > know. I missed this email earlier. I had assumed somebody else would pick it up, but as it

[PATCH v5 11/14] qmp: Include "share" property of memory backends

2021-04-13 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. Cc: Eric Blake Cc: Markus Armbruste

Re: trace_FOO_tcg bit-rotted?

2021-04-13 Thread Alex Bennée
Stefan Hajnoczi writes: > On Mon, Apr 12, 2021 at 08:06:57PM +0100, Alex Bennée wrote: >> >> Stefan Hajnoczi writes: >> >> > On Fri, Apr 09, 2021 at 05:29:08PM +0100, Alex Bennée wrote: >> >> >> >> Laurent Vivier writes: >> >> >> >> > Le 06/04/2021 à 18:00, Alex Bennée a écrit : >> >> >>

Re: [PATCH 2/2] Support monitor chardev hotswap with QMP

2021-04-13 Thread Li Zhang
On Tue, Apr 13, 2021 at 10:58 AM Daniel P. Berrangé wrote: > > On Tue, Apr 13, 2021 at 08:40:59AM +0200, Markus Armbruster wrote: > > Li Zhang writes: > > > > > From: Li Zhang > > > > > > For some scenarios, it needs to hot-add a monitor device. > > > But QEMU doesn't support hotplug yet. It als

Re: [PATCH v2 2/3] qom: move user_creatable_add_opts logic to vl.c and QAPIfy it

2021-04-13 Thread Kevin Wolf
Am 13.04.2021 um 10:13 hat David Hildenbrand geschrieben: > On 13.04.21 06:41, Markus Armbruster wrote: > > David Hildenbrand writes: > > > > > On 12.03.21 18:35, Paolo Bonzini wrote: > > > > Emulators are currently using OptsVisitor (via user_creatable_add_opts) > > > > to parse the -object comm

Re: [PATCH v2 2/3] qom: move user_creatable_add_opts logic to vl.c and QAPIfy it

2021-04-13 Thread Markus Armbruster
David Hildenbrand writes: > On 13.04.21 06:41, Markus Armbruster wrote: >> David Hildenbrand writes: >> >>> On 12.03.21 18:35, Paolo Bonzini wrote: Emulators are currently using OptsVisitor (via user_creatable_add_opts) to parse the -object command line option. This has one extra fea

[PATCH RESEND v7 00/13] virtio-mem: vfio support

2021-04-13 Thread David Hildenbrand
After silence for more than 1.5 months and the feeling like pinging into a black hole, I rebased and retested the patches. I hope we can get them into 6.1 early -- or at least get some more feedback on the patches. @Paolo: Michael and Alex already acked relevant parts -- A virtio-mem device man

[PATCH RESEND v7 02/13] memory: Helpers to copy/free a MemoryRegionSection

2021-04-13 Thread David Hildenbrand
In case one wants to create a permanent copy of a MemoryRegionSections, one needs access to flatview_ref()/flatview_unref(). Instead of exposing these, let's just add helpers to copy/free a MemoryRegionSection and properly adjust references. Cc: Paolo Bonzini Cc: "Michael S. Tsirkin" Cc: Alex Wi

[PATCH RESEND v7 04/13] virtio-mem: Don't report errors when ram_block_discard_range() fails

2021-04-13 Thread David Hildenbrand
Any errors are unexpected and ram_block_discard_range() already properly prints errors. Let's stop manually reporting errors. Cc: Paolo Bonzini Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Dr. David Alan Gilbert Cc: Igor Mammedov Cc: Pankaj Gupta Cc: Peter Xu Cc: Auger Eric Cc: Wei Yan

[PATCH RESEND v7 06/13] vfio: Support for RamDiscardManager in the !vIOMMU case

2021-04-13 Thread David Hildenbrand
Implement support for RamDiscardManager, to prepare for virtio-mem support. Instead of mapping the whole memory section, we only map "populated" parts and update the mapping when notified about discarding/population of memory via the RamDiscardListener. Similarly, when syncing the dirty bitmaps, sy

[PATCH RESEND v7 03/13] virtio-mem: Factor out traversing unplugged ranges

2021-04-13 Thread David Hildenbrand
Let's factor out the core logic, no need to replicate. Reviewed-by: Pankaj Gupta Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Cc: Paolo Bonzini Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Dr. David Alan Gilbert Cc: Igor Mammedov Cc: Pankaj Gupta Cc: Peter Xu Cc: Auge

[PATCH RESEND v7 01/13] memory: Introduce RamDiscardManager for RAM memory regions

2021-04-13 Thread David Hildenbrand
We have some special RAM memory regions (managed by virtio-mem), whereby the guest agreed to only use selected memory ranges. "unused" parts are discarded so they won't consume memory - to logically unplug these memory ranges. Before the VM is allowed to use such logically unplugged memory again, c

[PATCH RESEND v7 10/13] softmmu/physmem: Don't use atomic operations in ram_block_discard_(disable|require)

2021-04-13 Thread David Hildenbrand
We have users in migration context that don't hold the BQL (when finishing migration). To prepare for further changes, use a dedicated mutex instead of atomic operations. Keep using qatomic_read ("READ_ONCE") for the functions that only extract the current state (e.g., used by virtio-balloon), lock

[PATCH RESEND v7 08/13] vfio: Sanity check maximum number of DMA mappings with RamDiscardManager

2021-04-13 Thread David Hildenbrand
Although RamDiscardManager can handle running into the maximum number of DMA mappings by propagating errors when creating a DMA mapping, we want to sanity check and warn the user early that there is a theoretical setup issue and that virtio-mem might not be able to provide as much memory towards a

[PATCH RESEND v7 07/13] vfio: Query and store the maximum number of possible DMA mappings

2021-04-13 Thread David Hildenbrand
Let's query the maximum number of possible DMA mappings by querying the available mappings when creating the container (before any mappings are created). We'll use this informaton soon to perform some sanity checks and warn the user. Reviewed-by: Alex Williamson Acked-by: Alex Williamson Acked-b

[PATCH RESEND v7 13/13] vfio: Disable only uncoordinated discards for VFIO_TYPE1 iommus

2021-04-13 Thread David Hildenbrand
We support coordinated discarding of RAM using the RamDiscardManager for the VFIO_TYPE1 iommus. Let's unlock support for coordinated discards, keeping uncoordinated discards (e.g., via virtio-balloon) disabled if possible. This unlocks virtio-mem + vfio on x86-64. Note that vfio used via "nvme://"

[PATCH RESEND v7 05/13] virtio-mem: Implement RamDiscardManager interface

2021-04-13 Thread David Hildenbrand
Let's properly notify when (un)plugging blocks, after discarding memory and before allowing the guest to consume memory. Handle errors from notifiers gracefully (e.g., no remaining VFIO mappings) when plugging, rolling back the change and telling the guest that the VM is busy. One special case to

[PATCH RESEND v7 11/13] softmmu/physmem: Extend ram_block_discard_(require|disable) by two discard types

2021-04-13 Thread David Hildenbrand
We want to separate the two cases whereby we discard ram - uncoordinated: e.g., virito-balloon - coordinated: e.g., virtio-mem coordinated via the RamDiscardManager Reviewed-by: Pankaj Gupta Acked-by: Michael S. Tsirkin Cc: Paolo Bonzini Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc: Dr. Da

[PATCH RESEND v7 09/13] vfio: Support for RamDiscardManager in the vIOMMU case

2021-04-13 Thread David Hildenbrand
vIOMMU support works already with RamDiscardManager as long as guests only map populated memory. Both, populated and discarded memory is mapped into &address_space_memory, where vfio_get_xlat_addr() will find that memory, to create the vfio mapping. Sane guests will never map discarded memory (e.g

[PATCH RESEND v7 12/13] virtio-mem: Require only coordinated discards

2021-04-13 Thread David Hildenbrand
We implement the RamDiscardManager interface and only require coordinated discarding of RAM to work. Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Pankaj Gupta Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Cc: Paolo Bonzini Cc: "Michael S. Tsirkin" Cc: Alex Williamson Cc:

[PULL 0/3] MIPS patches for 2021-04-13

2021-04-13 Thread Philippe Mathieu-Daudé
The following changes since commit c1e90def01bdb8fcbdbebd9d1eaa8e4827ece620: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210412' into staging (2021-04-12 12:12:09 +0100) are available in the Git repository at: https://github.com/philmd/qemu.git tags/mip

[PULL 1/3] hw/isa/Kconfig: Add missing dependency VIA VT82C686 -> APM

2021-04-13 Thread Philippe Mathieu-Daudé
TYPE_VIA_PM calls apm_init() in via_pm_realize(), so requires APM to be selected. Reported-by: BALATON Zoltan Fixes: dd0ff8191ab ("isa: express SuperIO dependencies with Kconfig") Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210302080531.913802-1-f4...@amsat.org> --- hw/isa/Kconfig | 1

[PULL 2/3] hw/isa/piix4: Migrate Reset Control Register

2021-04-13 Thread Philippe Mathieu-Daudé
When adding the Reset register in commit 5790b757cfb we forgot to migrate it. While it is possible a VM using the PIIX4 is migrated just after requesting a system shutdown, it is very unlikely. However when restoring a migrated VM, we might have the RCR bit #4 set on the stack and when the VM resu

[PULL 3/3] target/mips: Fix TCG temporary leak in gen_cache_operation()

2021-04-13 Thread Philippe Mathieu-Daudé
Fix a TCG temporary leak when translating CACHE opcode. Fixes: 0d74a222c27 ("make ITC Configuration Tags accessible to the CPU") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210406202857.1440744-1-f4...@amsat.org> --- target/mips/translate.c | 2 ++ 1 file

Re: [PULL 0/1] NBD fix for 6.0-rc3

2021-04-13 Thread Peter Maydell
On Tue, 13 Apr 2021 at 07:47, Vladimir Sementsov-Ogievskiy wrote: > > 12.04.2021 18:48, Peter Maydell wrote: > > On Mon, 12 Apr 2021 at 13:19, Vladimir Sementsov-Ogievskiy > > wrote: > >> > >> The following changes since commit > >> 555249a59e9cdd6b58da103aba5cf3a2d45c899f: > >> > >>Merge re

Re: [PATCH] docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document

2021-04-13 Thread Andreas Färber
Hi Paolo, On 13.04.21 09:42, Paolo Bonzini wrote: > On 07/04/21 17:42, Kevin Wolf wrote: >>> +* Publishing other's private information, such as physical or >>> electronic >>> +addresses, without explicit permission >> >> Yes, it's pretty clear that I'm not publishing new information about >> peopl

Re: [PATCH] docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document

2021-04-13 Thread Peter Maydell
On Tue, 13 Apr 2021 at 11:23, Andreas Färber wrote: > Or consider the case you get a bug report not copied to the public > mailing lists from someone you don't know. Then I would still expect to > be allowed to attribute a commit via Reported-by/CC to that person, as > it seems in his/her interest

Re: Commit "x86/kvm: Move context tracking where it belongs" broke guest time accounting

2021-04-13 Thread Wanpeng Li
On Wed, 7 Apr 2021 at 18:55, Michael Tokarev wrote: > > Hi! > > It looks like this commit: > > commit 87fa7f3e98a1310ef1ac1900e7ee7f9610a038bc > Author: Thomas Gleixner > Date: Wed Jul 8 21:51:54 2020 +0200 > > x86/kvm: Move context tracking where it belongs > > Context tracking for K

Re: [PATCH] cutils: fix memory leak in get_relocated_path()

2021-04-13 Thread Philippe Mathieu-Daudé
Is this fix aiming at 6.0 release? On 4/12/21 7:02 PM, Stefano Garzarella wrote: > get_relocated_path() allocates a GString object and returns the > character data (C string) to the caller without freeing the memory > allocated for that object as reported by valgrind: > > 24 bytes in 1 blocks a

[PATCH for-6.0] x86: acpi: use offset instead of pointer when using build_header()

2021-04-13 Thread Igor Mammedov
Do the same as in commit (4d027afeb3a97 Virt: ACPI: fix qemu assert due to re-assigned table data address) for remaining tables that happen to use saved at the beginning pointer to build header to avoid assert when table_data is relocated due to implicit re-size. Reported-in: https://bugs.launch

Re: [PATCH RFC RESEND v2 3/6] hw/pci: Add pci_root_bus_max_bus

2021-04-13 Thread Xingang Wang
Hi Eric, On 2021/4/13 16:05, Auger Eric wrote: Hi Xingang, On 3/25/21 8:22 AM, Wang Xingang wrote: From: Xingang Wang This helps to find max bus number of a root bus. s/max bus number of a root bus/highest bus number of a bridge hierarchy? Thanks, I will change the description. Signed-

Re: [PATCH] vhost-user-fs: fix features handling

2021-04-13 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > On Thu, Apr 08, 2021 at 10:55:34PM +0300, Anton Kuchin wrote: > > Make virtio-fs take into account server capabilities. > > > > Just returning requested features assumes they all of then are implemented > > by server and results in setting unsupport

[PATCH 0/2] osdep: allow including qemu/osdep.h outside extern "C"

2021-04-13 Thread Paolo Bonzini
qemu/osdep.h is quite special in that, despite being part of QEMU sources, it is included by C++ source files as well. disas/nanomips.cpp is doing so within an 'extern "C"' block, which breaks with latest glib due to the inclusion of templates in glib.h. These patches implement Daniel Berrangé's

[PATCH 2/2] osdep: protect qemu/osdep.h with extern "C"

2021-04-13 Thread Paolo Bonzini
System headers may include templates if compiled with a C++ compiler, which cause the compiler to complain if qemu/osdep.h is included within a C++ source file's 'extern "C"' block. Add an 'extern "C"' block directly to qemu/osdep.h, so that system headers can be kept out of it. There is a stray

[PATCH 1/2] osdep: include glib-compat.h before other QEMU headers

2021-04-13 Thread Paolo Bonzini
glib-compat.h is sort of like a system header, and it needs to include system headers (glib.h) that may dislike being included under 'extern "C"'. Move it right after all system headers and before all other QEMU headers. Signed-off-by: Paolo Bonzini --- include/qemu/osdep.h | 3 ++- 1 file chan

Re: [PATCH] docs: Add a QEMU Code of Conduct and Conflict Resolution Policy document

2021-04-13 Thread Markus Armbruster
Peter Maydell writes: > On Tue, 13 Apr 2021 at 11:23, Andreas Färber wrote: >> Or consider the case you get a bug report not copied to the public >> mailing lists from someone you don't know. Then I would still expect to >> be allowed to attribute a commit via Reported-by/CC to that person, as >

Re: [PATCH] cutils: fix memory leak in get_relocated_path()

2021-04-13 Thread Stefano Garzarella
On Tue, Apr 13, 2021 at 12:59:36PM +0200, Philippe Mathieu-Daudé wrote: Is this fix aiming at 6.0 release? The leak is minimal, but the fix is very simple. So, I think it can go if someone has a pull request to send with other patches, but I'm not sure with which tree. Thanks, Stefano On

Re: [PATCH 0/2] osdep: allow including qemu/osdep.h outside extern "C"

2021-04-13 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210413113741.214867-1-pbonz...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210413113741.214867-1-pbonz...@redhat.com Subject: [PATCH 0/2] osdep: allow including

Re: [PATCH for-6.0] block/nbd: fix possible use after free of s->connect_thread

2021-04-13 Thread Max Reitz
On 06.04.21 17:51, Vladimir Sementsov-Ogievskiy wrote: If on nbd_close() we detach the thread (in nbd_co_establish_connection_cancel() thr->state becomes CONNECT_THREAD_RUNNING_DETACHED), after that point we should not use s->connect_thread (which is set to NULL), as running thread may free it at

Re: [PATCH 2/2] osdep: protect qemu/osdep.h with extern "C"

2021-04-13 Thread Peter Maydell
On Tue, 13 Apr 2021 at 12:37, Paolo Bonzini wrote: > > System headers may include templates if compiled with a C++ compiler, > which cause the compiler to complain if qemu/osdep.h is included > within a C++ source file's 'extern "C"' block. Add > an 'extern "C"' block directly to qemu/osdep.h, so

Re: [PATCH RFC RESEND v2 4/6] hw/arm/virt-acpi-build: Add explicit idmap info in IORT table

2021-04-13 Thread Xingang Wang
Hi Eric, On 2021/4/13 17:03, Auger Eric wrote: Hi Xingang, On 3/25/21 8:22 AM, Wang Xingang wrote: From: Xingang Wang The idmap of smmuv3 and root complex covers the whole RID space for now, this patch add explicit idmap info according to root bus number range. This add smmuv3 idmap for cert

Re: testing/next - hexagon toolchain update

2021-04-13 Thread Alex Bennée
Brian Cain writes: > Alex, > > You are the one maintaining the testing/next tree at > https://gitlab.com/stsquad/qemu correct? The current patch series for > hexagon under review requires toolchain updates. These changes to > llvm/clang landed in the last week or two. > > Can you apply this pat

Re: [RFC v12 00/65] arm cleanup experiment for kvm-only build

2021-04-13 Thread Claudio Fontana
On 3/28/21 9:27 PM, Richard Henderson wrote: > On 3/26/21 1:35 PM, Claudio Fontana wrote: >> Here a new version of the series that enables kvm-only builds. >> >> The goal here is to enable the KVM-only build, but there is >> some additional cleanup too. >> >> In this iteration I mostly fixed existi

[PULL 1/3] hw/arm/mps2-tz: Fix MPC setting for AN524 SRAM block

2021-04-13 Thread Peter Maydell
The AN524 has three MPCs: one for the BRAM, one for the QSPI flash, and one for the DDR. We incorrectly set the .mpc field in the RAMInfo struct for the SRAM block to 1, giving it the same MPC we are using for the QSPI. The effect of this was that the QSPI didn't get mapped into the system addres

Re: [PULL 00/13] qemu-sparc queue 20210412

2021-04-13 Thread Peter Maydell
On Mon, 12 Apr 2021 at 23:20, Mark Cave-Ayland wrote: > > The following changes since commit c1e90def01bdb8fcbdbebd9d1eaa8e4827ece620: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20210412' into staging (2021-04-12 > 12:12:09 +0100) > > are available in the Git rep

[PULL 2/3] hw/arm/mps2-tz: Assert if more than one RAM is attached to an MPC

2021-04-13 Thread Peter Maydell
Each board in mps2-tz.c specifies a RAMInfo[] array providing information about each RAM in the board. The .mpc field of the RAMInfo struct specifies which MPC, if any, the RAM is attached to. We already assert if the array doesn't have any entry for an MPC, but we don't diagnose the error of usin

[PULL 3/3] sphinx: qapidoc: Wrap "If" section body in a paragraph node

2021-04-13 Thread Peter Maydell
From: John Snow These sections need to be wrapped in a block-level element, such as Paragraph in order for them to be rendered into Texinfo correctly. Before (e.g.): If defined(CONFIG_REPLICATION) became: .SS If \fBdefined(CONFIG_REPLICATION)\fP.SS \fBBlockdevOptionsReplication\fP (

[PULL 0/3] target-arm queue

2021-04-13 Thread Peter Maydell
: https://git.linaro.org/people/pmaydell/qemu-arm.git tags/pull-target-arm-20210413 for you to fetch changes up to 2d18b4ca023ca1a3aee18064251d6e6e1084f3eb: sphinx: qapidoc: Wrap "If" section body in a paragraph node (2021-0

Re: [RFC v9 15/29] vfio: Set up nested stage mappings

2021-04-13 Thread Kunkun Jiang
Hi Eric, On 2021/4/11 20:08, Eric Auger wrote: In nested mode, legacy vfio_iommu_map_notify cannot be used as there is no "caching" mode and we do not trap on map. On Intel, vfio_iommu_map_notify was used to DMA map the RAM through the host single stage. With nested mode, we need to setup the

Re: [PATCH for-6.0] x86: acpi: use offset instead of pointer when using build_header()

2021-04-13 Thread Michael S. Tsirkin
On Tue, Apr 13, 2021 at 07:14:00AM -0400, Igor Mammedov wrote: > Do the same as in commit > (4d027afeb3a97 Virt: ACPI: fix qemu assert due to re-assigned table data > address) > for remaining tables that happen to use saved at > the beginning pointer to build header to avoid assert > when table_d

Re: [RFC v12 60/65] target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication

2021-04-13 Thread Claudio Fontana
On 3/28/21 9:05 PM, Richard Henderson wrote: > On 3/26/21 1:36 PM, Claudio Fontana wrote: >> Pointer Authentication is an AARCH64-only ARMv8.3 optional >> extension, whose cpu properties can be separated out in its own module. >> >> Signed-off-by: Claudio Fontana >> --- >> target/arm/cpu.h

Re: [PATCH for-6.0] block/nbd: fix possible use after free of s->connect_thread

2021-04-13 Thread Vladimir Sementsov-Ogievskiy
13.04.2021 14:53, Max Reitz wrote: On 06.04.21 17:51, Vladimir Sementsov-Ogievskiy wrote: If on nbd_close() we detach the thread (in nbd_co_establish_connection_cancel() thr->state becomes CONNECT_THREAD_RUNNING_DETACHED), after that point we should not use s->connect_thread (which is set to NUL

  1   2   3   >