Re: [Qemu-devel] [RFC PATCH v2.1 08/12] spapr: Add CPU type specific core devices

2016-04-08 Thread Michael Roth
Quoting David Gibson (2016-04-03 19:13:54) > On Fri, Apr 01, 2016 at 11:42:23AM +0530, Bharata B Rao wrote: > > On Fri, Apr 01, 2016 at 04:08:44PM +1100, David Gibson wrote: > > > On Thu, Mar 31, 2016 at 02:09:17PM +0530, Bharata B Rao wrote: > > > > Introduce core devices for each CPU type

Re: [Qemu-devel] best way to implement emulation of AArch64 tagged addresses

2016-04-08 Thread Thomas Hanson
Looking at tcg_out_tlb_load(): If I'm reading the pseudo-assembler of the function names correctly, it looks like in the i386 code we're already masking the address being checked: tgen_arithi(s, ARITH_AND + trexw, r1, TARGET_PAGE_MASK | (aligned ? s_mask : 0), 0); where TARGET_PAGE_MASK is a

Re: [Qemu-devel] [RFC PATCH v2.1 09/12] spapr: convert boot CPUs into CPU core devices

2016-04-08 Thread Michael Roth
Quoting Bharata B Rao (2016-03-31 03:39:18) > Introduce sPAPRMachineClass.dr_cpu_enabled to indicate support for > CPU core hotplug. Initialize boot time CPUs as core deivces and prevent > topologies that result in partially filled cores. Both of these are done > only if CPU core hotplug is

Re: [Qemu-devel] [RFC PATCH v2.1 11/12] xics, xics_kvm: Handle CPU unplug correctly

2016-04-08 Thread Michael Roth
Quoting David Gibson (2016-04-05 19:43:46) > On Tue, Apr 05, 2016 at 07:24:39PM -0500, Michael Roth wrote: > > Quoting Bharata B Rao (2016-03-31 03:39:20) > > > XICS is setup for each CPU during initialization. Provide a routine > > > to undo the same when CPU is unplugged. While here, move ss->cs

Re: [Qemu-devel] [RFC PATCH v2.1 08/12] spapr: Add CPU type specific core devices

2016-04-08 Thread Michael Roth
Quoting Bharata B Rao (2016-03-31 03:39:17) > Introduce core devices for each CPU type supported by sPAPR. These > core devices are derived from the base spapr-cpu-core device type. > > TODO: > - Add core types for other remaining CPU types > - Handle CPU model alias correctly > > Signed-off-by:

[Qemu-devel] [Bug 1563887] Re: qemu-system-ppc64 freezes on starting image on ppc64le

2016-04-08 Thread Alberto Salvia Novella
** Changed in: linux (Ubuntu) Importance: Undecided => High -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1563887 Title: qemu-system-ppc64 freezes on starting image on ppc64le Status in QEMU:

[Qemu-devel] [PATCH 07/18] nbd: Treat flags vs. command type as separate fields

2016-04-08 Thread Eric Blake
Current upstream NBD documents that requests have a 16-bit flags, followed by a 16-bit type integer; although older versions mentioned only a 32-bit field with masking to find flags. Since the protocol is in network order (big-endian over the wire), the ABI is unchanged; but dealing with the

[Qemu-devel] [PATCH 09/18] nbd: Share common reply-sending code in server

2016-04-08 Thread Eric Blake
Rather than open-coding NBD_REP_SERVER, reuse the code we already have by adding a length parameter. The code gets longer because of added comments, but the refactoring will make adding NBD_OPT_GO in a later patch easier. Signed-off-by: Eric Blake --- nbd/server.c | 59

[Qemu-devel] [RFC PATCH 17/18] nbd: Implement NBD_CMD_WRITE_ZEROES on server

2016-04-08 Thread Eric Blake
RFC because there is still discussion on the NBD list about adding an NBD_OPT_ to let the client suggest server defaults related to scanning for zeroes during NBD_CMD_WRITE, which may tweak this patch. Upstream NBD protocol recently added the ability to efficiently write zeroes without having to

[Qemu-devel] [PATCH 11/18] nbd: Let client skip portions of server reply

2016-04-08 Thread Eric Blake
The server has a nice helper function nbd_negotiate_drop_sync() which lets it easily ignore fluff from the client (such as the payload to an unknown option request). We can't quite make it common, since it depends on nbd_negotiate_read() which handles coroutine magic, but we can copy the idea

[Qemu-devel] [PATCH 16/18] nbd: Support NBD_CMD_CLOSE

2016-04-08 Thread Eric Blake
NBD_CMD_DISC is annoying: the server is not required to reply, so the client has no choice but to disconnect once it has sent the message; but depending on timing, the server can see the disconnect prior to reading the request, and treat things as an abrupt exit rather than a clean shutdown (which

[Qemu-devel] [RFC PATCH 18/18] nbd: Implement NBD_CMD_WRITE_ZEROES on client

2016-04-08 Thread Eric Blake
RFC because there is still discussion on the NBD list about adding an NBD_OPT_ to let the client suggest server defaults related to scanning for zeroes during NBD_CMD_WRITE, which may tweak this patch. Upstream NBD protocol recently added the ability to efficiently write zeroes without having to

[Qemu-devel] [PATCH 03/18] nbd: More debug typo fixes, use correct formats

2016-04-08 Thread Eric Blake
Clean up some debug message oddities missed earlier; this includes both typos, and recognizing that %d is not necessarily compatible with uint32_t. Signed-off-by: Eric Blake --- nbd/client.c | 41 ++--- nbd/server.c | 44

[Qemu-devel] [PATCH 15/18] nbd: Implement NBD_OPT_GO on server

2016-04-08 Thread Eric Blake
NBD_OPT_EXPORT_NAME is lousy: it requires us to close the connection rather than report an error. Upstream NBD recently added NBD_OPT_GO as the improved version of the option that does what we want, along with NBD_OPT_INFO that returns the same information but does not transition to transmission

[Qemu-devel] [PATCH 10/18] nbd: Share common option-sending code in client

2016-04-08 Thread Eric Blake
Rather than open-coding each option request, it's easier to have common helper functions do the work. That in turn requires having convenient packed types for handling option requests and replies. Signed-off-by: Eric Blake --- include/block/nbd.h | 29 +-

[Qemu-devel] [PATCH 14/18] nbd: Implement NBD_OPT_GO on client

2016-04-08 Thread Eric Blake
NBD_OPT_EXPORT_NAME is lousy: it doesn't have any sane error reporting. Upstream NBD recently added NBD_OPT_GO as the improved version of the option that does what we want: it reports sane errors on failures (including when a server requires TLS but does not have NBD_OPT_GO!), and on success it

[Qemu-devel] [PATCH 01/18] nbd: Don't kill server on client that doesn't request TLS

2016-04-08 Thread Eric Blake
Upstream NBD is documenting that servers MAY choose to operate in a conditional mode, where it is up to the client whether to use TLS. For qemu's case, we want to always be in FORCEDTLS mode, because of the risk of man-in-the-middle attacks, and since we never export more than one device;

[Qemu-devel] [PATCH 13/18] nbd: Support shorter handshake

2016-04-08 Thread Eric Blake
The NBD Protocol allows the server and client to mutually agree on a shorter handshake (omit the 124 bytes of reserved 0), via the server advertising NBD_FLAG_NO_ZEROES and the client acknowledging with NBD_FLAG_C_NO_ZEROES (only possible in newstyle, whether or not it is fixed newstyle). It

[Qemu-devel] [PATCH 12/18] nbd: Less allocation during NBD_OPT_LIST

2016-04-08 Thread Eric Blake
Since we know that the maximum name we are willing to accept is small enough to stack-allocate, rework the iteration over NBD_OPT_LIST responses to reuse a stack buffer rather than allocating every time. Furthermore, we don't even have to allocate if we know the server's length doesn't match what

[Qemu-devel] [PATCH 06/18] nbd: Avoid magic number for NBD max name size

2016-04-08 Thread Eric Blake
Declare a constant and use that when determining if an export name fits within the constraints we are willing to support. Signed-off-by: Eric Blake --- include/block/nbd.h | 2 ++ nbd/client.c| 2 +- nbd/server.c| 4 ++-- 3 files changed, 5 insertions(+), 3

[Qemu-devel] [PATCH 04/18] nbd: Detect servers that send unexpected error values

2016-04-08 Thread Eric Blake
Add some debugging to flag servers that are not compliant to the NBD protocol. Signed-off-by: Eric Blake --- nbd/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nbd/client.c b/nbd/client.c index 42e4e52..c834587 100644 --- a/nbd/client.c +++

[Qemu-devel] [PATCH 02/18] nbd: Don't fail handshake on NBD_OPT_LIST descriptions

2016-04-08 Thread Eric Blake
The NBD Protocol states that NBD_REP_SERVER may set 'length > sizeof(namelen) + namelen'; in which case the rest of the packet is a UTF-8 description of the export. While we don't know of any NBD servers that send this description yet, we had better consume the data so we don't choke when we

[Qemu-devel] [PATCH 08/18] nbd: Limit nbdflags to 16 bits

2016-04-08 Thread Eric Blake
Rather than asserting that nbdflags is within range, just give it the correct type to begin with :) nbdflags corresponds to the per-export portion of NBD Protocol "transmission flags", which is 16 bits in response to NBD_OPT_EXPORT_NAME and NBD_OPT_GO. Signed-off-by: Eric Blake

[Qemu-devel] [PATCH 05/18] nbd: Reject unknown request flags

2016-04-08 Thread Eric Blake
The NBD protocol says that clients should not send a command flag that has not been negotiated (whether by the client requesting an option during a handshake, or because we advertise support for the flag in response to NBD_OPT_EXPORT_NAME), and that servers should reject invalid flags with EINVAL.

[Qemu-devel] [RFC PATCH 00/18] NBD protocol additions

2016-04-08 Thread Eric Blake
This series is for qemu 2.7, and will probably need some rework especially since some of it is trying to implement features that are still marked experimental in upstream NBD. Included are some interoperability bug fixes, code cleanups, then added support both client-side and server-side for:

Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock

2016-04-08 Thread Sergey Fedorov
On 09/04/16 00:31, Richard Henderson wrote: > On 04/08/2016 02:26 PM, Paolo Bonzini wrote: >> >> On 08/04/2016 23:24, Alex Bennée wrote: Except that quite a lot of hosts can only (efficiently) do atomic operations on a minimum of 4 byte quantities. I'd rather continue to use int

Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock

2016-04-08 Thread Richard Henderson
On 04/08/2016 02:26 PM, Paolo Bonzini wrote: > > > On 08/04/2016 23:24, Alex Bennée wrote: >>> Except that quite a lot of hosts can only (efficiently) do atomic >>> operations on >>> a minimum of 4 byte quantities. I'd rather continue to use int here. >> >> I suspect bool == unsigned int

Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock

2016-04-08 Thread Paolo Bonzini
On 08/04/2016 23:24, Alex Bennée wrote: > > Except that quite a lot of hosts can only (efficiently) do atomic > > operations on > > a minimum of 4 byte quantities. I'd rather continue to use int here. > > I suspect bool == unsigned int underneath. But having true/false and 0/1 > mixed up >

Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock

2016-04-08 Thread Alex Bennée
Richard Henderson writes: > On 04/08/2016 06:02 AM, Alex Bennée wrote: >>> > +typedef struct QemuSpin { >>> > +int value; >> If we are throwing true and false around as the only two values can we >> use bool here and be consistent when setting/clearing. >> > > Except that

[Qemu-devel] [PATCH 48/50] cpu: move exec-all.h inclusion out of cpu.h

2016-04-08 Thread Paolo Bonzini
exec-all.h contains TCG-specific definitions. It is not needed outside TCG-specific files such as translate.c, exec.c or *helper.c. One generic function had snuck into include/exec/exec-all.h; move it to include/qom/cpu.h. Signed-off-by: Paolo Bonzini --- bsd-user/main.c

[Qemu-devel] [PATCH 50/50] hw: clean up hw/hw.h includes

2016-04-08 Thread Paolo Bonzini
Include qom/object.h and exec/memory.h instead of exec/ioport.h; exec/ioport.h was almost everywhere required only for those two includes, not for the content of the header itself. Remove block/aio.h, everybody is already including it through another path. With this change, include/hw/hw.h is

[Qemu-devel] [PATCH 46/50] hw: explicitly include qemu/log.h

2016-04-08 Thread Paolo Bonzini
Move the inclusion out of hw/hw.h, most files do not need it. Signed-off-by: Paolo Bonzini --- hw/arm/ast2400.c | 1 + hw/arm/nseries.c | 1 + hw/arm/palmetto-bmc.c | 1 + hw/arm/pxa2xx_gpio.c | 1 + hw/arm/stellaris.c

[Qemu-devel] [PATCH 47/50] exec: extract exec/tb-context.h

2016-04-08 Thread Paolo Bonzini
TCG backends do not need most of exec-all.h; extract what they actually need to a separate file or move it directly to tcg.h. The next patch will stop including exec-all.h from everywhere. Signed-off-by: Paolo Bonzini --- include/exec/exec-all.h | 47

[Qemu-devel] [PATCH 49/50] hw: remove pio_addr_t

2016-04-08 Thread Paolo Bonzini
pio_addr_t is almost unused, because these days I/O ports are simply accessed through the address space. cpu_{in,out}[bwl] themselves are almost unused; monitor.c and xen-hvm.c could use address_space_read/write directly, since they have an integer size at hand. This leaves qtest as the only

[Qemu-devel] [PATCH 44/50] arm: move arm_log_exception into .c file

2016-04-08 Thread Paolo Bonzini
Avoid need for qemu/log.h inclusion, and make the function static too. Signed-off-by: Paolo Bonzini --- target-arm/helper.c| 15 +++ target-arm/internals.h | 15 --- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git

[Qemu-devel] [PATCH 43/50] qemu-common: push cpu.h inclusion out of qemu-common.h

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- arch_init.c | 2 ++ cpus.c | 3 ++- exec.c | 2 +- gdbstub.c| 2 +- hw/arm/nseries.c

[Qemu-devel] [PATCH 41/50] s390x: move stuff out of cpu.h

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/s390x/css.c | 4 +- hw/s390x/s390-skeys.c | 1 + hw/s390x/s390-virtio-ccw.c | 4 +- hw/s390x/virtio-ccw.c | 5 +- hw/s390x/virtio-ccw.h

[Qemu-devel] [PATCH 42/50] acpi: do not use TARGET_PAGE_SIZE

2016-04-08 Thread Paolo Bonzini
This is a #define used by the CPU. NVDIMM can just use 4K unconditionally. Signed-off-by: Paolo Bonzini --- hw/acpi/nvdimm.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index

[Qemu-devel] [PATCH 40/50] dma: do not depend on kvm_enabled()

2016-04-08 Thread Paolo Bonzini
Memory barriers are needed also by Xen and, when the ioeventfd bugs are fixed, by TCG as well. sysemu/kvm.h is not anymore needed in sysemu/dma.h, move it to the actual users. Signed-off-by: Paolo Bonzini --- hw/intc/arm_gicv2m.c | 1 + hw/ppc/e500plat.c| 1 +

[Qemu-devel] [PATCH 37/50] qemu-common: stop including qemu/bswap.h from qemu-common.h

2016-04-08 Thread Paolo Bonzini
Move it to the actual users. There are still a few includes of qemu/bswap.h in headers; removing them is left for future work. Signed-off-by: Paolo Bonzini --- audio/mixeng.c | 1 + block/bochs.c | 1 + block/cloop.c | 1 + block/parallels.c

[Qemu-devel] [PATCH 30/50] explicitly include linux/kvm.h

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/i386/kvm/i8254.c | 1 + hw/i386/kvm/pci-assign.c | 1 + hw/vfio/common.c | 3 +++ 3 files changed, 5 insertions(+) diff --git a/hw/i386/kvm/i8254.c b/hw/i386/kvm/i8254.c index a4462e5..734992e 100644 --- a/hw/i386/kvm/i8254.c

[Qemu-devel] [PATCH 26/50] ppc: use PowerPCCPU instead of CPUPPCState

2016-04-08 Thread Paolo Bonzini
This changes a cpu.h dependency for hw/ppc/ppc.h into a cpu-qom.h dependency. For it to compile we also need to clean up a few unused definitions. Signed-off-by: Paolo Bonzini --- hw/ppc/ppc.c| 20 +- include/hw/ppc/ppc.h| 24 +++-

[Qemu-devel] [PATCH 36/50] cpu: move endian-dependent load/store functions to cpu-all.h

2016-04-08 Thread Paolo Bonzini
Disentangle cpu-common.h and memory.h from NEED_CPU_H. Prototypes are not defined for !NEED_CPU_H, so remove them from poison.h too. Only macros need poisoning. Signed-off-by: Paolo Bonzini --- include/exec/cpu-all.h| 25 +

[Qemu-devel] [PATCH 35/50] hw: cannot include hw/hw.h from user emulation

2016-04-08 Thread Paolo Bonzini
All qdev definitions are available from other headers, user-mode emulation does not need hw/hw.h. By considering system emulation only, it is simpler to disentangle hw/hw.h from NEED_CPU_H. Signed-off-by: Paolo Bonzini --- exec.c | 21

[Qemu-devel] [PATCH 28/50] explicitly include qom/cpu.h

2016-04-08 Thread Paolo Bonzini
exec/cpu-all.h includes qom/cpu.h. Explicit inclusion will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini --- hw/acpi/piix4.c | 1 + hw/arm/collie.c

[Qemu-devel] [PATCH 25/50] mips: use MIPSCPU instead of CPUMIPSState

2016-04-08 Thread Paolo Bonzini
This changes a cpu.h dependency into a cpu-qom.h dependency. Signed-off-by: Paolo Bonzini --- hw/mips/cps.c | 7 --- hw/mips/cputimer.c| 4 +++- hw/mips/mips_fulong2e.c | 4 ++-- hw/mips/mips_int.c| 3 ++- hw/mips/mips_jazz.c | 4 ++--

[Qemu-devel] [PATCH 33/50] hw: do not use VMSTATE_*TL

2016-04-08 Thread Paolo Bonzini
Reserve this to CPU state serialization. Luckily, they were only used by sPAPR devices and these are ppc64 only. So there is no change to migration format. Signed-off-by: Paolo Bonzini --- hw/net/spapr_llan.c| 8 hw/ppc/spapr_vio.c | 2 +-

[Qemu-devel] [PATCH 34/50] hw: move CPU state serialization to migration/cpu.h

2016-04-08 Thread Paolo Bonzini
Remove usage of NEED_CPU_H from hw/hw.h. Signed-off-by: Paolo Bonzini --- include/hw/hw.h | 49 --- include/migration/cpu.h | 48 ++ target-alpha/machine.c| 1 +

[Qemu-devel] [PATCH 38/50] qemu-common: stop including qemu/host-utils.h from qemu-common.h

2016-04-08 Thread Paolo Bonzini
Move it to the actual users. There are some inclusions of qemu/host-utils.h in headers, but they are all necessary. Signed-off-by: Paolo Bonzini --- audio/noaudio.c | 1 + audio/wavaudio.c| 2 +-

[Qemu-devel] [PATCH 22/50] m68k: include cpu-qom.h in files that require M68KCPU

2016-04-08 Thread Paolo Bonzini
This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini --- include/hw/m68k/mcf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/hw/m68k/mcf.h

[Qemu-devel] [PATCH 31/50] apic: move target-dependent definitions to cpu.h

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/intc/ioapic.c | 1 + include/hw/i386/apic.h | 5 - target-i386/cpu.h | 7 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index 378e663..4f42b91 100644 ---

[Qemu-devel] [PATCH 17/50] target-sparc: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make SPARCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 39/50] gdbstub: remove includes from gdbstub-xml.c

2016-04-08 Thread Paolo Bonzini
gdbstub-xml.c defines a bunch of arrays of strings; there is no need to include anything. Signed-off-by: Paolo Bonzini --- scripts/feature_to_c.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/feature_to_c.sh b/scripts/feature_to_c.sh index fb1f336..0994d95

[Qemu-devel] [PATCH 27/50] arm: remove useless cpu.h inclusion

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- include/hw/arm/digic.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/hw/arm/digic.h b/include/hw/arm/digic.h index a739d6a..aaefe0b 100644 --- a/include/hw/arm/digic.h +++ b/include/hw/arm/digic.h @@ -18,8 +18,6 @@ #ifndef

[Qemu-devel] [PATCH 32/50] include: poison symbols in osdep.h

2016-04-08 Thread Paolo Bonzini
Ensure that all target-independent files ignore poisoned symbols, and fix the fallout. Signed-off-by: Paolo Bonzini --- hw/core/Makefile.objs | 2 +- include/exec/cpu-common.h | 4 include/exec/helper-head.h | 23 +-- include/qemu/osdep.h

[Qemu-devel] [PATCH 14/50] target-ppc: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make PowerPCCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H

[Qemu-devel] [PATCH 45/50] mips: move CP0 functions out of cpu.h

2016-04-08 Thread Paolo Bonzini
These are here for historical reasons: they are needed from both gdbstub.c and op_helper.c, and the latter was compiled with fixed AREG0. It is not needed anymore, so uninline them. Signed-off-by: Paolo Bonzini --- target-mips/cpu.h| 113

[Qemu-devel] [PATCH 29/50] explicitly include hw/qdev-core.h

2016-04-08 Thread Paolo Bonzini
exec/cpu-all.h includes qom/cpu.h, which includes hw/qdev-core.h. Explicit inclusion will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini --- bootdevice.c | 1 + 1 file

[Qemu-devel] [PATCH 19/50] target-unicore32: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make UniCore32CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo

[Qemu-devel] [PATCH 16/50] target-sh4: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make SuperHCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo

[Qemu-devel] [PATCH 20/50] target-xtensa: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make XtensaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. Conversely, move all definitions needed to define a class to cpu-qom.h. This helps making files independent of NEED_CPU_H if

[Qemu-devel] [PATCH 21/50] arm: include cpu-qom.h in files that require ARMCPU

2016-04-08 Thread Paolo Bonzini
This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini --- hw/arm/stm32f205_soc.c | 1 - hw/arm/strongarm.h | 1 + include/hw/arm/arm.h| 2 +-

[Qemu-devel] [PATCH 15/50] target-s390x: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make S390XCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 12/50] target-mips: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make MIPSCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 13/50] target-ppc: do not use target_ulong in cpu-qom.h

2016-04-08 Thread Paolo Bonzini
Bring the PowerPCCPUClass handle_mmu_fault method type into line with the one in CPUState. Using vaddr also makes the cpu-qom.h file target independent. Signed-off-by: Paolo Bonzini --- target-ppc/cpu-qom.h| 3 +-- target-ppc/mmu-hash32.c | 2 +-

[Qemu-devel] [PATCH 24/50] alpha: include cpu-qom.h in files that require AlphaCPU

2016-04-08 Thread Paolo Bonzini
This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini --- hw/alpha/alpha_sys.h | 1 + hw/alpha/pci.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)

[Qemu-devel] [PATCH 23/50] sh4: include cpu-qom.h in files that require SuperHCPU

2016-04-08 Thread Paolo Bonzini
This will keep things working when cpu.h will not be included indirectly almost everywhere (either directly or through qemu-common.h). Signed-off-by: Paolo Bonzini --- include/hw/sh4/sh.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/sh4/sh.h

[Qemu-devel] [PATCH 08/50] target-i386: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make X86CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 18/50] target-tricore: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make TriCoreCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo

[Qemu-devel] [PATCH 07/50] target-cris: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make CRISCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 10/50] target-m68k: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make M68KCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 05/50] target-alpha: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make AlphaCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 11/50] target-microblaze: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make MicroBlazeCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo

[Qemu-devel] [PATCH 02/50] include: move CPU-related definitions out of qemu-common.h

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 24 include/qemu/timer.h | 1 + include/qom/cpu.h | 9 + include/sysemu/cpus.h | 13 + stubs/cpu-get-icount.c | 1 + translate-common.c | 1 + vl.c

[Qemu-devel] [PATCH 04/50] cpu: make cpu-qom.h only include-able from cpu.h

2016-04-08 Thread Paolo Bonzini
Make cpu-qom.h so that it is only included from cpu.h. Then there is no need for it to include cpu.h again. Later we will make cpu-qom.h target independent and we will _want_ to include it from elsewhere, but for now reduce the number of cases to handle. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 06/50] target-arm: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make ARMCPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 03/50] log: do not use CONFIG_USER_ONLY

2016-04-08 Thread Paolo Bonzini
This decouples logging further from config-target.h Signed-off-by: Paolo Bonzini --- bsd-user/main.c| 1 + include/qemu/log.h | 17 ++--- linux-user/main.c | 1 + util/log.c | 12 ++-- 4 files changed, 14 insertions(+), 17 deletions(-)

[Qemu-devel] [PATCH for-2.7 00/49] NEED_CPU_H / cpu.h / hw/hw.h cleanups

2016-04-08 Thread Paolo Bonzini
(CCs only on cover letter due to huge series). I am sending this now because of vacation coming soon (yay!). This series removes usage of NEED_CPU_H from several central include files in QEMU, most notably hw/hw.h and qemu-common.h. Definitions conditional on NEED_CPU_H remain only in

[Qemu-devel] [PATCH 09/50] target-lm32: make cpu-qom.h not target specific

2016-04-08 Thread Paolo Bonzini
Make LM32CPU an opaque type within cpu-qom.h, and move all definitions of private methods, as well as all type definitions that require knowledge of the layout to cpu.h. This helps making files independent of NEED_CPU_H if they only need to pass around CPU pointers. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 01/50] scripts: add script to build QEMU and analyze inclusions

2016-04-08 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/analyze-inclusions | 89 ++ 1 file changed, 89 insertions(+) create mode 100644 scripts/analyze-inclusions diff --git a/scripts/analyze-inclusions b/scripts/analyze-inclusions new file

Re: [Qemu-devel] [PULL v2 00/40] ivshmem: Fixes, cleanups, device model split

2016-04-08 Thread Markus Armbruster
I updated http://qemu-project.org/ChangeLog/2.6.

[Qemu-devel] [Bug 1568107] [NEW] setup_rt_frame: not implemented

2016-04-08 Thread PeteVine
Public bug reported: Trying to run this binary (https://github.com/ethcore/parity/releases/download/v1.0.1/parity_linux_1.0.1-0_amd64.deb) under qemu-x86_64 on ARM, ends like this: $ qemu-x86_64 parity --pruning fast setup_rt_frame: not implemented qemu: uncaught target signal 11 (Segmentation

Re: [Qemu-devel] [PATCH v2 10/13] tb hash: hash phys_pc, pc, and flags with xxhash

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > For some workloads such as arm bootup, tb_phys_hash is performance-critical. > The is due to the high frequency of accesses to the hash table, originated > by (frequent) TLB flushes that wipe out the cpu-private tb_jmp_cache's. > More info: >

Re: [Qemu-devel] [PATCH v2 09/13] exec: add tb_hash_func5, derived from xxhash

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > +#include Should already be done by > +/* > + * Note : although _rotl exists for minGW (GCC under windows), performance > + * seems poor. > + */ > +#if defined(_MSC_VER) > +# define XXH_rotl32(x, r) _rotl(x, r) > +#else > +# define

Re: [Qemu-devel] [PATCH v2 08/13] qemu-thread: optimize spin_lock for uncontended locks

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > static inline void qemu_spin_lock(QemuSpin *spin) > { > -do { > +while (atomic_xchg(>value, true)) { > while (atomic_read(>value)) { > cpu_relax(); > } > -} while (atomic_xchg(>value, true)); > +} > }

Re: [Qemu-devel] [PATCH v2 07/13] qemu-thread: call cpu_relax() while spinning

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > do { > -while (atomic_read(>value)); > +while (atomic_read(>value)) { > +cpu_relax(); > +} Please just merge this with the previous patch. r~

Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock

2016-04-08 Thread Richard Henderson
On 04/08/2016 06:02 AM, Alex Bennée wrote: >> > +typedef struct QemuSpin { >> > +int value; > If we are throwing true and false around as the only two values can we > use bool here and be consistent when setting/clearing. > Except that quite a lot of hosts can only (efficiently) do atomic

Re: [Qemu-devel] [PATCH v2 06/13] qemu-thread: add simple test-and-set spinlock

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > +while (atomic_read(>value)); I really really don't like ; snuggled up behind loop conditions. Isn't this where you want to use pause, anyway? r~

Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax()

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > Taken from the linux kernel. > > Signed-off-by: Emilio G. Cota > --- > include/qemu/processor.h | 28 > 1 file changed, 28 insertions(+) > create mode 100644 include/qemu/processor.h Reviewed-by:

Re: [Qemu-devel] [PATCH v2 04/13] seqlock: rename write_lock/unlock to write_begin/end

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > It is a more appropriate name, now that the mutex embedded > in the seqlock is gone. > > Reviewed-by: Alex Bennée > Signed-off-by: Emilio G. Cota > --- > cpus.c | 28

Re: [Qemu-devel] [PATCH v2 03/13] seqlock: remove optional mutex

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > This option is unused; besides, it bloats the struct when not needed. > Let's just let writers define their own locks elsewhere. > > Reviewed-by: Alex Bennée > Signed-off-by: Emilio G. Cota > --- > cpus.c

Re: [Qemu-devel] [PATCH v2 02/13] compiler.h: add QEMU_ALIGNED() to enforce struct alignment

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > Signed-off-by: Emilio G. Cota > --- > include/qemu/compiler.h | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Richard Henderson r~

Re: [Qemu-devel] [PATCH v2 01/13] translate-all: add missing fold of tb_ctx into tcg_ctx

2016-04-08 Thread Richard Henderson
On 04/07/2016 10:32 AM, Emilio G. Cota wrote: > Since 5e5f07e08 "TCG: Move translation block variables > to new context inside tcg_ctx: tb_ctx" on Feb 1 2013, compilation > of usermode + TB_DEBUG_CHECK has been broken. Fix it. > > Signed-off-by: Emilio G. Cota > --- >

Re: [Qemu-devel] best way to implement emulation of AArch64 tagged addresses

2016-04-08 Thread Peter Maydell
On 8 April 2016 at 18:20, Tom Hanson wrote: > On Mon, 2016-04-04 at 10:56 -0700, Richard Henderson wrote: >> On 04/04/2016 09:31 AM, Peter Maydell wrote: >> > On 4 April 2016 at 17:28, Richard Henderson wrote: >> >> On 04/04/2016 08:51 AM, Peter

Re: [Qemu-devel] best way to implement emulation of AArch64 tagged addresses

2016-04-08 Thread Richard Henderson
On 04/08/2016 10:20 AM, Tom Hanson wrote: > Is it an option to mask off the tag bits in all cases? Is there any case > it which those bits are valid address bits? It's not impossible to mask off bits in the address -- we do that for running 32-bit on 64-bit all of the time. It's all a question

Re: [Qemu-devel] [PATCH] MAINTAINERS: Block layer core, qcow2 and blkdebug

2016-04-08 Thread Kevin Wolf
Am 08.04.2016 um 19:29 hat Max Reitz geschrieben: > As agreed with Kevin and already practiced for a while, I am adding > myself as co-maintainer of the block layer core, qcow2 and blkdebug. > > Signed-off-by: Max Reitz Thanks, applied to the block branch. Kevin

[Qemu-devel] [PATCH] MAINTAINERS: Block layer core, qcow2 and blkdebug

2016-04-08 Thread Max Reitz
As agreed with Kevin and already practiced for a while, I am adding myself as co-maintainer of the block layer core, qcow2 and blkdebug. Signed-off-by: Max Reitz --- MAINTAINERS | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index

Re: [Qemu-devel] best way to implement emulation of AArch64 tagged addresses

2016-04-08 Thread Tom Hanson
On Mon, 2016-04-04 at 10:56 -0700, Richard Henderson wrote: > On 04/04/2016 09:31 AM, Peter Maydell wrote: > > On 4 April 2016 at 17:28, Richard Henderson wrote: > >> On 04/04/2016 08:51 AM, Peter Maydell wrote: > >>> In particular I think if you just do the relevant handling of

Re: [Qemu-devel] [Qemu-block] [PATCH 0/7] next round of qemu-iotests fixes

2016-04-08 Thread Sascha Silbe
Dear Max, Max Reitz writes: > On 05.04.2016 11:21, Sascha Silbe wrote: >> With these fixes, qemu-iotests complete successfully on my test >> systems (s390x, x86_64) when used with QCOW2 or raw image formats. >> >> These are purely bug fixes for tests and most are trivial, so

[Qemu-devel] [PATCH v3 for-2.7 5/8] block: Drop bdrv_new_root()

2016-04-08 Thread Max Reitz
It is unused now, so we may just as well drop it. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf --- block.c | 5 - include/block/block.h | 1 - 2 files changed, 6 deletions(-) diff --git

  1   2   3   >