Re: [PATCH v3] spapr: Fail CAS if option vector table cannot be parsed

2020-01-18 Thread David Gibson
On Fri, Jan 17, 2020 at 10:15:52AM +0100, Greg Kurz wrote: > Most of the option vector helpers have assertions to check their > arguments aren't null. The guest can provide an arbitrary address > for the CAS structure that would result in such null arguments. > Fail CAS with H_PARAMETER and print a

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

2020-01-18 Thread Guenter Roeck
On 1/18/20 12:02 PM, Peter Maydell wrote: On Sat, 18 Jan 2020 at 15:08, Guenter Roeck wrote: Do only the pointers have to be in Exynos4210State, or the entire data structures ? In the armsse code it looks like it is the complete data structures. Either works. Embedding the entire data structu

RE: [PATCH RFC 12/12] migration/rdma: only register the virt-ram block for MultiRDMA

2020-01-18 Thread fengzhimin
OK, I will modify it. Due to the mach-virt.ram is sent by the multiRDMA channels instead of the main channel, it don't to register on the main channel. It takes a long time to register the mach-virt.ram for VM with large capacity memory, so we shall try our best not to register it. Thanks for y

[PATCH] riscv: Fix defination of csr operations

2020-01-18 Thread 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 100644 --- a/targ

[PATCH v4 19/20] tests/boot_linux_console: Test booting NetBSD via U-Boot on OrangePi PC

2020-01-18 Thread Niek Linnenbank
From: Philippe Mathieu-Daudé This test boots U-Boot then NetBSD (stored on a SD card) on a OrangePi PC board. As it requires ~1.3GB of storage, it is disabled by default. U-Boot is built by the Debian project [1], and the SD card image is provided by the NetBSD organization [2]. Once the compr

[PATCH v4 09/20] hw/arm/allwinner-h3: add EMAC ethernet device

2020-01-18 Thread Niek Linnenbank
The Allwinner Sun8i System on Chip family includes an Ethernet MAC (EMAC) which provides 10M/100M/1000M Ethernet connectivity. This commit adds support for the Allwinner EMAC from the Sun8i family (H2+, H3, A33, etc), including emulation for the following functionality: * DMA transfers * MII int

[PATCH v4 18/20] Acceptance tests: Add interrupt_interactive_console_until_pattern()

2020-01-18 Thread Niek Linnenbank
From: Philippe Mathieu-Daudé We need a function to interrupt interactive consoles. Example: Interrupt U-Boot to set different environment values. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Niek Linnenbank Signed-off-by: Niek Linnenbank --- tests/acceptance/avocado_qemu/__init__.py | 3

[PATCH v4 17/20] Acceptance tests: Extract _console_interaction()

2020-01-18 Thread Niek Linnenbank
From: Philippe Mathieu-Daudé Since we are going to re-use the code shared between wait_for_console_pattern() and exec_command_and_wait_for_pattern(), extract the common part into a local function. Signed-off-by: Philippe Mathieu-Daudé Tested-by: Niek Linnenbank Signed-off-by: Niek Linnenbank

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

2020-01-18 Thread Niek Linnenbank
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 features: * DMA transfers * Direct FIFO I

[PATCH v4 12/20] hw/arm/allwinner: add RTC device support

2020-01-18 Thread Niek Linnenbank
Allwinner System-on-Chips usually contain a Real Time Clock (RTC) for non-volatile system date and time keeping. This commit adds a generic Allwinner RTC device that supports the RTC devices found in Allwinner SoC family sun4i (A10), sun7i (A20) and sun6i and newer (A31, H2+, H3, etc). The followin

[PATCH v4 11/20] hw/arm/allwinner-h3: add SDRAM controller device

2020-01-18 Thread Niek Linnenbank
In the Allwinner H3 SoC the SDRAM controller is responsible for interfacing with the external Synchronous Dynamic Random Access Memory (SDRAM). Types of memory that the SDRAM controller supports are DDR2/DDR3 and capacities of up to 2GiB. This commit adds emulation support of the Allwinner H3 SDRAM

[PATCH v4 15/20] tests/boot_linux_console: Add a SD card test for the OrangePi PC board

2020-01-18 Thread Niek Linnenbank
From: Philippe Mathieu-Daudé The kernel image and DeviceTree blob are built by the Armbian project (based on Debian): https://www.armbian.com/orange-pi-pc/ The SD image is from the kernelci.org project: https://kernelci.org/faq/#the-code If ARM is a target being built, "make check-acceptance" w

[PATCH v4 14/20] tests/boot_linux_console: Add initrd test for the Orange Pi PC board

2020-01-18 Thread Niek Linnenbank
From: Philippe Mathieu-Daudé This test boots a Linux kernel on a OrangePi PC board and verify the serial output is working. The kernel image and DeviceTree blob are built by the Armbian project (based on Debian): https://www.armbian.com/orange-pi-pc/ The cpio image used comes from the linux-bui

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

2020-01-18 Thread Niek Linnenbank
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 timeouts too quickly, so we can't run userland commands. The ker

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

2020-01-18 Thread Niek Linnenbank
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 code to internal SRAM. After loading the SoC b

[PATCH v4 13/20] tests/boot_linux_console: Add a quick test for the OrangePi PC board

2020-01-18 Thread Niek Linnenbank
From: Philippe Mathieu-Daudé This test boots a Linux kernel on a OrangePi PC board and verify the serial output is working. The kernel image and DeviceTree blob are built by the Armbian project (based on Debian): https://www.armbian.com/orange-pi-pc/ If ARM is a target being built, "make check-

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

2020-01-18 Thread Niek Linnenbank
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 Linnenbank --- include/hw/arm/allwinner-h3.h

[PATCH v4 20/20] docs: add Orange Pi PC document

2020-01-18 Thread Niek Linnenbank
The Xunlong Orange Pi PC machine is a functional ARM machine based on the Allwinner H3 System-on-Chip. It supports mainline Linux, U-Boot, NetBSD and is covered by acceptance tests. This commit adds a documentation text file with a description of the machine and instructions for the user. Signed-

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

2020-01-18 Thread Niek Linnenbank
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 following features: * CPU reset * CPU status Sign

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

2020-01-18 Thread Niek Linnenbank
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/allwinner-h3.h | 3 + include/hw/misc/

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

2020-01-18 Thread Niek Linnenbank
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/O. This commit add support for the Xunlong O

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

2020-01-18 Thread Niek Linnenbank
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 in the Allwinner H3 System on Chip. Signed-

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

2020-01-18 Thread Niek Linnenbank
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 the Allwinner H3 System on Chip. Signed-off-

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

2020-01-18 Thread Niek Linnenbank
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: * SMP (Quad Core Cortex A7) * Generic Interrupt Controller configura

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

2020-01-18 Thread Niek Linnenbank
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-by: Niek Linnenbank --- include/hw/arm/allwi

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

2020-01-18 Thread Niek Linnenbank
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: Allow untrusted code and large files Use 'git am --show-c

Re: [PATCH 2/4] Acceptance tests: Add interrupt_interactive_console_until_pattern()

2020-01-18 Thread Niek Linnenbank
On Sat, Jan 18, 2020 at 8:16 PM Philippe Mathieu-Daudé wrote: > We need a function to interrupt interactive consoles. > > Example: Interrupt U-Boot to set different environment values. > > Signed-off-by: Philippe Mathieu-Daudé > Tested-by: Niek Linnenbank > --- > tests/acceptance/avocado_qemu

Re: [PATCH 1/4] Acceptance tests: Extract _console_interaction()

2020-01-18 Thread Niek Linnenbank
On Sat, Jan 18, 2020 at 8:16 PM Philippe Mathieu-Daudé wrote: > Since we are going to re-use the code shared between > wait_for_console_pattern() and exec_command_and_wait_for_pattern(), > extract the common part into a local function. > > Signed-off-by: Philippe Mathieu-Daudé > Tested-by: Niek

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

2020-01-18 Thread Niek Linnenbank
Hi Philippe, On Sat, Jan 18, 2020 at 8:16 PM Philippe Mathieu-Daudé wrote: > This test boots U-Boot then NetBSD (stored on a SD card) on > a OrangePi PC board. > > As it requires ~1.3GB of storage, it is disabled by default. > > U-Boot is built by the Debian project [1], and the SD card image >

Re: Commit 3e7fb5811b or something in that series breaks build?

2020-01-18 Thread BALATON Zoltan
On Sun, 19 Jan 2020, BALATON Zoltan wrote: On Sat, 18 Jan 2020, Peter Maydell wrote: On Sat, 18 Jan 2020 at 22:41, BALATON Zoltan wrote: I'm getting errors about missing headers in qapi/* and build fails on current master. I've tried bisecting it which lead to commit 3e7fb5811b where I get:

Re: Commit 3e7fb5811b or something in that series breaks build?

2020-01-18 Thread BALATON Zoltan
On Sat, 18 Jan 2020, Peter Maydell wrote: On Sat, 18 Jan 2020 at 22:41, BALATON Zoltan wrote: I'm getting errors about missing headers in qapi/* and build fails on current master. I've tried bisecting it which lead to commit 3e7fb5811b where I get: CC qapi/qapi-types-audio.o cc: error

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

2020-01-18 Thread Niek Linnenbank
Hi Philippe, On Sat, Jan 18, 2020 at 4:37 PM Philippe Mathieu-Daudé wrote: > Hi Niek, > > On 1/13/20 8:18 PM, Niek Linnenbank wrote: > > Hi, > > > > Just a friendly reminder for review of this patch and the others in this > > series > > that don't yet have a reviewed-by tag :-) > > You are right

Re: Commit 3e7fb5811b or something in that series breaks build?

2020-01-18 Thread Peter Maydell
On Sat, 18 Jan 2020 at 22:41, BALATON Zoltan wrote: > I'm getting errors about missing headers in qapi/* and build fails on > current master. > > I've tried bisecting it which lead to commit 3e7fb5811b where I get: > >CC qapi/qapi-types-audio.o > cc: error: qapi/qapi-types-audio.c: No suc

Re: [PATCH v3 13/17] tests/boot_linux_console: Add a quick test for the OrangePi PC board

2020-01-18 Thread Niek Linnenbank
On Sat, Jan 18, 2020 at 12:22 PM Philippe Mathieu-Daudé wrote: > On 1/8/20 9:00 PM, Niek Linnenbank wrote: > > From: Philippe Mathieu-Daudé > > > > This test boots a Linux kernel on a OrangePi PC board and verify > > the serial output is working. > > > > The kernel image and DeviceTree blob are

Re: [PATCH v3 12/17] hw/arm/allwinner: add RTC device support

2020-01-18 Thread Niek Linnenbank
Hi Philippe, On Sat, Jan 18, 2020 at 4:05 PM Philippe Mathieu-Daudé wrote: > Hi Niek, > > On 1/14/20 11:57 PM, Niek Linnenbank wrote: > > On Tue, Jan 14, 2020 at 11:52 PM Niek Linnenbank > > mailto:nieklinnenb...@gmail.com>> wrote: > > > > Hi Philippe, > > > > On Mon, Jan 13, 2020 at 11:

Commit 3e7fb5811b or something in that series breaks build?

2020-01-18 Thread BALATON Zoltan
Hello, I'm getting errors about missing headers in qapi/* and build fails on current master. I've tried bisecting it which lead to commit 3e7fb5811b where I get: CC qapi/qapi-types-audio.o cc: error: qapi/qapi-types-audio.c: No such file or directory cc: fatal error: no input files (T

Re: [PATCH v3 17/17] docs: add Orange Pi PC document

2020-01-18 Thread Niek Linnenbank
Hi Philippe, On Sat, Jan 18, 2020 at 10:38 AM Philippe Mathieu-Daudé wrote: > On 1/8/20 9:00 PM, Niek Linnenbank wrote: > > The Xunlong Orange Pi PC machine is a functional ARM machine > > based on the Allwinner H3 System-on-Chip. It supports mainline > > Linux, U-Boot, NetBSD and is covered by

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

2020-01-18 Thread Niek Linnenbank
On Sat, Jan 18, 2020 at 10:09 AM Philippe Mathieu-Daudé wrote: > On 1/15/20 12:10 AM, Niek Linnenbank wrote: > > On Tue, Jan 14, 2020 at 12:28 AM Philippe Mathieu-Daudé > > mailto:phi...@redhat.com>> wrote: > > > > On 1/8/20 9:00 PM, Niek Linnenbank wrote: > > > A real Allwinner H3 SoC c

Re: [PATCH v3 06/17] hw/arm/allwinner: add CPU Configuration module

2020-01-18 Thread Niek Linnenbank
On Sat, Jan 18, 2020 at 10:06 AM Philippe Mathieu-Daudé wrote: > On 1/15/20 12:04 AM, Niek Linnenbank wrote: > > On Tue, Jan 14, 2020 at 12:14 AM Philippe Mathieu-Daudé > > mailto:phi...@redhat.com>> wrote: > > > > On 1/8/20 9:00 PM, Niek Linnenbank wrote: > > > Various Allwinner System

Re: [PATCH] qom/object: Display more helpful message when an interface is missing

2020-01-18 Thread Paolo Bonzini
On 18/01/20 17:23, Philippe Mathieu-Daudé wrote: > When adding new devices implementing QOM interfaces, we might > forgot to add the Kconfig dependency that pulls the required > objects in when building. > > Since QOM dependencies are resolved at runtime, we don't get any > link-time failures, and

Re: [PATCH 2/2] pvpanic: implement crashloaded event handling

2020-01-18 Thread Paolo Bonzini
On 14/01/20 03:31, zhenwei pi wrote: > +# @info: information about a panic (since 2.9) Removed this "since 2.9" and queued both patches, thanks. Paolo

Re: [PATCH 1/2] pvpanic: introduce crashloaded for pvpanic

2020-01-18 Thread Paolo Bonzini
On 14/01/20 03:31, zhenwei pi wrote: > Add bit 1 for pvpanic. This bit means that guest hits a panic, but > guest wants to handle error by itself. Typical case: Linux guest runs > kdump in panic. It will help us to separate the abnormal reboot from > normal operation. > > Signed-off-by: zhenwei pi

Re: [RFC PATCH] qapi: Incorrect attempt to fix building with MC146818RTC=n

2020-01-18 Thread Paolo Bonzini
On 13/01/20 15:01, Markus Armbruster wrote: > Philippe Mathieu-Daudé writes: > >> When configured with --without-default-devices and setting >> MC146818RTC=n, the build fails: >> >> LINKx86_64-softmmu/qemu-system-x86_64 >> /usr/bin/ld: qapi/qapi-commands-misc-target.o: in function >> `

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

2020-01-18 Thread Paolo Bonzini
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 the > Fuloong2e board. I plan to revert it when

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

2020-01-18 Thread Peter Maydell
On Sat, 18 Jan 2020 at 15:08, Guenter Roeck wrote: > Do only the pointers have to be in Exynos4210State, or the entire > data structures ? In the armsse code it looks like it is the complete > data structures. Either works. Embedding the entire data structure is the more "modern" approach, but we

Re: [PATCH 0/6] Fix more GCC9 -O3 warnings

2020-01-18 Thread Paolo Bonzini
On 18/12/19 07:05, Markus Armbruster wrote: > "Chubb, Peter (Data61, Kensington NSW)" > writes: > >>> "Philippe" == Philippe Mathieu-Daudé writes: >> >> Philippe> Fix some trivial warnings when building with -O3. >> >> For compatibility with lint and other older checkers, it'd be good to kee

[PATCH v41 21/21] target/avr: Update MAINTAINERS file

2020-01-18 Thread Michael Rolnik
Include AVR maintaners in MAINTAINERS file Signed-off-by: Michael Rolnik --- MAINTAINERS | 21 + 1 file changed, 21 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 55d3642e6c..c70d77b1ae 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -163,6 +163,15 @@ S: Maintained

Re: [PATCH v3 0/2] cpu: Clarify overloading of reset QOM methods

2020-01-18 Thread Paolo Bonzini
On 16/12/19 16:01, Greg Kurz wrote: > Each cpu subclass overloads the reset method of its parent class with > its own. But since it needs to call the parent method as well, it keeps > a parent_reset pointer to do so. This causes the same not very explicit > boiler plate to be duplicated all around

[PATCH v41 19/21] target/avr: Add boot serial test

2020-01-18 Thread Michael Rolnik
Print out 'T' through serial port Signed-off-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Thomas Huth tests/Makefile.include --- tests/qtest/boot-serial-test.c | 10 ++ tests/qtest/Makefile.include | 2 ++ 2 files changed, 12 i

[PATCH v41 18/21] target/avr: Update build system

2020-01-18 Thread Michael Rolnik
Make AVR support buildable Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic --- configure | 7 +++ default-configs/avr-softmmu.mak | 5 + target/avr/Makefile.objs| 34 + 3 fi

[PATCH v41 16/21] target/avr: Register AVR support with the rest of QEMU

2020-01-18 Thread Michael Rolnik
Add AVR related definitions into QEMU Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic include/disas/dis-asm.h --- qapi/machine.json | 3 ++- include/disas/dis-asm.h| 19 +++ include/sysemu/arch_init.h | 1 + arch_

[PATCH v41 20/21] target/avr: Add Avocado test

2020-01-18 Thread Michael Rolnik
The test is based on https://github.com/seharris/qemu-avr-tests/tree/master/free-rtos/Demo demo which. If working correctly, prints 'ABCDEFGHIJKLMNOPQRSTUVWX' out. it also demostrates that timer and IRQ are working Signed-off-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Tested-by: Phil

[PATCH v41 11/21] hw/avr: Add limited support for USART peripheral

2020-01-18 Thread Michael Rolnik
These were designed to facilitate testing but should provide enough function to be useful in other contexts. Only a subset of the functions of each peripheral is implemented, mainly due to the lack of a standard way to handle electrical connections (like GPIO pins). Signed-off-by: Sarah Harris

[PATCH v41 15/21] target/avr: Add section about AVR into QEMU documentation

2020-01-18 Thread Michael Rolnik
Signed-off-by: Michael Rolnik --- qemu-doc.texi | 51 +++ 1 file changed, 51 insertions(+) diff --git a/qemu-doc.texi b/qemu-doc.texi index 39f950471f..515aacfae9 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -1741,6 +1741,7 @@ differences are

[PATCH v41 17/21] target/avr: Add machine none test

2020-01-18 Thread Michael Rolnik
Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé Reviewed-by: Aleksandar Markovic --- tests/qtest/machine-none-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/machine-none-test.c b/tests/qtest/machine-none-test.c index 5953d31755..3e5c74e73e 100644 --- a/te

[PATCH v41 13/21] hw/avr: Add dummy mask device

2020-01-18 Thread Michael Rolnik
This is a simple device of just one register, whenver this register is written it calls qemu_set_irq function for each of 8 bits/IRQs.. It is used to implement AVR Power Reduction Signed-off-by: Michael Rolnik --- include/hw/misc/avr_mask.h | 47 hw/misc/avr_mask.c | 11

[PATCH v41 07/21] target/avr: Add instruction translation - Bit and Bit-test Instructions

2020-01-18 Thread Michael Rolnik
This includes: - LSR, ROR - ASR - SWAP - SBI, CBI - BST, BLD - BSET, BCLR Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 241 + target/avr/insn.decode | 14 +++ 2 files changed, 255 in

[PATCH v41 10/21] target/avr: Add instruction disassembly function

2020-01-18 Thread Michael Rolnik
Provide function disassembles executed instruction when `-d in_asm` is provided Example: `./avr-softmmu/qemu-system-avr -bios free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf -d in_asm` will produce something like the following ``` ... IN: 0x014a: CALL 0x3808 IN: main 0x

[PATCH v41 12/21] hw/avr: Add limited support for 16 bit timer peripheral

2020-01-18 Thread Michael Rolnik
These were designed to facilitate testing but should provide enough function to be useful in other contexts. Only a subset of the functions of each peripheral is implemented, mainly due to the lack of a standard way to handle electrical connections (like GPIO pins). Signed-off-by: Sarah Harris

[PATCH v41 05/21] target/avr: Add instruction translation - Branch Instructions

2020-01-18 Thread Michael Rolnik
This includes: - RJMP, IJMP, EIJMP, JMP - RCALL, ICALL, EICALL, CALL - RET, RETI - CPSE, CP, CPC, CPI - SBRC, SBRS, SBIC, SBIS - BRBC, BRBS Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 533 ++

[PATCH v41 09/21] target/avr: Add instruction translation - CPU main translation function

2020-01-18 Thread Michael Rolnik
Co-developed-by: Richard Henderson Co-developed-by: Michael Rolnik Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 234 + 1 file changed, 234 insertions(+) diff --git a/target/avr/translate.c b/target/avr/tr

[PATCH v41 04/21] target/avr: Add instruction translation - Arithmetic and Logic Instructions

2020-01-18 Thread Michael Rolnik
This includes: - ADD, ADC, ADIW - SBIW, SUB, SUBI, SBC, SBCI - AND, ANDI - OR, ORI, EOR - COM, NEG - INC, DEC - MUL, MULS, MULSU - FMUL, FMULS, FMULSU - DES Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 751 +

[PATCH v41 03/21] target/avr: Add instruction translation - Registers definition

2020-01-18 Thread Michael Rolnik
Signed-off-by: Michael Rolnik Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- target/avr/translate.c | 172 + 1 file changed, 172 insertions(+) create mode 100644 target/avr/translate.c diff --git a/target/avr/translate.c b/tar

[PATCH v41 08/21] target/avr: Add instruction translation - MCU Control Instructions

2020-01-18 Thread Michael Rolnik
This includes: - BREAK - NOP - SLEEP - WDR Signed-off-by: Michael Rolnik --- target/avr/translate.c | 68 ++ target/avr/insn.decode | 9 ++ 2 files changed, 77 insertions(+) diff --git a/target/avr/translate.c b/target/avr/translate.c

[PATCH v41 02/21] target/avr: Add instruction helpers

2020-01-18 Thread Michael Rolnik
Stubs for unimplemented instructions and helpers for instructions that need to interact with QEMU. SPM and WDR are unimplemented because they require emulation of complex peripherals. The implementation of SLEEP is very limited due to the lack of peripherals to generate wake interrupts. Memory a

[PATCH v41 06/21] target/avr: Add instruction translation - Data Transfer Instructions

2020-01-18 Thread Michael Rolnik
This includes: - MOV, MOVW - LDI, LDS LDX LDY LDZ - LDDY, LDDZ - STS, STX STY STZ - STDY, STDZ - LPM, LPMX - ELPM, ELPMX - SPM, SPMX - IN, OUT - PUSH, POP - XCH - LAS, LAC LAT Signed-off-by: Michael Rolnik Tested-by: Philippe Mathieu-Daudé --- tar

[PATCH v41 14/21] hw/avr: Add example board configuration

2020-01-18 Thread Michael Rolnik
A simple board setup that configures an AVR CPU to run a given firmware image. This is all that's useful to implement without peripheral emulation as AVR CPUs include a lot of on-board peripherals. NOTE: this is not a real board NOTE: it's used for CPU testing Signed-off-by: Michael Rol

[PATCH v41 00/21] QEMU AVR 8 bit cores

2020-01-18 Thread Michael Rolnik
This series of patches adds 8bit AVR cores to QEMU. All instruction, except BREAK/DES/SPM/SPMX, are implemented. Not fully tested yet. However I was able to execute simple code with functions. e.g fibonacci calculation. This series of patches include a non real, sample board. No fuses support yet

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

2020-01-18 Thread Philippe Mathieu-Daudé
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/qemu-devel@nongnu.org/msg669347.html The sdcard image is big, but the test runs very quick (1min), even on Travis CI: h

[PATCH v41 01/21] target/avr: Add outward facing interfaces and core CPU logic

2020-01-18 Thread Michael Rolnik
This includes: - CPU data structures - object model classes and functions - migration functions - GDB hooks Co-developed-by: Michael Rolnik Co-developed-by: Sarah Harris Signed-off-by: Michael Rolnik Signed-off-by: Sarah Harris Signed-off-by: Michael Rolnik Acked-by: Igor Mammedov Tested-by:

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

2020-01-18 Thread Philippe Mathieu-Daudé
This test boots U-Boot then NetBSD (stored on a SD card) on a OrangePi PC board. As it requires ~1.3GB of storage, it is disabled by default. U-Boot is built by the Debian project [1], and the SD card image is provided by the NetBSD organization [2]. Once the compressed SD card image is download

[PATCH 2/4] Acceptance tests: Add interrupt_interactive_console_until_pattern()

2020-01-18 Thread Philippe Mathieu-Daudé
We need a function to interrupt interactive consoles. Example: Interrupt U-Boot to set different environment values. Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/avocado_qemu/__init__.py | 32 +-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/t

[PATCH 1/4] Acceptance tests: Extract _console_interaction()

2020-01-18 Thread Philippe Mathieu-Daudé
Since we are going to re-use the code shared between wait_for_console_pattern() and exec_command_and_wait_for_pattern(), extract the common part into a local function. Signed-off-by: Philippe Mathieu-Daudé --- tests/acceptance/avocado_qemu/__init__.py | 31 +-- 1 file changed

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

2020-01-18 Thread Philippe Mathieu-Daudé
As Travis CI runs our tests in a disposable environment, we don't care much if the binaries are trusted. The more we test the better. Also, as of this commmit, the smallest available announced [1] is "approx 18GB", plenty of space to run our acceptance tests. Enable the proper environment variabl

[PATCH v3 5/5] qcow2: Use BDRV_SECTOR_SIZE instead of the hardcoded value

2020-01-18 Thread Alberto Garcia
This replaces all remaining instances in the qcow2 code. Signed-off-by: Alberto Garcia --- block/qcow2.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index a6b0d4ee1d..6cc13e388c 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3273,

[PATCH v3 1/5] qcow2: Don't round the L1 table allocation up to the sector size

2020-01-18 Thread Alberto Garcia
The L1 table is read from disk using the byte-based bdrv_pread() and is never accessed beyond its last element, so there's no need to allocate more memory than that. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/qcow2-cluster.c | 5 ++--- block/qcow2-refcount.c | 2 +- block/q

[PATCH v3 3/5] qcow2: Use bs->bl.request_alignment when updating an L1 entry

2020-01-18 Thread Alberto Garcia
When updating an L1 entry the qcow2 driver writes a (512-byte) sector worth of data to avoid a read-modify-write cycle. Instead of always writing 512 bytes we should follow the alignment requirements of the storage backend. (the only exception is when the alignment is larger than the cluster size

[PATCH v3 2/5] qcow2: Tighten cluster_offset alignment assertions

2020-01-18 Thread Alberto Garcia
qcow2_alloc_cluster_offset() and qcow2_get_cluster_offset() always return offsets that are cluster-aligned so don't just check that they are sector-aligned. The check in qcow2_co_preadv_task() is also replaced by an assertion for the same reason. Signed-off-by: Alberto Garcia Reviewed-by: Max Re

[PATCH v3 0/5] Misc BDRV_SECTOR_SIZE updates

2020-01-18 Thread Alberto Garcia
This series gets rid of all the remaining instances of hardcoded sector sizes in the qcow2 code and adds a check for images whose virtual size is not a multiple of the sector size. See the individual patches for details. Berto v3: - Patch 2: Use offset_into_cluster() instead of QEMU_IS_ALIGNED -

[PATCH v3 4/5] qcow2: Don't require aligned offsets in qcow2_co_copy_range_from()

2020-01-18 Thread Alberto Garcia
qemu-img's convert_co_copy_range() operates at the sector level and block_copy() operates at the cluster level so this condition is always true, but it is not necessary to restrict this here, so let's leave it to the driver implementation return an error if there is any. Signed-off-by: Alberto Gar

Re: [PATCH v2 4/4] qcow2: Use BDRV_SECTOR_SIZE instead of the hardcoded value

2020-01-18 Thread Alberto Garcia
On Tue 14 Jan 2020 03:15:48 PM CET, Max Reitz wrote: >> @@ -3836,7 +3837,7 @@ qcow2_co_copy_range_from(BlockDriverState *bs, >> case QCOW2_CLUSTER_NORMAL: >> child = s->data_file; >> copy_offset += offset_into_cluster(s, src_offset); >> -if ((copy_off

[PATCH v2 5/7] hw/char/exynos4210_uart: Implement Rx FIFO level triggers and timeouts

2020-01-18 Thread Guenter Roeck
The driver already implements a receive FIFO, but it does not handle receive FIFO trigger levels and timeout. Implement the missing functionality. Signed-off-by: Guenter Roeck --- v2: Call exynos4210_uart_rx_timeout_set() from new post_load function to set the receive timeout timer. Add t

[PATCH v2 6/7] hw/char/exynos4210_uart: Add receive DMA support

2020-01-18 Thread Guenter Roeck
To support receive DMA, we need to inform the DMA controller if receive data is available. Otherwise the DMA controller keeps requesting data, causing receive errors. Implement this using an interrupt line. The instantiating code then needs to connect the interrupt with the matching DMA controller

[PATCH v2 3/7] hw/char/exynos4210_uart: Convert to support tracing

2020-01-18 Thread Guenter Roeck
Replace debug code with tracing to aid debugging. Reviewed-by: Peter Maydell Signed-off-by: Guenter Roeck --- v2: Added Reviewed-by: tag hw/char/exynos4210_uart.c | 96 --- hw/char/trace-events | 17 +++ 2 files changed, 47 insertions(+), 66 deletio

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

2020-01-18 Thread Guenter Roeck
The Exynos4210 serial driver uses an interrupt line to signal if receive data is available. Connect that interrupt with the DMA controller's 'peripheral busy' gpio pin to stop the DMA if there is no more receive data available. Without this patch, receive DMA runs wild and fills the entire receive

[PATCH v2 2/7] hw/arm/exynos4210: Fix DMA initialization

2020-01-18 Thread Guenter Roeck
First parameter to exynos4210_get_irq() is not the SPI port number, but the interrupt group number. Interrupt groups are 20 for mdma and 21 for pdma. Interrupts are not inverted. Controllers support 32 events (pdma) or 31 events (mdma). Events must all be routed to a single interrupt line. Set othe

[PATCH v2 4/7] hw/char/exynos4210_uart: Implement post_load function

2020-01-18 Thread Guenter Roeck
After restoring a VM, serial parameters need to be updated to reflect restored register values. Implement a post_load function to handle this situation. Signed-off-by: Guenter Roeck --- v4: Additional patch to implement post-load functionality in exynos uart driver. Required for next patch in

[PATCH v2 1/7] dma/pl330: Convert to support tracing

2020-01-18 Thread Guenter Roeck
Replace debug logging code with tracing. Signed-off-by: Guenter Roeck --- v2: Make call to pl330_hexdump() conditional hw/dma/pl330.c | 88 - hw/dma/trace-events | 24 + 2 files changed, 72 insertions(+), 40 deletions(-) diff --git a

[PATCH v2 0/7] Fix Exynos4210 DMA support

2020-01-18 Thread Guenter Roeck
Commit 59520dc65e ("hw/arm/exynos4210: Add DMA support for the Exynos4210") introduced DMA support for Exynos4210. Unfortunately, it never really worked. DMA interrupt line and polarity was wrong, and the serial port needs extra code to support DMA. This patch series fixes the problem. The series

[PATCH] qom/object: Display more helpful message when an interface is missing

2020-01-18 Thread Philippe Mathieu-Daudé
When adding new devices implementing QOM interfaces, we might forgot to add the Kconfig dependency that pulls the required objects in when building. Since QOM dependencies are resolved at runtime, we don't get any link-time failures, and QEMU aborts while starting: $ qemu ... Segmentation fau

Re: [PATCH 037/104] virtiofsd: passthrough_ll: add fallback for racy ops

2020-01-18 Thread Masayoshi Mizuma
On Thu, Dec 12, 2019 at 04:37:57PM +, Dr. David Alan Gilbert (git) wrote: > From: Miklos Szeredi > > We have two operations that cannot be done race-free on a symlink in > certain cases: utimes and link. > > Add racy fallback for these if the race-free method doesn't work. We do > our best

Re: [PATCH v3 08/17] hw/arm/allwinner: add SD/MMC host controller

2020-01-18 Thread Philippe Mathieu-Daudé
On 1/8/20 9:00 PM, 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 v3 03/17] hw/arm/allwinner-h3: add Clock Control Unit

2020-01-18 Thread Philippe Mathieu-Daudé
Hi Niek, On 1/13/20 8:18 PM, Niek Linnenbank wrote: Hi, Just a friendly reminder for review of this patch and the others in this series that don't yet have a reviewed-by tag :-) You are right to ping the list after a week. Cc'ing Damien for this particular patch, he might have good advises

Re: [PATCH v3 07/17] hw/arm/allwinner: add Security Identifier device

2020-01-18 Thread Philippe Mathieu-Daudé
Cc'ing Corey/David for good advices about using UUID. On 1/8/20 9:00 PM, 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

Re: [PATCH v3 11/17] hw/arm/allwinner-h3: add SDRAM controller device

2020-01-18 Thread Philippe Mathieu-Daudé
Cc'ing Igor and Alex for this one. On 1/8/20 9:00 PM, Niek Linnenbank wrote: In the Allwinner H3 SoC the SDRAM controller is responsible for interfacing with the external Synchronous Dynamic Random Access Memory (SDRAM). Types of memory that the SDRAM controller supports are DDR2/DDR3 and capaci

Re: [PATCH v3 09/17] hw/arm/allwinner-h3: add EMAC ethernet device

2020-01-18 Thread Philippe Mathieu-Daudé
Cc'ing the maintainers, please Cc them on v4. On 1/8/20 9:00 PM, Niek Linnenbank wrote: The Allwinner Sun8i System on Chip family includes an Ethernet MAC (EMAC) which provides 10M/100M/1000M Ethernet connectivity. This commit adds support for the Allwinner EMAC from the Sun8i family (H2+, H3, A

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

2020-01-18 Thread Guenter Roeck
On 1/17/20 10:44 AM, Peter Maydell wrote: On Fri, 17 Jan 2020 at 18:29, Guenter Roeck wrote: [ ... ] Rather than having the uart and pl330 pointers be locals, they should be fields in Exynos4210State. (Otherwise technically we leak them, though this is unnoticeable in practice because there's

Re: [PATCH v3 12/17] hw/arm/allwinner: add RTC device support

2020-01-18 Thread Philippe Mathieu-Daudé
Hi Niek, On 1/14/20 11:57 PM, Niek Linnenbank wrote: On Tue, Jan 14, 2020 at 11:52 PM Niek Linnenbank mailto:nieklinnenb...@gmail.com>> wrote: Hi Philippe, On Mon, Jan 13, 2020 at 11:57 PM Philippe Mathieu-Daudé mailto:phi...@redhat.com>> wrote: On 1/8/20 9:00 PM, Niek Li

[PATCH v2] mailmap: Add more entries to sanitize 'git log' output

2020-01-18 Thread Philippe Mathieu-Daudé
Most of these developers have the Signed-off-by tag properly written, but not the author/committer name. Fix this. Also we incorrectly wrote Arei Gonglei name, update and reorder. The committer name/email is displayed when using: $ git log --format=fuller (which can be set in git-config settin

Re: [PATCH v2 0/6] buildsys: Build faster (mostly tools and linux-user)

2020-01-18 Thread Philippe Mathieu-Daudé
On 1/18/20 3:06 PM, Philippe Mathieu-Daudé wrote: In some configuration (linux-user, tools) we can ignore building various objects (and the libfdt). Tested with all the combinations of --[enable|disable]-tools, --[enable|disable]-user and --[enable|disable]-system using the following commands (s

  1   2   >