Re: [PATCH v2] ui/cocoa: Fix stride resolution of pixman image

2021-02-25 Thread Gerd Hoffmann
On Wed, Feb 24, 2021 at 01:08:22PM +, Peter Maydell wrote: > On Wed, 24 Feb 2021 at 11:23, Gerd Hoffmann wrote: > > > > On Mon, Feb 22, 2021 at 11:40:12PM +0900, Akihiko Odaki wrote: > > > A display can receive an image which its stride is greater than its > > > width. In fact, when a guest re

Re: [PATCH v2 1/1] hw/s390x: modularize virtio-gpu-ccw

2021-02-25 Thread Gerd Hoffmann
Hi, > a programming error. So I'm absolutely against shoving this logic > down into object.c. But I find the variant I posted nicer to document > and nicer to read: looking at virtio_ccw_gpu_register() one sees > immediately that if built as a module, it is OK if the registration > fails, and if

Re: [PATCH 1/3] migration/ram: Modify the code comment of ram_save_host_page()

2021-02-25 Thread Kunkun Jiang
On 2021/2/25 6:53, David Edmondson wrote: On Tuesday, 2021-02-23 at 10:16:43 +08, Kunkun Jiang wrote: The ram_save_host_page() has been modified several times since its birth. But the comment hasn't been modified as it should be. It'd better to modify the comment to explain ram_save_host_page()

Re: [PATCH] libqos/qgraph: format qgraph comments for sphinx documentation

2021-02-25 Thread Emanuele Giuseppe Esposito
On 24/02/2021 11:59, Emanuele Giuseppe Esposito wrote: On 24/02/2021 11:49, Paolo Bonzini wrote: On 24/02/21 11:18, Emanuele Giuseppe Esposito wrote:     qtest +   qgraph It may make sense to add instead a "toctree" directive in qtest.rst. I haven't checked what the result looks like,

Re: [PATCH] target/arm: Speed up aarch64 TBL/TBX

2021-02-25 Thread Alex Bennée
Richard Henderson writes: > Always perform one call instead of two for 16-byte operands. > Use byte loads/stores directly into the vector register file > instead of extractions and deposits to a 64-bit local variable. > > In order to easily receive pointers into the vector register file, > conv

Re: [PATCH v2] Autoconnect jack ports by default

2021-02-25 Thread José Ramón Muñoz Pekkarinen
On Thu, 25 Feb 2021 at 00:38, Geoffrey McRae wrote: > While I get where you're coming from, those using QEMU with Jack are > already advanced users that are used to reading technical documentation. > Having our one client do something that is unexpected/different would > not only confuse existing

Re: [PATCH v4] virtio-blk: Respect discard granularity

2021-02-25 Thread Stefano Garzarella
On Thu, Feb 25, 2021 at 09:12:39AM +0900, Akihiko Odaki wrote: Report the configured granularity for discard operation to the guest. If this is not set use the block size. Since until now we have ignored the configured discard granularity and always reported the block size, let's add 'report-dis

Re: [PATCH v2] ui/cocoa: Fix stride resolution of pixman image

2021-02-25 Thread Akihiko Odaki
2021年2月25日(木) 17:02 Gerd Hoffmann : > > On Wed, Feb 24, 2021 at 01:08:22PM +, Peter Maydell wrote: > > On Wed, 24 Feb 2021 at 11:23, Gerd Hoffmann wrote: > > > > > > On Mon, Feb 22, 2021 at 11:40:12PM +0900, Akihiko Odaki wrote: > > > > A display can receive an image which its stride is greate

[PATCH] ui/cocoa: Mark variables static

2021-02-25 Thread Akihiko Odaki
Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 0ef5fdf3b7a..9e9a2f88dde 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -80,7 +80,7 @@ static void cocoa_switch(DisplayChangeListener *dcl,

Re: [PATCH v2] Autoconnect jack ports by default

2021-02-25 Thread Gerd Hoffmann
On Wed, Feb 24, 2021 at 11:33:14PM +0100, Christian Schoenebeck wrote: > On Mittwoch, 24. Februar 2021 23:04:47 CET Geoffrey McRae wrote: > > This goes against how all standard jack clients work, a new jack client > > should not auto-connect at all unless explicitly configured to as if > > there is

Re: [PATCH v22 16/17] i386: gdbstub: only write CR0/CR2/CR3/EFER for SOFTMMU

2021-02-25 Thread Claudio Fontana
On 2/25/21 5:19 AM, Richard Henderson wrote: > On 2/24/21 5:34 AM, Claudio Fontana wrote: >> Signed-off-by: Claudio Fontana >> Cc: Paolo Bonzini >> --- >> target/i386/gdbstub.c | 16 >> 1 file changed, 16 insertions(+) >> >> diff --git a/target/i386/gdbstub.c b/target/i386/gdbst

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

2021-02-25 Thread Ying Fang
An accurate cpu topology may help improve the cpu scheduler's decision making when dealing with multi-core system. So cpu topology description is helpful to provide guest with the right view. Dario Faggioli's talk in [0] also shows the virtual topology may has impact on sched performace. Thus this

[RFC PATCH 5/5] hw/arm/virt-acpi-build: add PPTT table

2021-02-25 Thread Ying Fang
Add the Processor Properties Topology Table (PPTT) to present CPU topology information to the guest. A three-level cpu topology is built in accord with the linux kernel currently does. Tested-by: Jiajie Li Signed-off-by: Ying Fang --- hw/arm/virt-acpi-build.c | 50 ++

[RFC PATCH 4/5] hw/acpi/aml-build: add processor hierarchy node structure

2021-02-25 Thread Ying Fang
Add the processor hierarchy node structures to build ACPI information for CPU topology. Since the private resources may be used to describe cache hierarchy and it is variable among different topology level, three helpers are introduced to describe the hierarchy. (1) build_socket_hierarchy for sock

[RFC PATCH 1/5] device_tree: Add qemu_fdt_add_path

2021-02-25 Thread Ying Fang
qemu_fdt_add_path() works like qemu_fdt_add_subnode(), except it also adds any missing parent nodes. We also tweak an error message of qemu_fdt_add_subnode(). Signed-off-by: Andrew Jones Signed-off-by: Ying Fang --- include/sysemu/device_tree.h | 1 + softmmu/device_tree.c| 45

[RFC PATCH 3/5] hw/arm/virt-acpi-build: distinguish possible and present cpus

2021-02-25 Thread 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. This patch is a rewor

[RFC PATCH 2/5] hw/arm/virt: Add cpu-map to device tree

2021-02-25 Thread Ying Fang
Support device tree CPU topology descriptions. Signed-off-by: Ying Fang --- hw/arm/virt.c | 38 +- include/hw/arm/virt.h | 1 + 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 371147f3ae..c133b342b8 1

Re: [PATCH v3 1/3] ui/console: Add placeholder flag to message surface

2021-02-25 Thread Gerd Hoffmann
> -DisplaySurface *qemu_create_message_surface(int w, int h, > -const char *msg) > +DisplaySurface *qemu_create_placeholder_surface(int w, int h, > +const char *msg) > { > DisplaySurface *surface = qem

Re: [PATCH v22 17/17] i386: move cpu_load_efer into sysemu-only section of cpu.h

2021-02-25 Thread Claudio Fontana
On 2/25/21 5:28 AM, Richard Henderson wrote: > On 2/24/21 5:34 AM, Claudio Fontana wrote: >> cpu_load_efer is now used only for sysemu code. >> >> Therefore, make this inline function not visible anymore >> in CONFIG_USER_ONLY builds. >> >> Signed-off-by: Claudio Fontana >> --- >> target/i386/cpu

Re: [PATCH v3 2/3] ui/console: Pass placeholder surface to displays

2021-02-25 Thread Gerd Hoffmann
> +static void dpy_gfx_switch(DisplayChangeListener *dcl, DisplaySurface > *surface) int width, int height; > +static DisplaySurface *placeholder; > +static const char placeholder_msg[] = "Display output is not active."; > +DisplaySurface *broadcast; > + > +if (!dcl->ops->dpy_gfx

Re: [PATCH] qtest: delete redundant qtest.h header files

2021-02-25 Thread Markus Armbruster
Chen Qun writes: > There are 23 files that include the "sysemu/qtest.h", > but they do not use any qtest functions. > > Signed-off-by: Chen Qun The subject sounds as if you were deleting file include/sysemu/qtest.h, which would be wrong. You're actually deleting inclusions. Suggest to say

Re: [PATCH v3 3/3] virtio-gpu: Do not distinguish the primary console

2021-02-25 Thread Gerd Hoffmann
> -if (m->scanout_id == 0 && m->width == 0) { > +if (m->width == 0) { > s->ds = qemu_create_placeholder_surface(640, 480, > "Guest disabled > display."); > dpy_gfx_replace_surface(con, s->ds); Just call

[PATCH v2 1/7] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate

2021-02-25 Thread Eric Auger
With -Werror=maybe-uninitialized configuration we get ../hw/i386/intel_iommu.c: In function ‘vtd_context_device_invalidate’: ../hw/i386/intel_iommu.c:1888:10: error: ‘mask’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 1888 | mask = ~mask; | ~^~~ A

[PATCH v2 0/7] Some vIOMMU fixes

2021-02-25 Thread Eric Auger
Hi, Here is a set of vIOMMU fixes: SMMUv3: - top SID computation overflow when handling SMMU_CMD_CFGI_ALL - internal IOTLB handling (changes related to range invalidation) - smmu_iotlb_inv_iova with asid = -1 - non power of 2 invalidation range handling. VIRTIO-IOMMU: - non power of 2 inva

[PATCH v2 6/7] hw/arm/smmuv3: Fix SMMU_CMD_CFGI_STE_RANGE handling

2021-02-25 Thread Eric Auger
If the whole SID range (32b) is invalidated (SMMU_CMD_CFGI_ALL), @end overflows and we fail to handle the command properly. Once this gets fixed, the current code really is awkward in the sense it loops over the whole range instead of removing the currently cached configs through a hash table look

[PATCH v2 5/7] hw/arm/smmuv3: Enforce invalidation on a power of two range

2021-02-25 Thread Eric Auger
As of today, the driver can invalide a number of pages that is not a power of 2. However IOTLB unmap notifications and internal IOTLB invalidations work with masks leading to erroneous invalidations. In case the range is not a power of 2, split invalidations into power of 2 invalidations. When lo

[PATCH v2 2/7] dma: Introduce dma_aligned_pow2_mask()

2021-02-25 Thread Eric Auger
Currently get_naturally_aligned_size() is used by the intel iommu to compute the maximum invalidation range based on @size which is a power of 2 while being aligned with the @start address and less than the maximum range defined by @gaw. This helper is also useful for other iommu devices (virtio-i

[PATCH v2 3/7] virtio-iommu: Handle non power of 2 range invalidations

2021-02-25 Thread Eric Auger
Unmap notifiers work with an address mask assuming an invalidation range of a power of 2. Nothing mandates this in the VIRTIO-IOMMU spec. So in case the range is not a power of 2, split it into several invalidations. Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 19 --

[PATCH v2 7/7] hw/arm/smmuv3: Uniformize sid traces

2021-02-25 Thread Eric Auger
Convert all sid printouts to sid=0x%x. Signed-off-by: Eric Auger --- hw/arm/trace-events | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/arm/trace-events b/hw/arm/trace-events index a335ee891d..b79a91af5f 100644 --- a/hw/arm/trace-events +++ b/hw

[PATCH v2 4/7] hw/arm/smmu-common: Fix smmu_iotlb_inv_iova when asid is not set

2021-02-25 Thread Eric Auger
If the asid is not set, do not attempt to locate the key directly as all inserted keys have a valid asid. Use g_hash_table_foreach_remove instead. Signed-off-by: Eric Auger --- hw/arm/smmu-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/smmu-common.c b/hw/arm

Re: [PATCH v2 38/42] esp: convert ti_buf from array to Fifo8

2021-02-25 Thread Mark Cave-Ayland
On 23/02/2021 18:49, Philippe Mathieu-Daudé wrote: On 2/9/21 8:30 PM, Mark Cave-Ayland wrote: Rename TI_BUFSZ to ESP_FIFO_SZ since this constant is really describing the size of the FIFO and is not directly related to the TI size. Signed-off-by: Mark Cave-Ayland --- hw/scsi/esp.c |

[PATCH v3 00/38] ppc: qemu: Convert qemu-ppce500 to driver model and enable additional driver support

2021-02-25 Thread Bin Meng
At present when building qemu-ppce500 the following warnings are seen: = WARNING == This board does not use CONFIG_DM. CONFIG_DM will be compulsory starting with the v2020.01 release. Failure to update may result in board removal. UPD include/generated

RE: [PATCH 07/10] Disable auto-coverge before entering COLO mode.

2021-02-25 Thread Rao, Lei
Sorry for the late reply due to CNY. Auto-converge ensure that live migration can be completed smoothly when there are too many dirty pages. COLO may encounter the same situation when rebuild a new secondary VM. So, I think it is necessary to enable COLO and auto-converge at the same time. Thank

RE: [PATCH 02/10] Fix the qemu crash when guest shutdown during checkpoint

2021-02-25 Thread Rao, Lei
If user executes the shutdown normally and QEMU crashes, I think this is unacceptable. Since we can avoid this situation, why not do it? Thanks, Lei. -Original Message- From: Lukas Straub Sent: Sunday, February 14, 2021 7:46 PM To: Rao, Lei Cc: Zhang, Chen ; lizhij...@cn.fujitsu.com;

Re: [PATCH] qapi: Remove QMP events and commands from user-mode builds

2021-02-25 Thread Markus Armbruster
Paolo Bonzini writes: > On 24/02/21 18:16, Philippe Mathieu-Daudé wrote: >> We removed the QMP loop in user-mode builds in commit 1935e0e4e09 >> ("qapi/meson: Remove QMP from user-mode emulation"), now commands >> and events code is unreachable. >> Signed-off-by: Philippe Mathieu-Daudé >> --- >>

Re: [PATCH v3 3/3] virtio-gpu: Do not distinguish the primary console

2021-02-25 Thread Akihiko Odaki
2021年2月25日(木) 18:11 Gerd Hoffmann : > > > -if (m->scanout_id == 0 && m->width == 0) { > > +if (m->width == 0) { > > s->ds = qemu_create_placeholder_surface(640, 480, > > "Guest disabled > > display."); > >

Re: [PATCH v2 1/2] tests/acceptance: replace unstable apt.armbian.com URLs for orangepi-pc, cubieboard

2021-02-25 Thread Daniel P . Berrangé
On Wed, Feb 24, 2021 at 09:02:51PM +0100, Niek Linnenbank wrote: > Hi Philippe, Cleber, > > On Wed, Feb 24, 2021 at 8:14 PM Cleber Rosa wrote: > > > On Wed, Feb 24, 2021 at 10:12:10AM +0100, Philippe Mathieu-Daudé wrote: > > > Hi Niek, > > > > > > On 2/23/21 11:53 PM, Niek Linnenbank wrote: > >

Re: [PATCH 1/1] accel/tcg: Replace parallel_cpus with cpu->cflags_base

2021-02-25 Thread Alex Bennée
Richard Henderson writes: > Precompute the initial tb->cflags value for a cpu from its cluster > and the number of cpus live in the system. This avoids having to > compute this constant data every time we look up a TB. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Tested-by:

Re: [PATCH v2] target/arm: Speed up aarch64 TBL/TBX

2021-02-25 Thread Alex Bennée
Richard Henderson writes: > Always perform one call instead of two for 16-byte operands. > Use byte loads/stores directly into the vector register file > instead of extractions and deposits to a 64-bit local variable. > > In order to easily receive pointers into the vector register file, > conv

Re: [PATCH v2 00/42] esp: consolidate PDMA transfer buffers and other fixes

2021-02-25 Thread Mark Cave-Ayland
On 23/02/2021 21:32, Philippe Mathieu-Daudé wrote: Hi Mark, On 2/9/21 8:29 PM, Mark Cave-Ayland wrote: This patch series comes from an experimental branch that I've been working on to try and boot a MacOS toolbox ROM under the QEMU q800 machine. The effort is far from complete, but it seems wo

Re: [PATCH] libqos/qgraph: format qgraph comments for sphinx documentation

2021-02-25 Thread Paolo Bonzini
On 25/02/21 09:22, Emanuele Giuseppe Esposito wrote: diff --git a/docs/devel/index.rst b/docs/devel/index.rst index 1dcce3bbed..f0038f8722 100644 --- a/docs/devel/index.rst +++ b/docs/devel/index.rst @@ -12,6 +12,7 @@ Contents:  .. toctree::     :maxdepth: 2 +   :includehidden:     build-sys

Re: [PATCH] tcg/i386: rdpmc: use the the condtions

2021-02-25 Thread Paolo Bonzini
On 25/02/21 06:47, Zheng Zhan Liang wrote: Signed-off-by: Zheng Zhan Liang --- target/i386/tcg/misc_helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index f02e4fd400..90b87fdef0 100644 --- a/target/i38

Re: [PATCH v2 1/7] intel_iommu: Fix mask may be uninitialized in vtd_context_device_invalidate

2021-02-25 Thread Philippe Mathieu-Daudé
On 2/25/21 10:14 AM, Eric Auger wrote: > With -Werror=maybe-uninitialized configuration we get > ../hw/i386/intel_iommu.c: In function ‘vtd_context_device_invalidate’: > ../hw/i386/intel_iommu.c:1888:10: error: ‘mask’ may be used > uninitialized in this function [-Werror=maybe-uninitialized] > 188

Re: [PATCH v4 0/8] hw/sh4: Kconfig cleanups

2021-02-25 Thread Paolo Bonzini
On 22/02/21 15:15, Philippe Mathieu-Daudé wrote: Missing review: 1 (license) Since v3: - Include full MIT license text (Peter) Since v2: - Added missing TC58128/SH_PCI Kconfig entries (Peter) Since v1: - Addressed Peter Maydell review comments from https://www.mail-archive.com/qemu-block@nongn

Re: [PATCH v2] char: don't fail when client is not connected

2021-02-25 Thread Paolo Bonzini
On 09/02/21 06:49, Pavel Dovgalyuk wrote: This patch checks that ioc is not null before using it in tcp socket tcp_chr_add_watch function. The failure occurs in replay mode of the execution, when monitor and serial port are tcp servers, and there are no clients connected to them: -monitor tcp:1

[PATCH v1 2/2] block/qcow2: introduce inflight writes counters: fix discard

2021-02-25 Thread Vladimir Sementsov-Ogievskiy
There is a bug in qcow2: host cluster can be discarded (refcount becomes 0) and reused during data write. In this case data write may pollute another cluster (recently allocated) or even metadata. To fix the issue let's track inflight writes to host cluster in the hash table and consider new count

[PATCH v1 1/2] iotests: add qcow2-discard-during-rewrite

2021-02-25 Thread Vladimir Sementsov-Ogievskiy
Simple test: - start writing to allocated cluster A - discard this cluster - write to another unallocated cluster B (it's allocated in same place where A was allocated) - continue writing to A For now last action pollutes cluster B which is a bug fixed by the following commit. For now, add

[PATCH v1 0/2] qcow2: fix parallel rewrite and discard

2021-02-25 Thread Vladimir Sementsov-Ogievskiy
Hi all! It occurs that nothing prevents discarding and reallocating host cluster during data writing. This way data writing will pollute another flash allocated cluster of data or metadata. Here is my suggestion to fix it basing on improved refcounts model. Look at 02 for details. I don't insist

Re: [PATCH] tcg/i386: rdpmc: use the the condtions

2021-02-25 Thread Philippe Mathieu-Daudé
Hi Paolo, On 2/25/21 11:07 AM, Paolo Bonzini wrote: > On 25/02/21 06:47, Zheng Zhan Liang wrote: >> Signed-off-by: Zheng Zhan Liang >> --- >>   target/i386/tcg/misc_helper.c | 3 ++- >>   1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/target/i386/tcg/misc_helper.c >> b/target/i3

[PATCH v4 1/3] ui/console: Add placeholder flag to message surface

2021-02-25 Thread Akihiko Odaki
The surfaces created with former qemu_create_message_surface did not display the content from the guest and always contained simple messages describing the reason. A display backend may want to hide the window showing such a surface. This change renames the function to qemu_create_placeholder_surf

Re: [PATCH v2 7/7] hw/arm/smmuv3: Uniformize sid traces

2021-02-25 Thread Philippe Mathieu-Daudé
On 2/25/21 10:14 AM, Eric Auger wrote: > Convert all sid printouts to sid=0x%x. > > Signed-off-by: Eric Auger > --- > hw/arm/trace-events | 24 > 1 file changed, 12 insertions(+), 12 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH] hw/riscv: Add basic fw_cfg support to virt

2021-02-25 Thread Asherah Connor
Provides a minimal fw_cfg for the virt machine on riscv. I've arbitrarily selected an MMIO base for it. This is very rudimentary, so no DMA interface is exposed. Tested as working! (First patch to qemu, so whatever patience you can afford would be appreciated.) Signed-off-by: Asherah Connor -

[PATCH v4 3/3] virtio-gpu: Do not distinguish the primary console

2021-02-25 Thread Akihiko Odaki
In the past, virtio-gpu set NULL as the surface for the secondary consoles to hide its window. The distinction is now handled in ui/console and the display backends and virtio-gpu does no longer have to do that. Signed-off-by: Akihiko Odaki --- hw/display/vhost-user-gpu.c | 6 ++ hw/displa

[PATCH v4 2/3] ui/console: Pass placeholder surface to displays

2021-02-25 Thread Akihiko Odaki
ui/console used to accept NULL as graphic console surface, but its semantics was inconsistent among displays: - cocoa and gtk-egl perform NULL dereference. - egl-headless, spice and spice-egl do nothing. - gtk releases underlying resources. - sdl2-2d and sdl2-gl destroys the window. - vnc shows a m

Re: [PATCH] libqos/qgraph: format qgraph comments for sphinx documentation

2021-02-25 Thread Emanuele Giuseppe Esposito
On 25/02/2021 11:05, Paolo Bonzini wrote: On 25/02/21 09:22, Emanuele Giuseppe Esposito wrote: diff --git a/docs/devel/index.rst b/docs/devel/index.rst index 1dcce3bbed..f0038f8722 100644 --- a/docs/devel/index.rst +++ b/docs/devel/index.rst @@ -12,6 +12,7 @@ Contents:   .. toctree:: :m

Re: [RFC PATCH 0/5] Experimenting with tb-lookup tweaks

2021-02-25 Thread Alex Bennée
Richard Henderson writes: > On 2/24/21 8:58 AM, Alex Bennée wrote: >> Hi Richard, >> >> Well I spun up some of the ideas we talked about to see if there was >> anything to be squeezed out of the function. In the end the results >> seem to be a washout with my pigz benchmark: >> >> qemu-syste

Re: [PATCH 18/24] DAX/unmap virtiofsd: Parse unmappable elements

2021-02-25 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@redhat.com) wrote: > On Tue, Feb 09, 2021 at 07:02:18PM +, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > For some read/writes the virtio queue elements are unmappable by > > the daemon; these are cases where the data is to be read/w

[PATCH v2] blockjob: report a better error message

2021-02-25 Thread Stefano Garzarella
When a block job fails, we report strerror(-job->job.ret) error message, also if the job set an error object. Let's report a better error message using error_get_pretty(job->job.err). If an error object was not set, strerror(-job->ret) is used as fallback, as explained in include/qemu/job.h: type

Re: [PATCH] multiprocess: move feature to meson_options.txt

2021-02-25 Thread Philippe Mathieu-Daudé
On 2/24/21 1:23 PM, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > configure | 12 > meson.build | 9 +++-- > meson_options.txt | 2 ++ > 3 files changed, 13 insertions(+), 10 deletions(-) ... > @@ -2535,6 +2540,7 @@ endif > summary_info += {'target

Re: [PATCH v3 02/16] qapi/expr.py: Check for dict instead of OrderedDict

2021-02-25 Thread Markus Armbruster
John Snow writes: > On 2/24/21 4:30 AM, Markus Armbruster wrote: >> John Snow writes: >> >>> OrderedDict is a subtype of dict, so we can check for a more general >>> form. These functions do not themselves depend on it being any >>> particular type. >> >> True. The actual arguments can only b

Re: [PATCH] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute

2021-02-25 Thread Philippe Mathieu-Daudé
On 2/11/21 8:42 PM, Nathan Chancellor wrote: > fw_cfg_showrev() is called by an indirect call in kobj_attr_show(), > which violates clang's CFI checking because fw_cfg_showrev()'s second > parameter is 'struct attribute', whereas the ->show() member of 'struct > kobj_structure' expects the second p

Re: [PATCH 0/3] hw/block/nvme: mdts/zasl cleanup

2021-02-25 Thread Klaus Jensen
On Feb 23 06:00, Keith Busch wrote: > These look good. > > Reviewed-by: Keith Busch Thanks, applied to nvme-next. signature.asc Description: PGP signature

[PATCH v23 00/17] i386 cleanup PART 2

2021-02-25 Thread Claudio Fontana
v22 -> v23: * i386: move TCG btp_helper into sysemu/ - extended the #ifndef CONFIG_USER_ONLY to entire else of if (cpl != 0). * i386: split misc helper into user and sysemu parts - added g_assert_not_reached() and changed user file name to -stubs. * i386: separate fpu_helper into user and s

[PATCH v23 01/17] i386: split cpu accelerators from cpu.c, using AccelCPUClass

2021-02-25 Thread Claudio Fontana
i386 is the first user of AccelCPUClass, allowing to split cpu.c into: cpu.ccpuid and common x86 cpu functionality host-cpu.c host x86 cpu functions and "host" cpu type kvm/kvm-cpu.cKVM x86 AccelCPUClass hvf/hvf-cpu.cHVF x86 AccelCPUClass tcg/tcg-cpu.cTCG x86 AccelCPU

[PATCH v23 07/17] i386: split off sysemu-only functionality in tcg-cpu

2021-02-25 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/tcg/tcg-cpu.h | 24 + target/i386/tcg/sysemu/tcg-cpu.c | 83 ++ target/i386/tcg/tcg-cpu.c | 75 ++- target/i386/tcg/meson.build|

Re: [PATCH v2 00/42] esp: consolidate PDMA transfer buffers and other fixes

2021-02-25 Thread Philippe Mathieu-Daudé
On 2/25/21 10:54 AM, Mark Cave-Ayland wrote: > On 23/02/2021 21:32, Philippe Mathieu-Daudé wrote: > >> Hi Mark, >> >> On 2/9/21 8:29 PM, Mark Cave-Ayland wrote: >>> This patch series comes from an experimental branch that I've been >>> working on >>> to try and boot a MacOS toolbox ROM under the Q

[PATCH v23 03/17] accel: introduce new accessor functions

2021-02-25 Thread Claudio Fontana
avoid open coding the accesses to cpu->accel_cpu interfaces, and instead introduce: accel_cpu_instance_init, accel_cpu_realizefn to be used by the targets/ initfn code, and by cpu_exec_realizefn respectively. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Richard Henderso

[PATCH v23 05/17] accel-cpu: make cpu_realizefn return a bool

2021-02-25 Thread Claudio Fontana
overall, all devices' realize functions take an Error **errp, but return void. hw/core/qdev.c code, which realizes devices, therefore does: local_err = NULL; dc->realize(dev, &local_err); if (local_err != NULL) { goto fail; } However, we can improve at least accel_cpu to return a meaningful

[PATCH v23 02/17] cpu: call AccelCPUClass::cpu_realizefn in cpu_exec_realizefn

2021-02-25 Thread Claudio Fontana
move the call to accel_cpu->cpu_realizefn to the general cpu_exec_realizefn from target/i386, so it does not need to be called for every target explicitly as we enable more targets. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- cpu.c |

[RFC v8 00/28] vSMMUv3/pSMMUv3 2 stage VFIO integration

2021-02-25 Thread Eric Auger
Up to now vSMMUv3 has not been integrated with VFIO. VFIO integration requires to program the physical IOMMU consistently with the guest mappings. However, as opposed to VTD, SMMUv3 has no "Caching Mode" which allows easy trapping of guest mappings. This means the vSMMUV3 cannot use the same VFIO i

[PATCH v23 04/17] target/i386: fix host_cpu_adjust_phys_bits error handling

2021-02-25 Thread Claudio Fontana
move the check for phys_bits outside of host_cpu_adjust_phys_bits, because otherwise it is impossible to return an error condition explicitly. Signed-off-by: Claudio Fontana Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson --- target/i386/host-cpu.c

[PATCH v23 13/17] i386: split svm_helper into sysemu and stub-only user

2021-02-25 Thread Claudio Fontana
For now we just copy over the previous user stubs, but really, everything that requires s->cpl == 0 should be impossible to trigger from user-mode emulation. Later on we should add a check that asserts this easily f.e.: static bool check_cpl0(DisasContext *s) { int cpl = s->cpl; #ifdef CON

[PATCH v23 06/17] meson: add target_user_arch

2021-02-25 Thread Claudio Fontana
the lack of target_user_arch makes it hard to fully leverage the build system in order to separate user code from sysemu code. Provide it, so that we can avoid the proliferation of #ifdef in target code. Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée [claudio: added changes for new ta

[PATCH v23 10/17] i386: move TCG btp_helper into sysemu/

2021-02-25 Thread Claudio Fontana
for user-mode, assert that the hidden IOBPT flags are not set while attempting to generate io_bpt helpers. Signed-off-by: Claudio Fontana Cc: Paolo Bonzini Reviewed-by: Richard Henderson --- target/i386/helper.h| 7 + target/i386/tcg/helper-tcg.h| 3 + target/i386/t

[RFC v8 05/28] hw/arm/smmuv3: Properly propagate S1 asid invalidation

2021-02-25 Thread Eric Auger
At the moment ASID invalidation command (CMD_TLBI_NH_ASID) is propagated as a domain invalidation, ie. all ASIDs get invalidated, failing to restrict the invalidation to the accurate asid. Fix that by populating the new fields laterly introduced in the IOTLEntry struct, namely setting the granular

[PATCH v23 08/17] i386: split smm helper (sysemu)

2021-02-25 Thread Claudio Fontana
smm is only really useful for sysemu, split in two modules around the CONFIG_USER_ONLY, in order to remove the ifdef and use the build system instead. add cpu_abort() when detecting attempts to enter SMM mode via SMI interrupt in user-mode, and assert that the cpu is not in SMM mode while translat

[PATCH v23 11/17] i386: split misc helper user stubs and sysemu part

2021-02-25 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/i386/tcg/misc_helper.c| 463 --- target/i386/tcg/sysemu/misc_helper.c | 438 + target/i386/tcg/user/misc_stubs.c| 75 + target/i386/tcg/sysemu/meson.build | 1 + target/i386/tcg/user/mes

[PATCH v23 12/17] i386: separate fpu_helper into user and sysemu parts

2021-02-25 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Alex Bennée [claudio: removed unused return value] Signed-off-by: Claudio Fontana --- target/i386/cpu.h | 3 ++ target/i386/tcg/fpu_helper.c| 65 + target/i386/tcg/sysemu/fpu_helper.c | 57 ++

[RFC v8 01/28] hw/vfio/common: trace vfio_connect_container operations

2021-02-25 Thread Eric Auger
We currently trace vfio_disconnect_container() but we do not trace the container <-> group creation, which can be useful to understand the VFIO topology. Signed-off-by: Eric Auger --- hw/vfio/common.c | 3 +++ hw/vfio/trace-events | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hw/vfi

[RFC v8 09/28] iommu: Introduce generic header

2021-02-25 Thread Eric Auger
This header is meant to exposes data types used by several IOMMU devices such as struct for SVA and nested stage configuration. Signed-off-by: Eric Auger --- include/hw/iommu/iommu.h | 28 1 file changed, 28 insertions(+) create mode 100644 include/hw/iommu/iommu.h

[PATCH v23 09/17] i386: split tcg excp_helper into sysemu and user parts

2021-02-25 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/tcg/excp_helper.c| 572 -- target/i386/tcg/sysemu/excp_helper.c | 581 +++ target/i386/tcg/user/excp_helper.c | 39 ++ target/i386/tcg/sysemu/meson.build |

[PATCH v23 14/17] i386: split seg_helper into user-only and sysemu parts

2021-02-25 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h| 5 + target/i386/tcg/seg_helper.h| 66 target/i386/tcg/seg_helper.c| 233 +--- target/i386/tcg/sysemu/seg_helper.c | 125 +++ ta

[RFC v8 06/28] memory: Add IOMMU_ATTR_VFIO_NESTED IOMMU memory region attribute

2021-02-25 Thread Eric Auger
We introduce a new IOMMU Memory Region attribute, IOMMU_ATTR_VFIO_NESTED that tells whether the virtual IOMMU requires HW nested paging for VFIO integration. Current Intel virtual IOMMU device supports "Caching Mode" and does not require 2 stages at physical level to be integrated with VFIO. Howev

[RFC v8 12/28] vfio: Introduce hostwin_from_range helper

2021-02-25 Thread Eric Auger
Let's introduce a hostwin_from_range() helper that returns the hostwin encapsulating an IOVA range or NULL if none is found. This improves the readibility of callers and removes the usage of hostwin_found. Signed-off-by: Eric Auger --- hw/vfio/common.c | 36 +---

[PATCH v23 16/17] i386: gdbstub: only write CR0/CR2/CR3/EFER for sysemu

2021-02-25 Thread Claudio Fontana
define some aux functions to avoid repeating the same code all over. Signed-off-by: Claudio Fontana Cc: Paolo Bonzini --- target/i386/gdbstub.c | 167 -- 1 file changed, 63 insertions(+), 104 deletions(-) diff --git a/target/i386/gdbstub.c b/target/i386/

[RFC v8 15/28] vfio: Pass stage 1 MSI bindings to the host

2021-02-25 Thread Eric Auger
We register the stage1 MSI bindings when enabling the vectors and we unregister them on msi disable. Signed-off-by: Eric Auger --- v7 -> v8: - add unregistration on msix_diable - remove vfio_container_unbind_msis() v4 -> v5: - use VFIO_IOMMU_SET_MSI_BINDING v2 -> v3: - only register the notif

[RFC v8 04/28] memory: Add new fields in IOTLBEntry

2021-02-25 Thread Eric Auger
The current IOTLBEntry becomes too simple to interact with some physical IOMMUs. IOTLBs can be invalidated with different granularities: domain, pasid, addr. Current IOTLB entry only offers page selective invalidation. Let's add a granularity field that conveys this information. Also TLB entries a

[RFC v8 16/28] vfio: Helper to get IRQ info including capabilities

2021-02-25 Thread Eric Auger
As done for vfio regions, add helpers to retrieve irq info including their optional capabilities. Signed-off-by: Eric Auger --- hw/vfio/common.c | 97 +++ hw/vfio/trace-events | 1 + include/hw/vfio/vfio-common.h | 7 +++ 3 files changed, 1

[PATCH v23 15/17] i386: split off sysemu part of cpu.c

2021-02-25 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/i386/cpu-internal.h | 70 +++ target/i386/cpu-sysemu.c | 352 + target/i386/cpu.c | 385 + target/i386/meson.build| 1 + 4 files chan

[PATCH v23 17/17] i386: make cpu_load_efer sysemu-only

2021-02-25 Thread Claudio Fontana
cpu_load_efer is now used only for sysemu code. Therefore, move this function implementation to sysemu-only section of helper.c Signed-off-by: Claudio Fontana --- target/i386/cpu.h| 20 +--- target/i386/helper.c | 13 + 2 files changed, 18 insertions(+), 15 delet

[RFC v8 20/28] hw/arm/smmuv3: Advertise MSI_TRANSLATE attribute

2021-02-25 Thread Eric Auger
The SMMUv3 has the peculiarity to translate MSI transactionss. let's advertise the corresponding attribute. Signed-off-by: Eric Auger --- --- hw/arm/smmuv3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c index 6172a62b8e..a998e237f0 100644 --- a/hw/arm

[RFC v8 08/28] memory: Introduce IOMMU Memory Region inject_faults API

2021-02-25 Thread Eric Auger
This new API allows to inject @count iommu_faults into the IOMMU memory region. Signed-off-by: Eric Auger --- include/exec/memory.h | 24 softmmu/memory.c | 10 ++ 2 files changed, 34 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h

[RFC v8 19/28] vfio/pci: Implement the DMA fault handler

2021-02-25 Thread Eric Auger
Whenever the eventfd is triggered, we retrieve the DMA fault(s) from the mmapped fault region and inject them in the iommu memory region. Signed-off-by: Eric Auger --- hw/vfio/pci.c | 50 ++ hw/vfio/pci.h | 1 + 2 files changed, 51 insertions(+)

Re: [PATCH qemu v13] spapr: Implement Open Firmware client interface

2021-02-25 Thread Nicholas Piggin
Excerpts from Greg Kurz's message of February 23, 2021 1:01 am: > On Mon, 22 Feb 2021 22:48:51 +1100 > Alexey Kardashevskiy wrote: > >> Ping? >> >> I need community support here :) I am hearing that having this mode >> helps heaps with development in fully emulated environments as this >> skip

[RFC v8 13/28] vfio: Introduce helpers to DMA map/unmap a RAM section

2021-02-25 Thread Eric Auger
Let's introduce two helpers that allow to DMA map/unmap a RAM section. Those helpers will be called for nested stage setup in another call site. Also the vfio_listener_region_add/del() structure may be clearer. Signed-off-by: Eric Auger --- v5 -> v6: - add Error ** --- hw/vfio/common.c | 1

[RFC v8 21/28] hw/arm/smmuv3: Store the PASID table GPA in the translation config

2021-02-25 Thread Eric Auger
For VFIO integration we will need to pass the Context Descriptor (CD) table GPA to the host. The CD table is also referred to as the PASID table. Its GPA corresponds to the s1ctrptr field of the Stream Table Entry. So let's decode and store it in the configuration structure. Signed-off-by: Eric Au

[RFC v8 28/28] vfio/pci: Implement return_page_response page response callback

2021-02-25 Thread Eric Auger
This patch implements the page response path. The response is written into the page response ring buffer and then update header's head index is updated. This path is not used by this series. It is introduced here as a POC for vSVA/ARM integration. Signed-off-by: Eric Auger --- v11 -> v12: - use

[RFC v8 02/28] update-linux-headers: Import iommu.h

2021-02-25 Thread Eric Auger
Update the script to import the new iommu.h uapi header. Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index fa6f2b6272..f588678837 100755 --- a/s

[RFC v8 17/28] vfio/pci: Register handler for iommu fault

2021-02-25 Thread Eric Auger
We use the new extended IRQ VFIO_IRQ_TYPE_NESTED type and VFIO_IRQ_SUBTYPE_DMA_FAULT subtype to set/unset a notifier for physical DMA faults. The associated eventfd is triggered, in nested mode, whenever a fault is detected at IOMMU physical level. The actual handler will be implemented in subsequ

[RFC v8 23/28] hw/arm/smmuv3: Fill the IOTLBEntry leaf field on NH_VA invalidation

2021-02-25 Thread Eric Auger
Let's propagate the leaf attribute throughout the invalidation path. This hint is used to reduce the scope of the invalidations to the last level of translation. Not enforcing it induces large performance penalties in nested mode. Signed-off-by: Eric Auger --- hw/arm/smmuv3.c | 9 + 1 fi

  1   2   3   4   >