Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-18 Thread Jason Wang
On 2019/8/19 下午1:24, Bin Meng wrote: > On Sat, Aug 10, 2019 at 9:58 AM Alistair Francis wrote: >> On Fri, Aug 9, 2019 at 12:26 AM Bin Meng wrote: >>> When CADENCE_GEM_ERR_DEBUG is turned on, there are several >>> compilation errors in DB_PRINT(). Fix them. >>> >>> While we are here, update to

[Qemu-devel] [PATCH v4 23/28] riscv: roms: Update default bios for sifive_u machine

2019-08-18 Thread Bin Meng
With the support of heterogeneous harts and PRCI model, it's now possible to use the OpenSBI image (PLATFORM=sifive/fu540) built for the real hardware. Signed-off-by: Bin Meng --- Changes in v4: None Changes in v3: None Changes in v2: None pc-bios/opensbi-riscv64-sifive_u-fw_jump.bin | Bin

Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check

2019-08-18 Thread Zeng, Star
> -Original Message- > From: Wei Yang [mailto:richardw.y...@linux.intel.com] > Sent: Monday, August 19, 2019 10:39 AM > To: David Hildenbrand > Cc: Wei Yang ; Zeng, Star > ; imamm...@redhat.com; qemu-devel@nongnu.org; > m...@redhat.com > Subject: Re: [Qemu-devel] [PATCH v2 1/2]

[Qemu-devel] [PATCH v4 26/28] riscv: sifive_u: Fix broken GEM support

2019-08-18 Thread Bin Meng
At present the GEM support in sifive_u machine is seriously broken. The GEM block register base was set to a weird number (0x100900FC), which for no way could work with the cadence_gem model in QEMU. Not like other GEM variants, the FU540-specific GEM has a management block to control

[Qemu-devel] [Bug 1772165] Re: arm raspi2/raspi3 emulation has no USB support

2019-08-18 Thread Weber Kai via Qemu-devel
Hi! I've googled: "usb" "designware" "otg" "datasheet" I think this is the kernel driver for this device: https://github.com/torvalds/linux/tree/master/drivers/usb/dwc3 Maybe it should be possible to use this as a reference? Maybe try to redirect the proprietary drivers system calls? I don't

[Qemu-devel] [PATCH v4 21/28] riscv: sifive_u: Update UART base addresses and IRQs

2019-08-18 Thread Bin Meng
This updates the UART base address and IRQs to match the hardware. Signed-off-by: Bin Meng Reviewed-by: Jonathan Behrens Acked-by: Alistair Francis Reviewed-by: Chih-Min Chao --- Changes in v4: None Changes in v3: - update IRQ numbers of both UARTs to match hardware as well Changes in v2:

[Qemu-devel] [PATCH v4 27/28] riscv: sifive_u: Remove handcrafted clock nodes for UART and ethernet

2019-08-18 Thread Bin Meng
In the past we did not have a model for PRCI, hence two handcrafted clock nodes ("/soc/ethclk" and "/soc/uartclk") were created for the purpose of supplying hard-coded clock frequencies. But now since we have added the PRCI support in QEMU, we don't need them any more. Signed-off-by: Bin Meng

[Qemu-devel] [PATCH v4 28/28] riscv: sifive_u: Update model and compatible strings in device tree

2019-08-18 Thread Bin Meng
This updates model and compatible strings to use the same strings as used in the Linux kernel device tree (hifive-unleashed-a00.dts). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c | 5 +++-- 1 file

[Qemu-devel] [PATCH v4 17/28] riscv: sifive: Implement PRCI model for FU540

2019-08-18 Thread Bin Meng
This adds a simple PRCI model for FU540 (sifive_u). It has different register layout from the existing PRCI model for FE310 (sifive_e). Signed-off-by: Bin Meng --- Changes in v4: - prefix all macros/variables/functions with SIFIVE_U/sifive_u in the sifive_u_prci driver Changes in v3: None

[Qemu-devel] [PATCH v4 18/28] riscv: sifive_u: Generate hfclk and rtcclk nodes

2019-08-18 Thread Bin Meng
To keep in sync with Linux kernel device tree, generate hfclk and rtcclk nodes in the device tree, to be referenced by PRCI node. Signed-off-by: Bin Meng --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c | 23 +++

[Qemu-devel] [PATCH v4 19/28] riscv: sifive_u: Add PRCI block to the SoC

2019-08-18 Thread Bin Meng
Add PRCI mmio base address and size mappings to sifive_u machine, and generate the corresponding device tree node. Signed-off-by: Bin Meng --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c | 21 - include/hw/riscv/sifive_u.h | 1 +

[Qemu-devel] [PATCH v4 13/28] riscv: hart: Add a "hartid-base" property to RISC-V hart array

2019-08-18 Thread Bin Meng
At present each hart's hartid in a RISC-V hart array is assigned the same value of its index in the hart array. But for a system that has multiple hart arrays, this is not the case any more. Add a new "hartid-base" property so that hartid number can be assigned based on the property value.

[Qemu-devel] [PATCH v4 22/28] riscv: sifive_u: Change UART node name in device tree

2019-08-18 Thread Bin Meng
OpenSBI for fu540 does DT fix up (see fu540_modify_dt()) by updating chosen "stdout-path" to point to "/soc/serial@...", and U-Boot will use this information to locate the serial node and probe its driver. However currently we generate the UART node name as "/soc/uart@...", causing U-Boot fail to

[Qemu-devel] [PATCH v4 11/28] riscv: Add a sifive_cpu.h to include both E and U cpu type defines

2019-08-18 Thread Bin Meng
Group SiFive E and U cpu type defines into one header file. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- Changes in v4: None Changes in v3: None Changes in v2: None include/hw/riscv/sifive_cpu.h | 31 +++

Re: [Qemu-devel] [PATCH v3] hw: net: cadence_gem: Fix build errors in DB_PRINT()

2019-08-18 Thread Bin Meng
On Sat, Aug 10, 2019 at 9:58 AM Alistair Francis wrote: > > On Fri, Aug 9, 2019 at 12:26 AM Bin Meng wrote: > > > > When CADENCE_GEM_ERR_DEBUG is turned on, there are several > > compilation errors in DB_PRINT(). Fix them. > > > > While we are here, update to use appropriate modifiers in > > the

[Qemu-devel] [PATCH v4 20/28] riscv: sifive_u: Reference PRCI clocks in UART and ethernet nodes

2019-08-18 Thread Bin Meng
Now that we have added a PRCI node, update existing UART and ethernet nodes to reference PRCI as their clock sources, to keep in sync with the Linux kernel device tree. Signed-off-by: Bin Meng --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c |

[Qemu-devel] [PATCH v4 07/28] riscv: sifive: Rename sifive_prci.{c, h} to sifive_e_prci.{c, h}

2019-08-18 Thread Bin Meng
Current SiFive PRCI model only works with sifive_e machine, as it only emulates registers or PRCI block in the FE310 SoC. Rename the file name to make it clear that it is for sifive_e. This also prefix "sifive_e"/"SIFIVE_E" for all macros, variables and functions. Signed-off-by: Bin Meng

[Qemu-devel] [PATCH v4 16/28] riscv: sifive_u: Update PLIC hart topology configuration string

2019-08-18 Thread Bin Meng
With heterogeneous harts config, the PLIC hart topology configuration string are "M,MS,.." because of the monitor hart #0. Suggested-by: Fabien Chouteau Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c

[Qemu-devel] [PATCH v4 25/28] riscv: sifive_u: Instantiate OTP memory with a serial number

2019-08-18 Thread Bin Meng
This adds an OTP memory with a given serial number to the sifive_u machine. With such support, the upstream U-Boot for sifive_fu540 boots out of the box on the sifive_u machine. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2:

[Qemu-devel] [PATCH v4 08/28] riscv: sifive_e: prci: Fix a typo of hfxosccfg register programming

2019-08-18 Thread Bin Meng
For hfxosccfg register programming, SIFIVE_E_PRCI_HFXOSCCFG_RDY and SIFIVE_E_PRCI_HFXOSCCFG_EN should be used. Signed-off-by: Bin Meng Acked-by: Alistair Francis Reviewed-by: Chih-Min Chao Reviewed-by: Philippe Mathieu-Daudé --- Changes in v4: None Changes in v3: None Changes in v2: None

[Qemu-devel] [PATCH v4 12/28] riscv: hart: Extract hart realize to a separate routine

2019-08-18 Thread Bin Meng
Currently riscv_harts_realize() creates all harts based on the same cpu type given in the hart array property. With current implementation it can only create homogeneous harts. Exact the hart realize to a separate routine in preparation for supporting multiple hart arrays. Note the file header

[Qemu-devel] [PATCH v4 24/28] riscv: sifive: Implement a model for SiFive FU540 OTP

2019-08-18 Thread Bin Meng
This implements a simple model for SiFive FU540 OTP (One-Time Programmable) Memory interface, primarily for reading out the stored serial number from the first 1 KiB of the 16 KiB OTP memory reserved by SiFive for internal use. Signed-off-by: Bin Meng --- Changes in v4: - prefix all

[Qemu-devel] [PATCH v4 15/28] riscv: sifive_u: Set the minimum number of cpus to 2

2019-08-18 Thread Bin Meng
It is not useful if we only have one management CPU. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: - use management cpu count + 1 for the min_cpus Changes in v2: - update the file header to indicate at least 2 harts are created

[Qemu-devel] [PATCH v4 06/28] riscv: sifive_u: Remove the unnecessary include of prci header

2019-08-18 Thread Bin Meng
sifive_u machine does not use PRCI as of today. Remove the prci header inclusion. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/riscv/sifive_u.c

[Qemu-devel] [PATCH v4 14/28] riscv: sifive_u: Update hart configuration to reflect the real FU540 SoC

2019-08-18 Thread Bin Meng
The FU540-C000 includes a 64-bit E51 RISC-V core and four 64-bit U54 RISC-V cores. Currently the sifive_u machine only populates 4 U54 cores. Update the max cpu number to 5 to reflect the real hardware, by creating 2 CPU clusters as containers for RISC-V hart arrays to populate heterogeneous

[Qemu-devel] [PATCH v4 05/28] riscv: roms: Remove executable attribute of opensbi images

2019-08-18 Thread Bin Meng
Like other binary files, the executable attribute of opensbi images should not be set. Signed-off-by: Bin Meng --- Changes in v4: - new patch to remove executable attribute of opensbi images Changes in v3: None Changes in v2: None pc-bios/opensbi-riscv32-virt-fw_jump.bin | Bin

[Qemu-devel] [PATCH v4 00/28] riscv: sifive_u: Improve the emulation fidelity of sifive_u machine

2019-08-18 Thread Bin Meng
As of today, the QEMU 'sifive_u' machine is a special target that does not boot the upstream OpenSBI/U-Boot firmware images built for the real SiFive HiFive Unleashed board. Hence OpenSBI supports a special platform "qemu/sifive_u". For U-Boot, the sifive_fu540_defconfig is referenced in the

[Qemu-devel] [PATCH v4 04/28] riscv: hw: Change create_fdt() to return void

2019-08-18 Thread Bin Meng
There is no need to return fdt at the end of create_fdt() because it's already saved in s->fdt. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- Changes in v4: - change create_fdt() to return void in sifive_u.c too,

[Qemu-devel] [PATCH v4 09/28] riscv: sifive_e: prci: Update the PRCI register block size

2019-08-18 Thread Bin Meng
Currently the PRCI register block size is set to 0x8000, but in fact 0x1000 is enough, which is also what the manual says. Signed-off-by: Bin Meng Reviewed-by: Chih-Min Chao Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2: None

[Qemu-devel] [PATCH v4 03/28] riscv: hw: Remove not needed PLIC properties in device tree

2019-08-18 Thread Bin Meng
This removes "reg-names" and "riscv,max-priority" properties of the PLIC node from device tree. Signed-off-by: Bin Meng Reviewed-by: Jonathan Behrens Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2: - keep the PLIC compatible string unchanged as

[Qemu-devel] [PATCH v4 02/28] riscv: hw: Use qemu_fdt_setprop_cell() for property with only 1 cell

2019-08-18 Thread Bin Meng
Some of the properties only have 1 cell so we should use qemu_fdt_setprop_cell() instead of qemu_fdt_setprop_cells(). Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: None Changes in v3: None Changes in v2: None hw/riscv/sifive_u.c | 18 +-

[Qemu-devel] [PATCH v4 01/28] riscv: hw: Remove superfluous "linux, phandle" property

2019-08-18 Thread Bin Meng
"linux,phandle" property is optional. Remove all instances in the sifive_u, virt and spike machine device trees. Signed-off-by: Bin Meng Reviewed-by: Alistair Francis --- Changes in v4: - remove 2 more "linux,phandle" instances in sifive_u.c and spike.c after rebasing on Palmer's QEMU

Re: [Qemu-devel] [PATCH] migrtion: define MigrationState/MigrationIncomingState.state as MigrationStatus

2019-08-18 Thread Wei Yang
On Fri, Jun 21, 2019 at 10:27:39PM +0800, Wei Yang wrote: >No functional change. Add default case to fix warning. > Hi, David & Juan Do you like this? >Signed-off-by: Wei Yang >--- > migration/migration.c | 8 +++- > migration/migration.h | 6 +++--- > 2 files changed, 10 insertions(+), 4

[Qemu-devel] [PATCH v2] migration: cleanup check on ops in savevm.handlers iterations

2019-08-18 Thread Wei Yang
During migration, there are several places to iterate on savevm.handlers. And on each iteration, we need to check its ops and related callbacks before invoke it. Generally, ops is the first element to check, and it is only necessary to check it once. This patch clean all the related part in

Re: [Qemu-devel] [PATCH 0/6] net/eth: Remove duplicated tcp/udp_hdr structures

2019-08-18 Thread Jason Wang
On 2019/8/19 上午5:38, Philippe Mathieu-Daudé wrote: > Hi Jason, > > On 8/8/19 4:34 PM, Philippe Mathieu-Daudé wrote: >> This is a preparatory cleanup series. >> >> Commit 75020a70215 introduced 4 very equivalent structures: >> - tcp_header and tcp_hdr, >> - udp_header and udp_hdr. >> >> Choose

Re: [Qemu-devel] [PATCH 0/6] Refine exec

2019-08-18 Thread Wei Yang
On Thu, Mar 21, 2019 at 04:25:49PM +0800, Wei Yang wrote: >This serial refine exec a little. > Ping again. >Wei Yang (6): > exec.c: replace hwaddr with uint64_t for better understanding > exec.c: remove an unnecessary assert on PHYS_MAP_NODE_NIL in >phys_map_node_alloc() > exec.c: get

Re: [Qemu-devel] [PATCH v2 1/2] memory-device: not necessary to use goto for the last check

2019-08-18 Thread Wei Yang
On Thu, Aug 08, 2019 at 09:06:21AM +0200, David Hildenbrand wrote: >On 08.08.19 04:38, Wei Yang wrote: >> On Thu, Aug 08, 2019 at 02:30:02AM +, Zeng, Star wrote: -Original Message- From: Wei Yang [mailto:richardw.y...@linux.intel.com] Sent: Thursday, August 8, 2019 10:13

Re: [Qemu-devel] [PATCH 0/2] migration/qemu-file: cleanup and refine qemu-file

2019-08-18 Thread Wei Yang
On Wed, Jul 31, 2019 at 10:42:23PM +0800, Wei Yang wrote: >Two cleanup: > >Patch #1 make code consistent on calling add_to_iovec >Patch #2 refine the code to handle the case when buf already flushed > Ping~ >Wei Yang (2): > migration/qemu-file: remove check on writev_buffer in >

Re: [Qemu-devel] [PATCH] migration: check length directly to make sure the range is aligned

2019-08-18 Thread Wei Yang
On Fri, Jul 19, 2019 at 06:54:00PM +0100, Dr. David Alan Gilbert wrote: >* Wei Yang (richardw.y...@linux.intel.com) wrote: >> Since the start addr is already checked, to make sure the range is >> aligned, checking the length is enough. >> >> Signed-off-by: Wei Yang >> --- >> exec.c | 7 +++

Re: [Qemu-devel] [PATCH v4 14/14] audio: fix memory leak reported by ASAN

2019-08-18 Thread Zoltán Kővágó
Hi, On 2019-08-19 01:25, Philippe Mathieu-Daudé wrote: > Hi Zoltán, > > On 8/19/19 1:06 AM, Kővágó, Zoltán wrote: >> Signed-off-by: Kővágó, Zoltán >> --- >> audio/audio.c | 6 ++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/audio/audio.c b/audio/audio.c >> index

Re: [Qemu-devel] [PATCH 1/3] pc: Fix error message on die-id validation

2019-08-18 Thread Like Xu
On 2019/8/16 21:49, Eduardo Habkost wrote: On Fri, Aug 16, 2019 at 09:04:16AM +0800, Like Xu wrote: Hi, On 2019/8/16 2:38, Eduardo Habkost wrote: The error message for die-id range validation is incorrect. Example: $ qemu-system-x86_64 -smp 1,sockets=6,maxcpus=6 \ -device

[Qemu-devel] Machine specific option ROMs

2019-08-18 Thread BALATON Zoltan
Hello, I know about the possibility to set the option ROM of a PCIDevice with the romfile property (that we can set on command line or in a device's init method) but is there a way to set it depending on the machine that uses the device? If this is not currently possible what would be needed

Re: [Qemu-devel] [PATCH v4 00/14] Multiple simultaneous audio backends

2019-08-18 Thread no-reply
Patchew URL: https://patchew.org/QEMU/cover.1566168923.git.dirty.ice...@gmail.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Subject: [Qemu-devel] [PATCH v4 00/14] Multiple simultaneous audio backends Message-id:

Re: [Qemu-devel] [PATCH v4 14/14] audio: fix memory leak reported by ASAN

2019-08-18 Thread Philippe Mathieu-Daudé
Hi Zoltán, On 8/19/19 1:06 AM, Kővágó, Zoltán wrote: > Signed-off-by: Kővágó, Zoltán > --- > audio/audio.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/audio/audio.c b/audio/audio.c > index 924dddf2e7..9b28abca14 100644 > --- a/audio/audio.c > +++ b/audio/audio.c > @@ -1343,6

[Qemu-devel] [PATCH 4/4] tests/docker: Use Travis-CI default environment variables

2019-08-18 Thread Philippe Mathieu-Daudé
Update to environment variables of our Docker image to closely reproduce the builds run by the Travis-CI service. Default variables from: https://docs.travis-ci.com/user/environment-variables/#default-environment-variables Signed-off-by: Philippe Mathieu-Daudé ---

[Qemu-devel] [PATCH 3/4] tests/docker: Add test-acceptance runner

2019-08-18 Thread Philippe Mathieu-Daudé
Add a runner script to be able to run acceptance tests within Docker images. We can now reproduce Travis CI builds locally (and debug them!). Signed-off-by: Philippe Mathieu-Daudé --- tests/docker/test-acceptance | 21 + 1 file changed, 21 insertions(+) create mode 100755

[Qemu-devel] [PATCH 1/4] tests/docker: Use one package per line to improve readability

2019-08-18 Thread Philippe Mathieu-Daudé
Use one package per line to improve readability. This also helps while reviewing patches. Signed-off-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/travis.docker | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/docker/dockerfiles/travis.docker

[Qemu-devel] [PATCH v4 13/14] audio: use size_t where makes sense

2019-08-18 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- Notes: Changes from v3: * (Hopefully) fix windows build audio/audio.h | 4 +- audio/audio_int.h | 26 +++ audio/audio_template.h | 14 ++-- audio/mixeng.h | 9 +-- audio/rate_template.h | 2 +-

[Qemu-devel] [PATCH 2/4] tests/docker: update our Travis image to run acceptance tests locally

2019-08-18 Thread Philippe Mathieu-Daudé
Since commit aa983ff67c3, Travis CI runs acceptance tests using the Avocado framework. Since Avocado requires Python 3, update our Docker image to be able to run these tests locally. Signed-off-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/travis.docker | 2 ++ 1 file changed, 2

[Qemu-devel] [PATCH 0/4] docker: Update Travis-CI image to run acceptance tests

2019-08-18 Thread Philippe Mathieu-Daudé
This series adds a 'test-acceptance' Docker target, so we can run 'make docker-test-acceptance@travis' similarly to how the Travis-CI service runs its builds. This is particularly useful to debug Travis-CI failures locally. Regards, Phil. Philippe Mathieu-Daudé (4): tests/docker: Use one

[Qemu-devel] [PATCH v4 12/14] audio: remove read and write pcm_ops

2019-08-18 Thread Kővágó, Zoltán
They just called audio_pcm_sw_read/write anyway, so it makes no sense to have them too. (The noaudio's read is the only exception, but it should work with the generic code too.) Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 5 - audio/alsaaudio.c | 12

[Qemu-devel] [PATCH v4 14/14] audio: fix memory leak reported by ASAN

2019-08-18 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/audio/audio.c b/audio/audio.c index 924dddf2e7..9b28abca14 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -1343,6 +1343,12 @@ static void free_audio_state(AudioState *s)

[Qemu-devel] [PATCH v4 11/14] paaudio: fix playback glitches

2019-08-18 Thread Kővágó, Zoltán
Pulseaudio normally assumes that when the server wants it, the client can generate the audio samples and send it right away. Unfortunately this is not the case with QEMU -- it's up to the emulated system when does it generate the samples. Buffering the samples and sending them from a background

[Qemu-devel] [PATCH v4 07/14] paaudio: do not move stream when sink/source name is specified

2019-08-18 Thread Kővágó, Zoltán
Unless we disable stream moving, pulseaudio can easily move the stream on connect, effectively ignoring the source/sink specified by the user. Signed-off-by: Kővágó, Zoltán Reviewed-by: Marc-André Lureau --- audio/paaudio.c | 5 + 1 file changed, 5 insertions(+) diff --git

[Qemu-devel] [PATCH v4 05/14] paaudio: prepare for multiple audiodev

2019-08-18 Thread Kővágó, Zoltán
Have a pool of refcounted connections per server, so if the user creates multiple audiodevs to the same pa server, it will use a single connection. (It will still create different streams, so the user can manage those streams separately in pulseaudio.) Signed-off-by: Kővágó, Zoltán ---

[Qemu-devel] [PATCH v4 09/14] audio: remove audio_MIN, audio_MAX

2019-08-18 Thread Kővágó, Zoltán
There's already a MIN and MAX macro in include/qemu/osdep.h, use them instead. Signed-off-by: Kővágó, Zoltán Reviewed-by: Marc-André Lureau --- audio/audio.h | 17 - audio/alsaaudio.c | 6 +++--- audio/audio.c | 20 ++--

[Qemu-devel] [PATCH v4 10/14] audio: do not run each backend in audio_run

2019-08-18 Thread Kővágó, Zoltán
audio_run is called manually by alsa and oss backends when polling. In this case only the requesting backend should be run, not all of them. Signed-off-by: Kővágó, Zoltán Reviewed-by: Marc-André Lureau --- audio/audio_int.h | 2 +- audio/alsaaudio.c | 7 +-- audio/audio.c | 14

[Qemu-devel] [PATCH v4 02/14] audio: basic support for multi backend audio

2019-08-18 Thread Kővágó, Zoltán
Audio functions no longer access glob_audio_state, instead they get an AudioState as a parameter. This is required in order to support multiple backends. glob_audio_state is also gone, and replaced with a tailq so we can store more than one states. Signed-off-by: Kővágó, Zoltán --- Notes:

[Qemu-devel] [PATCH v4 04/14] audio: add audiodev properties to frontends

2019-08-18 Thread Kővágó, Zoltán
Finally add audiodev= options to audio frontends so users can specify which backend to use when multiple backends exist. Not specifying an audiodev= option currently causes the first audiodev to be used, this is fixed in the next commit. Example usage: -audiodev pa,id=foo -device

[Qemu-devel] [PATCH v4 08/14] paaudio: properly disconnect streams in fini_*

2019-08-18 Thread Kővágó, Zoltán
Currently this needs a workaround due to bug #247 in pulseaudio. Signed-off-by: Kővágó, Zoltán Reviewed-by: Marc-André Lureau --- audio/paaudio.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index

[Qemu-devel] [PATCH v4 06/14] audio: audiodev= parameters no longer optional when -audiodev present

2019-08-18 Thread Kővágó, Zoltán
This means you should probably stop using -soundhw (as it doesn't allow you to specify any options) and add the device manually with -device. The exception is pcspk, it's currently not possible to manually add it. To use it with audiodev, use something like this: -audiodev id=foo,... -global

[Qemu-devel] [PATCH v4 03/14] audio: add audiodev property to vnc and wav_capture

2019-08-18 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- Notes: Changes from v2: * audiodev parameter for wavcapture is now mandatory. * removed some unnecessary qdict_haskey calls from hmp_wavcapture ui/vnc.h| 2 ++ monitor/misc.c | 22 +++--- ui/vnc.c| 15

[Qemu-devel] [PATCH v4 00/14] Multiple simultaneous audio backends

2019-08-18 Thread Kővágó, Zoltán
Hello, This is the v4 of my audio patches. This is a compile-fix revision, hopefully fixing windows compile errors in "audio: use size_t where makes sense" and compile errors introduced by changes on master in "audio: add audiodev properties to frontends". Regards, Zoltan Kővágó, Zoltán (14):

[Qemu-devel] [PATCH v4 01/14] audio: reduce glob_audio_state usage

2019-08-18 Thread Kővágó, Zoltán
Remove glob_audio_state from functions, where possible without breaking the API. This means that most static functions in audio.c now take an AudioState pointer instead of implicitly using glob_audio_state. Also included a pointer in SWVoice*, HWVoice* structs, so that functions dealing them can

[Qemu-devel] [PATCH v4 12/15] hw/i386/pc: Let pc_build_feature_control() take a FWCfgState argument

2019-08-18 Thread Philippe Mathieu-Daudé
Pass the FWCfgState object by argument, this will allow us to remove the PCMachineState argument later. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index

[Qemu-devel] [PATCH v4 15/15] hw/i386/pc: Extract the x86 generic fw_cfg code

2019-08-18 Thread Philippe Mathieu-Daudé
Extract all the functions that are not PC-machine specific into the (arch-specific) fw_cfg.c file. This will allow other X86-machine to reuse these functions. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- v4: rebased using MachineState argument with smbios_get_tables*()

[Qemu-devel] [PATCH v4 14/15] hw/i386/pc: Rename pc_build_feature_control() as generic fw_cfg_build_*

2019-08-18 Thread Philippe Mathieu-Daudé
Now that the pc_build_feature_control_file() function has been refactored to not depend of PC specific types, rename it to a more generic name. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

Re: [Qemu-devel] [edk2-devel] CPU hotplug using SMM with QEMU+OVMF

2019-08-18 Thread Yao, Jiewen
in real world, we deprecate AB-seg usage because they are vulnerable to smm cache poison attack. I assume cache poison is out of scope in the virtual world, or there is a way to prevent ABseg cache poison. thank you! Yao, Jiewen > 在 2019年8月19日,上午3:50,Paolo Bonzini 写道: > >> On 17/08/19

[Qemu-devel] [PATCH v4 11/15] hw/i386/pc: Rename pc_build_smbios() as generic fw_cfg_build_smbios()

2019-08-18 Thread Philippe Mathieu-Daudé
Now that the pc_build_smbios() function has been refactored to not depend of PC specific types, rename it to a more generic name. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH v4 13/15] hw/i386/pc: Let pc_build_feature_control() take a MachineState argument

2019-08-18 Thread Philippe Mathieu-Daudé
Let the pc_build_feature_control_file() function take a generic MachineState argument. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index

[Qemu-devel] [PATCH v4 10/15] hw/i386/pc: Let pc_build_smbios() take a generic MachineState argument

2019-08-18 Thread Philippe Mathieu-Daudé
Let the pc_build_smbios() function take a generic MachineState argument. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 63cb27ff18..0bd411de6e 100644

[Qemu-devel] [PATCH v4 09/15] hw/i386/pc: Let pc_build_smbios() take a FWCfgState argument

2019-08-18 Thread Philippe Mathieu-Daudé
Pass the FWCfgState object by argument, this will allow us to remove the PCMachineState argument later. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c

[Qemu-devel] [PATCH v4 02/15] hw/i386/pc: Extract e820 memory layout code

2019-08-18 Thread Philippe Mathieu-Daudé
Suggested-by: Samuel Ortiz Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daudé --- v3: KISS, do not use unsigned, do not add broken documentation --- hw/i386/Makefile.objs| 2 +- hw/i386/e820_memory_layout.c | 59 ++ hw/i386/e820_memory_layout.h

[Qemu-devel] [PATCH v4 07/15] hw/i386/pc: Pass the CPUArchIdList array by argument

2019-08-18 Thread Philippe Mathieu-Daudé
Pass the CPUArchIdList array by argument, this will allow us to remove the PCMachineState argument later. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/hw/i386/pc.c

[Qemu-devel] [PATCH v4 08/15] hw/i386/pc: Remove unused PCMachineState argument in fw_cfg_arch_create

2019-08-18 Thread Philippe Mathieu-Daudé
In the previous commit we removed the last access to PCMachineState. It is now an unused argument, remove it from the function prototype. Suggested-by: Christophe de Dinechin Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[Qemu-devel] [PATCH v4 06/15] hw/i386/pc: Pass the apic_id_limit value by argument

2019-08-18 Thread Philippe Mathieu-Daudé
Pass the apic_id_limit value by argument, this will allow us to remove the PCMachineState argument later. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index

[Qemu-devel] [PATCH v4 01/15] hw/i386/pc: Use e820_get_num_entries() to access e820_entries

2019-08-18 Thread Philippe Mathieu-Daudé
To be able to extract the e820* code out of this file (in the next patch), access e820_entries with its correct helper. Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c

[Qemu-devel] [PATCH v4 05/15] hw/i386/pc: Pass the boot_cpus value by argument

2019-08-18 Thread Philippe Mathieu-Daudé
The boot_cpus is used once. Pass it by argument, this will allow us to remove the PCMachineState argument later. Suggested-by: Samuel Ortiz Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c

[Qemu-devel] [PATCH v4 03/15] hw/i386/pc: Use address_space_memory in place

2019-08-18 Thread Philippe Mathieu-Daudé
The address_space_memory variable is used once. Use it in place and remove the argument. Suggested-by: Samuel Ortiz Reviewed-by: Li Qiang Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c

[Qemu-devel] [PATCH v4 04/15] hw/i386/pc: Rename bochs_bios_init as more generic fw_cfg_arch_create

2019-08-18 Thread Philippe Mathieu-Daudé
The bochs_bios_init() function is not restricted to the Bochs BIOS and is useful to other BIOS. Since it is not specific to the PC machine, and can be reused by other machines of the X86 architecture, rename it as fw_cfg_arch_create(). Suggested-by: Samuel Ortiz Reviewed-by: Li Qiang

[Qemu-devel] [PATCH v4 00/15] hw/i386/pc: Do not restrict the fw_cfg functions to the PC machine

2019-08-18 Thread Philippe Mathieu-Daudé
Hi, This is my take at salvaging some NEMU good work. Samuel worked in adding the fw_cfg device to the x86-virt NEMU machine. This series is inspired by NEMU's commit 3cb92d080835 [0] and adapted to upstream style. The result makes the upstream codebase more modularizable. There are very little

Re: [Qemu-devel] [PATCH] linux-user: add memfd_create

2019-08-18 Thread Philippe Mathieu-Daudé
Cc'ing Marc-André On 8/16/19 11:10 PM, Shu-Chun Weng via Qemu-devel wrote: > Add support for the memfd_create syscall. If the host does not have the > libc wrapper, translate to a direct syscall with NC-macro. > > Buglink: https://bugs.launchpad.net/qemu/+bug/1734792 > Signed-off-by: Shu-Chun

Re: [Qemu-devel] [PATCH] Fix hw/rdma/vmw/pvrdma_cmd.c build

2019-08-18 Thread Philippe Mathieu-Daudé
On 8/18/19 2:28 PM, Yuval Shaia wrote: > On Thu, Aug 15, 2019 at 02:12:44PM +0200, Stephen Kitt wrote: >> On Thu, 15 Aug 2019 13:57:05 +0300, Yuval Shaia >> wrote: >> >>> On Sun, Aug 11, 2019 at 09:42:47PM +0200, Stephen Kitt wrote: This was broken by the cherry-pick in 41dd30f. Fix by

Re: [Qemu-devel] [PATCH v2 1/3] decodetree: Allow !function with no input bits

2019-08-18 Thread Philippe Mathieu-Daudé
On 8/18/19 8:39 AM, Richard Henderson wrote: > Call this form a "parameter", returning a value extracted > from the DisasContext. > > Signed-off-by: Richard Henderson > --- > docs/devel/decodetree.rst | 8 - > scripts/decodetree.py | 49 --- >

Re: [Qemu-devel] [PATCH v7 11/42] memory: Access MemoryRegion with MemOp

2019-08-18 Thread Philippe Mathieu-Daudé
On 8/16/19 9:30 AM, tony.ngu...@bt.com wrote: > Convert memory_region_dispatch_{read|write} operand "unsigned size" > into a "MemOp op". > > Signed-off-by: Tony Nguyen > Reviewed-by: Richard Henderson > --- >  include/exec/memop.h  | 20 ++-- >  include/exec/memory.h |  9

Re: [Qemu-devel] [PATCH 0/6] net/eth: Remove duplicated tcp/udp_hdr structures

2019-08-18 Thread Philippe Mathieu-Daudé
Hi Jason, On 8/8/19 4:34 PM, Philippe Mathieu-Daudé wrote: > This is a preparatory cleanup series. > > Commit 75020a70215 introduced 4 very equivalent structures: > - tcp_header and tcp_hdr, > - udp_header and udp_hdr. > > Choose the most widely use in the codebase, which happens to > provide

Re: [Qemu-devel] [PATCH] ppc: Three floating point fixes

2019-08-18 Thread Aleksandar Markovic
18.08.2019. 10.10, "Richard Henderson" је написао/ла: > > On 8/16/19 11:59 PM, Aleksandar Markovic wrote: > >> From: "Paul A. Clarke" > ... > >> ISA 3.0B has xscvdpspn leaving its result in word 1 of the target > > register, > >> and mffprwz expecting its input to come from word 0 of the

Re: [Qemu-devel] [edk2-devel] CPU hotplug using SMM with QEMU+OVMF

2019-08-18 Thread Paolo Bonzini
On 17/08/19 02:20, Yao, Jiewen wrote: > [Jiewen] That is OK. Then we MUST add the third adversary. > -- Adversary: Simple hardware attacker, who can use device to perform DMA > attack in the virtual world. > NOTE: The DMA attack in the real world is out of scope. That is be handled by > IOMMU in

[Qemu-devel] [Bug 1796520] Re: autogen crashes on qemu-sh4-user after 61dedf2af7

2019-08-18 Thread John Paul Adrian Glaubitz
We can ask both glibc upstream and some SuperH experts. I'll ask. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1796520 Title: autogen crashes on qemu-sh4-user after 61dedf2af7 Status in QEMU:

[Qemu-devel] [PATCH 1/2] configure: Check if we can use ibv_reg_mr_iova

2019-08-18 Thread Yuval Shaia
The function reg_mr_iova is an enhanced version of ibv_reg_mr function that can help to easly register and use guest's MRs. Add check in 'configure' phase to detect if we have libibverbs with this support. Signed-off-by: Yuval Shaia --- configure | 28 1 file

[Qemu-devel] [PATCH 0/2] rdma: Utilize ibv_reg_mr_iova for memory registration

2019-08-18 Thread Yuval Shaia
The virtual address that is provided by the guest in post_send and post_recv operations is related to the guest address space. This address space is unknown to the HCA resides on host so extra step in these operations is needed to adjust the address to host virtual address. This step, which is

[Qemu-devel] [PATCH 2/2] hw/rdma: Utilize ibv_reg_mr_iova for memory registration

2019-08-18 Thread Yuval Shaia
The virtual address that is provided by the guest in post_send and post_recv operations is related to the guest address space. This address space is unknown to the HCA resides on host so extra step in these operations is needed to adjust the address to host virtual address. This step, which is

[Qemu-devel] [PATCH] input-linux: add shift+shift as a grab toggle

2019-08-18 Thread Niklas Haas
From: Niklas Haas We have ctrl-ctrl and alt-alt; why not shift-shift? That's my preferred grab binding, personally. Signed-off-by: Niklas Haas --- qapi/ui.json | 3 ++- ui/input-linux.c | 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qapi/ui.json b/qapi/ui.json

Re: [Qemu-devel] [PATCH v7 38/42] memory: Single byte swap along the I/O path

2019-08-18 Thread Richard Henderson
On 8/16/19 8:38 AM, tony.ngu...@bt.com wrote: > +static void adjust_endianness(MemoryRegion *mr, uint64_t *data, MemOp op) > { > +if ((op & MO_BSWAP) != mr->ops->endianness) { > +switch (op & MO_SIZE) { You'll want to use devend_memop() here, as previously discussed. > @@ -2331,7

Re: [Qemu-devel] [PATCH v7 37/42] cputlb: Replace size and endian operands for MemOp

2019-08-18 Thread Richard Henderson
On 8/16/19 8:38 AM, tony.ngu...@bt.com wrote: > static uint64_t full_ldub_mmu(CPUArchState *env, target_ulong addr, >TCGMemOpIdx oi, uintptr_t retaddr) > { > -return load_helper(env, addr, oi, retaddr, 1, false, false, > - full_ldub_mmu);

Re: [Qemu-devel] [PATCH] Fix hw/rdma/vmw/pvrdma_cmd.c build

2019-08-18 Thread Yuval Shaia
On Thu, Aug 15, 2019 at 02:12:44PM +0200, Stephen Kitt wrote: > On Thu, 15 Aug 2019 13:57:05 +0300, Yuval Shaia > wrote: > > > On Sun, Aug 11, 2019 at 09:42:47PM +0200, Stephen Kitt wrote: > > > This was broken by the cherry-pick in 41dd30f. Fix by handling errors > > > as in the rest of the

Re: [Qemu-devel] [PATCH v7 36/42] memory: Access MemoryRegion with endianness

2019-08-18 Thread Richard Henderson
On 8/16/19 8:38 AM, tony.ngu...@bt.com wrote: > Preparation for collapsing the two byte swaps adjust_endianness and > handle_bswap into the former. > > Call memory_region_dispatch_{read|write} with endianness encoded into > the "MemOp op" operand. > > This patch does not change any behaviour as

Re: [Qemu-devel] [PATCH 1/2] virtio: add vhost-user-fs base device

2019-08-18 Thread Michael S. Tsirkin
On Fri, Aug 16, 2019 at 03:33:20PM +0100, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > The virtio-fs virtio device provides shared file system access using > the FUSE protocol carried ovew virtio. > The actual file server is implemented in an external vhost-user-fs

[Qemu-devel] Patchew s390 QEMU build issues

2019-08-18 Thread Stefan Hajnoczi
Hi, Peter messaged me on IRC to say that QEMU Patchew s390 builds seemed broken. Any chance you could take a look? Thanks, Stefan

Re: [Qemu-devel] [PATCH] qcow2: Fix the calculation of the maximum L2 cache size

2019-08-18 Thread Leonid Bloch
Thanks, Berto! On 8/16/19 3:17 PM, Alberto Garcia wrote: > The size of the qcow2 L2 cache defaults to 32 MB, which can be easily > larger than the maximum amount of L2 metadata that the image can have. > For example: with 64 KB clusters the user would need a qcow2 image > with a virtual size of

  1   2   >