[PATCH] backup-top: fix a memory leak in bdrv_backup_top_append()

2020-01-19 Thread pannengyuan
From: Pan Nengyuan top->opaque is aleardy malloced in bdrv_new_open_driver(), and then change the pointer but without freeing it. It will cause a memory leak, the leak stack is as follow: Direct leak of 24 byte(s) in 1 object(s) allocated from: #0 0x7ff6f7be4970 (/lib64/libasan.so.5+0xef970)

[PATCH] python: Treat None-return of greeting cmd

2020-01-19 Thread Lukáš Doktor
In case qemu process dies the "monitor.cmd" returns None which gets passed to the "__negotiate_capabilities" and leads to unhandled exception. Let's only check the resp in case it has a value. Signed-off-by: Lukáš Doktor --- python/qemu/qmp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-

Re: [PATCH 062/104] virtiofsd: Handle hard reboot

2020-01-19 Thread Misono Tomohiro
> From: "Dr. David Alan Gilbert" > > Handle a > mount > hard reboot (without unmount) > mount > > we get another 'init' which FUSE doesn't normally expect. > > Signed-off-by: Dr. David Alan Gilbert > --- > tools/virtiofsd/fuse_lowlevel.c | 16 +++- > 1 file changed, 15 inser

[PATCH v7 20/20] fuzz: add documentation to docs/devel/

2020-01-19 Thread Bulekov, Alexander
Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- docs/devel/fuzzing.txt | 116 + 1 file changed, 116 insertions(+) create mode 100644 docs/devel/fuzzing.txt diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt new file mode 10064

[PATCH v7 20/20] fuzz: add virtio-scsi fuzz target

2020-01-19 Thread Bulekov, Alexander
The virtio-scsi fuzz target sets up and fuzzes the available virtio-scsi queues. After an element is placed on a queue, the fuzzer can select whether to perform a kick, or continue adding elements. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- tests/qtest/fuzz/Makefile.inclu

[PATCH v7 12/20] exec: keep ram block across fork when using qtest

2020-01-19 Thread Bulekov, Alexander
Ram blocks were marked MADV_DONTFORK breaking fuzzing-tests which execute each test-input in a forked process. Signed-off-by: Alexander Bulekov --- exec.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index d4b769d0d4..99368f175b 100644 --- a/e

[PATCH v7 18/20] fuzz: add i440fx fuzz targets

2020-01-19 Thread Bulekov, Alexander
These three targets should simply fuzz reads/writes to a couple ioports, but they mostly serve as examples of different ways to write targets. They demonstrate using qtest and qos for fuzzing, as well as using rebooting and forking to reset state, or not resetting it at all. Signed-off-by: Alexand

[PATCH v7 09/20] libqos: move useful qos-test funcs to qos_external

2020-01-19 Thread Bulekov, Alexander
The moved functions are not specific to qos-test and might be useful elsewhere. For example the virtual-device fuzzer makes use of them for qos-assisted fuzz-targets. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- tests/qtest/Makefile.incl

[PATCH v7 19/20] fuzz: add virtio-net fuzz target

2020-01-19 Thread Bulekov, Alexander
The virtio-net fuzz target feeds inputs to all three virtio-net virtqueues, and uses forking to avoid leaking state between fuzz runs. Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/Makefile.include | 1 + tests/qtest/fuzz/virtio_net_fuzz.c | 190 + 2 files

[PATCH v7 17/20] fuzz: add i440fx fuzz targets

2020-01-19 Thread Bulekov, Alexander
These three targets should simply fuzz reads/writes to a couple ioports, but they mostly serve as examples of different ways to write targets. They demonstrate using qtest and qos for fuzzing, as well as using rebooting and forking to reset state, or not resetting it at all. Signed-off-by: Alexand

[PATCH v7 17/20] fuzz: add documentation to docs/devel/

2020-01-19 Thread Bulekov, Alexander
Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- docs/devel/fuzzing.txt | 119 + 1 file changed, 119 insertions(+) create mode 100644 docs/devel/fuzzing.txt diff --git a/docs/devel/fuzzing.txt b/docs/devel/fuzzing.txt new file mode 10064

[PATCH v7 09/20] libqos: split qos-test and libqos makefile vars

2020-01-19 Thread Bulekov, Alexander
Most qos-related objects were specified in the qos-test-obj-y variable. qos-test-obj-y also included qos-test.o which defines a main(). This made it difficult to repurpose qos-test-obj-y to link anything beside tests/qos-test against libqos. This change separates objects that are libqos-specific an

[PATCH v7 16/20] fuzz: add configure flag --enable-fuzzing

2020-01-19 Thread Bulekov, Alexander
Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- configure | 39 +++ 1 file changed, 39 insertions(+) diff --git a/configure b/configure index 08c3a1c1f0..17aa5d02ee 100755 --- a/configure +++ b/configure

[PATCH v7 18/20] fuzz: add virtio-net fuzz target

2020-01-19 Thread Bulekov, Alexander
The virtio-net fuzz target feeds inputs to all three virtio-net virtqueues, and uses forking to avoid leaking state between fuzz runs. Signed-off-by: Alexander Bulekov --- tests/qtest/fuzz/Makefile.include | 1 + tests/qtest/fuzz/virtio_net_fuzz.c | 190 + 2 files

[PATCH v7 07/20] qtest: add in-process incoming command handler

2020-01-19 Thread Bulekov, Alexander
The handler allows a qtest client to send commands to the server by directly calling a function, rather than using a file/CharBackend Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- include/sysemu/qtest.h | 1 + qtest.c| 13 + 2 files changed, 14 i

Re: [PATCH v3] ui: Print available display backends with '-display help'

2020-01-19 Thread Thomas Huth
On 20/01/2020 01.01, Philippe Mathieu-Daudé wrote: > Hi Thomas, > > On 1/8/20 3:47 PM, Thomas Huth wrote: >> We already print availabled devices with "-device help", or available >> backends with "-netdev help" or "-chardev help". Let's provide a way >> for the users to query the available display

[PATCH v7 14/20] fuzz: add support for qos-assisted fuzz targets

2020-01-19 Thread Bulekov, Alexander
Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- tests/qtest/fuzz/Makefile.include | 2 + tests/qtest/fuzz/qos_fuzz.c | 229 ++ tests/qtest/fuzz/qos_fuzz.h | 33 + 3 files changed, 264 insertions(+) create mode 100644 tests/qtest/f

[PATCH v7 13/20] fuzz: support for fork-based fuzzing.

2020-01-19 Thread Bulekov, Alexander
fork() is a simple way to ensure that state does not leak in between fuzzing runs. Unfortunately, the fuzzer mutation engine relies on bitmaps which contain coverage information for each fuzzing run, and these bitmaps should be copied from the child to the parent(where the mutation occurs). These b

[PATCH v7 05/20] libqtest: add a layer of abstraction to send/recv

2020-01-19 Thread Bulekov, Alexander
This makes it simple to swap the transport functions for qtest commands to and from the qtest client. For example, now it is possible to directly pass qtest commands to a server handler that exists within the same process, without the standard way of writing to a file descriptor. Signed-off-by: Al

[PATCH v7 10/20] libqos: move useful qos-test funcs to qos_external

2020-01-19 Thread Bulekov, Alexander
The moved functions are not specific to qos-test and might be useful elsewhere. For example the virtual-device fuzzer makes use of them for qos-assisted fuzz-targets. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- tests/qtest/Makefile.incl

[PATCH v7 11/20] fuzz: add fuzzer skeleton

2020-01-19 Thread Bulekov, Alexander
tests/fuzz/fuzz.c serves as the entry point for the virtual-device fuzzer. Namely, libfuzzer invokes the LLVMFuzzerInitialize and LLVMFuzzerTestOneInput functions, both of which are defined in this file. This change adds a "FuzzTarget" struct, along with the fuzz_add_target function, which should b

[PATCH v7 19/20] fuzz: add virtio-scsi fuzz target

2020-01-19 Thread Bulekov, Alexander
The virtio-scsi fuzz target sets up and fuzzes the available virtio-scsi queues. After an element is placed on a queue, the fuzzer can select whether to perform a kick, or continue adding elements. Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- tests/qtest/fuzz/Makefile.inclu

[PATCH v7 06/20] libqtest: make bufwrite rely on the TransportOps

2020-01-19 Thread Bulekov, Alexander
When using qtest "in-process" communication, qtest_sendf directly calls a function in the server (qtest.c). Previously, bufwrite used socket_send, which bypasses the TransportOps enabling the call into qtest.c. This change replaces the socket_send calls with ops->send, maintaining the benefits of t

[PATCH v7 10/20] libqtest: make bufwrite rely on the TransportOps

2020-01-19 Thread Bulekov, Alexander
When using qtest "in-process" communication, qtest_sendf directly calls a function in the server (qtest.c). Previously, bufwrite used socket_send, which bypasses the TransportOps enabling the call into qtest.c. This change replaces the socket_send calls with ops->send, maintaining the benefits of t

[PATCH v7 08/20] libqos: rename i2c_send and i2c_recv

2020-01-19 Thread Bulekov, Alexander
The names i2c_send and i2c_recv collide with functions defined in hw/i2c/core.c. This causes an error when linking against libqos and softmmu simultaneously (for example when using qtest inproc). Rename the libqos functions to avoid this. Signed-off-by: Alexander Bulekov Acked-by: Thomas Huth Re

[PATCH v7 15/20] fuzz: add target/fuzz makefile rules

2020-01-19 Thread Bulekov, Alexander
Signed-off-by: Alexander Bulekov Reviewed-by: Darren Kenny Reviewed-by: Stefan Hajnoczi --- Makefile| 15 ++- Makefile.objs | 2 +- Makefile.target | 16 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e6de7a47bb.

[PATCH v7 03/20] fuzz: add FUZZ_TARGET module type

2020-01-19 Thread Bulekov, Alexander
Signed-off-by: Alexander Bulekov Reviewed-by: Stefan Hajnoczi --- include/qemu/module.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index 65ba596e46..684753d808 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h

[PATCH v7 02/20] module: check module wasn't already initialized

2020-01-19 Thread Bulekov, Alexander
The virtual-device fuzzer must initialize QOM, prior to running vl:qemu_init, so that it can use the qos_graph to identify the arguments required to initialize a guest for libqos-assisted fuzzing. This change prevents errors when vl:qemu_init tries to (re)initialize the previously initialized QOM m

[PATCH v7 06/20] module: check module wasn't already initialized

2020-01-19 Thread Bulekov, Alexander
The virtual-device fuzzer must initialize QOM, prior to running vl:qemu_init, so that it can use the qos_graph to identify the arguments required to initialize a guest for libqos-assisted fuzzing. This change prevents errors when vl:qemu_init tries to (re)initialize the previously initialized QOM m

[PATCH v7 08/20] libqos: split qos-test and libqos makefile vars

2020-01-19 Thread Bulekov, Alexander
Most qos-related objects were specified in the qos-test-obj-y variable. qos-test-obj-y also included qos-test.o which defines a main(). This made it difficult to repurpose qos-test-obj-y to link anything beside tests/qos-test against libqos. This change separates objects that are libqos-specific an

[PATCH v7 01/20] softmmu: split off vl.c:main() into main.c

2020-01-19 Thread Bulekov, Alexander
A program might rely on functions implemented in vl.c, but implement its own main(). By placing main into a separate source file, there are no complaints about duplicate main()s when linking against vl.o. For example, the virtual-device fuzzer uses a main() provided by libfuzzer, and needs to perfo

[PATCH v7 00/20] Add virtual device fuzzing support

2020-01-19 Thread Bulekov, Alexander
This series adds a framework for coverage-guided fuzzing of virtual-devices. Fuzzing targets are based on qtest and can make use of the libqos abstractions. This version mostly contains cleanup with some changes to the virtio-net fuzzer. V7: * virtio-net: add virtio-net-check-used which waits fo

[PATCH v7 04/20] qtest: add qtest_server_send abstraction

2020-01-19 Thread Bulekov, Alexander
qtest_server_send is a function pointer specifying the handler used to transmit data to the qtest client. In the standard configuration, this calls the CharBackend handler, but now it is possible for other types of handlers, e.g direct-function calls if the qtest client and server exist within the

[PATCH v7 02/20] libqos: rename i2c_send and i2c_recv

2020-01-19 Thread Bulekov, Alexander
The names i2c_send and i2c_recv collide with functions defined in hw/i2c/core.c. This causes an error when linking against libqos and softmmu simultaneously (for example when using qtest inproc). Rename the libqos functions to avoid this. Signed-off-by: Alexander Bulekov Acked-by: Thomas Huth Re

Re: [PATCH v3 1/2] MAINTAINERS: Add missing m48t59 files to the PReP section

2020-01-19 Thread Thomas Huth
On 17/01/2020 17.58, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > --- > MAINTAINERS | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 4b425d030d..c162145bd0 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1084,6 +1084,8 @

Re: [PATCH v3 1/2] MAINTAINERS: Add missing m48t59 files to the PReP section

2020-01-19 Thread Thomas Huth
On 17/01/2020 17.58, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > --- > MAINTAINERS | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index 4b425d030d..c162145bd0 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1084,6 +1084,8 @

[Qemu-devel] Xenial in Travis (was: qapi: Fix code generation with Python 3.5)

2020-01-19 Thread Thomas Huth
On 18/01/2020 09.29, Philippe Mathieu-Daudé wrote: [...] > This broke 29 of the 32 Travis jobs we have: > > https://travis-ci.org/qemu/qemu/builds/637999366 > > Since we started to use Travis CI, it catched quite some bugs... > > I think it is important to add in the equation we also depend of o

Re: [PATCH v3 0/8] hw/avr: Introduce the Arduino boards

2020-01-19 Thread Michael Rolnik
Sure, no problem. On Mon, Jan 20, 2020 at 12:50 AM Philippe Mathieu-Daudé wrote: > Hi Michael, > > On 12/30/19 7:17 PM, Michael Rolnik wrote: > > Hi Philippe. > > > > Thank you for joining the effort. > > Could you test this series? > > Are you OK if we use the Arduino machines it introduces to

Re: [PATCH v2 5/6] hw/core: Restrict reset handlers API to system-mode

2020-01-19 Thread Thomas Huth
On 18/01/2020 15.06, Philippe Mathieu-Daudé wrote: > The user-mode code does not use this API, restrict it > to the system-mode. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/core/Makefile.objs | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/core/Makefile.ob

[Bug 1853083] Re: qemu ppc64 4.0 boot AIX5.1 hung

2020-01-19 Thread Launchpad Bug Tracker
[Expired for QEMU because there has been no activity for 60 days.] ** Changed in: qemu Status: Incomplete => Expired -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1853083 Title: qemu ppc64

Re: [PATCH V4 0/5] Introduce Advanced Watch Dog module

2020-01-19 Thread Jason Wang
On 2020/1/19 下午5:10, Zhang, Chen wrote: Hi~ Anyone have comments about this module? Hi Chen: I will take a look at this series. Two general questions: - if it can detect more than network stall, it should not belong to /net - need to convince libvirt guys for this proposal, since usually

Re: [PATCH v6 3/3] target/ppc: support single stepping with KVM HV

2020-01-19 Thread David Gibson
On Fri, Jan 10, 2020 at 12:13:44PM -0300, Fabiano Rosas wrote: > The hardware singlestep mechanism in POWER works via a Trace Interrupt > (0xd00) that happens after any instruction executes, whenever MSR_SE = > 1 (PowerISA Section 6.5.15 - Trace Interrupt). > > However, with kvm_hv, the Trace Inte

[PATCH v3 2/2] hw/arm: Use helper function to trigger hotplug handler plug

2020-01-19 Thread Keqian Zhu
We can use existing helper function to trigger hotplug handler plug, which makes code clearer. Reviewed-by: Igor Mammedov Signed-off-by: Keqian Zhu --- hw/arm/virt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 39ab5f47e0..656b008

[PATCH v3 1/2] hw/acpi: Remove extra indent in ACPI GED hotplug cb

2020-01-19 Thread Keqian Zhu
There is extra indent in ACPI GED hotplug cb that should be deleted. Reviewed-by: Igor Mammedov Signed-off-by: Keqian Zhu --- hw/acpi/generic_event_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c index

[PATCH v3 0/2] Adjust some codes about memory hotplug

2020-01-19 Thread Keqian Zhu
This removes extra indent and makes some code refactor related to memory hotplug. Changelog: v2 -> v3 - Addressed Peter's comments. v1 -> v2 - Add Igor's R-b. Keqian Zhu (2): hw/acpi: Remove extra indent in ACPI GED hotplug cb hw/arm: Use helper function to trigger hotplug handler plug

Re: [PATCH v20 6/7] migration: Include migration support for machine check handling

2020-01-19 Thread David Gibson
On Fri, Jan 17, 2020 at 03:08:54PM +0530, Ganesh Goudar wrote: > From: Aravinda Prasad > > This patch includes migration support for machine check > handling. Especially this patch blocks VM migration > requests until the machine check error handling is > complete as these errors are specific to

Re: [PATCH v20 5/7] ppc: spapr: Handle "ibm,nmi-register" and "ibm,nmi-interlock" RTAS calls

2020-01-19 Thread David Gibson
On Fri, Jan 17, 2020 at 03:08:53PM +0530, Ganesh Goudar wrote: > From: Aravinda Prasad > > This patch adds support in QEMU to handle "ibm,nmi-register" > and "ibm,nmi-interlock" RTAS calls. > > The machine check notification address is saved when the > OS issues "ibm,nmi-register" RTAS call. >

Re: [PATCH v20 2/7] ppc: spapr: Introduce FWNMI capability

2020-01-19 Thread David Gibson
On Fri, Jan 17, 2020 at 03:08:50PM +0530, Ganesh Goudar wrote: > From: Aravinda Prasad > > Introduce fwnmi an spapr capability and add a helper function > which tries to enable it, which would be used by following patch > of the series. This patch by itself does not change the existing > behavior

Re: [PATCH 3/9] cputlb: Pass CPUTLBDescFast to tlb_n_entries and sizeof_tlb

2020-01-19 Thread Alistair Francis
On Thu, Jan 9, 2020 at 12:49 PM Richard Henderson wrote: > > We do not need the entire CPUArchState to compute these values. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > accel/tcg/cputlb.c | 15 --- > 1 file changed, 8 insertions(+), 7 delet

Re: [PATCH 2/9] cputlb: Make tlb_n_entries private to cputlb.c

2020-01-19 Thread Alistair Francis
On Thu, Jan 9, 2020 at 12:49 PM Richard Henderson wrote: > > There are no users of this function outside cputlb.c, > and its interface will change in the next patch. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > --- > include/exec/cpu_ldst.h | 5 - > accel

Re: [PATCH 1/9] cputlb: Merge tlb_table_flush_by_mmuidx into tlb_flush_one_mmuidx_locked

2020-01-19 Thread Alistair Francis
On Thu, Jan 9, 2020 at 12:49 PM Richard Henderson wrote: > > There is only one caller for tlb_table_flush_by_mmuidx. Place > the result at the earlier line number, due to an expected user > in the near future. > > Signed-off-by: Richard Henderson Reviewed-by: Alistair Francis Alistair > ---

Re: [Qemu-devel] [PATCH v4 3/7] target/riscv: Create function to test if FP is enabled

2020-01-19 Thread Alistair Francis
On Mon, Jan 6, 2020 at 2:59 AM Aurelien Jarno wrote: > > On 2020-01-05 17:36, Aurelien Jarno wrote: > > > diff --git a/target/riscv/csr.c b/target/riscv/csr.c > > > index e0d4586760..2789215b5e 100644 > > > --- a/target/riscv/csr.c > > > +++ b/target/riscv/csr.c > > > > [ snip ] > > > > > @@ -307,

Re: [PATCH v3] ui: Print available display backends with '-display help'

2020-01-19 Thread Philippe Mathieu-Daudé
Hi Thomas, On 1/8/20 3:47 PM, Thomas Huth wrote: > We already print availabled devices with "-device help", or available > backends with "-netdev help" or "-chardev help". Let's provide a way > for the users to query the available display backends, too. > > Reviewed-by: Philippe Mathieu-Daudé >

[PATCH v3 14/14] dp8393x: Don't stop reception upon RBE interrupt assertion

2020-01-19 Thread Finn Thain
Section 3.4.7 of the datasheet explains that, The RBE bit in the Interrupt Status register is set when the SONIC finishes using the second to last receive buffer and reads the last RRA descriptor. Actually, the SONIC is not truly out of resources, but gives the system an early warn

[PATCH v3 12/14] dp8393x: Always update RRA pointers and sequence numbers

2020-01-19 Thread Finn Thain
These operations have to take place regardless of whether or not rx descriptors have been used up (that is, EOL flag was observed). The algorithm is the now the same for a packet that was withheld as for a packet that was not. Signed-off-by: Finn Thain Tested-by: Laurent Vivier --- hw/net/dp83

[PATCH v3 01/14] dp8393x: Mask EOL bit from descriptor addresses

2020-01-19 Thread Finn Thain
The Least Significant bit of a descriptor address register is used as an EOL flag. It has to be masked when the register value is to be used as an actual address for copying memory around. But when the registers are to be updated the EOL bit should not be masked. Signed-off-by: Finn Thain Tested-

[PATCH v3 03/14] dp8393x: Clean up endianness hacks

2020-01-19 Thread Finn Thain
According to the datasheet, section 3.4.4, "in 32-bit mode ... the SONIC always writes long words". Therefore, use the same technique for the 'in_use' field that is used everywhere else, and write the full long word. Signed-off-by: Finn Thain Tested-by: Laurent Vivier --- Changed since v1: - U

[PATCH v3 08/14] dp8393x: Don't clobber packet checksum

2020-01-19 Thread Finn Thain
A received packet consumes pkt_size bytes in the buffer and the frame checksum that's appended to it consumes another 4 bytes. The Receive Buffer Address register takes the former quantity into account but not the latter. So the next packet written to the buffer overwrites the frame checksum. Fix t

[PATCH v3 10/14] dp8393x: Pad frames to word or long word boundary

2020-01-19 Thread Finn Thain
The existing code has a bug where the Remaining Buffer Word Count (RBWC) is calculated with a truncating division, which gives the wrong result for odd-sized packets. Section 1.4.1 of the datasheet says, Once the end of the packet has been reached, the serializer will fill out the last wo

[PATCH v3 06/14] dp8393x: Clear RRRA command register bit only when appropriate

2020-01-19 Thread Finn Thain
It doesn't make sense to clear the command register bit unless the command was actually issued. Signed-off-by: Finn Thain Reviewed-by: Philippe Mathieu-Daudé Tested-by: Laurent Vivier --- hw/net/dp8393x.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/net/dp8393x

[PATCH v3 04/14] dp8393x: Have dp8393x_receive() return the packet size

2020-01-19 Thread Finn Thain
This function re-uses its 'size' argument as a scratch variable. Instead, declare a local 'size' variable for that purpose so that the function result doesn't get messed up. Signed-off-by: Finn Thain Reviewed-by: Philippe Mathieu-Daudé Tested-by: Laurent Vivier --- hw/net/dp8393x.c | 9 +--

[PATCH v3 00/14] Fixes for DP8393X SONIC device emulation

2020-01-19 Thread Finn Thain
Hi All, There are bugs in the emulated dp8393x device that can stop packet reception in a Linux/m68k guest (q800 machine). With a Linux/mips guest (magnum machine), the driver fails to probe the dp8393x device. With a NetBSD/arc 5.1 guest (magnum machine), the bugs in the device can be fatal to

[PATCH v3 09/14] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode

2020-01-19 Thread Finn Thain
Section 3.4.1 of the datasheet says, The alignment of the RRA is confined to either word or long word boundaries, depending upon the data width mode. In 16-bit mode, the RRA must be aligned to a word boundary (A0 is always zero) and in 32-bit mode, the RRA is aligned to a long word

[PATCH v3 02/14] dp8393x: Always use 32-bit accesses

2020-01-19 Thread Finn Thain
The DP83932 and DP83934 have 32 data lines. The datasheet says, Data Bus: These bidirectional lines are used to transfer data on the system bus. When the SONIC is a bus master, 16-bit data is transferred on D15-D0 and 32-bit data is transferred on D31-D0. When the SONIC is accessed

[PATCH v3 05/14] dp8393x: Update LLFA and CRDA registers from rx descriptor

2020-01-19 Thread Finn Thain
Follow the algorithm given in the National Semiconductor DP83932C datasheet in section 3.4.7: At the next reception, the SONIC re-reads the last RXpkt.link field, and updates its CRDA register to point to the next descriptor. The chip is designed to allow the host to provide a new list of

[PATCH v3 11/14] dp8393x: Clear descriptor in_use field to release packet

2020-01-19 Thread Finn Thain
When the SONIC receives a packet into the last available descriptor, it retains ownership of that descriptor for as long as necessary. Section 3.4.7 of the datasheet says, When the system appends more descriptors, the SONIC releases ownership of the descriptor after writing h to the R

[PATCH v3 13/14] dp8393x: Don't reset Silicon Revision register

2020-01-19 Thread Finn Thain
The jazzsonic driver in Linux uses the Silicon Revision register value to probe the chip. The driver fails unless the SR register contains 4. Unfortunately, reading this register in QEMU usually returns 0 because the s->regs[] array gets wiped after a software reset. Fixes: bd8f1ebce4 ("net/dp8393

[PATCH v3 07/14] dp8393x: Implement packet size limit and RBAE interrupt

2020-01-19 Thread Finn Thain
Add a bounds check to prevent a large packet from causing a buffer overflow. This is defensive programming -- I haven't actually tried sending an oversized packet or a jumbo ethernet frame. The SONIC handles packets that are too big for the buffer by raising the RBAE interrupt and dropping them. L

Re: [PATCH v3 0/8] hw/avr: Introduce the Arduino boards

2020-01-19 Thread Philippe Mathieu-Daudé
Hi Michael, On 12/30/19 7:17 PM, Michael Rolnik wrote: > Hi Philippe. > > Thank you for joining the effort. Could you test this series? Are you OK if we use the Arduino machines it introduces to replace your 'sample' board? > Regards, > Michael Rolnik > > > On Mon, Dec 30, 2019 at 12:45 AM P

[Bug 1860053] Re: Possible lack of precision when calling clock_gettime via vDSO on user mode ppc64le

2020-01-19 Thread Patrick Meiring
Thank you Fabiano for investigating. It seems the golang side agrees with your analysis: https://github.com/golang/go/issues/36592 I have marked this bug invalid for now. Thank you for your help. Regards, Patrick ** Bug watch added: github.com/golang/go/issues #36592 https://github.com/golan

[Bug 1860053] Re: Possible lack of precision when calling clock_gettime via vDSO on user mode ppc64le

2020-01-19 Thread Patrick Meiring
** Changed in: qemu Status: New => Invalid -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1860053 Title: Possible lack of precision when calling clock_gettime via vDSO on user mode ppc64le

Re: [PATCH v4 16/20] tests/boot_linux_console: Add a SLOW test booting Ubuntu on OrangePi PC

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: > From: Philippe Mathieu-Daudé > > This test boots Ubuntu Bionic on a OrangePi PC board. > > As it requires 1GB of storage, and is slow, this test is disabled > on automatic CI testing. > > It is useful for workstation testing. Currently Avocado timeou

Re: [PATCH v4 10/20] hw/arm/allwinner-h3: add Boot ROM support

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: A real Allwinner H3 SoC contains a Boot ROM which is the first code that runs right after the SoC is powered on. The Boot ROM is responsible for loading user code (e.g. a bootloader) from any of the supported external devices and writing the downloaded c

Re: [PATCH 6/6] hw/arm/exynos4210: Connect serial port DMA busy signals with pl330

2020-01-19 Thread Guenter Roeck
On 1/19/20 11:01 AM, Peter Maydell wrote: On Sun, 19 Jan 2020 at 01:52, Guenter Roeck wrote: I'd rather try to fix it all if I am at it; otherwise it feels kind of incomplete. Would you be ok with addressing this separately after the current patch series is accepted ? Absolutely, if you'd lik

Re: [PATCH v4 08/20] hw/arm/allwinner: add SD/MMC host controller

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Allwinner System on Chip families sun4i and above contain an integrated storage controller for Secure Digital (SD) and Multi Media Card (MMC) interfaces. This commit adds support for the Allwinner SD/MMC storage controller with the following emulated

Re: [PATCH 6/6] hw/arm/exynos4210: Connect serial port DMA busy signals with pl330

2020-01-19 Thread Peter Maydell
On Sun, 19 Jan 2020 at 01:52, Guenter Roeck wrote: > I'd rather try to fix it all if I am at it; otherwise it feels kind > of incomplete. Would you be ok with addressing this separately after > the current patch series is accepted ? Absolutely, if you'd like to clean up the code please feel free.

Re: [PATCH v4 07/20] hw/arm/allwinner: add Security Identifier device

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Security Identifier device found in various Allwinner System on Chip designs gives applications a per-board unique identifier. This commit adds support for the Allwinner Security Identifier using a 128-bit UUID value as input. Signed-off-by: Niek Li

Re: [PATCH v4 06/20] hw/arm/allwinner: add CPU Configuration module

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: Various Allwinner System on Chip designs contain multiple processors that can be configured and reset using the generic CPU Configuration module interface. This commit adds support for the Allwinner CPU configuration interface which emulates the followin

Re: [PATCH v4 05/20] hw/arm/allwinner-h3: add System Control module

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Allwinner H3 System on Chip has an System Control module that provides system wide generic controls and device information. This commit adds support for the Allwinner H3 System Control module. Signed-off-by: Niek Linnenbank --- include/hw/arm/all

Re: [PATCH v4 04/20] hw/arm/allwinner-h3: add USB host controller

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 7:37 PM, Philippe Mathieu-Daudé wrote: On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Allwinner H3 System on Chip contains multiple USB 2.0 bus connections which provide software access using the Enhanced Host Controller Interface (EHCI) and Open Host Controller Interface (OHCI) inter

Re: [PATCH v4 04/20] hw/arm/allwinner-h3: add USB host controller

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Allwinner H3 System on Chip contains multiple USB 2.0 bus connections which provide software access using the Enhanced Host Controller Interface (EHCI) and Open Host Controller Interface (OHCI) interfaces. This commit adds support for both interfaces

Re: [PATCH v4 03/20] hw/arm/allwinner-h3: add Clock Control Unit

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Clock Control Unit is responsible for clock signal generation, configuration and distribution in the Allwinner H3 System on Chip. This commit adds support for the Clock Control Unit which emulates a simple read/write register interface. Signed-off-b

Re: [PATCH v4 02/20] hw/arm: add Xunlong Orange Pi PC machine

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Xunlong Orange Pi PC is an Allwinner H3 System on Chip based embedded computer with mainline support in both U-Boot and Linux. The board comes with a Quad Core Cortex A7 @ 1.3GHz, 1GiB RAM, 100Mbit ethernet, USB, SD/MMC, USB, HDMI and various other I

Re: [PATCH v4 01/20] hw/arm: add Allwinner H3 System-on-Chip

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:50 AM, Niek Linnenbank wrote: The Allwinner H3 is a System on Chip containing four ARM Cortex A7 processor cores. Features and specifications include DDR2/DDR3 memory, SD/MMC storage cards, 10/100/1000Mbit Ethernet, USB 2.0, HDMI and various I/O modules. This commit adds support for

Re: [PATCH v5 4/6] hppa: add emulation of LASI PS2 controllers

2020-01-19 Thread Sven Schnelle
On Fri, Jan 03, 2020 at 07:15:49AM +0100, Philippe Mathieu-Daudé wrote: > On 12/20/19 10:15 PM, Sven Schnelle wrote: > > Signed-off-by: Sven Schnelle > > --- > > hw/hppa/Kconfig| 1 + > > hw/hppa/lasi.c | 10 +- > > hw/input/Kconfig | 3 + > > hw/input/M

[PATCH] riscv: Fix defination of csr operations

2020-01-19 Thread jiangzhiying
From: Ian Jiang There is a mistake in defining CSR operations for pmpcfg registers. This patch fixes the bug. Signed-off-by: Ian Jiang --- target/riscv/csr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index da02f9f0b1..e07b5267be

[PATCH] hw/intc/arm_gicv3_kvm: Stop wrongly programming GICR_PENDBASER.PTZ bit

2020-01-19 Thread Zenghui Yu
If LPIs are disabled, KVM will just ignore the GICR_PENDBASER.PTZ bit when restoring GICR_CTLR. Setting PTZ here makes littlt sense in "reduce GIC initialization time". And what's worse, PTZ is generally programmed by guest to indicate to the Redistributor whether the LPI Pending table is zero wh

Re: [PATCH v4 00/20] Add Allwinner H3 SoC and Orange Pi PC Machine

2020-01-19 Thread Niek Linnenbank
On Sun, Jan 19, 2020, 01:51 Niek Linnenbank wrote: > Dear QEMU developers, > > Hereby I would like to contribute the following set of patches to QEMU > which add support for the Allwinner H3 System on Chip and the > Orange Pi PC machine. The following features and devices are supported: > > * SM

Re: [Qemu-devel] What should a virtual board emulate?

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/18/20 9:46 PM, Paolo Bonzini wrote: > On 04/01/20 22:16, Philippe Mathieu-Daudé wrote: >> 1/ the Radeon chip is soldered on the motherboard, >> >> 2/ the default BIOS expects the Radeon chip to be >>    unconditionally present, >> >> I insist this patch is incorrect for the particular case of

Re: [PATCH] qapi: Fix code generation with Python 3.5

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/18/20 9:33 AM, Philippe Mathieu-Daudé wrote: > On 1/17/20 11:49 AM, Markus Armbruster wrote: >> Thomas Huth writes: >> >>> On 16/01/2020 21.25, Markus Armbruster wrote: Recent commit 3e7fb5811b "qapi: Fix code generation for empty modules" modules" switched QAPISchema.visit() from >

Re: [PATCH 4/4] .travis.yml: Allow untrusted code and large files

2020-01-19 Thread Philippe Mathieu-Daudé
On 1/19/20 1:28 AM, Niek Linnenbank wrote: > Hi Philippe, > > For some reason, I can't apply this patch with git am: > > Applying: .travis.yml: Allow untrusted code and large files > error: patch failed: .travis.yml:260 > error: .travis.yml: patch does not apply > Patch failed at 0001 .travis.yml

Re: [PATCH v2] hw/arm: Adjust some coding styles about memory hotplug

2020-01-19 Thread zhukeqian
On 2020/1/17 19:07, Peter Maydell wrote: > On Fri, 17 Jan 2020 at 06:41, Keqian Zhu wrote: >> >> From: zhukeqian >> >> There is extra indent in ACPI GED plug cb. And we can use >> existing helper function to trigger hotplug handler plug. >> >> Reviewed-by: Igor Mammedov >> Signed-off-by: Keqia

RE: [PATCH V4 0/5] Introduce Advanced Watch Dog module

2020-01-19 Thread Zhang, Chen
Hi~ Anyone have comments about this module? We have some clients already try to use this module with COLO. Please review this part. If no one want to maintain this module, I can maintain this module myself. Thanks Zhang Chen > -Original Message- > From: Qemu-devel bounces+chen.zhang=in

RE: util/async: File descriptor leak in aio_context_unref()?

2020-01-19 Thread Tuguoyi
OK, I got it, it will be released in aio_ctx_finalize(). Please ignore this mail. > -Original Message- > From: tuguoyi (Cloud) > Sent: Sunday, January 19, 2020 4:15 PM > To: 'Stefan Hajnoczi' ; 'Fam Zheng' > ; 'qemu-bl...@nongnu.org' > Cc: 'qemu-devel@nongnu.org' ; changlimin (Cloud) > ;

Re: [PATCH 0/4] tests/boot_linux_console: Test booting NetBSD via U-Boot on OrangePi PC

2020-01-19 Thread Kamil Rytarowski
Thank you for improving testing of the NetBSD target. On 18.01.2020 20:16, Philippe Mathieu-Daudé wrote: > This series add a test on the OrangePi PC for: > - SD Card booting > - U-boot & UART > - NetBSD 9 > > I simply followed Niek description in docs/orangepi.rst: > https://www.mail-archive.com/

Re: [PATCH 105/104] virtiofsd: Unref old/new inodes with the same mutex lock in lo_rename()

2020-01-19 Thread Xiao Yang
On 2020/1/17 21:32, Philippe Mathieu-Daudé wrote: We can unref both old/new inodes with the same mutex lock. Signed-off-by: Philippe Mathieu-Daudé --- Based-on:<20191212163904.159893-1-dgilb...@redhat.com> "virtiofs daemon" https://www.mail-archive.com/qemu-devel@nongnu.org/msg664652.html too

Re: [PATCH v22 9/9] MAINTAINERS: Add ACPI/HEST/GHES entries

2020-01-19 Thread gengdongjiu
On 2020/1/17 19:22, Philippe Mathieu-Daudé wrote: > On 1/17/20 12:09 PM, Peter Maydell wrote: >> On Fri, 17 Jan 2020 at 07:22, Philippe Mathieu-Daudé >> wrote: >>> >>> Hi Peter, >>> >>> On 1/16/20 5:46 PM, Peter Maydell wrote: On Wed, 8 Jan 2020 at 11:32, Dongjiu Geng wrote: > > I a

util/async: File descriptor leak in aio_context_unref()?

2020-01-19 Thread Tuguoyi
In aio_context_new(), the @notifier variable will be initialized, but it don't get cleaned up in aio_context_unref() when reference count reaches to 0, it will cause file descriptor leak. -- Best regards, Guoyi

Re: [BUG qemu 4.0] segfault when unplugging virtio-blk-pci device

2020-01-19 Thread Eryu Guan
On Tue, Jan 14, 2020 at 04:16:24PM +, Stefan Hajnoczi wrote: > On Tue, Jan 14, 2020 at 10:50:58AM +0800, Eryu Guan wrote: > > On Mon, Jan 13, 2020 at 04:38:55PM +, Stefan Hajnoczi wrote: > > > On Thu, Jan 09, 2020 at 12:58:06PM +0800, Eryu Guan wrote: > > > > On Tue, Jan 07, 2020 at 03:01:0

Re: [PATCH 040/104] virtiofsd: Pass write iov's all the way through

2020-01-19 Thread Xiao Yang
On 2019/12/13 0:38, Dr. David Alan Gilbert (git) wrote: From: "Dr. David Alan Gilbert" Pass the write iov pointing to guest RAM all the way through rather than copying the data. Signed-off-by: Dr. David Alan Gilbert --- tools/virtiofsd/fuse_virtio.c | 79 ---

  1   2   >