Re: [PATCH v2] target/arm: Merge arm_cpu_vq_map_next_smaller into sole caller

2019-11-17 Thread Andrew Jones
On Sat, Nov 16, 2019 at 12:06:42PM +0100, Richard Henderson wrote: > Coverity reports, in sve_zcr_get_valid_len, > > "Subtract operation overflows on operands > arm_cpu_vq_map_next_smaller(cpu, start_vq + 1U) and 1U" > > First, the aarch32 stub version of arm_cpu_vq_map_next_smaller, > returning

Re: [PATCH] target/arm: Clean up arm_cpu_vq_map_next_smaller asserts

2019-11-17 Thread Andrew Jones
On Fri, Nov 15, 2019 at 06:45:51PM +0100, Richard Henderson wrote: > On 11/15/19 5:06 PM, Andrew Jones wrote: > >> bitnum = find_last_bit(cpu->sve_vq_map, vq - 1); > >> -return bitnum == vq - 1 ? 0 : bitnum + 1; > >> + > >> +/* We always have vq == 1 present in sve_vq_map. */ > > > >

Re: [RFC PATCH 02/11] gdbstub: stop passing GDBState * around

2019-11-17 Thread Richard Henderson
On 11/15/19 6:29 PM, Alex Bennée wrote: > We only have one GDBState which should be allocated at the time we > process any commands. This will make further clean-up a bit easier. > > Signed-off-by: Alex Bennée > --- > gdbstub.c | 307 +++--- > 1 fi

Re: [PATCH 5/5] aspeed: Add support for the tacoma-bmc board

2019-11-17 Thread Cédric Le Goater
On 18/11/2019 08:18, Joel Stanley wrote: > On Thu, 14 Nov 2019 at 09:46, Cédric Le Goater wrote: >> >> The Tacoma BMC board is replacement board for the BMC of the OpenPOWER >> Witherspoon system. It uses a AST2600 SoC instead of a AST2500 and is >> used for HW bringup. >> >> Signed-off-by: Cédric

Re: [RFC PATCH 01/11] gdbstub: move allocation of GDBState to one place

2019-11-17 Thread Richard Henderson
On 11/15/19 6:29 PM, Alex Bennée wrote: > > static GDBState *gdbserver_state; > > +static GDBState *gdb_allocate_state(void) > +{ > +g_assert(!gdbserver_state); > +gdbserver_state = g_new0(GDBState, 1); > +return gdbserver_state; > +} > + Actually, if we're only going to have one,

Re: [RFC PATCH 01/11] gdbstub: move allocation of GDBState to one place

2019-11-17 Thread Richard Henderson
On 11/15/19 6:29 PM, Alex Bennée wrote: > We use g_new0() as it is the preferred form for such allocations. We > can also ensure that gdbserver_state is reset in one place. > > Signed-off-by: Alex Bennée > --- > gdbstub.c | 14 +- > 1 file changed, 9 insertions(+), 5 deletions(-) Re

Re: [PATCH v16 03/14] util/cutils: refactor do_strtosz() to support suffixes list

2019-11-17 Thread Tao Xu
On 11/15/2019 8:11 PM, Philippe Mathieu-Daudé wrote: Cc'ing Markus & Stefan. On 11/15/19 8:53 AM, Tao Xu wrote: Add do_strtomul() to convert string according to different suffixes. Reviewed-by: Eduardo Habkost Signed-off-by: Tao Xu --- No changes in v16. Changes in v15: - Add a new p

Re: [PATCH 3/5] aspeed/smc: Add AST2600 timings registers

2019-11-17 Thread Joel Stanley
On Thu, 14 Nov 2019 at 09:46, Cédric Le Goater wrote: > > Each CS has its own Read Timing Compensation Register on newer SoCs. > > Signed-off-by: Cédric Le Goater Reviewed-by: Joel Stanley > --- > include/hw/ssi/aspeed_smc.h | 1 + > hw/ssi/aspeed_smc.c | 17 ++--- > 2 fi

Re: [PATCH 5/5] aspeed: Add support for the tacoma-bmc board

2019-11-17 Thread Joel Stanley
On Thu, 14 Nov 2019 at 09:46, Cédric Le Goater wrote: > > The Tacoma BMC board is replacement board for the BMC of the OpenPOWER > Witherspoon system. It uses a AST2600 SoC instead of a AST2500 and is > used for HW bringup. > > Signed-off-by: Cédric Le Goater > --- > hw/arm/aspeed.c | 52 +++

Re: [PATCH 4/5] aspeed: Remove AspeedBoardConfig array and use AspeedMachineClass

2019-11-17 Thread Joel Stanley
On Thu, 14 Nov 2019 at 09:46, Cédric Le Goater wrote: > > AspeedBoardConfig is a redundant way to define class attributes and it > complexifies the machine definition and initialization. > > Signed-off-by: Cédric Le Goater Reviewed-by: Joel Stanley A good cleanup. > --- > include/hw/arm/aspe

Re: [PATCH 2/5] aspeed/smc: Do not map disabled segment on the AST2600

2019-11-17 Thread Joel Stanley
On Thu, 14 Nov 2019 at 09:46, Cédric Le Goater wrote: > > The segments can be disabled on the AST2600 (zero register value). > CS0 is open by default but not the other CS. This is closing the > access to the flash device in user mode and forbids scanning. > > In the model, check the segment size a

Re: [PATCH 1/5] aspeed/smc: Restore default AHB window mapping at reset

2019-11-17 Thread Joel Stanley
On Thu, 14 Nov 2019 at 09:46, Cédric Le Goater wrote: > > The current model only restores the Segment Register values but leaves > the previous CS mapping behind. Introduce a helper setting the > register value and mapping the region at the requested address. Use > this helper when a Segment regis

Re: [RFC v2 00/14] Add SDEI support for arm64

2019-11-17 Thread Guoheyi
Hi Peter, Could you spare some time to review the framework and provide comments and advice? Thanks, HG On 2019/11/5 17:10, Heyi Guo wrote: SDEI is for ARM "Software Delegated Exception Interface". AS ARM64 doesn't have native non-maskable interrupt (NMI), we rely on higher privileged (lar

Re: [RFC v2 14/14] virt/acpi: add SDEI table if SDEI is enabled

2019-11-17 Thread Guoheyi
On 2019/11/12 22:52, Igor Mammedov wrote: On Tue, 5 Nov 2019 17:10:56 +0800 Heyi Guo wrote: Add SDEI table if SDEI is enabled, so that guest OS can get aware and utilize the interfaces. Signed-off-by: Heyi Guo Cc: Peter Maydell Cc: Dave Martin Cc: Marc Zyngier Cc: Mark Rutland Cc: Jam

[PATCH v2] Implement backend program convention command for vhost-user-blk

2019-11-17 Thread Micky Yun Chan
From: michan Signed-off-by: Micky Yun Chan (michiboo) --- contrib/vhost-user-blk/vhost-user-blk.c | 102 ++-- 1 file changed, 58 insertions(+), 44 deletions(-) diff --git a/contrib/vhost-user-blk/vhost-user-blk.c b/contrib/vhost-user-blk/vhost-user-blk.c index ae61034656..

[PATCH] misc/pca9552: Add qom set and get

2019-11-17 Thread Joel Stanley
Following the pattern of the work recently done with the ASPEED GPIO model, this adds support for inspecting and modifying the PCA9552 LEDs from the monitor. (qemu) qom-set /machine/unattached/device[17] led0 on (qemu) qom-get /machine/unattached/device[17] led0 "on" (qemu) qom-set /machin

[PATCH v8 1/3] block: introduce compress filter driver

2019-11-17 Thread Andrey Shinkevich
Allow writing all the data compressed through the filter driver. The written data will be aligned by the cluster size. Based on the QEMU current implementation, that data can be written to unallocated clusters only. May be used for a backup job. Suggested-by: Max Reitz Signed-off-by: Andrey Shink

[PATCH v8 3/3] tests/qemu-iotests: add case to write compressed data of multiple clusters

2019-11-17 Thread Andrey Shinkevich
Add the case to the iotest #214 that checks possibility of writing compressed data of more than one cluster size. The test case involves the compress filter driver showing a sample usage of that. Signed-off-by: Andrey Shinkevich --- tests/qemu-iotests/214 | 43 +++

[PATCH v8 2/3] qcow2: Allow writing compressed data of multiple clusters

2019-11-17 Thread Andrey Shinkevich
QEMU currently supports writing compressed data of the size equal to one cluster. This patch allows writing QCOW2 compressed data that exceed one cluster. Now, we split buffered data into separate clusters and write them compressed using the block/aio_task API. Suggested-by: Pavel Butsykin Sugges

[PATCH v8 0/3] qcow2: advanced compression options

2019-11-17 Thread Andrey Shinkevich
The compression filter driver is introduced as suggested by Max. A sample usage of the filter can be found in the test #214. Now, multiple clusters can be written compressed. It is useful for the backup job. v8: The filter child was changed from the 'backing' to the 'file' one. Discussed in the

[QEMU-DEVEL][PATCH] gpio: fix memory leak in aspeed_gpio_init()

2019-11-17 Thread pannengyuan
From: PanNengyuan Address Sanitizer shows memory leak in hw/gpio/aspeed_gpio.c:875 Reported-by: Euler Robot Signed-off-by: PanNengyuan --- hw/gpio/aspeed_gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/gpio/aspeed_gpio.c b/hw/gpio/aspeed_gpio.c index 7acc5fa..41e11ea 100644 ---

[Qemu-devel][PATCH] ppc/spapr_events: fix potential NULL pointer dereference in rtas_event_log_dequeue

2019-11-17 Thread pannengyuan
From: PanNengyuan source is being dereferenced before it is null checked, hence there is a potential null pointer dereference. This fixes: 360 CID 68911917: (NULL_RETURNS) 361. dereference: Dereferencing "source", which is known to be "NULL". 361if (so

Re: [PATCH 0/2] not use multifd during postcopy

2019-11-17 Thread Wei Yang
Ping for comments. On Sat, Oct 26, 2019 at 07:19:58AM +0800, Wei Yang wrote: >We don't support multifd during postcopy, but user still could enable >both multifd and postcopy. This leads to migration failure. > >Patch 1 does proper cleanup, otherwise we may have data corruption. >Patch 2 does the

[PATCH for-5.0 4/4] spapr: Abort if XICS interrupt controller cannot be initialized

2019-11-17 Thread Greg Kurz
Failing to set any of the ICS property should really never happen: - object_property_add_child() always succeed unless the child object already has a parent, which isn't the case here obviously since the ICS has just been created with object_new() - the ICS has an "nr-irqs" property than can be

[PATCH for-5.0 3/4] xics: Link ICP_PROP_CPU property to ICPState::cs pointer

2019-11-17 Thread Greg Kurz
The ICP object has both a pointer and an ICP_PROP_CPU property pointing to the cpu. Confusing bugs could arise if these ever go out of sync. Change the property definition so that it explicitely sets the pointer. The property isn't optional : not being able to set the link is a bug and QEMU should

[PATCH for-5.0 2/4] xics: Link ICP_PROP_XICS property to ICPState::xics pointer

2019-11-17 Thread Greg Kurz
The ICP object has both a pointer and an ICP_PROP_XICS property pointing to the XICS fabric. Confusing bugs could arise if these ever go out of sync. Change the property definition so that it explicitely sets the pointer. The property isn't optional : not being able to set the link is a bug and QE

[PATCH for-5.0 1/4] xics: Link ICS_PROP_XICS property to ICSState::xics pointer

2019-11-17 Thread Greg Kurz
The ICS object has both a pointer and an ICS_PROP_XICS property pointing to the XICS fabric. Confusing bugs could arise if these ever go out of sync. Change the property definition so that it explicitely sets the pointer. The property isn't optional : not being able to set the link is a bug and QE

[PATCH for-5.0 0/4] ppc: Some more QOM cleanup for XICS

2019-11-17 Thread Greg Kurz
This series consolidates some more QOM links and pointers that point to the same object. While here also simplify the XICS interrupt controller init in the machine code. -- Greg --- Greg Kurz (4): xics: Link ICS_PROP_XICS property to ICSState::xics pointer xics: Link ICP_PROP_XICS pr

[PATCH] Modify tests to work with clang

2019-11-17 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- tests/tcg/multiarch/float_helpers.c | 2 -- tests/tcg/multiarch/linux-test.c| 6 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/tcg/multiarch/float_helpers.c b/tests/tcg/multiarch/float_helpers.c index 8ee7903..bc530e5 100644 ---

[Bug 1846427] Re: 4.1.0: qcow2 corruption on savevm/quit/loadvm cycle

2019-11-17 Thread Matti Hameister
The image was fine before upgrading qemu. I rechecked the image after the first use and it was fine. But after the larger Windows 1903 -> 1909 upgrade done in qemu 4.1.0 the image was damaged. I will try the git master version of qemu in the coming days and report back. -- You received this bug n

Re: [PATCH v2] mc146818rtc: fix timer interrupt reinjection

2019-11-17 Thread Alex Williamson
On Sun, 17 Nov 2019 11:12:43 +0100 Paolo Bonzini wrote: > On 17/11/19 05:31, Alex Williamson wrote: > > The 'merge' option gives me a similar error. The 'delay' option is > > the only other choice where I can actually start the VM, but this > > results in the commandline: > > > > -rtc base=loca

[PATCH] qom/object: enable setter for uint types

2019-11-17 Thread Felipe Franciosi
Traditionally, the uint-specific property helpers only offer getters. When adding object (or class) uint types, one must therefore use the generic property helper if a setter is needed. This enhances the uint-specific property helper APIs by adding a 'readonly' field and modifying all users of tha

Re: [PATCH v2] mc146818rtc: fix timer interrupt reinjection

2019-11-17 Thread Paolo Bonzini
On 17/11/19 05:31, Alex Williamson wrote: > The 'merge' option gives me a similar error. The 'delay' option is > the only other choice where I can actually start the VM, but this > results in the commandline: > > -rtc base=localtime > > (no driftfix specified) none is the default, so that's oka

[PATCH 2/2] target/arm: Relax r13 restriction for ldrex/strex for v8.0

2019-11-17 Thread Richard Henderson
Armv8-A removes UNPREDICTABLE for R13 for these cases. Signed-off-by: Richard Henderson --- target/arm/translate.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index b285b23858..3db8103966 100644 --- a/target/arm/tran

[PATCH 1/2] target/arm: Do not reject rt == rt2 for strexd

2019-11-17 Thread Richard Henderson
There was too much cut and paste between ldrexd and strexd, as ldrexd does prohibit two output registers the same. Fixes: af288228995 Reported-by: Michael Goffioul Signed-off-by: Richard Henderson --- target/arm/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tar

[PATCH for-4.2 0/2] target/arm: two fixes for ldrex/strex

2019-11-17 Thread Richard Henderson
During this cycle I added checks for UNPREDICTABLE behavior, but didn't quite get it all right. r~ Richard Henderson (2): target/arm: Do not reject rt == rt2 for strexd target/arm: Relax r13 restriction for ldrex/strex for v8.0 target/arm/translate.c | 10 +- 1 file changed, 5 ins

Re: Invalid ARM instruction for clang-compiled Android code

2019-11-17 Thread Richard Henderson
On 11/15/19 12:03 PM, Peter Maydell wrote: > On Fri, 15 Nov 2019 at 05:03, Michael Goffioul > wrote: >> When running QEMU user mode on some code compiled by clang (dynamic linker >> from AOSP-10), the emulator chokes on this instruction: >> >>9aa92: e8c0 2277 strexd r7, r2, r2, [