[Qemu-devel] [PATCH v7 4/7] smbus: add a smbus_eeprom_init_one() routine

2018-05-29 Thread Cédric Le Goater
This is an helper routine to add a single EEPROM on an I2C bus. It can be directly used by smbus_eeprom_init() which adds a certain number of EEPROMs on mips and x86 machines. Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé --- include/hw/i2c/smbus.h | 1 + hw/i2c/smbus_eep

[Qemu-devel] [PATCH v7 3/7] aspeed: add an I2C RTC device to all machines

2018-05-29 Thread Cédric Le Goater
The AST2500 EVB does not have an RTC but we can pretend that one is plugged on the I2C bus header. The romulus and witherspoon boards expects an Epson RX8900 I2C RTC but a ds1338 is good enough for the basic features we need. Signed-off-by: Cédric Le Goater Reviewed-by: Andrew Jeffery --- hw/a

Re: [Qemu-devel] [PATCH v2] ARM: ACPI: Fix use-after-free due to memory realloc

2018-05-29 Thread Shannon Zhao
Hi Eric, On 2018/5/30 14:38, Auger Eric wrote: > I checked against the v1 in my branch thinking you did not change > anything besides the comment (your log history?). Sorry about this, I'll add some words in commit message. Thanks, -- Shannon

[Qemu-devel] [PATCH v7 6/7] misc: add pca9552 LED blinker model

2018-05-29 Thread Cédric Le Goater
Specs are available here : https://www.nxp.com/docs/en/application-note/AN264.pdf This is a simple model supporting the basic registers for led and GPIO mode. The device also supports two blinking rates but not the model yet. Signed-off-by: Cédric Le Goater Reviewed-by: Peter Maydell Revie

[Qemu-devel] [PATCH v7 2/7] aspeed: add support for the witherspoon-bmc board

2018-05-29 Thread Cédric Le Goater
The Witherspoon boards are OpenPOWER system hosting POWER9 Processors. Add support for their BMC including a couple of I2C devices as found on real HW. Signed-off-by: Cédric Le Goater Reviewed-by: Andrew Jeffery --- hw/arm/aspeed.c | 49 + 1 file

[Qemu-devel] [PATCH v7 7/7] aspeed: add the pc9552 chips to the witherspoon machine

2018-05-29 Thread Cédric Le Goater
The pca9552 LED blinkers on the Witherspoon machine are used for leds but also as GPIOs to control fans and GPUs. Signed-off-by: Cédric Le Goater Reviewed-by: Andrew Jeffery Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/aspeed.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/arm/a

[Qemu-devel] [PATCH v7 5/7] aspeed: Add EEPROM I2C devices

2018-05-29 Thread Cédric Le Goater
The Aspeed boards have at least one EEPROM to hold the Vital Product Data (VPD). Signed-off-by: Cédric Le Goater Reviewed-by: Andrew Jeffery --- hw/arm/aspeed.c | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 8efa783722c5..2ad94b494ed2

[Qemu-devel] [PATCH v7 0/7] aspeed: add a witherspoon-bmc machine

2018-05-29 Thread Cédric Le Goater
Hello This series adds a new Aspeed machine to emulate the BMC of a Witherspoon system. It also extends the other Aspeed machines with I2C devices and adds a simple model for the pca9552 LED blinker present on the Witherspoon board. Thanks, C. Changes since v6: - removed code duplication in t

[Qemu-devel] [PATCH v7 1/7] aspeed: remove ignore_memory_transaction_failures on all boards

2018-05-29 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater Reviewed-by: Peter Maydell --- hw/arm/aspeed.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index aecb3c1e7578..133614a4384d 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -279,7 +279,6 @@ static void palmetto_bmc_

Re: [Qemu-devel] [PATCH v4 1/2] qemu-error: introduce {error|warn}_report_once

2018-05-29 Thread Peter Xu
On Wed, May 30, 2018 at 07:47:32AM +0300, Michael S. Tsirkin wrote: > On Thu, May 24, 2018 at 12:44:53PM +0800, Peter Xu wrote: > > There are many error_report()s that can be used in frequently called > > functions, especially on IO paths. That can be unideal in that > > malicious guest can try to

Re: [Qemu-devel] [PATCH v2] ARM: ACPI: Fix use-after-free due to memory realloc

2018-05-29 Thread Auger Eric
Hi Shannon, On 05/30/2018 03:14 AM, Shannon Zhao wrote: > > > On 2018/5/30 3:53, Auger Eric wrote: >> Hi Shannon, >> >> On 05/29/2018 04:09 PM, Shannon Zhao wrote: >>> >>> 在 2018年5月29日,21:53,Peter Maydell 写道: > On 29 May 2018 at 04:08, Shannon Zhao wrote: > acpi_data_push use

Re: [Qemu-devel] [PATCH 0/6] ftgmac100 and NC-SI enhancements for the Aspeed SoC

2018-05-29 Thread Cédric Le Goater
On 05/30/2018 07:35 AM, Joel Stanley wrote: > On 29 May 2018 at 15:58, Cédric Le Goater wrote: >> Hello, >> >> Here is a couple of enhancements and fixes for the ftgmac100 NIC used >> on the Aspeed SoC. It includes VLAN and multicast support. >> >> Following is an assorted set of changes for the N

Re: [Qemu-devel] [PATCH v4 09/21] target: Do not include "exec/exec-all.h" if it is not necessary

2018-05-29 Thread Philippe Mathieu-Daudé
Le mer. 30 mai 2018 02:50, Philippe Mathieu-Daudé a écrit : > On Wed, May 30, 2018 at 1:42 AM, Michael S. Tsirkin > wrote: > > On Wed, May 30, 2018 at 12:12:55AM -0300, Philippe Mathieu-Daudé wrote: > >> Hi Cornelia, > >> > >> On 05/29/2018 08:40 AM, Cornelia Huck wrote: > >> > On Mon, 28 May 20

[Qemu-devel] [PATCH v2 2/4] ftgmac100: add IEEE 802.1Q VLAN support

2018-05-29 Thread Cédric Le Goater
The ftgmac100 NIC supports VLAN tag insertion and the MAC engine also has a control to remove VLAN tags from received packets. The VLAN control bits and VLAN tag information are contained in the second word of the transmit and receive descriptors. The Insert VLAN bit and the VLAN Tag available bit

[Qemu-devel] [PATCH v2 4/4] ftgmac100: remove check on runt messages

2018-05-29 Thread Cédric Le Goater
This is a ethernet wire limitation not needed in emulation. It breaks U-Boot n/w stack also. Signed-off-by: Cédric Le Goater --- hw/net/ftgmac100.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index 8a7f274dc118..909c1182eebe 100644 --- a/hw/ne

[Qemu-devel] [PATCH v2 1/4] ftgmac100: compute maximum frame size depending on the protocol

2018-05-29 Thread Cédric Le Goater
The maximum frame size includes the CRC and depends if a VLAN tag is inserted or not. Adjust the frame size limit in the transmit handler using on the FTGMAC100State buffer size and in the receive handler use the packet protocol. Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé

[Qemu-devel] [PATCH v2 3/4] ftgmac100: fix multicast hash routine

2018-05-29 Thread Cédric Le Goater
Based on the multicast hash calculation of the FTGMAC100 Linux driver. Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé --- hw/net/ftgmac100.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c index abf80655f28f..8

Re: [Qemu-devel] [PATCH for 2.10 15/35] usb: correctly handle Zero Length Packets

2018-05-29 Thread Gerd Hoffmann
On Tue, May 29, 2018 at 11:22:46AM -0300, Philippe Mathieu-Daudé wrote: > On 07/24/2017 03:27 PM, Philippe Mathieu-Daudé wrote: > > USB Specification Revision 2.0, §5.5.3: > > The Data stage of a control transfer from an endpoint to the host is > > complete when the endpoint does one of the foll

[Qemu-devel] [PATCH v2 0/4] net: ftgmac100 enhancements

2018-05-29 Thread Cédric Le Goater
Hello, Here is a couple of enhancements and fixes for the ftgmac100 NIC used on the Aspeed SoC. It includes VLAN and multicast support. Thanks, Cédric. Cédric Le Goater (4): ftgmac100: compute maximum frame size depending on the protocol ftgmac100: add IEEE 802.1Q VLAN support ftgmac100:

[Qemu-devel] [PATCH v2 1/3] slirp/ncsi: fix "Get Version ID" payload length

2018-05-29 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé --- slirp/ncsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slirp/ncsi.c b/slirp/ncsi.c index d12ba3e494b0..02d0e9def3e8 100644 --- a/slirp/ncsi.c +++ b/slirp/ncsi.c @@ -60,7 +60,7 @@ static const struct

[Qemu-devel] [PATCH v2 3/3] slirp/ncsi: add checksum support

2018-05-29 Thread Cédric Le Goater
The checksum field of a NC-SI packet contains a value that may be included in each command and response. The verification is optional but the Linux driver does so when a non-zero value is provided. Let's extend the model to compute the checksum value and exercise a little more the Linux driver. Se

[Qemu-devel] [PATCH v2 0/3] slirp: NC-SI enhancements

2018-05-29 Thread Cédric Le Goater
Hello, Here is a couple of enhancements and fixes for the NC-SI backend used on the Aspeed SoC when soldered on OpenPOWER boards. Thanks, C. Cédric Le Goater (3): slirp/ncsi: fix "Get Version ID" payload length slirp/ncsi: add a "Get Parameters" response slirp/ncsi: add checksum support

[Qemu-devel] [PATCH v2 2/3] slirp/ncsi: add a "Get Parameters" response

2018-05-29 Thread Cédric Le Goater
Command 0x17 'Get Parameters' is used to get configuration parameter values currently in effect on the controller and it is mandatory in the NS-CI specification. Provide a minimum response to exercise the kernel. Signed-off-by: Cédric Le Goater --- Changes since v1: - removed bogus MAC addr

Re: [Qemu-devel] [PATCH v4 09/21] target: Do not include "exec/exec-all.h" if it is not necessary

2018-05-29 Thread Philippe Mathieu-Daudé
On Wed, May 30, 2018 at 1:42 AM, Michael S. Tsirkin wrote: > On Wed, May 30, 2018 at 12:12:55AM -0300, Philippe Mathieu-Daudé wrote: >> Hi Cornelia, >> >> On 05/29/2018 08:40 AM, Cornelia Huck wrote: >> > On Mon, 28 May 2018 20:27:07 -0300 >> > Philippe Mathieu-Daudé wrote: >> > >> >> Code change

Re: [Qemu-devel] [PATCH 0/6] ftgmac100 and NC-SI enhancements for the Aspeed SoC

2018-05-29 Thread Joel Stanley
On 29 May 2018 at 15:58, Cédric Le Goater wrote: > Hello, > > Here is a couple of enhancements and fixes for the ftgmac100 NIC used > on the Aspeed SoC. It includes VLAN and multicast support. > > Following is an assorted set of changes for the NC-SI backend also > used on the Aspeed SoC when sold

Re: [Qemu-devel] cmdline: How to connect a SD card to a specific SD controller?

2018-05-29 Thread Thomas Huth
On 30.05.2018 01:08, Philippe Mathieu-Daudé wrote: > On 05/28/2018 01:30 AM, Philippe Mathieu-Daudé wrote: >> Hi, >> >> I'd like to connect a specific SD card to a specific SDHCI from command >> line, and I'm getting a bit lost with command line options. >> >> I'm using an updated version of this p

Re: [Qemu-devel] [Qemu-arm] [PATCH 0/6] ftgmac100 and NC-SI enhancements for the Aspeed SoC

2018-05-29 Thread Cédric Le Goater
On 05/30/2018 05:04 AM, Philippe Mathieu-Daudé wrote: > On 05/29/2018 01:57 PM, Cédric Le Goater wrote: >> On 05/29/2018 02:34 PM, Philippe Mathieu-Daudé wrote: >>> Hi Cédric, >>> >>> On 05/29/2018 03:28 AM, Cédric Le Goater wrote: Hello, Here is a couple of enhancements and fixes fo

Re: [Qemu-devel] [PATCH qemu v2 1/2] memory/hmp: Print owners/parents in "info mtree"

2018-05-29 Thread Alexey Kardashevskiy
On 3/5/18 3:40 pm, Alexey Kardashevskiy wrote: > On 30/4/18 7:53 pm, Paolo Bonzini wrote: >> On 30/04/2018 08:25, Alexey Kardashevskiy wrote: >>> +DeviceState *dev = (DeviceState *) object_dynamic_cast(obj, >>> TYPE_DEVICE); >>> +const char *id = object_property_print(obj, "id", true, NULL

Re: [Qemu-devel] [PATCH v4 1/2] qemu-error: introduce {error|warn}_report_once

2018-05-29 Thread Michael S. Tsirkin
On Thu, May 24, 2018 at 12:44:53PM +0800, Peter Xu wrote: > There are many error_report()s that can be used in frequently called > functions, especially on IO paths. That can be unideal in that > malicious guest can try to trigger the error tons of time which might > use up the log space on the ho

Re: [Qemu-devel] [PATCH v4 09/21] target: Do not include "exec/exec-all.h" if it is not necessary

2018-05-29 Thread Michael S. Tsirkin
On Wed, May 30, 2018 at 12:12:55AM -0300, Philippe Mathieu-Daudé wrote: > Hi Cornelia, > > On 05/29/2018 08:40 AM, Cornelia Huck wrote: > > On Mon, 28 May 2018 20:27:07 -0300 > > Philippe Mathieu-Daudé wrote: > > > >> Code change produced with: > >> $ git grep '#include "exec/exec-all.h"' |

Re: [Qemu-devel] [PATCH v2 08/16] qemu-iotests: Add VM.run_job()

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:39:02PM +0200, Kevin Wolf wrote: > Add an iotests.py function that runs a job and only returns when it is > destroyed. An error is logged when the job failed and job-finalize and > job-dismiss commands are issued if necessary. > > Signed-off-by: Kevin Wolf Reviewed-by:

Re: [Qemu-devel] [PATCH v2 09/16] qemu-iotests: iotests.py helper for non-file protocols

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:39:03PM +0200, Kevin Wolf wrote: > This adds two helper functions that are useful for test cases that make > use of a non-file protocol (specifically ssh). > > Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody > --- > tests/qemu-iotests/iotests.py | 17 ++

Re: [Qemu-devel] [PATCH v2 07/16] qemu-iotests: Add iotests.img_info_log()

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:39:01PM +0200, Kevin Wolf wrote: > This adds a filter function to postprocess 'qemu-img info' input > (similar to what _img_info does), and an img_info_log() function that > calls 'qemu-img info' and logs the filtered output. > > Signed-off-by: Kevin Wolf Reviewed-by:

Re: [Qemu-devel] [PATCH v2 05/16] qemu-iotests: Add VM.get_qmp_events_filtered()

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:59PM +0200, Kevin Wolf wrote: > This adds a helper function that returns a list of QMP events that are > already filtered through filter_qmp_event(). > > Signed-off-by: Kevin Wolf > Reviewed-by: Max Reitz Reviewed-by: Jeff Cody > --- > tests/qemu-iotests/iotests

Re: [Qemu-devel] [PATCH v2 04/16] block/create: Make x-blockdev-create a job

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:58PM +0200, Kevin Wolf wrote: > This changes the x-blockdev-create QMP command so that it doesn't block > the monitor and the main loop any more, but starts a background job that > performs the image creation. > > The basic job as implemented here is all that is neces

Re: [Qemu-devel] [Qemu-arm] [PATCH v3] aspeed_scu: Implement RNG register

2018-05-29 Thread Joel Stanley
On 30 May 2018 at 00:52, Peter Maydell wrote: > On 29 May 2018 at 05:19, Joel Stanley wrote: >> The ASPEED SoCs contain a single register that returns random data when >> read. This models that register so that guests can use it. >> >> The random number data register has a corresponding control r

Re: [Qemu-devel] [PATCH v2 03/16] job: Add error message for failing jobs

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:57PM +0200, Kevin Wolf wrote: > So far we relied on job->ret and strerror() to produce an error message > for failed jobs. Not surprisingly, this tends to result in completely > useless messages. > > This adds a Job.error field that can contain an error string for a >

Re: [Qemu-devel] [PATCH v4 1/2] qemu-error: introduce {error|warn}_report_once

2018-05-29 Thread Peter Xu
On Tue, May 29, 2018 at 11:30:00AM +0200, Cornelia Huck wrote: > On Thu, 24 May 2018 12:44:53 +0800 > Peter Xu wrote: > > > There are many error_report()s that can be used in frequently called > > functions, especially on IO paths. That can be unideal in that > > malicious guest can try to trigg

Re: [Qemu-devel] [PATCH] qga: add mountpoint usage to GuestFilesystemInfo

2018-05-29 Thread Eric Blake
On 05/29/2018 10:19 PM, Eric Blake wrote: @@ -846,13 +846,14 @@   # @name: disk name   # @mountpoint: mount point path   # @type: file system type string +# @usage: file system usage Needs more details.  As written, it is an integer between 0 and 100; but if you use floating point, a better d

Re: [Qemu-devel] [PATCH] qga: add mountpoint usage to GuestFilesystemInfo

2018-05-29 Thread Eric Blake
On 05/29/2018 10:01 PM, Chen Hanxiao wrote: From: Chen Hanxiao This patch adds support for getting the usage of mounted filesystem. It's very useful when we try to monitor guest's filesystem. Use df of coreutils for reference. Cc: Michael Roth Signed-off-by: Chen Hanxiao --- @@ -1072,6 +1

Re: [Qemu-devel] [PATCH v4 09/21] target: Do not include "exec/exec-all.h" if it is not necessary

2018-05-29 Thread Philippe Mathieu-Daudé
Hi Cornelia, On 05/29/2018 08:40 AM, Cornelia Huck wrote: > On Mon, 28 May 2018 20:27:07 -0300 > Philippe Mathieu-Daudé wrote: > >> Code change produced with: >> $ git grep '#include "exec/exec-all.h"' | \ >> cut -d: -f-1 | \ >> xargs egrep -L >> "(cpu_address_space_init|cpu_loo

Re: [Qemu-devel] [Qemu-arm] [PATCH 0/6] ftgmac100 and NC-SI enhancements for the Aspeed SoC

2018-05-29 Thread Philippe Mathieu-Daudé
On 05/29/2018 01:57 PM, Cédric Le Goater wrote: > On 05/29/2018 02:34 PM, Philippe Mathieu-Daudé wrote: >> Hi Cédric, >> >> On 05/29/2018 03:28 AM, Cédric Le Goater wrote: >>> Hello, >>> >>> Here is a couple of enhancements and fixes for the ftgmac100 NIC used >>> on the Aspeed SoC. It includes VLA

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/6] ftgmac100: add IEEE 802.1Q VLAN support

2018-05-29 Thread Philippe Mathieu-Daudé
On 05/29/2018 01:56 PM, Cédric Le Goater wrote: > On 05/29/2018 03:34 PM, Philippe Mathieu-Daudé wrote: >> Hi Cédric, >> >> On 05/29/2018 03:28 AM, Cédric Le Goater wrote: >>> The ftgmac100 NIC supports VLAN tag insertion and the MAC engine also >>> has a control to remove VLAN tags from received p

[Qemu-devel] [PATCH] qga: add mountpoint usage to GuestFilesystemInfo

2018-05-29 Thread Chen Hanxiao
From: Chen Hanxiao This patch adds support for getting the usage of mounted filesystem. It's very useful when we try to monitor guest's filesystem. Use df of coreutils for reference. Cc: Michael Roth Signed-off-by: Chen Hanxiao --- qga/commands-posix.c | 17 + qga/qapi-schema.

Re: [Qemu-devel] [RFC 0/3] nRF51 SoC: Add UART support

2018-05-29 Thread Philippe Mathieu-Daudé
Hi Julia, On 05/29/2018 07:03 PM, Julia Suvorova via Qemu-devel wrote: > This series adds basic support for the nRF51 SoC UART, that used in > BBC Micro:bit board, and QTest for it. > > Based-on: <20180503090532.3113-1-j...@jms.id.au> > > Julia Suvorova (3): > hw/arm/nrf51_soc: Fix compilation

Re: [Qemu-devel] [PATCH] socket: dont't free msgfds if error equals EAGAIN

2018-05-29 Thread Peter Xu
On Tue, May 29, 2018 at 10:52:40AM +0800, linzhecheng wrote: > Signed-off-by: linzhecheng > > diff --git a/chardev/char-socket.c b/chardev/char-socket.c > index 159e69c3b1..17519ec589 100644 > --- a/chardev/char-socket.c > +++ b/chardev/char-socket.c > @@ -134,8 +134,8 @@ static int tcp_chr_write

Re: [Qemu-devel] [Qemu-arm] [PATCH v4 2/2] arm_gicv3_kvm: kvm_dist_get/put: skip the registers banked by GICR

2018-05-29 Thread Shannon Zhao
On 2018/5/29 22:44, Peter Maydell wrote: > On 25 May 2018 at 12:22, Shannon Zhao wrote: >> While we skip the GIC_INTERNAL irqs, we don't change the register offset >> accordingly. This will overlap the GICR registers value and leave the >> last GIC_INTERNAL irq's registers out of update. >> >>

Re: [Qemu-devel] [PATCH v2 00/16] block: Make blockdev-create a job and stable API

2018-05-29 Thread Jeff Cody
On Tue, May 29, 2018 at 10:38:54PM +0200, Kevin Wolf wrote: > This changes the x-blockdev-create QMP command so that it doesn't block > the monitor and the main loop any more, but starts a background job that > performs the image creation. > I'm sure modifying the drivers is fodder for a future s

Re: [Qemu-devel] [PATCH] Fix hang with -L and symlink loop

2018-05-29 Thread no-reply
Hi, This series failed docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. Type: series Message-id: 20180529234409.27023-1-evgr...@chromium.org Subject: [Qemu-devel] [PATCH] Fix hang with -L

[Qemu-devel] [PATCH] Fix hang with -L and symlink loop

2018-05-29 Thread Evan Green
When using -L with Linux app emulation, there is an issue in init_paths where Qemu will get lost exploring a directory tree with a symlink loop in it. This causes Qemu to hang, and eventually consume all memory in the system. Qemu's code for pre-exploring the entire directory tree is both error-pr

Re: [Qemu-devel] [PATCH v2] ARM: ACPI: Fix use-after-free due to memory realloc

2018-05-29 Thread Shannon Zhao
On 2018/5/30 3:53, Auger Eric wrote: > Hi Shannon, > > On 05/29/2018 04:09 PM, Shannon Zhao wrote: >> >> >>> 在 2018年5月29日,21:53,Peter Maydell 写道: >>> On 29 May 2018 at 04:08, Shannon Zhao wrote: acpi_data_push uses g_array_set_size to resize the memory size. If there is no enou

Re: [Qemu-devel] [PATCH] nbd/client: Relax handling of large NBD_CMD_BLOCK_STATUS reply

2018-05-29 Thread Eric Blake
On 05/29/2018 10:34 AM, Vladimir Sementsov-Ogievskiy wrote: 04.05.2018 01:26, Eric Blake wrote: The NBD spec is proposing a relaxation of NBD_CMD_BLOCK_STATUS where a server may have the final extent per context give a length beyond the original request, if it can easily prove that subsequent by

[Qemu-devel] About cpu_physical_memory_map()

2018-05-29 Thread Huaicheng Li
Dear QEMU/KVM developers, I was trying to map a buffer in host QEMU process to a guest user space application. I tried to achieve this by allocating a buffer in the guest application first, then map this buffer to QEMU process address space via GVA -> GPA --> HVA (GPA to HVA is done via cpu_physic

Re: [Qemu-devel] [PATCH v1 17/30] RISC-V: Replace __builtin_popcount with ctpop8 in PLIC

2018-05-29 Thread Alistair Francis
On Tue, May 22, 2018 at 5:15 PM, Michael Clark wrote: > The mode variable only uses the lower 4-bits (M,H,S,U) so > replace the GCC specific __builtin_popcount with ctpop8. > > Cc: Palmer Dabbelt > Cc: Sagar Karandikar > Cc: Bastian Koppelmann > Cc: Alistair Francis > Signed-off-by: Michael Cl

Re: [Qemu-devel] [PATCH v1 16/30] RISC-V: Use riscv prefix consistently on cpu helpers

2018-05-29 Thread Alistair Francis
On Tue, May 22, 2018 at 5:15 PM, Michael Clark wrote: > * Add riscv prefix to raise_exception function > * Add riscv prefix to CSR read/write functions > * Add riscv prefix to signal handler function > * Add riscv prefix to get fflags function > * Remove redundant declaration of riscv_cpu_init >

Re: [Qemu-devel] [PATCH v1 11/30] RISC-V: Split out mstatus_fs from tb_flags

2018-05-29 Thread Alistair Francis
On Tue, May 22, 2018 at 5:14 PM, Michael Clark wrote: > From: Richard Henderson > > Cc: Sagar Karandikar > Cc: Bastian Koppelmann > Cc: Palmer Dabbelt > Cc: Alistair Francis > Cc: Richard Henderson > Signed-off-by: Michael Clark > Reviewed-by: Michael Clark Shouldn't this also have Richar

Re: [Qemu-devel] [PATCH v1 12/30] RISC-V: Mark mstatus.fs dirty

2018-05-29 Thread Alistair Francis
On Tue, May 22, 2018 at 5:14 PM, Michael Clark wrote: > From: Richard Henderson > > Modifed from Richard Henderson's patch [1] to integrate > with the new control and status register implementation. > > [1] https://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg07034.html > > Note: the f* CS

Re: [Qemu-devel] [PATCH v1 09/30] RISC-V: Implement atomic mip/sip CSR updates

2018-05-29 Thread Alistair Francis
On Tue, May 22, 2018 at 5:14 PM, Michael Clark wrote: > Use the new CSR read/modify/write interface to implement > atomic updates to mip/sip. > > Cc: Sagar Karandikar > Cc: Bastian Koppelmann > Cc: Palmer Dabbelt > Cc: Alistair Francis > Signed-off-by: Michael Clark Acked-by: Alistair Franci

Re: [Qemu-devel] [PATCH v1 03/30] RISC-V: Use atomic_cmpxchg to update PLIC bitmaps

2018-05-29 Thread Alistair Francis
On Tue, May 22, 2018 at 5:14 PM, Michael Clark wrote: > The PLIC previously used a mutex to protect against concurrent > access to the claimed and pending bitfields. Instead of using > a mutex, we update the bitfields using atomic_cmpxchg. > > Rename sifive_plic_num_irqs_pending to sifive_plic_irq

Re: [Qemu-devel] [PATCH] target/ppc: Use proper logging function for possible guest errors

2018-05-29 Thread Alistair Francis
On Mon, May 28, 2018 at 11:11 AM, Thomas Huth wrote: > fprintf() and qemu_log_separate() are frowned upon these days for printing > logging information in QEMU. Accessing the wrong SPRs indicates wrong guest > behaviour in most cases, and we've got a proper way to log such situations, > which is t

Re: [Qemu-devel] cmdline: How to connect a SD card to a specific SD controller?

2018-05-29 Thread Philippe Mathieu-Daudé
On 05/28/2018 01:30 AM, Philippe Mathieu-Daudé wrote: > Hi, > > I'd like to connect a specific SD card to a specific SDHCI from command > line, and I'm getting a bit lost with command line options. > > I'm using an updated version of this patch, but this is not relevant to > this thread: > http:/

[Qemu-devel] [RFC 3/3] tests/boot-serial-test: Add support for the microbit board

2018-05-29 Thread Julia Suvorova via Qemu-devel
New mini-kernel test for nRF51 SoC UART. Signed-off-by: Julia Suvorova --- tests/boot-serial-test.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index 4d6815c3e0..e6dbc8a293 100644 --- a/tests/boot-serial-test.c +++ b/tests/

[Qemu-devel] [RFC 0/3] nRF51 SoC: Add UART support

2018-05-29 Thread Julia Suvorova via Qemu-devel
This series adds basic support for the nRF51 SoC UART, that used in BBC Micro:bit board, and QTest for it. Based-on: <20180503090532.3113-1-j...@jms.id.au> Julia Suvorova (3): hw/arm/nrf51_soc: Fix compilation and memory regions hw/char/nrf51_uart: Implement nRF51 SoC UART tests/boot-serial

[Qemu-devel] [RFC 2/3] hw/char/nrf51_uart: Implement nRF51 SoC UART

2018-05-29 Thread Julia Suvorova via Qemu-devel
Basic implementation of nRF51 SoC UART. Description could be found here: http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.1.pdf The following features are not yet implemented: Control with SUSPEND/START*/STOP* CTS/NCTS flow control Mapping registers to pins Signed-off-by: Julia Suvo

[Qemu-devel] [RFC 1/3] hw/arm/nrf51_soc: Fix compilation and memory regions

2018-05-29 Thread Julia Suvorova via Qemu-devel
nRF51 SoC implementation is intended for the BBC Micro:bit board, which has 256 KB flash and 16 KB RAM. Added FICR defines. Signed-off-by: Julia Suvorova --- hw/arm/nrf51_soc.c | 12 +++- include/hw/arm/nrf51_soc.h | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --

Re: [Qemu-devel] [PATCH v4] block: fix QEMU crash with scsi-hd and drive_del

2018-05-29 Thread Greg Kurz
On Tue, 29 May 2018 22:19:17 +0200 Kevin Wolf wrote: > Am 28.05.2018 um 14:03 hat Greg Kurz geschrieben: > > Removing a drive with drive_del while it is being used to run an I/O > > intensive workload can cause QEMU to crash. > > > > An AIO flush can yield at some point: > > > > blk_aio_flush_e

Re: [Qemu-devel] [PATCH 08/13] 9p: darwin: Ignore O_{NOATIME, DIRECT}

2018-05-29 Thread Greg Kurz
On Sat, 26 May 2018 01:23:10 -0400 k...@juliacomputing.com wrote: > From: Keno Fischer > > Signed-off-by: Keno Fischer > --- > hw/9pfs/9p.c | 37 +++-- > 1 file changed, 23 insertions(+), 14 deletions(-) > > diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c > index 4965

Re: [Qemu-devel] [PATCH 06/13] 9p: darwin: Address minor differences

2018-05-29 Thread Greg Kurz
On Sat, 26 May 2018 01:23:08 -0400 k...@juliacomputing.com wrote: > From: Keno Fischer > > - Darwin doesn't have strchrnul > - Comparisons of mode_t with -1 require an explicit cast, since mode_t > is unsigned on Darwin. > > Signed-off-by: Keno Fischer > --- > hw/9pfs/9p-local.c | 9 ++-

Re: [Qemu-devel] [PATCH v2 1/2] qapi: allow empty branches in flat unions

2018-05-29 Thread Eric Blake
On 05/29/2018 11:41 AM, Anton Nefedov wrote: It often happens that just a few discriminator values imply extra data in a flat union. Existing checks did not make possible to leave other values uncovered. Such cases had to be worked around by either stating a dummy (empty) type or introducing anot

Re: [Qemu-devel] [PATCH] ui/cocoa.m: Suppress NSFileHandlingPanelOKButton depreciation warning

2018-05-29 Thread Eric Blake
On 05/29/2018 01:08 PM, John Arbuckle wrote: In the subject: s/depreciation/deprecation/ OSX 10.13 deprecates the NSFileHandlingPanelOKButton constant, and would rather you use NSModalResponseOK, which was introduced in OS 10.9. Use the recommended new constant name, with a backward compatibili

[Qemu-devel] [PATCH v2 15/16] qemu-iotests: Rewrite 213 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 213 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wo

Re: [Qemu-devel] [PATCH v2 2/2] qapi: remove empty flat union branches and types

2018-05-29 Thread Eric Blake
On 05/29/2018 11:41 AM, Anton Nefedov wrote: Flat unions may now have uncovered branches, so it is possible to get rid of empty types defined for that purpose only. Signed-off-by: Anton Nefedov --- qapi/block-core.json | 55 qapi/crypto.js

[Qemu-devel] [PATCH v2 12/16] qemu-iotests: Rewrite 210 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 210 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wo

[Qemu-devel] [PATCH v2 11/16] qemu-iotests: Rewrite 207 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 207 to work with the new x-blockdev-create job rather than the old synchronous version of the command. Most of the test cases stay the same as before (the exception being some improved 'size' options that allow distinguishing which command created the image), but in ord

Re: [Qemu-devel] [PATCH 07/13] 9p: darwin: Properly translate AT_REMOVEDIR flag

2018-05-29 Thread Greg Kurz
On Sat, 26 May 2018 01:23:09 -0400 k...@juliacomputing.com wrote: > From: Keno Fischer > > This code relied on P9_DOTL_AT_REMOVEDIR and AT_REMOVEDIR having the same > numerical value, but on Darwin, they do not. > > Signed-off-by: Keno Fischer > --- > hw/9pfs/9p-local.c | 12 +++- > 1

[Qemu-devel] [PATCH v2 09/16] qemu-iotests: iotests.py helper for non-file protocols

2018-05-29 Thread Kevin Wolf
This adds two helper functions that are useful for test cases that make use of a non-file protocol (specifically ssh). Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 17 + 1 file changed, 17 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iot

[Qemu-devel] [PATCH v2 13/16] qemu-iotests: Rewrite 211 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 211 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wo

[Qemu-devel] [PATCH v2 16/16] block/create: Mark blockdev-create stable

2018-05-29 Thread Kevin Wolf
We're ready to declare the blockdev-create job stable. This renames the corresponding QMP command from x-blockdev-create to blockdev-create. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- qapi/block-core.json | 4 ++-- qapi/job.json | 2 +- blo

[Qemu-devel] [PATCH v2 05/16] qemu-iotests: Add VM.get_qmp_events_filtered()

2018-05-29 Thread Kevin Wolf
This adds a helper function that returns a list of QMP events that are already filtered through filter_qmp_event(). Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 5 + 1 file changed, 5 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/q

[Qemu-devel] [PATCH v2 14/16] qemu-iotests: Rewrite 212 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 212 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wo

[Qemu-devel] [PATCH v2 04/16] block/create: Make x-blockdev-create a job

2018-05-29 Thread Kevin Wolf
This changes the x-blockdev-create QMP command so that it doesn't block the monitor and the main loop any more, but starts a background job that performs the image creation. The basic job as implemented here is all that is necessary to make image creation asynchronous and to provide a QMP interfac

[Qemu-devel] [PATCH v2 07/16] qemu-iotests: Add iotests.img_info_log()

2018-05-29 Thread Kevin Wolf
This adds a filter function to postprocess 'qemu-img info' input (similar to what _img_info does), and an img_info_log() function that calls 'qemu-img info' and logs the filtered output. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 18 ++ 1 file changed, 18 inser

[Qemu-devel] [PATCH v2 06/16] qemu-iotests: Add VM.qmp_log()

2018-05-29 Thread Kevin Wolf
This adds a helper function that logs both the QMP request and the received response before returning it. Signed-off-by: Kevin Wolf Reviewed-by: Jeff Cody --- tests/qemu-iotests/iotests.py | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qem

[Qemu-devel] [PATCH v2 00/16] block: Make blockdev-create a job and stable API

2018-05-29 Thread Kevin Wolf
This changes the x-blockdev-create QMP command so that it doesn't block the monitor and the main loop any more, but starts a background job that performs the image creation. The basic job as implemented here is all that is necessary to make image creation asynchronous and to provide a QMP interfac

[Qemu-devel] [PATCH v2 08/16] qemu-iotests: Add VM.run_job()

2018-05-29 Thread Kevin Wolf
Add an iotests.py function that runs a job and only returns when it is destroyed. An error is logged when the job failed and job-finalize and job-dismiss commands are issued if necessary. Signed-off-by: Kevin Wolf --- tests/qemu-iotests/iotests.py | 19 +++ 1 file changed, 19 ins

[Qemu-devel] [PATCH v2 02/16] vhdx: Fix vhdx_co_create() return value

2018-05-29 Thread Kevin Wolf
.bdrv_co_create() is supposed to return 0 on success, but vhdx could return a positive value instead. Fix this. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/vhdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vhdx.c b/block/vhdx

[Qemu-devel] [PATCH v2 01/16] vdi: Fix vdi_co_do_create() return value

2018-05-29 Thread Kevin Wolf
.bdrv_co_create() is supposed to return 0 on success, but vdi could return a positive value instead. Fix this. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/vdi.c b/block/vdi.c index 96a22b8e83.

[Qemu-devel] [PATCH v2 10/16] qemu-iotests: Rewrite 206 for blockdev-create job

2018-05-29 Thread Kevin Wolf
This rewrites the test case 206 to work with the new x-blockdev-create job rather than the old synchronous version of the command. All of the test cases stay the same as before, but in order to be able to implement proper job handling, the test case is rewritten in Python. Signed-off-by: Kevin Wo

[Qemu-devel] [PATCH v2 03/16] job: Add error message for failing jobs

2018-05-29 Thread Kevin Wolf
So far we relied on job->ret and strerror() to produce an error message for failed jobs. Not surprisingly, this tends to result in completely useless messages. This adds a Job.error field that can contain an error string for a failing job, and a parameter to job_completed() that sets the field. As

Re: [Qemu-devel] [PATCH 05/13] 9p: darwin: Handle struct dirent differences

2018-05-29 Thread Greg Kurz
On Sat, 26 May 2018 01:23:07 -0400 k...@juliacomputing.com wrote: > From: Keno Fischer > > Signed-off-by: Keno Fischer > --- > hw/9pfs/9p-synth.c | 4 > hw/9pfs/9p.c | 18 -- > 2 files changed, 20 insertions(+), 2 deletions(-) > > diff --git a/hw/9pfs/9p-synth.c b/

Re: [Qemu-devel] [PATCH] qemu: Emit RESET event with -no-reboot option

2018-05-29 Thread no-reply
Hi, This series failed build test on s390x host. Please find the details below. Type: series Message-id: 20180529055312.29633-1-christian_lud...@genua.de Subject: [Qemu-devel] [PATCH] qemu: Emit RESET event with -no-reboot option === TEST SCRIPT BEGIN === #!/bin/bash # Testing script will be inv

Re: [Qemu-devel] [PATCH v4] block: fix QEMU crash with scsi-hd and drive_del

2018-05-29 Thread Kevin Wolf
Am 28.05.2018 um 14:03 hat Greg Kurz geschrieben: > Removing a drive with drive_del while it is being used to run an I/O > intensive workload can cause QEMU to crash. > > An AIO flush can yield at some point: > > blk_aio_flush_entry() > blk_co_flush(blk) > bdrv_co_flush(blk->root->bs) >...

Re: [Qemu-devel] [PATCH 00/15] linux-user: move more definitions out of syscall_defs.h

2018-05-29 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180529194207.31503-1-laur...@vivier.eu Subject: [Qemu-devel] [PATCH 00/15] linux-user: move more definitions out of syscall_defs.h === TEST SCRIPT BEGIN === #!/bin/bash B

Re: [Qemu-devel] Live viewing qemu running image

2018-05-29 Thread Eric Blake
On 05/29/2018 07:33 AM, Olga Levy wrote: Hi, Nice to meet you. I'm a new security engineer and working on a prototype using QEMU. What I need is to collect running image internal data (like running processes, netstat, files modification, etc.) but without running any process inside. I mean, doi

Re: [Qemu-devel] [qemu PATCH v4 0/4] support NFIT platform capabilities

2018-05-29 Thread Ross Zwisler
Ping on this series. Rob, I think I've addressed all your feedback. Can you please verify? Thanks, - Ross On Mon, May 21, 2018 at 10:31:59AM -0600, Ross Zwisler wrote: > Changes since v3: > * Updated the text in docs/nvdimm.txt to make it clear that the value >being passed in on the comman

[Qemu-devel] [PATCH 08/15] linux-user: move get_sp_from_cpustate() to target_cpu.h

2018-05-29 Thread Laurent Vivier
Remove useless includes Fix HPPA include guard. Signed-off-by: Laurent Vivier --- linux-user/aarch64/signal.c | 1 - linux-user/aarch64/target_cpu.h | 4 linux-user/aarch64/target_signal.h| 7 --- linux-user/alpha/signal.c | 1 - linux-user/alpha/targ

Re: [Qemu-devel] [Qemu-block] [PATCH 03/14] job: Add error message for failing jobs

2018-05-29 Thread Kevin Wolf
Am 29.05.2018 um 16:43 hat Jeff Cody geschrieben: > On Fri, May 25, 2018 at 06:33:16PM +0200, Kevin Wolf wrote: > > So far we relied on job->ret and strerror() to produce an error message > > for failed jobs. Not surprisingly, this tends to result in completely > > useless messages. > > > > This a

[Qemu-devel] [PATCH 11/15] linux-user: move mips signal definitions to mips/target_signal.h

2018-05-29 Thread Laurent Vivier
No code change. Signed-off-by: Laurent Vivier --- linux-user/mips/target_signal.h | 50 ++ linux-user/mips64/target_signal.h | 49 ++ linux-user/syscall_defs.h | 56 +-- 3 files changed,

[Qemu-devel] [PATCH 14/15] linux-user: move hppa signal definitions to hppa/target_signal.h

2018-05-29 Thread Laurent Vivier
No code change. Signed-off-by: Laurent Vivier --- linux-user/hppa/target_signal.h | 46 linux-user/syscall_defs.h | 52 - 2 files changed, 46 insertions(+), 52 deletions(-) diff --git a/linux-user/hppa/target_sig

Re: [Qemu-devel] [PATCH v2] ARM: ACPI: Fix use-after-free due to memory realloc

2018-05-29 Thread Auger Eric
Hi Shannon, On 05/29/2018 04:09 PM, Shannon Zhao wrote: > > >> 在 2018年5月29日,21:53,Peter Maydell 写道: >> >>> On 29 May 2018 at 04:08, Shannon Zhao wrote: >>> acpi_data_push uses g_array_set_size to resize the memory size. If there >>> is no enough contiguous memory, the address will be changed.

  1   2   3   4   >