[Qemu-devel] [PATCH v5 2/4] qemu-thread: introduce qemu-thread-common.h

2018-04-23 Thread Peter Xu
Introduce some hooks for the shared part of qemu thread between POSIX and Windows implementations. Note that in qemu_mutex_unlock_impl() we moved the call before unlock operation which should make more sense. And we don't need qemu_mutex_post_unlock() hook. Currently the hooks only calls the

Re: [Qemu-devel] [PATCH v4 3/4] QemuMutex: support --enable-debug-mutex

2018-04-23 Thread Peter Xu
On Mon, Apr 23, 2018 at 02:11:07PM -0400, Emilio G. Cota wrote: > On Mon, Apr 23, 2018 at 13:39:26 +0800, Peter Xu wrote: > > We have had some tracing tools for mutex but it's not easy to use them > > for e.g. dead locks. Let's provide "--enable-debug-mutex" parameter > > when configure to allow

[Qemu-devel] [PATCH v5 0/4] qemu-thread: support --enable-debug-mutex

2018-04-23 Thread Peter Xu
v5: - init file/line [Emilio] v4: - cherrypick Emilio's patch to add "-m" parameter to atomic_add-bench tool. - use inline functions [Emilio] Micro benchmark result on "taskset -c 0 atomic_add-bench -m": |+-+| || with --enable-debug

[Qemu-devel] [PATCH v5 3/4] QemuMutex: support --enable-debug-mutex

2018-04-23 Thread Peter Xu
We have had some tracing tools for mutex but it's not easy to use them for e.g. dead locks. Let's provide "--enable-debug-mutex" parameter when configure to allow QemuMutex to store the last owner that took specific lock. It will be easy to use this tool to debug deadlocks since we can directly

[Qemu-devel] [PATCH v5 1/4] tests/atomic_add-bench: add -m option to use mutexes

2018-04-23 Thread Peter Xu
From: "Emilio G. Cota" This allows us to use atomic-add-bench as a microbenchmark for evaluating qemu_mutex_lock's performance. Signed-off-by: Emilio G. Cota [cherry picked from https://github.com/cota/qemu/commit/f04f34df] Signed-off-by: Peter Xu

[Qemu-devel] [PATCH v5 4/4] configure: enable debug-mutex if debug enabled

2018-04-23 Thread Peter Xu
Reviewed-by: Emilio G. Cota Signed-off-by: Peter Xu --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index a80af735b2..87453edd88 100755 --- a/configure +++ b/configure @@ -1005,6 +1005,7 @@ for opt do --enable-debug)

Re: [Qemu-devel] [RFC for-2.13 0/7] spapr: Clean up pagesize handling

2018-04-23 Thread David Gibson
On Mon, Apr 23, 2018 at 10:31:39AM +0200, Andrea Bolognani wrote: > On Fri, 2018-04-20 at 20:21 +1000, David Gibson wrote: > > On Fri, Apr 20, 2018 at 11:31:10AM +0200, Andrea Bolognani wrote: > > > I'll check out what other distros are doing: if all the major ones > > > are defaulting to 64 KiB

Re: [Qemu-devel] [PATCH v3 01/35] ppc/xive: introduce a XIVE interrupt source model

2018-04-23 Thread David Gibson
On Mon, Apr 23, 2018 at 09:11:28AM +0200, Cédric Le Goater wrote: > On 04/23/2018 05:59 AM, David Gibson wrote: > > On Fri, Apr 20, 2018 at 10:27:21AM +0200, Cédric Le Goater wrote: > >> On 04/20/2018 09:10 AM, David Gibson wrote: > >>> On Thu, Apr 19, 2018 at 02:42:57PM +0200, Cédric Le Goater

Re: [Qemu-devel] [PATCH] acpi/nvdimm: remove forward name references

2018-04-23 Thread Michael S. Tsirkin
On Tue, Apr 24, 2018 at 12:41:29AM +, Schmauss, Erik wrote: > > > > -Original Message- > > From: Michael S. Tsirkin [mailto:m...@redhat.com] > > Sent: Monday, April 23, 2018 4:03 PM > > To: qemu-devel@nongnu.org > > Cc: Schmauss, Erik ; Igor Mammedov > >

Re: [Qemu-devel] [PATCH] acpi/nvdimm: remove forward name references

2018-04-23 Thread Schmauss, Erik
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Monday, April 23, 2018 4:03 PM > To: qemu-devel@nongnu.org > Cc: Schmauss, Erik ; Igor Mammedov > ; Xiao Guangrong > Subject:

Re: [Qemu-devel] [PATCH v2 12/17] translate-all: add page_collection assertions

2018-04-23 Thread Emilio G. Cota
On Fri, Apr 13, 2018 at 17:42:45 -1000, Richard Henderson wrote: > On 04/05/2018 04:13 PM, Emilio G. Cota wrote: > > +static __thread bool page_collection_locked; > > + > > +void assert_page_collection_locked(bool val) > > +{ > > +tcg_debug_assert(page_collection_locked == val); > > +} > > + >

Re: [Qemu-devel] RFC: altering the NVDIMM acpi table

2018-04-23 Thread Schmauss, Erik
> -Original Message- > From: Michael S. Tsirkin [mailto:m...@redhat.com] > Sent: Monday, April 23, 2018 4:05 PM > To: Schmauss, Erik > Cc: imamm...@redhat.com; qemu-devel@nongnu.org; Williams, Dan J > ; He, Junyan ;

Re: [Qemu-devel] [PATCH v2 11/17] translate-all: add page_locked assertions

2018-04-23 Thread Emilio G. Cota
On Fri, Apr 13, 2018 at 17:31:20 -1000, Richard Henderson wrote: > On 04/05/2018 04:13 PM, Emilio G. Cota wrote: > > +#ifdef CONFIG_DEBUG_TCG > > + > > +struct page_lock_debug { > > +const PageDesc *pd; > > +QLIST_ENTRY(page_lock_debug) entry; > > +}; > > + > > +static __thread

Re: [Qemu-devel] [PATCH v2 10/17] translate-all: use per-page locking in !user-mode

2018-04-23 Thread Emilio G. Cota
On Thu, Apr 05, 2018 at 22:13:01 -0400, Emilio G. Cota wrote: > +/* > + * Lock a range of pages ([@start,@end[) as well as the pages of all > + * intersecting TBs. > + * Locking order: acquire locks in ascending order of page index. > + */ > +struct page_collection * >

Re: [Qemu-devel] [PATCH v2 10/17] translate-all: use per-page locking in !user-mode

2018-04-23 Thread Emilio G. Cota
On Fri, Apr 13, 2018 at 17:29:20 -1000, Richard Henderson wrote: > On 04/05/2018 04:13 PM, Emilio G. Cota wrote: (snip) > > +struct page_collection { > > +GTree *tree; > > +struct page_entry *max; > > +}; > > I don't understand the motivation for this data structure. Substituting one >

Re: [Qemu-devel] [PATCH v4 10/11] spapr: rename "hotplug memory" terminology to "device memory"

2018-04-23 Thread David Gibson
On Mon, Apr 23, 2018 at 06:51:25PM +0200, David Hildenbrand wrote: > Let's make it clear at relevant places that we are dealing with device > memory. That it can be used for memory hotplug is just a special case. > > Signed-off-by: David Hildenbrand Acked-by: David Gibson

Re: [Qemu-devel] RFC: altering the NVDIMM acpi table

2018-04-23 Thread Michael S. Tsirkin
On Mon, Apr 23, 2018 at 11:57:04PM +0300, Michael S. Tsirkin wrote: > On Mon, Apr 23, 2018 at 08:35:45PM +, Schmauss, Erik wrote: > > Hello, > > > > I work on ACPICA and we have recently made changes to the behavior of > > the Linux AML interpreter to match other OS implementations. After >

Re: [Qemu-devel] [PATCH] hw/block/nand: Fix bad offset in nand_blk_load for on-drive OOB

2018-04-23 Thread Karl Beldan
On Mon, Apr 23, 2018 at 05:14:03PM -0500, Eric Blake wrote: > On 04/23/2018 04:14 PM, Karl Beldan wrote: > > The logic wants 512-byte aligned blk ops. > > The commit you are referencing mentions that the code permits 256, 512, > or 2048-byte alignment, based on the configuration of the hardware

[Qemu-devel] [PATCH] acpi/nvdimm: remove forward name references

2018-04-23 Thread Michael S. Tsirkin
NVDIMM SSDT table references a name ("MEMA") before it is defined. This is reported to no longer be supported since Linux 4.17-rc1. While arguably Linux needs to keep working on old hypervisors, and other OSes seem fine with our behaviour, it seems cleaner to have the definition appear in the

[Qemu-devel] [PATCH v5 4/5] qcow2: Don't allow overflow during cluster allocation

2018-04-23 Thread Eric Blake
Our code was already checking that we did not attempt to allocate more clusters than what would fit in an INT64 (the physical maximimum if we can access a full off_t's worth of data). But this does not catch smaller limits enforced by various spots in the qcow2 image description: L1 and normal

[Qemu-devel] [PATCH v5 3/5] qcow2: Reduce REFT_OFFSET_MASK

2018-04-23 Thread Eric Blake
Match our code to the spec change in the previous patch - there's no reason for the refcount table to allow larger offsets than the L1/L2 tables. In practice, no image has more than 64PB of allocated clusters anyways, as anything beyond that can't be expressed via L2 mappings to host offsets.

[Qemu-devel] [PATCH v5 5/5] qcow2: Avoid memory over-allocation on compressed images

2018-04-23 Thread Eric Blake
When reading a compressed image, we were allocating s->cluster_data to 32*cluster_size + 512 (possibly over 64 megabytes, for an image with 2M clusters). Let's check out the history: Back when qcow2 was first written, we used s->cluster_data for everything, including copy_sectors() and

[Qemu-devel] [PATCH v5 0/5] minor qcow2 compression improvements

2018-04-23 Thread Eric Blake
Another attempt at this series; v4 was over a month ago: https://lists.gnu.org/archive/html/qemu-devel/2018-02/msg06780.html Since then: add R-b, and another round of wording tweaks [Berto, Max], emphasizing that refcount table is not the limiting factor and that other limits like ext4 are more

[Qemu-devel] [PATCH v5 1/5] qcow2: Prefer byte-based calls into bs->file

2018-04-23 Thread Eric Blake
We had only a few sector-based stragglers left; convert them to use our preferred byte-based accesses. Signed-off-by: Eric Blake Reviewed-by: Alberto Garcia --- v5: commit message tweak v2: indentation fix --- block/qcow2-cluster.c | 5 ++---

[Qemu-devel] [PATCH v5 2/5] qcow2: Document some maximum size constraints

2018-04-23 Thread Eric Blake
Although off_t permits up to 63 bits (8EB) of file offsets, in practice, we're going to hit other limits first. Document some of those limits in the qcow2 spec, and how choice of cluster size can influence some of the limits. While at it, notice that since we cannot map any virtual cluster to

[Qemu-devel] [PATCH] hw/block/nand: Fix bad offset in nand_blk_load for on-drive OOB

2018-04-23 Thread Karl Beldan
The logic wants 512-byte aligned blk ops. To switch to byte-based block accesses, the fixed commit changed the blk read offset, PAGE_START(addr) >> 9 with PAGE_START(addr) which min alignment, for on-drive OOB, is the min OOB size. Consequently the reads are offset by

Re: [Qemu-devel] [PATCH] hw/block/nand: Fix bad offset in nand_blk_load for on-drive OOB

2018-04-23 Thread Eric Blake
On 04/23/2018 04:14 PM, Karl Beldan wrote: > The logic wants 512-byte aligned blk ops. The commit you are referencing mentions that the code permits 256, 512, or 2048-byte alignment, based on the configuration of the hardware it is emulating. The whole file is hard to read, and I'm not surprised

[Qemu-devel] [Bug 1763536] Re: go build fails under qemu-ppc64le-static (qemu-user)

2018-04-23 Thread Murilo Opsfelder Araújo
Using QEMU from tag v2.12.0-rc4 on Ubuntu Xenial ppc64el, it works. muriloo@jaspion1:~/go-docker$ sudo docker run --rm -it qemutest /go # /usr/bin/qemu-ppc64le-static --version qemu-ppc64 version 2.11.94 (v2.12.0-rc4-dirty) Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

[Qemu-devel] [Bug 1191326] Re: QNX 4 doesn't boot on qemu >= 1.3

2018-04-23 Thread Lukas Jirkovsky
It turns out modifying code is not needed at all. The only thing that is needed is to configure SeaBIOS with CONFIG_ATA_DMA=y. So the steps needed to make QNX 4 work on current QEMU are 1. Download SeaBIOS source and make sure the configuration has CONFIG_ATA_DMA=y set 2. Build SeaBIOS 3. Run

Re: [Qemu-devel] RFC: altering the NVDIMM acpi table

2018-04-23 Thread Michael S. Tsirkin
On Mon, Apr 23, 2018 at 08:35:45PM +, Schmauss, Erik wrote: > Hello, > > I work on ACPICA and we have recently made changes to the behavior of > the Linux AML interpreter to match other OS implementations. After > sending the patches to upstream Linux, we have identified that >

Re: [Qemu-devel] RFC: altering the NVDIMM acpi table

2018-04-23 Thread Dan Williams
On Mon, Apr 23, 2018 at 1:35 PM, Schmauss, Erik wrote: > Hello, > > I work on ACPICA and we have recently made changes to the behavior of > the Linux AML interpreter to match other OS implementations. After > sending the patches to upstream Linux, we have identified that

Re: [Qemu-devel] RFC: altering the NVDIMM acpi table

2018-04-23 Thread Michael S. Tsirkin
On Mon, Apr 23, 2018 at 08:35:45PM +, Schmauss, Erik wrote: > Hello, > > I work on ACPICA and we have recently made changes to the behavior of > the Linux AML interpreter to match other OS implementations. After > sending the patches to upstream Linux, we have identified that >

Re: [Qemu-devel] [PATCH v4 00/11] pc-dimm: factor out MemoryDevice

2018-04-23 Thread Eduardo Habkost
On Mon, Apr 23, 2018 at 08:40:59PM +0300, Michael S. Tsirkin wrote: > On Mon, Apr 23, 2018 at 06:51:15PM +0200, David Hildenbrand wrote: > > Right now we can only map PCDIMM/NVDIMM into guest address space. In the > > future, we might want to do the same for virtio devices - e.g. > > virtio-pmem

Re: [Qemu-devel] [PATCH v4 0/9] enable numa configuration before machine_init() from QMP

2018-04-23 Thread Eduardo Habkost
On Mon, Apr 23, 2018 at 06:55:14PM +0200, Igor Mammedov wrote: > On Mon, 23 Apr 2018 10:05:54 -0300 > Eduardo Habkost wrote: > > > On Mon, Apr 23, 2018 at 11:50:16AM +0200, Igor Mammedov wrote: > > > On Fri, 20 Apr 2018 08:31:18 +0200 > > > Markus Armbruster

[Qemu-devel] RFC: altering the NVDIMM acpi table

2018-04-23 Thread Schmauss, Erik
Hello, I work on ACPICA and we have recently made changes to the behavior of the Linux AML interpreter to match other OS implementations. After sending the patches to upstream Linux, we have identified that hw/acpi/nvdimm.c specifies an ACPI table with a forward reference (MEMA is a forward

Re: [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash

2018-04-23 Thread Eric Blake
On 04/23/2018 11:38 AM, Ian Jackson wrote: > You are right. Perhaps my testing was inadequate. I wrote this a > long while ago, and if there was a syntax along these lines that DTRT > in both bash and dash in my tests it is long gone. Starting de novo, > the following code works for me: > >

Re: [Qemu-devel] [PATCH v11 08/17] hw/arm/smmuv3: Event queue recording helper

2018-04-23 Thread Auger Eric
Hi Peter, On 04/16/2018 06:51 PM, Peter Maydell wrote: > On 12 April 2018 at 08:37, Eric Auger wrote: >> Let's introduce a helper function aiming at recording an >> event in the event queue. >> >> Signed-off-by: Eric Auger >> >> --- >> v9 -> v10: >>

Re: [Qemu-devel] [RFC 01/24] qemu.py: Introduce _create_console() method

2018-04-23 Thread Eduardo Habkost
On Mon, Apr 23, 2018 at 05:26:13AM +0200, Thomas Huth wrote: > On 20.04.2018 21:56, Eduardo Habkost wrote: > > On Fri, Apr 20, 2018 at 03:19:28PM -0300, Eduardo Habkost wrote: > >> From: Amador Pahim > >> > >> This patch adds the QEMUMachine._create_console() method, which > >>

Re: [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command

2018-04-23 Thread Eric Blake
On 04/22/2018 04:47 AM, Simon Ruderich wrote: > On Tue, Apr 17, 2018 at 04:18:43PM -0500, Eric Blake wrote: >> Focusing on just the interface: >> >>> +++ b/qapi/misc.json >>> @@ -1185,6 +1185,26 @@ >>> { 'command': 'pmemsave', >>>'data': {'val': 'int', 'size': 'int', 'filename': 'str'} } >>>

Re: [Qemu-devel] [PATCH RFC] s390x: refactor reset/reipl handling

2018-04-23 Thread David Hildenbrand
On 23.04.2018 12:42, Cornelia Huck wrote: > On Thu, 12 Apr 2018 21:26:02 +0200 > David Hildenbrand wrote: > >> Calling pause_all_vcpus()/resume_all_vcpus() from a VCPU thread might >> not be the best idea. As pause_all_vcpus() temporarily drops the qemu >> mutex, two parallel

Re: [Qemu-devel] [PATCH RFC] s390x: refactor reset/reipl handling

2018-04-23 Thread David Hildenbrand
On 23.04.2018 12:45, Cornelia Huck wrote: > On Wed, 18 Apr 2018 16:33:13 +0200 > David Hildenbrand wrote: > >>> static void s390_ipl_class_init(ObjectClass *klass, void *data) >>> diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h >>> index 0570d0ad75..102f1ea7af 100644 >>> ---

Re: [Qemu-devel] [PATCH v2 5/5] target-microblaze: mmu: Make the TLBX MISS bit read-only

2018-04-23 Thread Richard Henderson
On 04/23/2018 02:32 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Make the TLBX MISS bit read-only. > > Reviewed-by: Alistair Francis > Signed-off-by: Edgar E. Iglesias > --- >

Re: [Qemu-devel] [PATCH v2 4/5] target-microblaze: mmu: Make TLBSX write-only

2018-04-23 Thread Richard Henderson
On 04/23/2018 02:32 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Make TLBSX write-only and guest-error log reads from it. > > Reviewed-by: Alistair Francis > Signed-off-by: Edgar E. Iglesias > ---

Re: [Qemu-devel] [PATCH v2 3/5] target-microblaze: Don't clobber the IMM reg for ld/st reversed

2018-04-23 Thread Richard Henderson
On 04/23/2018 02:32 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Do not clobber the IMM register on reversed load/stores. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 2 -- > 1 file changed,

Re: [Qemu-devel] [PATCH v2 1/5] target-microblaze: Respect MSR.PVR as read-only

2018-04-23 Thread Richard Henderson
On 04/23/2018 02:32 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Respect MSR.PVR as read-only. We were wrongly overwriting the PVR bit. > > Signed-off-by: Edgar E. Iglesias > --- > target/microblaze/translate.c | 2 +- > 1

Re: [Qemu-devel] [PATCH v2 2/5] target-microblaze: Fix trap checks for FPU insns

2018-04-23 Thread Richard Henderson
On 04/23/2018 02:32 AM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Fix trap checks for FPU insns when extended FPU insns are enabled. > > Reviewed-by: Alistair Francis > Signed-off-by: Edgar E. Iglesias

Re: [Qemu-devel] [qemu RFC v3 1/3] qapi: add SysEmuTarget to "common.json"

2018-04-23 Thread Laszlo Ersek
On 04/23/18 11:52, Markus Armbruster wrote: > Laszlo Ersek writes: > >> We'll soon need an enumeration type that lists all the softmmu targets >> that QEMU (the project) supports. Introduce @SysEmuTarget to >> "common.json". >> >> Cc: "Daniel P. Berrange"

Re: [Qemu-devel] [qemu RFC v3 2/3] qapi: change the type of TargetInfo.arch from string to enum SysEmuTarget

2018-04-23 Thread Laszlo Ersek
On 04/23/18 11:50, Markus Armbruster wrote: > Laszlo Ersek writes: > >> Now that we have @SysEmuTarget, it makes sense to restict >> @TargetInfo.@arch to valid sysemu targets at the schema level. > > We could mention that supported targets become visible in QMP >

Re: [Qemu-devel] Restoring bitmaps after failed/cancelled migration

2018-04-23 Thread Dr. David Alan Gilbert
* Vladimir Sementsov-Ogievskiy (vsement...@virtuozzo.com) wrote: > Hi all. > > We now have the following problem: > > If dirty-bitmaps migration capability is enabled, persistance flag is > dropped for all migrated bitmaps, to prevent their storing to the storage on > inactivate. It works ok,

[Qemu-devel] [Bug 1191326] Re: QNX 4 doesn't boot on qemu >= 1.3

2018-04-23 Thread Lukas Jirkovsky
@Christiat: thank you so much, you are right! I put together a quick hack[1] to seabios to forcefully enable bus master bit on ata device and QNX booted! [1] I just added an unconditional call to the pci_enable_busmaster(pci); to the init_pciata() function in ata.c -- You received this bug

Re: [Qemu-devel] [PATCH v4 4/4] configure: enable debug-mutex if debug enabled

2018-04-23 Thread Emilio G. Cota
On Mon, Apr 23, 2018 at 13:39:27 +0800, Peter Xu wrote: > Signed-off-by: Peter Xu > --- Reviewed-by: Emilio G. Cota E.

Re: [Qemu-devel] [PATCH v4 3/4] QemuMutex: support --enable-debug-mutex

2018-04-23 Thread Emilio G. Cota
On Mon, Apr 23, 2018 at 13:39:26 +0800, Peter Xu wrote: > We have had some tracing tools for mutex but it's not easy to use them > for e.g. dead locks. Let's provide "--enable-debug-mutex" parameter > when configure to allow QemuMutex to store the last owner that took > specific lock. It will be

Re: [Qemu-devel] [PATCH v4 2/4] qemu-thread: introduce qemu-thread-common.h

2018-04-23 Thread Emilio G. Cota
On Mon, Apr 23, 2018 at 13:39:25 +0800, Peter Xu wrote: > Introduce some hooks for the shared part of qemu thread between POSIX > and Windows implementations. Note that in qemu_mutex_unlock_impl() we > moved the call before unlock operation which should make more sense. > And we don't need

Re: [Qemu-devel] [PATCH v4 00/11] pc-dimm: factor out MemoryDevice

2018-04-23 Thread Michael S. Tsirkin
On Mon, Apr 23, 2018 at 06:51:15PM +0200, David Hildenbrand wrote: > Right now we can only map PCDIMM/NVDIMM into guest address space. In the > future, we might want to do the same for virtio devices - e.g. > virtio-pmem or virtio-mem. Especially, they should be able to live side > by side to each

Re: [Qemu-devel] [PATCH v3 2/2] loader: Fix 64-bit misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
On 04/23/2018 02:34 PM, Richard Henderson wrote: > On 04/23/2018 06:25 AM, Philippe Mathieu-Daudé wrote: >> Assuming the base of the fdt is aligned, a 32-bit property returns >> a 32-bit aligned pointer... > ... >> case 4: >> -*addr = fdt32_to_cpu(*(fdt32_t *)prop); >> +*addr

Re: [Qemu-devel] [PATCH v3 2/2] loader: Fix 64-bit misaligned member access

2018-04-23 Thread Richard Henderson
On 04/23/2018 06:25 AM, Philippe Mathieu-Daudé wrote: > Assuming the base of the fdt is aligned, a 32-bit property returns > a 32-bit aligned pointer... ... > case 4: > -*addr = fdt32_to_cpu(*(fdt32_t *)prop); > +*addr = fdt32_to_cpu(ldl_he_p(prop)); > return 0; So

Re: [Qemu-devel] [PATCH v3 1/2] bswap.h: Fix ldl_he_p() signedness

2018-04-23 Thread Richard Henderson
On 04/23/2018 06:25 AM, Philippe Mathieu-Daudé wrote: > As per the "Load and Store APIs" documentation (docs/devel/loads-stores.rst), > "No signed load operations are provided." > Update lduw_he_p() to return as unsigned. > > Signed-off-by: Philippe Mathieu-Daudé > --- >

Re: [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash

2018-04-23 Thread Ian Jackson
Daniel P. Berrangé writes ("Re: [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash"): > Personally I'd suggest we add informative messages throughout the > configure script for each check being run. If people really hate the > idea of a verbose output from

Re: [Qemu-devel] [PATCH v4 0/9] enable numa configuration before machine_init() from QMP

2018-04-23 Thread Igor Mammedov
On Mon, 23 Apr 2018 10:05:54 -0300 Eduardo Habkost wrote: > On Mon, Apr 23, 2018 at 11:50:16AM +0200, Igor Mammedov wrote: > > On Fri, 20 Apr 2018 08:31:18 +0200 > > Markus Armbruster wrote: > > > > > Eduardo Habkost writes: > > >

Re: [Qemu-devel] [PATCH 07/18] target/mips: convert to DisasJumpType

2018-04-23 Thread Emilio G. Cota
On Sun, Apr 22, 2018 at 09:52:02 -1000, Richard Henderson wrote: (snip) > Otherwise, > Reviewed-by: Richard Henderson I incorporated these changes, plus this and the remaining R-b tags, to an updated branch available here:

[Qemu-devel] [PATCH v4 09/11] pc: rename "hotplug memory" terminology to "device memory"

2018-04-23 Thread David Hildenbrand
Let's make it clear that we are dealing with device memory. That it can be used for memory hotplug is just a special case. Signed-off-by: David Hildenbrand --- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 25 - include/hw/i386/pc.h | 2 +- 3

[Qemu-devel] [PATCH v4 11/11] vl: allow 'maxmem' without 'slot'

2018-04-23 Thread David Hildenbrand
We will be able to have memory devices (e.g. virtio) not requiring the slot parameter (e.g. not exposed via ACPI). We still need the maxmem parameter to setup a proper memory region for device memory. And some architectures (e.g. s390x) will have to set up the maximum possible guest address space

[Qemu-devel] [PATCH v4 10/11] spapr: rename "hotplug memory" terminology to "device memory"

2018-04-23 Thread David Hildenbrand
Let's make it clear at relevant places that we are dealing with device memory. That it can be used for memory hotplug is just a special case. Signed-off-by: David Hildenbrand --- hw/ppc/spapr.c | 28 ++-- include/hw/ppc/spapr.h | 4 ++-- 2

[Qemu-devel] [PATCH v4 04/11] pc-dimm: pass in the machine and to the MemoryHotplugState

2018-04-23 Thread David Hildenbrand
We use the machine internally either way, so let's just pass it in then. Signed-off-by: David Hildenbrand --- hw/i386/pc.c | 4 ++-- hw/mem/pc-dimm.c | 8 hw/ppc/spapr.c | 6 +++--- include/hw/mem/pc-dimm.h | 4 ++-- 4 files changed, 11

[Qemu-devel] [PATCH v4 06/11] pc-dimm: factor out capacity and slot checks into MemoryDevice

2018-04-23 Thread David Hildenbrand
Move the checks into memory_device_get_free_addr(). This will check before doing any calculations if we have KVM/vhost slots left and if the total region size would be exceeded. Of course, while at it, make it independent of pc-dimm code. Signed-off-by: David Hildenbrand ---

Re: [Qemu-devel] [PATCH v3 1/2] bswap.h: Fix ldl_he_p() signedness

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 17:25, Philippe Mathieu-Daudé wrote: > As per the "Load and Store APIs" documentation (docs/devel/loads-stores.rst), > "No signed load operations are provided." That phrase is used in the documentation sections for other kinds of load/store function, but not

[Qemu-devel] [PATCH v4 08/11] machine: rename MemoryHotplugState to DeviceMemoryState

2018-04-23 Thread David Hildenbrand
Rename it to better match the new terminology. Signed-off-by: David Hildenbrand --- hw/ppc/spapr_hcall.c| 6 +++--- hw/ppc/spapr_rtas_ddw.c | 5 ++--- include/hw/boards.h | 8 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/ppc/spapr_hcall.c

[Qemu-devel] [PATCH v4 02/11] machine: make MemoryHotplugState accessible via the machine

2018-04-23 Thread David Hildenbrand
Let's allow to query the MemoryHotplugState directly from the machine. If the pointer is NULL, the machine does not support memory devices. If the pointer is !NULL, the machine supports memory devices and the data structure contains information about the applicable physical guest address space

[Qemu-devel] [PATCH v4 01/11] pc-dimm: factor out MemoryDevice interface

2018-04-23 Thread David Hildenbrand
On the qmp level, we already have the concept of memory devices: "query-memory-devices" Right now, we only support NVDIMM and PCDIMM. We want to map other devices later into the address space of the guest. Such device could e.g. be virtio devices. These devices will have a guest memory range

[Qemu-devel] [PATCH v4 05/11] pc-dimm: factor out address search into MemoryDevice code

2018-04-23 Thread David Hildenbrand
This mainly moves code, but does a handfull of optimizations: - We pass the machine instead of the address space properties - We check the hinted address directly and handle fragmented memory better - We make the search independent of pc-dimm Signed-off-by: David Hildenbrand

[Qemu-devel] [PATCH v4 07/11] pc-dimm: move actual plug/unplug of a memory region to MemoryDevice

2018-04-23 Thread David Hildenbrand
Registering the memory region for migration has do be done by the owner. There could be cases, where we don't want to migrate the memory. Signed-off-by: David Hildenbrand --- hw/mem/memory-device.c | 18 ++ hw/mem/pc-dimm.c | 5 ++---

[Qemu-devel] [PATCH v4 03/11] pc-dimm: no need to pass the memory region

2018-04-23 Thread David Hildenbrand
We can just query it ourselves. When unplugging, we should always be able to the region (as it was previously plugged). E.g. PPC already assumed that and used _abort. Signed-off-by: David Hildenbrand --- hw/i386/pc.c | 13 ++--- hw/mem/pc-dimm.c |

[Qemu-devel] [PATCH v4 00/11] pc-dimm: factor out MemoryDevice

2018-04-23 Thread David Hildenbrand
Right now we can only map PCDIMM/NVDIMM into guest address space. In the future, we might want to do the same for virtio devices - e.g. virtio-pmem or virtio-mem. Especially, they should be able to live side by side to each other. E.g. the virto based memory devices regions will not be exposed

Re: [Qemu-devel] race between tb_gen_code() and qemu_ram_free()

2018-04-23 Thread Peter Maydell
On 20 April 2018 at 19:20, Paolo Bonzini wrote: > Note that qemu_ram_free() is _also_ RCU-freeing the RAMBlock. If it is > not found, it means that codegen is not running within > rcu_read_lock()/rcu_read_unlock(). In fact it's not. This seems to not be the only problem.

Re: [Qemu-devel] [RFC] configure script mistakenly detects static libraries

2018-04-23 Thread Murilo Opsfelder Araujo
On 04/23/2018 01:16 PM, Peter Maydell wrote: > On 23 April 2018 at 17:10, Murilo Opsfelder Araujo > wrote: >> Hi, everyone! >> >> I'm facing an issue on how configure script detects static libraries and >> would like to hear from community to find a common ground on how to

Re: [Qemu-devel] [PATCH] test-qga: add trivial tests for some commands

2018-04-23 Thread Marc-André Lureau
On Fri, Apr 20, 2018 at 8:04 PM, Tomáš Golembiovský wrote: > These commands did not get their tests in the original commits: > - guest-get-host-name > - guest-get-timezone > - guest-get-users > > Trivial tests that mostly only call the commands were added. > > Signed-off-by:

Re: [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash

2018-04-23 Thread Ian Jackson
Anthony PERARD writes ("Re: [PATCH 16/16] configure: do_compiler: Dump some extra info under bash"): > On Thu, Apr 19, 2018 at 05:45:19PM +0100, Ian Jackson wrote: > > +funcs: ${FUNCNAME} > > +lines: ${BASH_LINENO} > > +files: ${BASH_SOURCE}" > > echo $compiler "$@" >> config.log > >

Re: [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash

2018-04-23 Thread Daniel P . Berrangé
On Mon, Apr 23, 2018 at 05:21:42PM +0100, Anthony PERARD wrote: > On Thu, Apr 19, 2018 at 05:45:19PM +0100, Ian Jackson wrote: > > This makes it much easier to find a particular thing in config.log. > > > > The information may be lacking in other shells, resulting in harmless > > empty output.

Re: [Qemu-devel] [PATCH v3 0/3] pc-dimm: factor out MemoryDevice

2018-04-23 Thread David Hildenbrand
On 23.04.2018 17:32, Pankaj Gupta wrote: > > Hi Igor, > >> >>> Right now we can only map PCDIMM/NVDIMM into guest address space. In the >>> future, we might want to do the same for virtio devices - e.g. >>> virtio-pmem or virtio-mem. Especially, they should be able to live side >>> by side to

Re: [Qemu-devel] [RFC] configure script mistakenly detects static libraries

2018-04-23 Thread Daniel P . Berrangé
On Mon, Apr 23, 2018 at 05:16:02PM +0100, Peter Maydell wrote: > On 23 April 2018 at 17:10, Murilo Opsfelder Araujo > wrote: > > Hi, everyone! > > > > I'm facing an issue on how configure script detects static libraries and > > would like to hear from community to find a

[Qemu-devel] [PATCH v3 2/2] loader: Fix 64-bit misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
The libfdt does not guarantee than fdt_getprop() returns a pointer aligned to the property size. Assuming the base of the fdt is aligned, a 32-bit property returns a 32-bit aligned pointer. This is however not guaranteed for 64-bit properties, where 64-bit loads might trigger unaligned access.

[Qemu-devel] [PATCH v3 0/2] loader: Fix misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
This series fixes an unaligned of a 64-bit FDT property in the FIT loader. Since v2: - Use the ldst API - Let ldl_he_p() returns unsigned - Use the same API for handling 32/64-bit FDT properties Philippe Mathieu-Daudé (2): bswap.h: Fix ldl_he_p() signedness loader: Fix 64-bit misaligned

[Qemu-devel] [PATCH v3 1/2] bswap.h: Fix ldl_he_p() signedness

2018-04-23 Thread Philippe Mathieu-Daudé
As per the "Load and Store APIs" documentation (docs/devel/loads-stores.rst), "No signed load operations are provided." Update lduw_he_p() to return as unsigned. Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bswap.h | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [Qemu-devel] [PATCH] cpus: Fix event order on resume of stopped guest

2018-04-23 Thread Kevin Wolf
Am 23.04.2018 um 17:47 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 23.04.2018 um 10:45 hat Markus Armbruster geschrieben: > >> When resume of a stopped guest immediately runs into block device > >> errors, the BLOCK_IO_ERROR event is sent before the RESUME

Re: [Qemu-devel] [PATCH 16/16] configure: do_compiler: Dump some extra info under bash

2018-04-23 Thread Anthony PERARD
On Thu, Apr 19, 2018 at 05:45:19PM +0100, Ian Jackson wrote: > This makes it much easier to find a particular thing in config.log. > > The information may be lacking in other shells, resulting in harmless > empty output. (This is why we don't use the proper ${FUNCNAME[*]} > array syntax - other

Re: [Qemu-devel] [RFC] configure script mistakenly detects static libraries

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 17:10, Murilo Opsfelder Araujo wrote: > Hi, everyone! > > I'm facing an issue on how configure script detects static libraries and > would like to hear from community to find a common ground on how to > possibly fix it. > > Throughout configure, we use

[Qemu-devel] [RFC] configure script mistakenly detects static libraries

2018-04-23 Thread Murilo Opsfelder Araujo
Hi, everyone! I'm facing an issue on how configure script detects static libraries and would like to hear from community to find a common ground on how to possibly fix it. Throughout configure, we use pkg-config command to verify if a library is installed so qemu can be linked to it. This works

Re: [Qemu-devel] [PATCH] hw/arm/virt: Add linux, pci-domain property

2018-04-23 Thread Jan Kiszka
On 2018-04-23 15:11, Peter Maydell wrote: > On 23 April 2018 at 06:18, Jan Kiszka wrote: >> From: Jan Kiszka >> >> This allows to pin the host controller in the Linux PCI domain space. >> Linux requires that property to be available consistently or not

Re: [Qemu-devel] [PATCH 05/16] xen: defer call to xen_restrict until just before os_setup_post

2018-04-23 Thread Anthony PERARD
On Thu, Apr 19, 2018 at 05:45:08PM +0100, Ian Jackson wrote: > diff --git a/stubs/xen-hvm.c b/stubs/xen-hvm.c > index 0067bcc..7787ea2 100644 > --- a/stubs/xen-hvm.c > +++ b/stubs/xen-hvm.c > @@ -13,6 +13,7 @@ > #include "hw/xen/xen.h" > #include "exec/memory.h" > #include

Re: [Qemu-devel] [Qemu-block] [PATCH 0/3] block/file-posix: File locking during creation

2018-04-23 Thread Max Reitz
On 2018-04-23 15:19, Alberto Garcia wrote: > On Sat 21 Apr 2018 12:09:10 AM CEST, Max Reitz wrote: >> Currently we do not take permissions on a file while it is being >> created. That is a bit sad. The simplest way to test this is the >> following: >> >> $ qemu-img create -f qcow2 foo.qcow2

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 16:49, Philippe Mathieu-Daudé wrote: > I think I never noticed ldq_he_p(), good to know. > > $ git grep -E '(ld|st)._he_' > net/checksum.c:130:stw_he_p(>th_sum, 0); > net/checksum.c:151:stw_he_p(>uh_sum, 0); > util/bufferiszero.c:47:

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Philippe Mathieu-Daudé
On 04/23/2018 12:32 PM, Peter Maydell wrote: > On 23 April 2018 at 15:26, Philippe Mathieu-Daudé wrote: >>> On 04/23/2018 11:04 AM, Peter Maydell wrote: On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: > On 04/23/2018 12:16 AM, David Gibson

Re: [Qemu-devel] [PATCH] cpus: Fix event order on resume of stopped guest

2018-04-23 Thread Markus Armbruster
Kevin Wolf writes: > Am 23.04.2018 um 10:45 hat Markus Armbruster geschrieben: >> When resume of a stopped guest immediately runs into block device >> errors, the BLOCK_IO_ERROR event is sent before the RESUME event. >> >> Reproducer: >> >> 1. Create a scratch image >>$

Re: [Qemu-devel] [PATCH] docker: add debian/alpha image

2018-04-23 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > This image is not enough to cross-build QEMU, > but it is useful enough to cross-compile TCG tests. > > Suggested-by: Alex Bennée > Signed-off-by: Philippe Mathieu-Daudé > --- >

Re: [Qemu-devel] [PATCH 12/16] xen: Remove now-obsolete xen_xc_domain_add_to_physmap

2018-04-23 Thread Anthony PERARD
On Thu, Apr 19, 2018 at 05:45:15PM +0100, Ian Jackson wrote: > The last user was just removed; remove this function, accordingly. > > Signed-off-by: Ian Jackson Acked-by: Anthony PERARD -- Anthony PERARD

Re: [Qemu-devel] [PATCH] loader: Fix misaligned member access

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 15:26, Philippe Mathieu-Daudé wrote: >> On 04/23/2018 11:04 AM, Peter Maydell wrote: >>> On 23 April 2018 at 14:57, Philippe Mathieu-Daudé wrote: On 04/23/2018 12:16 AM, David Gibson wrote: > On Sun, Apr 22, 2018 at 11:41:20AM +0100,

Re: [Qemu-devel] [PATCH v3 0/3] pc-dimm: factor out MemoryDevice

2018-04-23 Thread Pankaj Gupta
Hi Igor, > > > Right now we can only map PCDIMM/NVDIMM into guest address space. In the > > future, we might want to do the same for virtio devices - e.g. > > virtio-pmem or virtio-mem. Especially, they should be able to live side > > by side to each other. > > > > E.g. the virto based memory

Re: [Qemu-devel] [ARM/FDPIC v2 4/4] linux-user: ARM-FDPIC: Add support for signals for FDPIC targets

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 15:22, Christophe Lyon wrote: > On 23/04/2018 15:05, Peter Maydell wrote: >> >> On 23 April 2018 at 08:51, Christophe Lyon wrote: >>> @@ -2149,7 +2164,21 @@ setup_return(CPUARMState *env, struct >>> target_sigaction *ka, >>> {

Re: [Qemu-devel] [PATCH v2] loader: Fix misaligned member access

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 15:14, Philippe Mathieu-Daudé wrote: > This fixes the following ASan warning: > > $ mips64el-softmmu/qemu-system-mips64el -M boston -kernel vmlinux.gz.itb > -nographic > hw/core/loader-fit.c:108:17: runtime error: load of misaligned address >

Re: [Qemu-devel] [ARM/FDPIC v2 3/4] linux-user: ARM-FDPIC: Add support of FDPIC for ARM.

2018-04-23 Thread Peter Maydell
On 23 April 2018 at 15:13, Christophe Lyon wrote: > On 23/04/2018 14:49, Peter Maydell wrote: > This patch defines and uses info_is_fdpic, the next one in the > series uses information for TaskState, so I suppose it's OK > not to add this new flag as you suggest, and in

  1   2   3   >