[Qemu-devel] Guest application exit point.

2018-10-25 Thread Rafael K. V. Maeda
Hi, I am implementing a plugin that allocates several resources. I need to cleanup some of these resources when QEMU finishes executing the guest application. Where is the best exit point to place my cleanup functions? I have tried registering a function call "atexit" but it does not seem

Re: [Qemu-devel] [PATCH v5 3/3] x86: define a new MSR based feature word -- FEATURE_WORDS_ARCH_CAPABILITIES

2018-10-25 Thread Robert Hoo
On Wed, 2018-10-24 at 07:06 -0300, Eduardo Habkost wrote: > On Mon, Oct 15, 2018 at 12:47:25PM +0800, Robert Hoo wrote: > > Note RSBA is specially treated -- no matter host support it or not, > > qemu > > pretends it is supported. > > > > Signed-off-by: Robert Hoo > > I am now wondering what

Re: [Qemu-devel] [PULL v2 00/28] pci, pc, virtio: fixes, features

2018-10-25 Thread Michael S. Tsirkin
On Thu, Oct 25, 2018 at 08:16:44PM +0100, Peter Maydell wrote: > On 25 October 2018 at 01:52, Michael S. Tsirkin wrote: > > The following changes since commit 13399aad4fa87b2878c49d02a5d3bafa6c966ba3: > > > > Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' > > into

Re: [Qemu-devel] [PULL v2 00/28] pci, pc, virtio: fixes, features

2018-10-25 Thread Michael S. Tsirkin
On Thu, Oct 25, 2018 at 08:16:44PM +0100, Peter Maydell wrote: > On 25 October 2018 at 01:52, Michael S. Tsirkin wrote: > > The following changes since commit 13399aad4fa87b2878c49d02a5d3bafa6c966ba3: > > > > Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' > > into

[Qemu-devel] [PATCH RFC 4/4] net/slirp: add ipv6-hostfwd option for user netdev type

2018-10-25 Thread Maxim Samoylov
This allows forwarding TCP6 and UDP6 connections down to netdev=user connected guests. Signed-off-by: Maxim Samoylov --- hmp-commands.hx | 31 include/net/slirp.h | 2 + net/slirp.c | 214 qapi/net.json | 3 +-

[Qemu-devel] [PATCH RFC 3/4] slirp: add helpers for ipv6 hostfwd manipulation

2018-10-25 Thread Maxim Samoylov
Signed-off-by: Maxim Samoylov --- slirp/libslirp.h | 6 ++ slirp/slirp.c| 43 +++ 2 files changed, 49 insertions(+) diff --git a/slirp/libslirp.h b/slirp/libslirp.h index 42e42e9..3710650 100644 --- a/slirp/libslirp.h +++ b/slirp/libslirp.h @@

[Qemu-devel] [PATCH RFC 2/4] slirp: add helper for udp6 socket creation

2018-10-25 Thread Maxim Samoylov
Signed-off-by: Maxim Samoylov --- slirp/udp.c | 48 slirp/udp.h | 2 ++ 2 files changed, 50 insertions(+) diff --git a/slirp/udp.c b/slirp/udp.c index e5bf065..ab24935 100644 --- a/slirp/udp.c +++ b/slirp/udp.c @@ -366,3 +366,51 @@

[Qemu-devel] [PATCH RFC 1/4] slirp: add helper for tcp6 socket creation

2018-10-25 Thread Maxim Samoylov
Signed-off-by: Maxim Samoylov --- slirp/socket.c | 73 ++ slirp/socket.h | 2 ++ 2 files changed, 75 insertions(+) diff --git a/slirp/socket.c b/slirp/socket.c index 322383a..e16e6c1 100644 --- a/slirp/socket.c +++ b/slirp/socket.c @@

[Qemu-devel] [PATCH RFC 0/4] slirp: support hostfwd for ipv6 addresses

2018-10-25 Thread Maxim Samoylov
The following patch implements ipv6 host port forwarding support for qemu slirp net subsystem. The slirp itself supports ipv6 communication, but hostfwd currently does not allow listening on and forwarding ports for ipv6 addresses. This should be useful, when host works in v6-capable environment

Re: [Qemu-devel] [PULL v2 00/28] pci, pc, virtio: fixes, features

2018-10-25 Thread Michael S. Tsirkin
On Thu, Oct 25, 2018 at 08:16:44PM +0100, Peter Maydell wrote: > On 25 October 2018 at 01:52, Michael S. Tsirkin wrote: > > The following changes since commit 13399aad4fa87b2878c49d02a5d3bafa6c966ba3: > > > > Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' > > into

Re: [Qemu-devel] [PATCH] lsi53c895a: check message length value

2018-10-25 Thread Paolo Bonzini
On 25/10/2018 22:09, P J P wrote: > From: Prasad J Pandit > > While writing a message in 'lsi_do_msgin', message length value > in msg_len could be invalid, add check to avoid OOB access issue. > > Reported-by: Ameya More > Signed-off-by: Prasad J Pandit > --- > hw/scsi/lsi53c895a.c | 9

[Qemu-devel] [Bug 1762707] Re: VFIO device gets DMA failures when virtio-balloon leak from highmem to lowmem

2018-10-25 Thread Alex Williamson
There are two scenarios here, if we have a regular, directly assigned physical device (including VFs), vfio's page pinning will populate the full memory footprint of the guest regardless of the balloon. The balloon is effectively fully deflated, but the balloon driver in the guest hasn't released

[Qemu-devel] [Bug 1762707] Re: VFIO device gets DMA failures when virtio-balloon leak from highmem to lowmem

2018-10-25 Thread Jose Carlos Venegas Munoz
Alex, I see this issue is closed but I have a question, do you know if the problem only comes the balloon is resized to return memory to the host. I ask because we have a situation where we will start a VM with balloon enabled, and later it maybe possible a devices is assigned via hot-plug. So I

Re: [Qemu-devel] [RFC 0/2] Attempt to implement the standby feature for assigned network devices

2018-10-25 Thread Michael S. Tsirkin
On Thu, Oct 25, 2018 at 05:06:29PM +0300, Sameeh Jubran wrote: > From: Sameeh Jubran > > Hi all, > > Background: > > There has been a few attempts to implement the standby feature for vfio > assigned devices which aims to enable the migration of such devices. This > is another attempt. > >

Re: [Qemu-devel] Call for patches for the qemu-trivial pull request

2018-10-25 Thread Laurent Vivier
On 25/10/2018 21:13, Thomas Huth wrote: > On 2018-10-23 11:04, Laurent Vivier wrote: >> Hi, >> >> I'm going to collect patches for the next pull request for the >> qemu-trivial I'd like to do before the softfreeze. >> >> As we didn't have any pull request for more than 3 months and some of >> the

Re: [Qemu-devel] [PATCH] lsi53c895a: check message length value

2018-10-25 Thread Ameya More
Hi Prasad, Thanks for following up on this. While Mark and I reported this issue to you, it was actually discovered by Dejvau Security and they should receive credit for reporting this issue. http://www.dejavusecurity.com Thanks, Ameya On 10/25/2018 03:09 PM, P J P wrote: From: Prasad J

Re: [Qemu-devel] [libvirt] [PATCH 2/3] adlib: mark as insecure and deprecated.

2018-10-25 Thread Daniel P . Berrangé
On Thu, Oct 25, 2018 at 04:26:16PM +0530, P J P wrote: > +-- On Thu, 25 Oct 2018, Gerd Hoffmann wrote --+ > | We have a lovely, guest-triggerable buffer overflow in opl2 emulation. > | > | Reproducer: > | outw(0xff60, 0x220); > | outw(0x1020, 0x220); > | outw(0xffb0, 0x220); > |

Re: [Qemu-devel] [PATCH 3/3] cirrus: mark as deprecated

2018-10-25 Thread Daniel P . Berrangé
On Thu, Oct 25, 2018 at 10:52:56AM +0200, Gerd Hoffmann wrote: > While being at it deprecate cirrus too. > > Reason (short version): use stdvga instead. > Verbose version: > https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful Every single one of my guests is using

Re: [Qemu-devel] [PATCH] linux-user: fix comment s/atomic_write/atomic_set/

2018-10-25 Thread Laurent Vivier
On 11/08/2018 22:10, Emilio G. Cota wrote: > Signed-off-by: Emilio G. Cota > --- > linux-user/qemu.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/linux-user/qemu.h b/linux-user/qemu.h > index b4959e41c6..e6a8bc5867 100644 > --- a/linux-user/qemu.h > +++

Re: [Qemu-devel] [PATCH v4 01/11] hw/m68k: add via support

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 07:22, Thomas Huth wrote: > On 2018-10-18 19:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> Co-developed-by: Mark Cave-Ayland >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Laurent Vivier >> --- > [...] >> diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c >>

Re: [Qemu-devel] [Qemu-trivial] [PATCH] piix: use TYPE_FOO constants than string constats

2018-10-25 Thread Laurent Vivier
On 25/10/2018 16:11, Li Qiang wrote: > Hello Laurent, > Thanks, > > This patch has been in Michael's pull request. > Maybe you can drop it. Removed Thanks, Laurent

Re: [Qemu-devel] [PATCH v2 03/29] target/riscv: Convert RVXI branch insns to decodetree

2018-10-25 Thread Palmer Dabbelt
On Sat, 20 Oct 2018 00:14:25 PDT (-0700), Bastian Koppelmann wrote: Signed-off-by: Bastian Koppelmann Signed-off-by: Peer Adelt --- v1 -> v2: - use ctx->env instead of current_cpu->env_ptr target/riscv/insn32.decode | 19 ++ target/riscv/insn_trans/trans_rvi.inc.c |

Re: [Qemu-devel] [PATCH v4 11/11] hw/m68k: define Macintosh Quadra 800

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 14:16, Philippe Mathieu-Daudé wrote: > Hi Laurent, Mark, > > On 18/10/18 20:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> Co-developed-by: Mark Cave-Ayland >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Laurent Vivier >> --- >>   MAINTAINERS

[Qemu-devel] [PULL 2/3] target/mips: Implement emulation of nanoMIPS EVA instructions

2018-10-25 Thread Aleksandar Markovic
From: Dimitrije Nikolic Implement emulation of nanoMIPS EVA instructions. They are all part of P.LS.E0 instruction pool, or one of its subpools. Reviewed-by: Stefan Markovic Signed-off-by: Dimitrije Nikolic Signed-off-by: Aleksandar Markovic --- target/mips/translate.c | 128

Re: [Qemu-devel] [PATCH v4 04/11] hw/m68k: add macfb video card

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 08:13, Thomas Huth wrote: > On 2018-10-18 19:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> Co-developed-by: Mark Cave-Ayland >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Laurent Vivier >> --- >> arch_init.c | 4 + >>

[Qemu-devel] [PULL 0/3] MIPS queue for October 2018 - part 3

2018-10-25 Thread Aleksandar Markovic
From: Aleksandar Markovic The following changes since commit 808ebd66e467f77c0d1f8c6346235f81e9c99cf2: Merge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-sf0' into staging (2018-10-25 17:41:03 +0100) are available in the git repository at:

[Qemu-devel] [PULL 1/3] target/mips: Add nanoMIPS CRC32 instruction pool

2018-10-25 Thread Aleksandar Markovic
From: Aleksandar Markovic Add nanoMIPS CRC32 instruction pool. Reviewed-by: Stefan Markovic Signed-off-by: Aleksandar Markovic --- target/mips/translate.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/mips/translate.c b/target/mips/translate.c index c44a751..4338b9a

Re: [Qemu-devel] [PATCH v4 11/11] hw/m68k: define Macintosh Quadra 800

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 12:20, Thomas Huth wrote: > On 2018-10-18 19:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> Co-developed-by: Mark Cave-Ayland >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Laurent Vivier >> --- > [...] >> diff --git a/hw/m68k/Makefile.objs

Re: [Qemu-devel] [PATCH 2/3] adlib: mark as insecure and deprecated.

2018-10-25 Thread Thomas Huth
On 2018-10-25 09:52, Gerd Hoffmann wrote: > We have a lovely, guest-triggerable buffer overflow in opl2 emulation. > > Reproducer: > outw(0xff60, 0x220); > outw(0x1020, 0x220); > outw(0xffb0, 0x220); > Result: > Will overflow FM_OPL->AR_TABLE[] (see hw/audio/fmopl.[ch]) > > The

Re: [Qemu-devel] [PATCH v4 02/11] hw/m68k: implement ADB bus support for via

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 07:49, Thomas Huth wrote: > On 2018-10-18 19:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> Co-developed-by: Mark Cave-Ayland >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Laurent Vivier >> --- >> hw/input/adb.c| 2 + >> hw/misc/mac_via.c

Re: [Qemu-devel] [PATCH v4 07/11] hw/m68k: add Nubus support

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 08:36, Thomas Huth wrote: > On 2018-10-18 19:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> Co-developed-by: Mark Cave-Ayland >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Laurent Vivier >> --- > [...] >> +static void nubus_register_format_block(NubusDevice

Re: [Qemu-devel] [PATCH v4 05/11] hw/m68k: Apple Sound Chip (ASC) emulation

2018-10-25 Thread Mark Cave-Ayland
On 23/10/2018 08:18, Thomas Huth wrote: > On 2018-10-18 19:28, Mark Cave-Ayland wrote: >> From: Laurent Vivier >> >> This is broken as the linux driver seems broken too... > > So is this required for the initial version, or does Linux also boot > without this device in the emulated machine? In

Re: [Qemu-devel] [PATCH v1] arm: check bit index before usage

2018-10-25 Thread P J P
+-- On Thu, 25 Oct 2018, Peter Maydell wrote --+ | Hi; thanks for this patch. Looking at the SA1110 manual, | it says that writes to the reserved bits [31:28] are | ignored. So I think that rather than doing this check | here, we should do what the strongarm_ppc_* code in the | same file does --

Re: [Qemu-devel] [PATCH 3/3] cirrus: mark as deprecated

2018-10-25 Thread Thomas Huth
On 2018-10-25 09:52, Gerd Hoffmann wrote: > While being at it deprecate cirrus too. > > Reason (short version): use stdvga instead. > Verbose version: > https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful > > Signed-off-by: Gerd Hoffmann > --- > hw/display/cirrus_vga.c

Re: [Qemu-devel] Call for patches for the qemu-trivial pull request

2018-10-25 Thread Thomas Huth
On 2018-10-23 11:04, Laurent Vivier wrote: > Hi, > > I'm going to collect patches for the next pull request for the > qemu-trivial I'd like to do before the softfreeze. > > As we didn't have any pull request for more than 3 months and some of > the patches have been pushed through another

[Qemu-devel] [PATCH] lsi53c895a: check message length value

2018-10-25 Thread P J P
From: Prasad J Pandit While writing a message in 'lsi_do_msgin', message length value in msg_len could be invalid, add check to avoid OOB access issue. Reported-by: Ameya More Signed-off-by: Prasad J Pandit --- hw/scsi/lsi53c895a.c | 9 ++--- 1 file changed, 6 insertions(+), 3

Re: [Qemu-devel] [PULL v2 00/28] pci, pc, virtio: fixes, features

2018-10-25 Thread Peter Maydell
On 25 October 2018 at 01:52, Michael S. Tsirkin wrote: > The following changes since commit 13399aad4fa87b2878c49d02a5d3bafa6c966ba3: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' > into staging (2018-10-23 17:20:23 +0100) > > are available in the Git repository

Re: [Qemu-devel] [PATCH v5 2/5] hw/riscv/virt: Connect the gpex PCIe

2018-10-25 Thread Peter Maydell
On 4 October 2018 at 21:06, Alistair Francis wrote: > Connect the gpex PCIe device based on the device tree included in the > HiFive Unleashed ROM. > > Signed-off-by: Alistair Francis > --- > default-configs/riscv32-softmmu.mak | 6 ++- > default-configs/riscv64-softmmu.mak | 6 ++- >

Re: [Qemu-devel] [PULL] First RISC-V Patch Set for the 3.1 Soft Freeze

2018-10-25 Thread Peter Maydell
On 17 October 2018 at 22:54, Palmer Dabbelt wrote: > The following changes since commit 09558375a634e17cea6cfbfec883ac2376d2dc7f: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20181016-1' into staging (2018-10-16 > 17:42:56 +0100) > > are available in the Git

Re: [Qemu-devel] Call for patches for the qemu-trivial pull request

2018-10-25 Thread Emilio G. Cota
On Tue, Oct 23, 2018 at 11:04:36 +0100, Laurent Vivier wrote: > So, it would be helpful if any of you knowing that some patches have to > be added to the pull request send me their list. I sent this one in August: linux-user: fix comment s/atomic_write/atomic_set/

Re: [Qemu-devel] [PATCH v8 00/38] target/mips: Limited support for the R5900

2018-10-25 Thread Fredrik Noring
Hi Maciej, > > Is the membership field intended to be used? The opcodes for CLZ and CLO > > clash with the R5900 opcodes for MADD1 and MADDU1, resulting in incorrect > > disassembly of MADD1 and MADDU1. For example: > > > > 0x70853020 madd1 a2,a0,a1 disassembles into clz a2 or a1,a0 > >

Re: [Qemu-devel] [RFC 0/2] Attempt to implement the standby feature for assigned network devices

2018-10-25 Thread Sameeh Jubran
On Thu, Oct 25, 2018 at 5:06 PM Sameeh Jubran wrote: > > From: Sameeh Jubran > > Hi all, > > Background: > > There has been a few attempts to implement the standby feature for vfio > assigned devices which aims to enable the migration of such devices. This > is another attempt. > > The series

[Qemu-devel] [Bug 1799766] Re: -device does not work as -drive do

2018-10-25 Thread Yannick Duchêne
Yes, I messed up with `-device`, because I initially tried to do it with `-device`, later rely only on automatically created device, and so had automatically created devices. Thanks for you rich comment, I will study it. -- You received this bug notification because you are a member of qemu-

Re: [Qemu-devel] [PATCH v8 00/38] target/mips: Limited support for the R5900

2018-10-25 Thread Maciej W. Rozycki
Hi Fredrik, > > NB all but pipeline 1 instructions of these are also implemented by other > > members of the TXx9 family. They seem to be referred to as just "multiply > > and multiply-add instructions" in the TX79 manual (cf Section B.3.1). > > Would > > ASE_TOSHIBA_MMI -- TX79 128-bit

[Qemu-devel] [PATCH 11/11] disas/mips: Disassemble R5900 DIV[U]1, M{F, T}{LO, HI}1 and MULT[U]1

2018-10-25 Thread Fredrik Noring
Disassemble the R5900 instructions DIV1, DIVU1, MFLO1, MTLO1, MFHI1, MTHI1, MULT1 and MULTU1. Signed-off-by: Fredrik Noring --- disas/mips.c | 12 1 file changed, 12 insertions(+) diff --git a/disas/mips.c b/disas/mips.c index 9f01fda8bd..eddfb59325 100644 --- a/disas/mips.c +++

Re: [Qemu-devel] [PATCH v8 00/38] target/mips: Limited support for the R5900

2018-10-25 Thread Maciej W. Rozycki
Hi Fredrik, > > > Option 3: Extend the mips_opcode::membership field. > > > > It's trivial to extend the field to uint64_t. > > Is the membership field intended to be used? The opcodes for CLZ and CLO > clash with the R5900 opcodes for MADD1 and MADDU1, resulting in incorrect > disassembly of

[Qemu-devel] [PATCH 01/11] target/mips: Rename ASE_MMI to ASE_TOSHIBA_MMI, with Toshiba namespace

2018-10-25 Thread Fredrik Noring
Several vendors have multimedia instruction (MMI) sets and other extensions of various kinds. ASE vendor namespaces make it clear these are not generic architectural features and also avoid name clashes. Reported-by: Maciej W. Rozycki Signed-off-by: Fredrik Noring --- target/mips/mips-defs.h

[Qemu-devel] [PATCH 04/11] target/mips: Support R5900 three-operand MADD1 and MADDU1

2018-10-25 Thread Fredrik Noring
Signed-off-by: Fredrik Noring --- target/mips/translate.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index add6203c5a..208a15c0c1 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -4813,7

[Qemu-devel] [PATCH 09/11] disas/mips: Increase 'member of ISAs' flag holder size

2018-10-25 Thread Fredrik Noring
From: Philippe Mathieu-Daudé Increase the size of 'membership' holder size to 64 bits. This is needed for future extensions since existing bits are almost all used. This change is related to commit f9c9cd63e3 "target/mips: Increase 'supported ISAs/ASEs' flag holder size". Signed-off-by:

[Qemu-devel] [PATCH 10/11] disas/mips: Define R5900 disassembly constants

2018-10-25 Thread Fredrik Noring
Amend definition for MIPS ISAs in disassembler with R5900. Signed-off-by: Fredrik Noring --- disas/mips.c | 8 1 file changed, 8 insertions(+) diff --git a/disas/mips.c b/disas/mips.c index d73d4094d8..9f01fda8bd 100644 --- a/disas/mips.c +++ b/disas/mips.c @@ -611,6 +611,9 @@ struct

[Qemu-devel] [PATCH 05/11] tests/tcg/mips: Test R5900 three-operand MADD

2018-10-25 Thread Fredrik Noring
Signed-off-by: Fredrik Noring --- tests/tcg/mips/mipsr5900/Makefile | 1 + tests/tcg/mips/mipsr5900/madd.c | 45 +++ 2 files changed, 46 insertions(+) create mode 100644 tests/tcg/mips/mipsr5900/madd.c diff --git a/tests/tcg/mips/mipsr5900/Makefile

[Qemu-devel] [RFC 00/48] Plugin support

2018-10-25 Thread Emilio G. Cota
For those of you who need some context: "plugins" are dynamic libraries that are loaded at run-time. These plugins can subscribe to interesting events (e.g. instruction execution) via an API, to then do something interesting with them. This functionality is similar to what other instrumentation

[Qemu-devel] [PATCH 08/11] tests/tcg/mips: Test R5900 three-operand MADDU1

2018-10-25 Thread Fredrik Noring
Signed-off-by: Fredrik Noring --- tests/tcg/mips/mipsr5900/maddu.c | 37 ++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/tests/tcg/mips/mipsr5900/maddu.c b/tests/tcg/mips/mipsr5900/maddu.c index e4e552102d..30936fb2b4 100644 ---

Re: [Qemu-devel] [PULL v2 05/43] hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events

2018-10-25 Thread David Gibson
On Thu, Oct 25, 2018 at 10:32:23AM -0300, Eduardo Habkost wrote: > From: Philippe Mathieu-Daudé > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Artyom Tarasenko > Reviewed-by: Cédric Le Goater > Message-Id: <20181002212522.23303-3-f4...@amsat.org> > Signed-off-by: Eduardo Habkost >

[Qemu-devel] [PATCH 02/11] target/mips: R5900 LQ and SQ also belong to the Toshiba MMI ASE

2018-10-25 Thread Fredrik Noring
Signed-off-by: Fredrik Noring --- target/mips/translate.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 8547a6e6f6..18167df26d 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -26100,7

[Qemu-devel] [RFC 05/48] include: move exec/tb-hash-xx.h to qemu/xxhash.h

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/tb-hash.h | 2 +- include/{exec/tb-hash-xx.h => qemu/xxhash.h} | 6 +++--- tests/qht-bench.c| 2 +- util/qsp.c | 2 +- 4 files changed, 6 insertions(+), 6

[Qemu-devel] [PATCH 07/11] tests/tcg/mips: Test R5900 three-operand MADDU

2018-10-25 Thread Fredrik Noring
Signed-off-by: Fredrik Noring --- tests/tcg/mips/mipsr5900/Makefile | 1 + tests/tcg/mips/mipsr5900/maddu.c | 37 +++ 2 files changed, 38 insertions(+) create mode 100644 tests/tcg/mips/mipsr5900/maddu.c diff --git a/tests/tcg/mips/mipsr5900/Makefile

[Qemu-devel] [RFC 08/48] tcg: export tcg_gen_runtime_helper

2018-10-25 Thread Emilio G. Cota
This takes the TCGHelperInfo directly, which will allow us to generate helpers at run-time. Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 2 ++ tcg/tcg.c | 50 +- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/tcg/tcg.h

[Qemu-devel] [PATCH 00/11] target/mips: Amend R5900 support

2018-10-25 Thread Fredrik Noring
This series amends the R5900 support with the following noncritical features: - The vendor-specific Application-Specific Extension (ASE) ASE_MMI is renamed to ASE_TOSHIBA_MMI, because several vendors have multimedia instruction (MMI) sets and other extensions of various kinds. ASE vendor

[Qemu-devel] [PATCH 06/11] tests/tcg/mips: Test R5900 three-operand MADD1

2018-10-25 Thread Fredrik Noring
Signed-off-by: Fredrik Noring --- tests/tcg/mips/mipsr5900/madd.c | 43 + 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/tests/tcg/mips/mipsr5900/madd.c b/tests/tcg/mips/mipsr5900/madd.c index 9ad2ea6dbb..f6f215e1c3 100644 ---

[Qemu-devel] [RFC 12/48] atomic_template: define pre/post macros

2018-10-25 Thread Emilio G. Cota
In preparation for plugin support. Signed-off-by: Emilio G. Cota --- accel/tcg/atomic_template.h | 92 +++-- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index 8d177fefef..b13318c1ce

[Qemu-devel] [RFC 02/48] trace: expand mem_info:size_shift to 3 bits

2018-10-25 Thread Emilio G. Cota
This will allow us to trace 16B-long memory accesses. While at it, add some defines for the mem_info bits and simplify trace_mem_get_info by making it a wrapper around trace_mem_build_info. Signed-off-by: Emilio G. Cota --- trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Qemu-devel] [PATCH 03/11] target/mips: Support Toshiba specific three-operand MADD and MADDU

2018-10-25 Thread Fredrik Noring
From: Philippe Mathieu-Daudé The three-operand MADD and MADDU are specific to the Toshiba TX19/TX39/TX79 cores. The "32-Bit TX System RISC TX39 Family Architecture manual" is available at https://wiki.qemu.org/File:DSAE0022432.pdf Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Fredrik

[Qemu-devel] [RFC 20/48] *-user: notify plugin of exit

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- bsd-user/syscall.c | 3 +++ linux-user/exit.c | 1 + 2 files changed, 4 insertions(+) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 66492aaf5d..b7818af450 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -332,6 +332,7 @@ abi_long

[Qemu-devel] [RFC 09/48] tcg: reset runtime helpers when flushing the code cache

2018-10-25 Thread Emilio G. Cota
In preparation for adding plugin support. One of the clean-up actions when uninstalling plugins will be to flush the code cache. We'll also have to clear the runtime helpers, since some of those runtime helpers may belong to the plugin being uninstalled. Signed-off-by: Emilio G. Cota ---

[Qemu-devel] [RFC 11/48] atomic_template: fix indentation in GEN_ATOMIC_HELPER

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/atomic_template.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index efde12fdb2..8d177fefef 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@

[Qemu-devel] [RFC 43/48] linux-user: support -plugin option

2018-10-25 Thread Emilio G. Cota
From: Lluís Vilanova Signed-off-by: Lluís Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota --- linux-user/main.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 923cbb753a..0244ad736c 100644 ---

[Qemu-devel] [RFC 04/48] exec: introduce qemu_xxhash{2,4,5,6,7}

2018-10-25 Thread Emilio G. Cota
Before moving them all to include/qemu/xxhash.h. Signed-off-by: Emilio G. Cota --- include/exec/tb-hash-xx.h | 41 +-- include/exec/tb-hash.h| 2 +- tests/qht-bench.c | 2 +- util/qsp.c| 12 ++-- 4 files changed, 39

[Qemu-devel] [RFC 19/48] translate-all: notify plugin code of tb_flush

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/translate-all.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 3423cf74db..1690e3fd5b 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1233,6 +1233,8 @@

[Qemu-devel] [RFC 03/48] tcg/README: fix typo s/afterwise/afterwards/

2018-10-25 Thread Emilio G. Cota
Afterwise is "wise after the fact", as in "hindsight". Here we meant "afterwards" (as in "subsequently"). Fix it. Signed-off-by: Emilio G. Cota --- tcg/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/README b/tcg/README index d22ee084b8..3fa8a7059f 100644 ---

[Qemu-devel] [RFC 39/48] plugin: add API symbols to qemu-plugins.symbols

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- qemu-plugins.symbols | 32 1 file changed, 32 insertions(+) create mode 100644 qemu-plugins.symbols diff --git a/qemu-plugins.symbols b/qemu-plugins.symbols new file mode 100644 index 00..76a57e62bb --- /dev/null +++

[Qemu-devel] [RFC 06/48] tcg: use QHT for helper_table

2018-10-25 Thread Emilio G. Cota
This will allow us to add TCG helpers at run-time. While at it, rename tcg_find_helper to tcg_helper_find for consistency with the added tcg_helper_foo functions. Signed-off-by: Emilio G. Cota --- tcg/tcg.c | 59 +-- 1 file changed, 49

[Qemu-devel] [RFC 13/48] xxhash: add qemu_xxhash8

2018-10-25 Thread Emilio G. Cota
It will be used for TB hashing soon. Signed-off-by: Emilio G. Cota --- include/qemu/xxhash.h | 40 +++- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index fe35dde328..450427eeaa 100644 ---

[Qemu-devel] [RFC 15/48] plugin: add core code

2018-10-25 Thread Emilio G. Cota
The goals are to: - Have a simple implementation that shares nothing with tracing code. - Make sure we cannot deadlock, particularly under MTTCG. For this, we acquire a lock when called from plugin code, and keep RCU lists of callbacks so that we do not have to hold the lock when calling

[Qemu-devel] [RFC 24/48] translator: add .ctx_base_offset and .ctx_size to TranslatorOps

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/translator.h | 4 1 file changed, 4 insertions(+) diff --git a/include/exec/translator.h b/include/exec/translator.h index a28147b3dd..e20ca9f854 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -106,6 +106,8 @@

[Qemu-devel] [RFC 07/48] tcg: export TCGHelperInfo

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 7 +++ tcg/tcg.c | 7 --- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index f4efbaa680..9f9643b470 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -480,6 +480,13 @@ typedef TCGv_ptr TCGv_env; /* Used to

[Qemu-devel] [RFC 25/48] target/arm: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/arm/translate-a64.c | 8 ++-- target/arm/translate.c | 25 + 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8b1e20dd59..dab5f6efd3 100644 ---

[Qemu-devel] [RFC 01/48] cpu: introduce run_on_cpu_no_bql

2018-10-25 Thread Emilio G. Cota
This allows us to queue synchronous CPU work without the BQL. Will gain a user soon. Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 13 + cpus-common.c | 28 ++-- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/include/qom/cpu.h

[Qemu-devel] [RFC 46/48] plugin: add plugin-chan PCI device

2018-10-25 Thread Emilio G. Cota
This will allow communication between guest and plugins. Signed-off-by: Emilio G. Cota --- Makefile.target | 2 + include/hw/pci/pci.h| 2 + include/qemu/plugin.h | 1 + hw/plugin/plugin-chan.c | 136 plugin.c| 4 ++

[Qemu-devel] [RFC 10/48] exec: export do_tb_flush

2018-10-25 Thread Emilio G. Cota
This will be used by plugin code to flush the code cache as well as doing other bookkeeping in a safe work environment. Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 1 + accel/tcg/translate-all.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git

[Qemu-devel] [RFC 16/48] tcg: add plugin_mask to TB hash

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 2 ++ include/exec/tb-hash.h| 6 -- include/exec/tb-lookup.h | 1 + accel/tcg/cpu-exec.c | 6 +- accel/tcg/translate-all.c | 6 -- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git

[Qemu-devel] [RFC 21/48] *-user: plugin syscalls

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- bsd-user/syscall.c | 9 + linux-user/syscall.c | 3 +++ 2 files changed, 12 insertions(+) diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index b7818af450..4993f81b2b 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -323,6 +323,8 @@

[Qemu-devel] [RFC 47/48] plugin: support guest hooks

2018-10-25 Thread Emilio G. Cota
These "hooks" are callbacks from the guest to plugins. This is useful when we need guest-host communication, for instance to signal the beginning/end of a certain "region of interest" in the guest program. Simulators typically would use "magic" instructions for this, but that is painful to

[Qemu-devel] [RFC 33/48] target/riscv: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/riscv/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index a33cf6802b..6f5be8e7d7 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -1851,6 +1851,7 @@ static

[Qemu-devel] [RFC 38/48] translator: implement 2-pass translation

2018-10-25 Thread Emilio G. Cota
The second pass only occurs when a plugin has subscribed to TB translation events. Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 8 accel/tcg/translator.c | 91 +- 2 files changed, 97 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [RFC 18/48] tcg: add memory callbacks for plugins (WIP)

2018-10-25 Thread Emilio G. Cota
XXX: store hostaddr from non-i386 TCG backends XXX: what hostaddr to return for I/O accesses? XXX: what hostaddr to return for cross-page accesses? Here the trickiest feature is passing the host address to memory callbacks that request it. Perhaps it would be more appropriate to pass a "physical"

[Qemu-devel] [RFC 48/48] plugin: add a couple of very simple examples

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- plugin-examples/bbcount_avgsize_racy.c | 50 ++ plugin-examples/mem_count_racy_both.c | 58 ++ plugin-examples/Makefile | 31 ++ 3 files changed, 139 insertions(+) create mode 100644

[Qemu-devel] [RFC 17/48] plugin-gen: add TCG code generation helpers

2018-10-25 Thread Emilio G. Cota
Here we implement several features: - Inlining TCG code for simple operations. Crucially, we do not export TCG ops to plugins. Instead, we give them a C API to insert inlined ops. So far we only support adding an immediate to a u64, e.g. to count events. - "Direct" callbacks. These are

[Qemu-devel] [RFC 14/48] plugin: preliminary user-facing API

2018-10-25 Thread Emilio G. Cota
Add the API first to ease review. Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 227 ++ 1 file changed, 227 insertions(+) create mode 100644 include/qemu/plugin-api.h diff --git a/include/qemu/plugin-api.h b/include/qemu/plugin-api.h new

[Qemu-devel] [RFC 22/48] cpu: hook plugin vcpu events

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- cpus.c| 10 ++ exec.c| 2 ++ qom/cpu.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/cpus.c b/cpus.c index 28e39f045a..3efe89354d 100644 --- a/cpus.c +++ b/cpus.c @@ -43,6 +43,7 @@ #include "exec/exec-all.h" #include

[Qemu-devel] [RFC 41/48] configure: add --enable-plugins

2018-10-25 Thread Emilio G. Cota
For now only add it for ELF platforms, since we rely on the linker's --dynamic-list flag to pass a list of symbols to be exported to the executable. An alternative would be to use -rdynamic, but that would expose all of QEMU's objects to plugins. I have no experience with non-ELF systems but I

[Qemu-devel] [RFC 26/48] target/ppc: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/ppc/translate.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target/ppc/translate.c b/target/ppc/translate.c index 34c3ed0a41..88f88adaff 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -7565,6 +7565,9 @@ static void

[Qemu-devel] [RFC 23/48] translator: add plugin_insn argument to translate_insn

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/exec/translator.h | 4 +++- accel/tcg/translator.c | 4 ++-- target/alpha/translate.c| 3 ++- target/arm/translate-a64.c | 3 ++- target/arm/translate.c | 6 -- target/hppa/translate.c | 3 ++- target/i386/translate.c | 3 ++-

[Qemu-devel] [RFC 32/48] target/alpha: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/alpha/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 72a302e102..21405df2b8 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -2990,6 +2990,7 @@ static

[Qemu-devel] [RFC 42/48] vl: support -plugin option

2018-10-25 Thread Emilio G. Cota
From: Lluís Vilanova Signed-off-by: Lluís Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota --- vl.c| 11 +++ qemu-options.hx | 17 + 2 files changed, 28 insertions(+) diff --git a/vl.c b/vl.c index 4e25c78bff..ebb188552e 100644 ---

[Qemu-devel] [RFC 35/48] target/sparc: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/sparc/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 2fa8b68e0a..74889de426 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5902,6 +5902,7 @@ static

[Qemu-devel] [RFC 40/48] plugin: let plugins control the virtual clock

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 9 + include/qemu/plugin.h | 5 +++ plugin.c | 79 +++ stubs/plugin.c| 9 + util/qemu-timer.c | 3 ++ qemu-plugins.symbols | 1 +

[Qemu-devel] [RFC 30/48] target/m68k: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/m68k/translate.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index dd7d868b25..9b5a4b1eb5 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -116,6 +116,7

[Qemu-devel] [RFC 28/48] target/i386: prepare for 2-pass translation

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- target/i386/translate.c | 35 --- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 86e59d7bf7..1d7b20bce3 100644 --- a/target/i386/translate.c +++

[Qemu-devel] [RFC 45/48] plugin: lockstep execution support

2018-10-25 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qemu/plugin-api.h | 7 +++ include/qemu/plugin.h | 5 + cpus.c| 1 + plugin.c | 35 +++ qemu-plugins.symbols | 3 +++ 5 files changed, 51 insertions(+) diff --git

  1   2   3   >