Re: [Qemu-devel] [PATCH 6/7] hw/mips_cpc: kick a VP when putting it into Run state

2018-01-19 Thread Alex Bennée
Aleksandar Markovic writes: > From: Miodrag Dinic > > While testing mttcg VP0 could get gets stuck in a loop waiting > for other VPs to come up (which never actually happens). To fix this, > kick VPs while they are being powered up by

Re: [Qemu-devel] [PULL 00/27] Migration pull

2018-01-19 Thread Philippe Mathieu-Daudé
On 01/19/2018 01:34 PM, Peter Maydell wrote: > On 19 January 2018 at 16:27, Philippe Mathieu-Daudé wrote: >> We have armel/armhf/powerpc hosts failing since this pull due to commit >> 3be98be4e9f. >> >> Those target are currently tested on Shippable CI, eventually adding an >>

[Qemu-devel] [PULL v2 17/19] nvdimm: add 'unarmed' option

2018-01-19 Thread Eduardo Habkost
From: Haozhong Zhang Currently the only vNVDIMM backend can guarantee the guest write persistence is device DAX on Linux, because no host-side kernel cache is involved in the guest access to it. The approach to detect whether the backend is device DAX needs to access

[Qemu-devel] [PATCH 2/4] hw/intc/arm_gic: Fix C_RPR value on idle priority

2018-01-19 Thread luc . michel
From: Luc MICHEL When there is no active interrupts in the GIC, a read to the C_RPR register should return the value of the "Idle priority", which is either the maximum value an IRQ priority field can be set to, or 0xff. Since the QEMU GIC model implements all the 8

Re: [Qemu-devel] [PATCH 3/7] Revert "target/mips: hold BQL for timer interrupts"

2018-01-19 Thread Alex Bennée
Aleksandar Markovic writes: > From: Aleksandar Markovic > > This reverts commit d394698d73836d1c50545bdb32dc58d09708fcfb. > > Ther revert is needed in order not to cause overlap with subsequent > patches related to handling

Re: [Qemu-devel] [PATCH 12/12] Fix configure for s390 qemu on alpine

2018-01-19 Thread Christian Borntraeger
ignore the 12/12, it is just one patch On 01/19/2018 05:42 PM, Christian Borntraeger wrote: > From: Alice Frosi > > In alpine docker image the qemu-system-s390x build is broken and > it throws this error: > qemu-system-s390x: Initialization of device s390-ipl

[Qemu-devel] [PATCH 4/4] hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1

2018-01-19 Thread luc . michel
From: Luc MICHEL When C_CTRL.CBPR is 1, the Non-Secure view of C_BPR is altered: - A Non-Secure read of C_BPR should return the BPR value plus 1, saturated to 7, - A Non-Secure write should be ignored. Signed-off-by: Luc MICHEL ---

[Qemu-devel] [PATCH 12/12] Fix configure for s390 qemu on alpine

2018-01-19 Thread Christian Borntraeger
From: Alice Frosi In alpine docker image the qemu-system-s390x build is broken and it throws this error: qemu-system-s390x: Initialization of device s390-ipl failed: could not load bootloader 's390-ccw.img' The grep command of busybox uses regex. This fails on binary

[Qemu-devel] [PATCH] hw/vfio/platform: Init the interrupt mutex

2018-01-19 Thread Eric Auger
Add the initialization of the mutex protecting the interrupt list. Signed-off-by: Eric Auger --- hw/vfio/platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index da84abf..0d4bc0a 100644 --- a/hw/vfio/platform.c +++

[Qemu-devel] [PATCH 3/4] hw/intc/arm_gic: Fix group priority computation for group 1 IRQs

2018-01-19 Thread luc . michel
From: Luc MICHEL When determining the group priority of a group 1 IRQ, if C_CTRL.CBPR is 0, the non-secure BPR value is used. However, this value must be incremented by one so that it matches the secure world number of implemented priority bits (NS world has one less

[Qemu-devel] [PATCH 0/4] arm_gic: Various fixes

2018-01-19 Thread luc . michel
From: Luc MICHEL Hi, Here is a patch set for issues I found in the GIC. I found those by writing unitary tests for the GIC, and compared the result against real hardware (a Zynq UltraScale+ board with a GICv2). The first patch prevents the GIC from signaling an IRQ

Re: [Qemu-devel] [PULL 00/27] Migration pull

2018-01-19 Thread Alexey Perevalov
On 01/19/2018 07:27 PM, Philippe Mathieu-Daudé wrote: On 01/15/2018 01:14 PM, Peter Maydell wrote: On 15 January 2018 at 11:52, Juan Quintela wrote: Hi - rebase on top of lastest - fix compilation on 32bit machines - add Peter Xu cleanups Please, apply. The following

Re: [Qemu-devel] [PATCH v2] linux-user: Add AT_SECURE auxval

2018-01-19 Thread Laurent Vivier
Le 11/01/2018 à 19:56, Marco A L Barbosa a écrit : > Thanks Peter, > > Signed-off-by: Marco A L Barbosa With this S-o-b, applied to my linux-user branch. Thanks, Laurent

[Qemu-devel] [PULL v2 11/19] q35: Allow only supported dynamic sysbus devices

2018-01-19 Thread Eduardo Habkost
The only user-creatable sysbus devices in qemu-system-x86_64 are amd-iommu, intel-iommu, and xen-backend. xen-backend is handled by xen_set_dynamic_sysbus(), so we only need to add amd-iommu and intel-iommu. Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum

Re: [Qemu-devel] [PATCHv4] linux-user: Add getcpu() support

2018-01-19 Thread Laurent Vivier
Le 12/01/2018 à 09:14, Samuel Thibault a écrit : > Signed-off-by: Samuel Thibault > > --- > Difference between v1 and v2: handle failure of put_user_u32 with goto efault; > Difference between v2 and v3: handle failure of sys_getcpu system call > Difference between

[Qemu-devel] [PULL v2 08/19] ppc: e500: Allow only supported dynamic sysbus devices

2018-01-19 Thread Eduardo Habkost
platform_bus_create_devtree() already rejects all dynamic sysbus devices except TYPE_ETSEC_COMMON, so register it as the only allowed dynamic sysbus device for the ppce500 machine-type. Cc: Alexander Graf Cc: David Gibson Cc: qemu-...@nongnu.org

[Qemu-devel] [PULL v2 19/19] fw_cfg: fix memory corruption when all fw_cfg slots are used

2018-01-19 Thread Eduardo Habkost
From: Marcel Apfelbaum When all the fw_cfg slots are used, a write is made outside the bounds of the fw_cfg files array as part of the sort algorithm. Fix it by avoiding an unnecessary array element move. Fix also an assert while at it. Signed-off-by: Marcel Apfelbaum

Re: [Qemu-devel] [PATCHv2] linux-user: Fix sched_get/setaffinity conversion

2018-01-19 Thread Laurent Vivier
Le 09/01/2018 à 21:16, Samuel Thibault a écrit : > sched_get/setaffinity linux-user syscalls were missing conversions for > little/big endian, which is hairy since longs may not be the same size > either. > > For simplicity, this just introduces loops to convert bit by bit like is > done for

[Qemu-devel] [PATCH 1/4] hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending"

2018-01-19 Thread luc . michel
From: Luc MICHEL In the GIC, when an IRQ is acknowledged, its state goes from "pending" to: - "active" if the corresponding IRQ pin has been de-asserted - "active and pending" otherwise. The GICv2 manual states that when a IRQ becomes active (or active and

[Qemu-devel] [PULL v2 16/19] nvdimm: add a macro for property "label-size"

2018-01-19 Thread Eduardo Habkost
From: Haozhong Zhang Signed-off-by: Haozhong Zhang Reviewed-by: Stefan Hajnoczi Message-Id: <20171211072806.2812-3-haozhong.zh...@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Eduardo Habkost

Re: [Qemu-devel] [PULL 00/27] Migration pull

2018-01-19 Thread Peter Maydell
On 19 January 2018 at 16:27, Philippe Mathieu-Daudé wrote: > We have armel/armhf/powerpc hosts failing since this pull due to commit > 3be98be4e9f. > > Those target are currently tested on Shippable CI, eventually adding an > IRC bot we could notice. > > I know companies using

[Qemu-devel] [PULL v2 13/19] qdev: Check for the availability of a hotplug controller before adding a device

2018-01-19 Thread Eduardo Habkost
From: Thomas Huth The qdev_unplug() function contains a g_assert(hotplug_ctrl) statement, so QEMU crashes when the user tries to device_add + device_del a device that does not have a corresponding hotplug controller. This could be provoked for a couple of devices in the past

Re: [Qemu-devel] [RFC] qid path collision issues in 9pfs

2018-01-19 Thread Greg Kurz
On Fri, 19 Jan 2018 16:52:44 +0100 Eduard Shishkin wrote: > On 1/19/2018 11:27 AM, Greg Kurz wrote: > > On Mon, 15 Jan 2018 11:49:31 +0800 > > Antonios Motakis wrote: > > > >> On 13-Jan-18 00:14, Greg Kurz wrote: > >>> On Fri, 12 Jan

Re: [Qemu-devel] [PATCH v2] linux-user/mmap.c: Avoid choosing NULL as start address

2018-01-19 Thread Laurent Vivier
Le 07/01/2018 à 02:01, Maximilian Riemensberger a écrit : > mmap() is required by the linux kernel ABI and POSIX to return a > non-NULL address when the implementation chooses a start address for the > mapping. > > The current implementation of mmap_find_vma_reserved() can return NULL > as start

[Qemu-devel] [PULL v2 14/19] scripts: Remove fixed entries from the device-crash-test

2018-01-19 Thread Eduardo Habkost
From: Thomas Huth These are crashes / errors which have been fixed already in the past months. We can remove these from the device-crash-test script now. Signed-off-by: Thomas Huth Message-Id: <1513613438-11017-1-git-send-email-th...@redhat.com>

[Qemu-devel] [PULL v2 18/19] possible_cpus: add CPUArchId::type field

2018-01-19 Thread Eduardo Habkost
From: Igor Mammedov Remove dependency of possible_cpus on 1st CPU instance, which decouples configuration data from CPU instances that are created using that data. Also later it would be used for enabling early cpu to numa node configuration at runtime

Re: [Qemu-devel] [RFC] qid path collision issues in 9pfs

2018-01-19 Thread Eduard Shishkin
On 1/19/2018 11:27 AM, Greg Kurz wrote: On Mon, 15 Jan 2018 11:49:31 +0800 Antonios Motakis wrote: On 13-Jan-18 00:14, Greg Kurz wrote: On Fri, 12 Jan 2018 19:32:10 +0800 Antonios Motakis wrote: Hello all, Hi Antonios, I see

[Qemu-devel] [PULL v2 12/19] qdev_monitor: Simplify error handling in qdev_device_add()

2018-01-19 Thread Eduardo Habkost
From: Thomas Huth Instead of doing the clean-ups on errors multiple times, introduce a jump label at the end of the function that can be used by all error paths that need this cleanup. Suggested-by: Igor Mammedov Signed-off-by: Thomas Huth

[Qemu-devel] [PULL v2 07/19] hw/arm/virt: Allow only supported dynamic sysbus devices

2018-01-19 Thread Eduardo Habkost
Replace the TYPE_SYS_BUS_DEVICE entry in the allowed sysbus device list with the two device types that are really supported by the virt machine: vfio-amd-xgbe and vfio-calxeda-xgmac. Cc: Peter Maydell Cc: qemu-...@nongnu.org Signed-off-by: Eduardo Habkost

[Qemu-devel] [PULL v2 10/19] xen: Add only xen-sysdev to dynamic sysbus device list

2018-01-19 Thread Eduardo Habkost
There's no need to make the machine allow every possible sysbus device. We can now just add xen-sysdev to the allowed list. Cc: Stefano Stabellini Cc: Anthony Perard Cc: xen-de...@lists.xenproject.org Cc: Juergen Gross

[Qemu-devel] [PULL v2 15/19] hostmem-file: add "align" option

2018-01-19 Thread Eduardo Habkost
From: Haozhong Zhang When mmap(2) the backend files, QEMU uses the host page size (getpagesize(2)) by default as the alignment of mapping address. However, some backends may require alignments different than the page size. For example, mmap a device DAX (e.g.,

[Qemu-devel] [PULL v2 06/19] machine: Replace has_dynamic_sysbus with list of allowed devices

2018-01-19 Thread Eduardo Habkost
The existing has_dynamic_sysbus flag makes the machine accept every user-creatable sysbus device type on the command-line. Replace it with a list of allowed device types, so machines can easily accept some sysbus devices while rejecting others. To keep exactly the same behavior as before, the

Re: [Qemu-devel] [PATCH] linux-user: Translate flags argument to dup3 syscall

2018-01-19 Thread Laurent Vivier
Le 15/12/2017 à 16:18, Peter Maydell a écrit : > The third argument to dup3() is a flags word which may be > O_CLOEXEC. We weren't translating this flag from target to > host value, which meant that if the target used a different > value from the host (eg sparc guest and x86 host) the dup3() >

[Qemu-devel] [PULL v2 05/19] numa: fix missing '-numa cpu' in '-help' output

2018-01-19 Thread Eduardo Habkost
From: Igor Mammedov commit 419fcdec3c (numa: add '-numa cpu,...' option for property based node mapping) added '-numa cpu' option but forgot to update appropriate section for '--help'. Add '-numa cpu' description to '-help' output Reported-by: Markus Armbruster

[Qemu-devel] [PULL v2 09/19] spapr: Allow only supported dynamic sysbus devices

2018-01-19 Thread Eduardo Habkost
TYPE_SPAPR_PCI_HOST_BRIDGE is the only dynamic sysbus device not rejected by ppc_spapr_reset(), so it can be the only entry on the allowed list. Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Eduardo Habkost

[Qemu-devel] [PULL v2 03/19] qemu-options: document missing memory-backend-file options

2018-01-19 Thread Eduardo Habkost
From: Stefan Hajnoczi This patch adds undocumented memory-backend-file options to the documentation. Signed-off-by: Stefan Hajnoczi Message-Id: <20171128161529.3025-2-stefa...@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Eduardo

[Qemu-devel] [PULL v2 01/19] memfd: split qemu_memfd_alloc()

2018-01-19 Thread Eduardo Habkost
From: Marc-André Lureau Add a function to only create a memfd, without mmap. The function is used in the following memory backend. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id:

[Qemu-devel] [PULL v2 00/19] machine queue, 2018-01-19

2018-01-19 Thread Eduardo Habkost
Changes from v1 (2018-01-18): * Fix build failure on 32-bit The following changes since commit 3e5bdc6573edf0585e4085e6a4e349b135abf3b4: Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging (2018-01-19 10:17:20 +) are available in the Git repository at:

[Qemu-devel] [PULL v2 04/19] qemu-options: document memory-backend-ram

2018-01-19 Thread Eduardo Habkost
From: Stefan Hajnoczi The documentation should mention -object memory-backend-ram. Suggested-by: Yumei Huang Signed-off-by: Stefan Hajnoczi Message-Id: <20171128161529.3025-3-stefa...@redhat.com> Reviewed-by: Eric Blake

[Qemu-devel] [PULL v2 02/19] memfd: remove needless include

2018-01-19 Thread Eduardo Habkost
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20171023141815.17709-3-marcandre.lur...@redhat.com> Signed-off-by: Eduardo Habkost ---

Re: [Qemu-devel] [PATCH 2/2] linux-user: Don't use CMSG_ALIGN(sizeof struct cmsghdr)

2018-01-19 Thread Laurent Vivier
Le 15/12/2017 à 14:52, Peter Maydell a écrit : > The Linux struct cmsghdr is already guaranteed to be sufficiently > aligned that CMSG_ALIGN(sizeof struct cmsghdr) is always equal > to sizeof struct cmsghdr. Stop doing the unnecessary alignment > arithmetic for host and target cmsghdr. > > This

Re: [Qemu-devel] [PATCH 1/2] linux-user: Fix length calculations in host_to_target_cmsg()

2018-01-19 Thread Laurent Vivier
Le 15/12/2017 à 14:52, Peter Maydell a écrit : > The handling of length calculations in host_to_target_cmsg() > was rather confused: > * when checking for whether the target cmsg header fit in >the remaining buffer, we were using the host struct size, >not the target size > * we were

Re: [Qemu-devel] [PATCH 1/7] target/mips: compare virtual addresses in LL/SC sequence

2018-01-19 Thread Alex Bennée
Aleksandar Markovic writes: > From: Leon Alrae > > Do only virtual addresses comaprisons in LL/SC sequence. Doesn't this make things less correct? I know we currently use virtual addresses for the ARM code but in theory you could map two

Re: [Qemu-devel] [PULL 00/27] Migration pull

2018-01-19 Thread Philippe Mathieu-Daudé
On 01/15/2018 01:14 PM, Peter Maydell wrote: > On 15 January 2018 at 11:52, Juan Quintela wrote: >> Hi >> - rebase on top of lastest >> - fix compilation on 32bit machines >> - add Peter Xu cleanups >> >> Please, apply. >> >> The following changes since commit

Re: [Qemu-devel] [PULL 0/1] Dump patches

2018-01-19 Thread Marc-Andre Lureau
On Fri, Jan 19, 2018 at 5:21 PM, Peter Maydell wrote: > On 19 January 2018 at 16:08, Marc-Andre Lureau wrote: >> Hi >> >> On Fri, Jan 19, 2018 at 4:29 PM, Peter Maydell >> wrote: >>> On 19 January 2018 at 15:24, Peter

[Qemu-devel] [PATCH v2] dump-guest-memory.py: fix python 2 support

2018-01-19 Thread Marc-André Lureau
Python GDB support may use Python 2 or 3. Inferior.read_memory() may return a 'buffer' with Python 2 or a 'memoryview' with Python 3 (see also https://sourceware.org/gdb/onlinedocs/gdb/Inferiors-In-Python.html) The elf.add_vmcoreinfo_note() method expects a "bytes" object. Wrap the returned

Re: [Qemu-devel] [PULL 0/1] Dump patches

2018-01-19 Thread Peter Maydell
On 19 January 2018 at 16:08, Marc-Andre Lureau wrote: > Hi > > On Fri, Jan 19, 2018 at 4:29 PM, Peter Maydell > wrote: >> On 19 January 2018 at 15:24, Peter Maydell wrote: >>> On 19 January 2018 at 14:35, Marc-Andre Lureau

Re: [Qemu-devel] [RFC PATCH] migration: do not use atomic__nocheck() functions directly

2018-01-19 Thread Philippe Mathieu-Daudé
On Fri, Jan 19, 2018 at 11:39 AM, Philippe Mathieu-Daudé wrote: > (incorrectly use in 3be98be4e9f) > > Signed-off-by: Philippe Mathieu-Daudé > --- > currently on ppc32 the linking fails: Well armel and armhf hosts are also failing since 3be98be4e9f. > > CC

Re: [Qemu-devel] [PULL 0/1] Dump patches

2018-01-19 Thread Marc-Andre Lureau
Hi On Fri, Jan 19, 2018 at 4:29 PM, Peter Maydell wrote: > On 19 January 2018 at 15:24, Peter Maydell wrote: >> On 19 January 2018 at 14:35, Marc-Andre Lureau wrote: >>> I have not found how to translate a python 'buffer'

[Qemu-devel] [PATCH 2/7] target/mips: reimplement SC instruction and use cmpxchg

2018-01-19 Thread Aleksandar Markovic
From: Leon Alrae Completely rewrite conditional stores handling. Use cmpxchg. This eliminates need for separate implementations for user and system emulation. Signed-off-by: Leon Alrae Signed-off-by: Miodrag Dinic

Re: [Qemu-devel] [PATCH qemu v2] RFC: vfio-pci: Allow mmap of MSIX BAR

2018-01-19 Thread Alex Williamson
On Fri, 19 Jan 2018 19:55:49 +1100 Alexey Kardashevskiy wrote: > On 19/01/18 08:59, Alex Williamson wrote: > > On Tue, 16 Jan 2018 16:17:58 +1100 > > Alexey Kardashevskiy wrote: > > > >> On 06/01/18 02:29, Alex Williamson wrote: > >>> On Fri, 5 Jan 2018

[Qemu-devel] [PATCH 1/7] target/mips: compare virtual addresses in LL/SC sequence

2018-01-19 Thread Aleksandar Markovic
From: Leon Alrae Do only virtual addresses comaprisons in LL/SC sequence. Until this patch, physical addresses had been compared in LL/SC sequence. Unfortunately, that meant that, on each SC, the address translation had to be done, which is a quite complex operation.

[Qemu-devel] [PATCH 3/7] Revert "target/mips: hold BQL for timer interrupts"

2018-01-19 Thread Aleksandar Markovic
From: Aleksandar Markovic This reverts commit d394698d73836d1c50545bdb32dc58d09708fcfb. Ther revert is needed in order not to cause overlap with subsequent patches related to handling synchronization of interrupt code paths. Signed-off-by: Miodrag Dinic

[Qemu-devel] [PATCH 0/7] target-mips: support MTTCG feature

2018-01-19 Thread Aleksandar Markovic
From: Aleksandar Markovic This series introduces MTTCG feature for MIPS targets by adding all missing bits and pieces, and formally enabling corresponding QEMU builds to support such configurations. PATCH ORGANIZATION == The organization of patches

[Qemu-devel] [PATCH 6/7] hw/mips_cpc: kick a VP when putting it into Run state

2018-01-19 Thread Aleksandar Markovic
From: Miodrag Dinic While testing mttcg VP0 could get gets stuck in a loop waiting for other VPs to come up (which never actually happens). To fix this, kick VPs while they are being powered up by Cluster Power Controller in a async task which is triggered once the host

[Qemu-devel] [PATCH 5/7] target/mips: hold BQL in mips_vpe_wake()

2018-01-19 Thread Aleksandar Markovic
From: Goran Ferenc Hold BQL whenever mips_vpe_wake() is invoked. Without this patch, MIPS MT with MTTCG enabled triggers an abort in tcg_handle_interrupt() due to an unlocked access to cpu_interrupt(). This patch makes sure that the BQL is held in this case.

[Qemu-devel] [PATCH 7/7] target/mips: introduce MTTCG-enabled builds

2018-01-19 Thread Aleksandar Markovic
From: Aleksandar Markovic Introduce MTTCG-enabled QEMU builds for mips32, mipsn32, and mips64. Signed-off-by: Miodrag Dinic Signed-off-by: Aleksandar Markovic --- configure | 3 +++ target/mips/cpu.h

[Qemu-devel] [PATCH 4/7] hw/mips_int: hold BQL for all interrupt requests

2018-01-19 Thread Aleksandar Markovic
From: Miodrag Dinic Make sure BQL is held for all interrupt requests. For MTTCG-enabled configurations, handling soft and hard interrupts between vCPUs must be properly locked. By acquiring BQL, make sure all paths triggering an IRQ are synchronized. Signed-off-by:

Re: [Qemu-devel] [PULL 0/1] Dump patches

2018-01-19 Thread Peter Maydell
On 19 January 2018 at 15:24, Peter Maydell wrote: > On 19 January 2018 at 14:35, Marc-Andre Lureau wrote: >> I have not found how to translate a python 'buffer' to a bytes string >> in 2.6. > > A local python expert suggests that "bytes(buffer)"

Re: [Qemu-devel] [PATCH v2 5/5] vfio/pci: Allow relocating MSI-X MMIO

2018-01-19 Thread Auger Eric
Hi Alex, On 19/01/18 16:23, Alex Williamson wrote: > Hi Eric, > > On Fri, 19 Jan 2018 10:50:53 +0100 > Auger Eric wrote: > >> Hi Alex, >> >> On 10/01/18 20:02, Alex Williamson wrote: >>> Recently proposed vfio-pci kernel changes (v4.16) remove the >>> restriction

Re: [Qemu-devel] [PULL 0/1] Dump patches

2018-01-19 Thread Peter Maydell
On 19 January 2018 at 14:35, Marc-Andre Lureau wrote: > I have not found how to translate a python 'buffer' to a bytes string > in 2.6. A local python expert suggests that "bytes(buffer)" should work. thanks -- PMM

Re: [Qemu-devel] [PATCH v2 5/5] vfio/pci: Allow relocating MSI-X MMIO

2018-01-19 Thread Alex Williamson
Hi Eric, On Fri, 19 Jan 2018 10:50:53 +0100 Auger Eric wrote: > Hi Alex, > > On 10/01/18 20:02, Alex Williamson wrote: > > Recently proposed vfio-pci kernel changes (v4.16) remove the > > restriction preventing userspace from mmap'ing PCI BARs in areas > > overlapping

Re: [Qemu-devel] [PATCH] linux-user: wrap fork() in a start/end exclusive section

2018-01-19 Thread Laurent Vivier
Le 07/12/2017 à 13:41, Peter Maydell a écrit : > When we do a fork() in usermode emulation, we need to be in > a start/end exclusive section, so that we can ensure that no > other thread is in an RCU section. Otherwise you can get this > deadlock: > > - fork thread: has mmap_lock, waits for

Re: [Qemu-devel] [PATCH] linux-user: Fix locking order in fork_start()

2018-01-19 Thread Laurent Vivier
Le 04/12/2017 à 15:22, Peter Maydell a écrit : > Our locking order is that the tb lock should be taken > inside the mmap_lock, but fork_start() grabs locks the > other way around. This means that if a heavily multithreaded > guest process (such as Java) calls fork() it can deadlock, > with the

[Qemu-devel] [RFC v5 19/22] memory.h: Add set_page_size_mask IOMMUMemoryRegion callback

2018-01-19 Thread Eric Auger
This callback allows to inform the IOMMU memory region about restrictions on the supported page sizes. Signed-off-by: Eric Auger --- include/exec/memory.h | 4 1 file changed, 4 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index

Re: [Qemu-devel] [PATCH v2 0/5] tpm: CRB device and cleanups

2018-01-19 Thread Stefan Berger
On 01/19/2018 09:56 AM, Marc-Andre Lureau wrote: On Fri, Jan 19, 2018 at 3:36 PM, wrote: /tmp/qemu-test/src/hw/tpm/tpm_crb.c: In function 'tpm_crb_mmio_read': /tmp/qemu-test/src/hw/tpm/tpm_crb.c:126:13: error: format '%lx' expects argument of type 'long unsigned int',

[Qemu-devel] [RFC v5 16/22] virtio_iommu: Handle reserved regions in translation process

2018-01-19 Thread Eric Auger
When translating an address we need to check if it belongs to a reserved virtual address range. If it does, there are 2 cases: - it belongs to a RESERVED region: the guest should neither use this address in a MAP not instruct the end-point to DMA on them. We report an error - It belongs to

[Qemu-devel] [RFC v5 21/22] virtio-iommu: Implement set_page_size_mask

2018-01-19 Thread Eric Auger
We implement the set_page_size_mask callback to allow the virtio-iommu to be aware of any restrictions on the page size mask due to an underlying HW IOMMU. Signed-off-by: Eric Auger --- hw/virtio/trace-events | 1 + hw/virtio/virtio-iommu.c | 16 2

[Qemu-devel] [RFC v5 14/22] virtio-iommu: Add an msi_bypass property

2018-01-19 Thread Eric Auger
In case the msi_bypass property is set, it means we need to register the IOAPIC MSI window as a reserved region: 0xFEE0 - 0xFEEF. Signed-off-by: Eric Auger --- --- hw/virtio/virtio-iommu.c | 52

Re: [Qemu-devel] [PATCH 0/2] linux-user: Fix race between threads in page_unprotect()

2018-01-19 Thread Laurent Vivier
Le 19/01/2018 à 15:51, Riku Voipio a écrit : > Hi Laurent, > > On Mon, Jan 15, 2018 at 01:52:32PM +0100, Laurent Vivier wrote: >> Le 15/01/2018 à 13:48, Peter Maydell a écrit : >>> On 28 November 2017 at 14:35, Peter Maydell >>> wrote: If multiple guest threads in

[Qemu-devel] [RFC v5 20/22] hw/vfio/common: Set the IOMMUMemoryRegion supported page sizes

2018-01-19 Thread Eric Auger
We store the page_size_mask in the container and on vfio_listener_region_add(), the information is conveyed to the IOMMUMemoryRegion. Signed-off-by: Eric Auger --- hw/vfio/common.c | 5 + include/hw/vfio/vfio-common.h | 1 + 2 files changed, 6

[Qemu-devel] [RFC v5 11/22] virtio-iommu: Implement map/unmap

2018-01-19 Thread Eric Auger
This patch implements virtio_iommu_map/unmap. Signed-off-by: Eric Auger --- v3 -> v4: - implement unmap semantics as specified in v0.4 --- hw/virtio/trace-events | 3 ++ hw/virtio/virtio-iommu.c | 91 ++-- 2 files changed,

[Qemu-devel] [RFC v5 17/22] hw/arm/virt: Add virtio-iommu to the virt board

2018-01-19 Thread Eric Auger
The specific virtio-mmio node is inconditionally added on machine init while the binding between this latter and the PCIe host bridge is done on machine init done notifier, only if -device virtio-iommu-device was added to the qemu command line. Signed-off-by: Eric Auger

[Qemu-devel] [RFC v5 22/22] hw/vfio/common: Do not print error when viommu translates into an mmio region

2018-01-19 Thread Eric Auger
On ARM, the MSI doorbell is translated by the virtual IOMMU. As such address_space_translate() returns the MSI controller MMIO region and we get an "iommu map to non memory area" message. Let's remove this latter. Signed-off-by: Eric Auger --- hw/vfio/common.c | 2 -- 1

[Qemu-devel] [RFC v5 15/22] virtio-iommu: Implement fault reporting

2018-01-19 Thread Eric Auger
The event queue allows to report asynchronous errors. The translate function now injects faults when relevant. Signed-off-by: Eric Auger --- hw/virtio/trace-events | 1 + hw/virtio/virtio-iommu.c | 67 +--- 2 files changed,

[Qemu-devel] [RFC v5 10/22] virtio-iommu: Implement attach/detach command

2018-01-19 Thread Eric Auger
This patch implements the endpoint attach/detach to/from a domain. Signed-off-by: Eric Auger --- hw/virtio/virtio-iommu.c | 39 +-- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio-iommu.c

[Qemu-devel] [RFC v5 13/22] virtio-iommu: Implement probe request

2018-01-19 Thread Eric Auger
This patch implements the PROBE request. At the moment, no reserved regions are returned as none are registered per device. Only a NONE property is returned. Signed-off-by: Eric Auger --- v4 -> v5: - initialize bufstate.error to false - add cpu_to_le64(size) ---

[Qemu-devel] [RFC v5 18/22] hw/arm/virt-acpi-build: Add virtio-iommu node in IORT table

2018-01-19 Thread Eric Auger
This patch builds the virtio-iommu node in the ACPI IORT table. The dt node creation function fills the information used by the IORT table generation function (base address, base irq, type of the smmu). The RID space of the root complex, which spans 0x0-0x1 maps to streamid space 0x0-0x1

Re: [Qemu-devel] [PULL 00/13] ppc-for-2.12 queue 20180119

2018-01-19 Thread Thomas Huth
018-01-17' into >> staging (2018-01-18 15:25:17 +) >> >> are available in the Git repository at: >> >> git://github.com/dgibson/qemu.git tags/ppc-for-2.12-20180119 >> >> for you to fetch changes up to 040cb0a2badf9e265cdbb78380048cd1624dd434: >

[Qemu-devel] [RFC v5 12/22] virtio-iommu: Implement translate

2018-01-19 Thread Eric Auger
This patch implements the translate callback Signed-off-by: Eric Auger --- v4 -> v5: - check the device domain is not NULL - s/printf/error_report - set flags to IOMMU_NONE in case of all translation faults --- hw/virtio/trace-events | 1 + hw/virtio/virtio-iommu.c |

[Qemu-devel] [RFC v5 09/22] virtio-iommu: Register attached endpoints

2018-01-19 Thread Eric Auger
This patch introduce domain and endpoint internal datatypes. Both are stored in RB trees. The domain owns a list of endpoints attached to it. It is assumed the endpoint ID corresponds to the PCI BDF. Signed-off-by: Eric Auger --- v4 -> v5: - initialize as->endpoint_list

[Qemu-devel] [RFC v5 07/22] virtio-iommu: Decode the command payload

2018-01-19 Thread Eric Auger
This patch adds the command payload decoding and introduces the functions that will do the actual command handling. Those functions are not yet implemented. Signed-off-by: Eric Auger --- v4 -> v5: - adopt new v0.5 terminology v3 -> v4: - no flags field anymore in struct

Re: [Qemu-devel] [PATCH v2 3/5] tpm: report backend request error

2018-01-19 Thread Stefan Berger
On 01/19/2018 09:11 AM, Marc-André Lureau wrote: Use an Error** for request to let the caller handle error reporting. This will also allow to inform the frontend of a backend error. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger

[Qemu-devel] [RFC v5 05/22] linux-headers: Partial update for virtio-iommu

2018-01-19 Thread Eric Auger
Partial sync against Jean-Philippe's branch: git://linux-arm.org/linux-jpb.git virtio-iommu/v0.5-dev Signed-off-by: Eric Auger --- include/standard-headers/linux/virtio_ids.h | 1 + include/standard-headers/linux/virtio_iommu.h | 195 ++

Re: [Qemu-devel] [PULL 0/1] Dump patches

2018-01-19 Thread Eric Blake
On 01/19/2018 08:35 AM, Marc-Andre Lureau wrote: dump-guest-memory.py: fix python 2 support (2018-01-17 15:47:14 +0100) >>> >>> The commit says it works with python 2.7, but we still require support >>> for python 2.6. Is this pull request premature? >> >> So should I apply this, or

[Qemu-devel] [RFC v5 08/22] virtio-iommu: Add the iommu regions

2018-01-19 Thread Eric Auger
This patch initializes the iommu memory regions so that PCIe end point transactions get translated. The translation function is not yet implemented though. Signed-off-by: Eric Auger --- v4 -> v5: - use PCI bus handle as a key - use get_primary_pci_bus() callback v3 ->

[Qemu-devel] [RFC v5 04/22] update-linux-headers: Import virtio_iommu.h

2018-01-19 Thread Eric Auger
Update the script to update the virtio_iommu.h header. Signed-off-by: Eric Auger --- scripts/update-linux-headers.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 135a10d..e5af161 100755 ---

Re: [Qemu-devel] [PATCH v2 0/5] tpm: CRB device and cleanups

2018-01-19 Thread Marc-Andre Lureau
On Fri, Jan 19, 2018 at 3:36 PM, wrote: > /tmp/qemu-test/src/hw/tpm/tpm_crb.c: In function 'tpm_crb_mmio_read': > /tmp/qemu-test/src/hw/tpm/tpm_crb.c:126:13: error: format '%lx' expects > argument of type 'long unsigned int', but argument 2 has type 'hwaddr {aka > long

[Qemu-devel] [RFC v5 03/22] pc: Implement get_primary_pci_bus

2018-01-19 Thread Eric Auger
Implement this get_primary_pci_bus() which returns the root bus. Signed-off-by: Eric Auger --- hw/i386/pc.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 55686bf..00f4623 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@

[Qemu-devel] [RFC v5 06/22] virtio-iommu: Add skeleton

2018-01-19 Thread Eric Auger
This patchs adds the skeleton for the virtio-iommu device. Signed-off-by: Eric Auger --- v4 -> v5: - use the new v0.5 terminology (domain, endpoint) - add the event virtqueue v3 -> v4: - use page_size_mask instead of page_sizes - added set_features() - added some traces

[Qemu-devel] [RFC v5 02/22] hw/arm/virt: Implement get_primary_pci_bus

2018-01-19 Thread Eric Auger
get_primary_pci_bus() returns the root bus. We also add the PCIBus handle to VirtMachineState. Signed-off-by: Eric Auger --- hw/arm/virt.c | 11 ++- include/hw/arm/virt.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt.c

Re: [Qemu-devel] [PATCH 0/2] linux-user: Fix race between threads in page_unprotect()

2018-01-19 Thread Riku Voipio
Hi Laurent, On Mon, Jan 15, 2018 at 01:52:32PM +0100, Laurent Vivier wrote: > Le 15/01/2018 à 13:48, Peter Maydell a écrit : > > On 28 November 2017 at 14:35, Peter Maydell > > wrote: > >> If multiple guest threads in user-mode emulation write to a > >> page which QEMU

[Qemu-devel] [RFC v5 01/22] machine: Add a get_primary_pci_bus callback

2018-01-19 Thread Eric Auger
After e492dc5a267e "pci: Eliminate pci_find_primary_bus()" we don't have an easy mean to retrieve the primary bus of a machine. This will be needed by virtio-iommu-device which is bound to be dynamically instantiated in at least ARM virt and Q35 machines. Adding a get_primary_pci_bus() callback

[Qemu-devel] [RFC v5 00/22] VIRTIO-IOMMU device

2018-01-19 Thread Eric Auger
This series implements the virtio-iommu device. This v5 is an upgrade to v0.5 spec [1]. Compared to v4: - event queue and fault reporting - we now return the IOAPIC MSI region if the virtio-iommu is instantiated in a PC machine. - we bypass transactions on MSI HW region and fault on reserved

Re: [Qemu-devel] [PATCH v2 5/5] tpm: extend TPM CRB with state migration support

2018-01-19 Thread Marc-André Lureau
Hi On Fri, Jan 19, 2018 at 3:46 PM, Stefan Berger wrote: > On 01/19/2018 09:11 AM, Marc-André Lureau wrote: >> >> From: Stefan Berger >> >> We need to synchronize with the backend thread to make sure that a command >> being processed by

Re: [Qemu-devel] [PATCH v2 5/5] tpm: extend TPM CRB with state migration support

2018-01-19 Thread Stefan Berger
On 01/19/2018 09:11 AM, Marc-André Lureau wrote: From: Stefan Berger We need to synchronize with the backend thread to make sure that a command being processed by the external TPM emulator has completed and its response been received. In case the bottom half did not

[Qemu-devel] [RFC PATCH] migration: do not use atomic__nocheck() functions directly

2018-01-19 Thread Philippe Mathieu-Daudé
(incorrectly use in 3be98be4e9f) Signed-off-by: Philippe Mathieu-Daudé --- currently on ppc32 the linking fails: CC migration/postcopy-ram.o ... LINKmicroblaze-softmmu/qemu-system-microblaze ../migration/postcopy-ram.o: In function `mark_postcopy_blocktime_end':

Re: [Qemu-devel] [PATCH v7 4/7] vhost: Regenerate region list from changed sections list

2018-01-19 Thread Igor Mammedov
On Fri, 19 Jan 2018 10:39:21 + "Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Compare the sections list that's just been generated, and if it's > different from the old one regenerate the region list. > > Signed-off-by:

Re: [Qemu-devel] [PATCH] hw/char: remove legacy interface escc_init()

2018-01-19 Thread Eric Blake
On 01/19/2018 06:47 AM, Mark Cave-Ayland wrote: > On 18/01/18 08:53, Laurent Vivier wrote: >> Move necessary stuff in escc.h and update type names. >> Remove slavio_serial_ms_kbd_init(). >> Fix code style problems reported by checkpatch.pl >> Update mac_newworld, mac_oldworld and sun4m to use

Re: [Qemu-devel] [PATCH] allow to build with older sed

2018-01-19 Thread Eric Blake
On 01/19/2018 01:52 AM, Jan Beulich wrote: > sed's -E option may not be supported by older distros. As there's no > point using sed here at all, use just shell mechanisms to establish the > variable values, starting from the stem instead of the full target. Grammar in the subject ("allow to

<    1   2   3   4   >