Re: [Qemu-devel] [PATCH v4 09/11] virtio-net: update the head descriptor in a chain lastly

2019-02-19 Thread Jason Wang
On 2019/2/20 下午12:01, Wei Xu wrote: AFAICT, virtqueue_fill() is a generic API for all relevant userspace virtio devices that do not support batching , without touching virtqueue_fill(), supporting batching changes the meaning of the parameter 'idx' which should be kept overall. To fix it, I

Re: [Qemu-devel] [PATCH 1/5] vfio/migration: define kernel interfaces

2019-02-19 Thread Zhao Yan
On Tue, Feb 19, 2019 at 02:09:18PM +0100, Cornelia Huck wrote: > On Tue, 19 Feb 2019 16:52:14 +0800 > Yan Zhao wrote: > > > - defined 4 device states regions: one control region and 3 data regions > > - defined layout of control region in struct vfio_device_state_ctl > > - defined 4 device

Re: [Qemu-devel] [PATCH v3 03/25] chardev/wctablet: Use unsigned type to hold unsigned value

2019-02-19 Thread Gerd Hoffmann
On Wed, Feb 20, 2019 at 02:02:10AM +0100, Philippe Mathieu-Daudé wrote: > TabletChardev::query is an array of uint8_t. > Use the same type to hold it (this also silent a -Wsign-conversion > warning in the trace function). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann >

Re: [Qemu-devel] [PATCH v3 10/25] usb-redir: Verify usbredirparser_write get called with positive count

2019-02-19 Thread Gerd Hoffmann
On Wed, Feb 20, 2019 at 02:02:17AM +0100, Philippe Mathieu-Daudé wrote: > The usbredirparser_write handler should never be called with a negative > size payload, return an error if this is not the case. > Now that we are sure the 'count' value is positive, make it obvious by > casting it to a

Re: [Qemu-devel] [PATCH v3 08/25] ui/gtk: Remove pointless cast

2019-02-19 Thread Gerd Hoffmann
On Wed, Feb 20, 2019 at 02:02:15AM +0100, Philippe Mathieu-Daudé wrote: > The 'size' value is of type 'guint' which is already unsigned. > Remove the useless cast. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gerd Hoffmann

Re: [Qemu-devel] [PATCH] hw/display: Add basic ATI VGA emulation

2019-02-19 Thread Gerd Hoffmann
Hi, > > So it could be tested with linux guests on x86 too I guess? > > Can the radeon drm driver handle the devices too? > > Yes you can try with x86 guests, I haven't tested that yet. The radeon > driver only supports RV100 and up I think so may only work with the 0x5159 > variant not with

Re: [Qemu-devel] [PATCH] hw/ide/ich: Compile ich.c only if CONFIG_PCI is also set

2019-02-19 Thread Thomas Huth
On 20/02/2019 07.37, Wei Yang wrote: > On Tue, Feb 19, 2019 at 04:55:57PM +0100, Thomas Huth wrote: >> With the upcoming Kconfig-like build system, it will be easy to >> build also version of QEMU that only contain a single machine. Some > > Sorry for my poor English. > > What is also version?

Re: [Qemu-devel] [PATCH] block/pflash_cfi02: Fix memory leak and potential use-after-free

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 10:37:27AM -0500, Stephen Checkoway wrote: >Don't dynamically allocate the pflash's timer. But do use timer_del in >an unrealize function to make sure that the timer can't fire after the >pflash_t has been freed. > >Signed-off-by: Stephen Checkoway Reviewed-by: Wei Yang

Re: [Qemu-devel] [PATCH] hw/ide/ich: Compile ich.c only if CONFIG_PCI is also set

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 04:55:57PM +0100, Thomas Huth wrote: >With the upcoming Kconfig-like build system, it will be easy to >build also version of QEMU that only contain a single machine. Some Sorry for my poor English. What is also version? >of these machines (like the ARM cubieboard) use

Re: [Qemu-devel] [PATCH] hw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs

2019-02-19 Thread Thomas Huth
On 19/02/2019 21.19, Michael S. Tsirkin wrote: > On Tue, Feb 19, 2019 at 05:07:39PM +0100, Thomas Huth wrote: >> Some machines have an AHCI adapter, but no PCI. To be able to >> compile hw/ide/ahci.c without CONFIG_PCI, we still need the two >> functions msi_enabled() and msi_notify() for linking.

Re: [Qemu-devel] [PATCH] hw/ide/ich: Compile ich.c only if CONFIG_PCI is also set

2019-02-19 Thread Thomas Huth
On 19/02/2019 19.18, Paolo Bonzini wrote: > On 19/02/19 16:55, Thomas Huth wrote: >> With the upcoming Kconfig-like build system, it will be easy to >> build also version of QEMU that only contain a single machine. Some >> of these machines (like the ARM cubieboard) use CONFIG_AHCI for an >> AHCI

Re: [Qemu-devel] [PATCH] doc: update .gitignore and fix typos for docs in tree

2019-02-19 Thread Like Xu
On 2019/2/20 11:09, Eric Blake wrote: On 2/20/19 2:55 AM, Like Xu wrote: Signed-off-by: Like Xu This feels like two independent patches - the .gitignore change is different from typo fixes. Actually, for .gitignore, you could just as easily do: echo '*.patch' >> .git/info/exclude and fix

Re: [Qemu-devel] [PATCH 0/5] QEMU VFIO live migration

2019-02-19 Thread Zhao Yan
On Tue, Feb 19, 2019 at 11:32:13AM +, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > This patchset enables VFIO devices to have live migration capability. > > Currently it does not support post-copy phase. > > > > It follows Alex's comments on last version of

[Qemu-devel] [PATCH v2] doc: fix typos for documents in tree

2019-02-19 Thread Like Xu
Signed-off-by: Like Xu --- docs/COLO-FT.txt | 2 +- docs/amd-memory-encryption.txt | 2 +- docs/can.txt | 2 +- docs/colo-proxy.txt| 6 +++--- docs/cpu-hotplug.rst | 2 +- docs/qcow2-cache.txt | 2 +- docs/qemu-block-drivers.texi

Re: [Qemu-devel] [PATCH 5/5] vfio/migration: support device memory capability

2019-02-19 Thread Zhao Yan
On Tue, Feb 19, 2019 at 11:25:43AM +, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > If a device has device memory capability, save/load data from device memory > > in pre-copy and stop-and-copy phases. > > > > LOGGING state is set for device memory for dirty

Re: [Qemu-devel] [PATCH] migration: Fix cancel state

2019-02-19 Thread Peter Xu
On Tue, Feb 19, 2019 at 07:59:28PM +, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > During a cancelled migration there's a race where the fd can > go into an error state before we get back around the migration loop > and migration_detect_error transitions from

Re: [Qemu-devel] [PATCH 2/5] vfio/migration: support device of device config capability

2019-02-19 Thread Zhao Yan
On Tue, Feb 19, 2019 at 11:01:45AM +, Dr. David Alan Gilbert wrote: > * Yan Zhao (yan.y.z...@intel.com) wrote: > > Device config is the default data that every device should have. so > > device config capability is by default on, no need to set. > > > > - Currently two type of resources are

Re: [Qemu-devel] [PATCH] mips: implement qmp query-cpu-definitions command

2019-02-19 Thread Pavel Dovgalyuk
> From: Aleksandar Markovic [mailto:amarko...@wavecomp.com] > > From: Markus Armbruster > > Subject: Re: [Qemu-devel] [PATCH] mips: implement qmp query-cpu-definitions > > command > > > Please rebase. Let me know if you need help. > > Hi, Markus. > > Pavel was probably busy today, so I took

[Qemu-devel] [PATCH 3/3] target/arm: Implement ARMv8.5-CondM

2019-02-19 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.h | 5 target/arm/translate-a64.c | 58 ++ 2 files changed, 63 insertions(+) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 000e778619..0480f9baba 100644 --- a/target/arm/cpu.h +++

[Qemu-devel] [PATCH 0/3] target/arm: Implement ARMv8.5-CondM

2019-02-19 Thread Richard Henderson
Based-on: https://lists.gnu.org/archive/html/qemu-devel/2019-02/msg02733.html aka the v3 ARMv8.5-MemTag patch set, or at least some of the early patches that split handle_msr_i. The v8.4 parts have been tested vs FVP, but there's no released version that supports v8.5 yet, so XAFlag and AXFlag

[Qemu-devel] [PATCH 2/3] target/arm: Implement ARMv8.4-CondM

2019-02-19 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/cpu.h | 5 ++ linux-user/elfload.c | 1 + target/arm/cpu64.c | 1 + target/arm/translate-a64.c | 97 +- 4 files changed, 103 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.h

[Qemu-devel] [PATCH 1/3] target/arm: Rearrange disas_data_proc_reg

2019-02-19 Thread Richard Henderson
This decoding more closely matches the ARMv8.4 Table C4-6, Encoding table for Data Processing - Register Group. In particular, op2 == 0 is now more than just Add/sub (with carry). Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 98 ++ 1

Re: [Qemu-devel] [PATCH v2] target/mips: implement QMP query-cpu-definitions command

2019-02-19 Thread Markus Armbruster
Eric Blake writes: > On 2/19/19 1:15 PM, Aleksandar Markovic wrote: >> From: Pavel Dovgalyuk >> >> This patch enables QMP-based querying of the available CPU types for >> MIPS and MIPS64 platforms. >> >> Signed-off-by: Pavel Dovgalyuk >> Signed-off-by: Aleksandar Markovic >> Reviewed-by:

Re: [Qemu-devel] [PATCH v4 09/11] virtio-net: update the head descriptor in a chain lastly

2019-02-19 Thread Wei Xu
On Wed, Feb 20, 2019 at 10:34:32AM +0800, Jason Wang wrote: > > On 2019/2/20 上午9:54, Wei Xu wrote: > >On Tue, Feb 19, 2019 at 09:09:33PM +0800, Jason Wang wrote: > >>On 2019/2/19 下午6:51, Wei Xu wrote: > >>>On Tue, Feb 19, 2019 at 03:23:01PM +0800, Jason Wang wrote: > On 2019/2/14 下午12:26,

Re: [Qemu-devel] [PATCH v2] target/mips: implement QMP query-cpu-definitions command

2019-02-19 Thread Markus Armbruster
Aleksandar Markovic writes: > From: Pavel Dovgalyuk > > This patch enables QMP-based querying of the available CPU types for > MIPS and MIPS64 platforms. > > Signed-off-by: Pavel Dovgalyuk > Signed-off-by: Aleksandar Markovic > Reviewed-by: Philippe Mathieu-Daudé > Tested-by: Philippe

Re: [Qemu-devel] [PATCH] ppc/xive: xive does not have a POWER7 interrupt model

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 03:25:30PM +0100, Cédric Le Goater wrote: > Patch "target/ppc: Add POWER9 external interrupt model" should have > removed the section covering PPC_FLAGS_INPUT_POWER7. > > Signed-off-by: Cédric Le Goater Applied to ppc-for-4.0, thanks. > --- > hw/intc/xive.c | 3 --- >

Re: [Qemu-devel] [PATCH] hw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs

2019-02-19 Thread Michael S. Tsirkin
On Tue, Feb 19, 2019 at 06:19:30PM -0500, Paolo Bonzini wrote: > > > > Makes sense, but it is also abstraction time. :) What if instead there > > > was a function > > > > > > void msi_allocate_irqs(PCIDevice *pdev, int num, bool fallback_to_intx); > > > > > > and then ich.c did > > > > > >

Re: [Qemu-devel] [PATCH v5 11/17] spapr: populate PHB DRC entries for root DT node

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:29PM +0100, Greg Kurz wrote: > From: Nathan Fontenot > > This add entries to the root OF node to advertise our PHBs as being > DR-capable in accordance with PAPR specification. > > Signed-off-by: Nathan Fontenot > Signed-off-by: Michael Roth > Reviewed-by: David

Re: [Qemu-devel] [PATCH v5 00/17] spapr: Add support for PHB hotplug

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:17:33PM +0100, Greg Kurz wrote: > This allows to hotplug/unplug PHBs. I could successfully test: > - using in-kernel XICS, emulated XICS and XIVE > - hotplug/unplug with e1000 device to validate LSIs > - hotplug/unplug with virtio-net device to validate MSIs > - some

Re: [Qemu-devel] [PATCH v5 13/17] spapr_pci: provide node start offset via spapr_populate_pci_dt()

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:39PM +0100, Greg Kurz wrote: > From: Michael Roth > > PHB hotplug re-uses PHB device tree generation code and passes > it to a guest via RTAS. Doing this requires knowledge of where > exactly in the device tree the node describing the PHB begins. > > Provide this

Re: [Qemu-devel] [PATCH v5 12/17] spapr_events: add support for phb hotplug events

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:34PM +0100, Greg Kurz wrote: > From: Michael Roth > > Extend the existing EPOW event format we use for PCI > devices to emit PHB plug/unplug events. > > Signed-off-by: Michael Roth > Reviewed-by: David Gibson > Signed-off-by: Greg Kurz Applied, thanks. > --- >

Re: [Qemu-devel] [PATCH v5 14/17] spapr_pci: add ibm, my-drc-index property for PHB hotplug

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:44PM +0100, Greg Kurz wrote: > From: Michael Roth > > This is needed to denote a boot-time PHB as being hot-pluggable. > > Signed-off-by: Michael Roth > Reviewed-by: David Gibson > Signed-off-by: Greg Kurz Applied, thanks. > --- > hw/ppc/spapr_pci.c |9

Re: [Qemu-devel] [PATCH v5 09/17] spapr_pci: add PHB unrealize

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:18PM +0100, Greg Kurz wrote: > To support PHB hotplug we need to clean up lingering references, > memory, child properties, etc. prior to the PHB object being > finalized. Generally this will be called as a result of calling > object_unparent() on the PHB object,

Re: [Qemu-devel] [PATCH v5 07/17] spapr: Expose the name of the interrupt controller node

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:08PM +0100, Greg Kurz wrote: > This will be needed by PHB hotplug in order to access the "phandle" > property of the interrupt controller node. > > Reviewed-by: Cédric Le Goater > Signed-off-by: Greg Kurz > Reviewed-by: David Gibson Applied, thanks. > --- >

Re: [Qemu-devel] [PATCH v5 06/17] xics: Write source state to KVM at claim time

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:03PM +0100, Greg Kurz wrote: > The pseries machine only uses LSIs to support legacy PCI devices. Every > PHB claims 4 LSIs at realize time. When using in-kernel XICS (or upcoming > in-kernel XIVE), QEMU synchronizes the state of all irqs, including these > LSIs, later

Re: [Qemu-devel] [PATCH v5 05/17] spapr/drc: Drop spapr_drc_attach() fdt argument

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:17:58PM +0100, Greg Kurz wrote: > All DRC subtypes have been converted to generate the FDT fragment at > configure connector time instead of attach time. The fdt and fdt_offset > arguments of spapr_drc_attach() aren't needed anymore. Drop them and > make the

Re: [Qemu-devel] [PATCH v5 08/17] spapr_irq: Expose the phandle of the interrupt controller

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:13PM +0100, Greg Kurz wrote: > This will be used by PHB hotplug in order to create the "interrupt-map" > property of the PHB node. > > Signed-off-by: Greg Kurz Applied, thanks. > --- > v5: - return phandle by value > v4: - return phandle via a pointer > --- >

Re: [Qemu-devel] [PATCH v5 10/17] spapr: create DR connectors for PHBs

2019-02-19 Thread David Gibson
On Tue, Feb 19, 2019 at 06:18:23PM +0100, Greg Kurz wrote: > From: Michael Roth > > Signed-off-by: Michael Roth > Reviewed-by: David Gibson > Signed-off-by: Greg Kurz Applied, thanks. > --- > hw/ppc/spapr.c | 13 + > hw/ppc/spapr_drc.c | 17

[Qemu-devel] [PATCH v3 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PATCH v3 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may mislead users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov Reviewed-by: Eric Blake --- v3:

[Qemu-devel] [PATCH v3 0/2] CODING_STYLE: trivial update

2019-02-19 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. v3: * fix typo in both changelog and example v2: * adjust Patch 1 as suggested by Eric Wei Yang (2): CODING_STYLE: specify the

Re: [Qemu-devel] [PATCH] doc: update .gitignore and fix typos for docs in tree

2019-02-19 Thread Eric Blake
On 2/20/19 2:55 AM, Like Xu wrote: > Signed-off-by: Like Xu This feels like two independent patches - the .gitignore change is different from typo fixes. Actually, for .gitignore, you could just as easily do: echo '*.patch' >> .git/info/exclude and fix it so you never commit patch files

Re: [Qemu-devel] [PATCH v2 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
On Tue, Feb 19, 2019 at 09:02:34PM -0600, Eric Blake wrote: >On 2/19/19 6:31 PM, Wei Yang wrote: >> We didn't specify the indent rule for multiline code here, which may >> misleading users. And in current code, the code use different rules. > >s/misleading/mislead/ > >> >> Add this rule in

Re: [Qemu-devel] -device ipmi-bmc-sim attached to -netdev vde

2019-02-19 Thread Corey Minyard
On Mon, Feb 11, 2019 at 06:09:24PM +0100, Robin Jarry wrote: > Hi, > > I have several QEMU VMs connected via a vde_switch (with "-netdev vde" > interfaces). I use this to create virtual network topologies without > requiring root access (i.e. no tap + bridge on host). Performance is not > a

Re: [Qemu-devel] [PATCH v2 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Eric Blake
On 2/19/19 6:31 PM, Wei Yang wrote: > We didn't specify the indent rule for multiline code here, which may > misleading users. And in current code, the code use different rules. s/misleading/mislead/ > > Add this rule in CODING_STYLE to make sure this is clear to every one. > > Signed-off-by:

Re: [Qemu-devel] [PATCH] doc: update .gitignore and fix typos for docs in tree

2019-02-19 Thread Wei Yang
On Wed, Feb 20, 2019 at 04:55:53PM +0800, Like Xu wrote: >Signed-off-by: Like Xu >--- > .gitignore | 1 + > docs/COLO-FT.txt | 2 +- > docs/amd-memory-encryption.txt | 2 +- > docs/can.txt | 2 +- > docs/colo-proxy.txt| 6 +++--- >

Re: [Qemu-devel] [PATCH v3 15/25] spapr-vty: Let vty_putchars() use size_t

2019-02-19 Thread David Gibson
On Wed, Feb 20, 2019 at 02:02:22AM +0100, Philippe Mathieu-Daudé wrote: > Both callers (h_put_term_char and rtas_display_character) use > an unsigned value. > > Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson > --- > hw/char/spapr_vty.c| 2 +- >

Re: [Qemu-devel] [PATCH v4 09/11] virtio-net: update the head descriptor in a chain lastly

2019-02-19 Thread Jason Wang
On 2019/2/20 上午9:54, Wei Xu wrote: On Tue, Feb 19, 2019 at 09:09:33PM +0800, Jason Wang wrote: On 2019/2/19 下午6:51, Wei Xu wrote: On Tue, Feb 19, 2019 at 03:23:01PM +0800, Jason Wang wrote: On 2019/2/14 下午12:26, w...@redhat.com wrote: From: Wei Xu This is a helper for packed ring. To

Re: [Qemu-devel] [PATCH v4 08/11] virtio: event suppression support for packed ring

2019-02-19 Thread Wei Xu
On Tue, Feb 19, 2019 at 09:06:42PM +0800, Jason Wang wrote: > > On 2019/2/19 下午6:40, Wei Xu wrote: > >On Tue, Feb 19, 2019 at 03:19:58PM +0800, Jason Wang wrote: > >>On 2019/2/14 下午12:26, w...@redhat.com wrote: > >>>From: Wei Xu > >>> > >>>Difference between 'avail_wrap_counter' and

Re: [Qemu-devel] [PATCH v4 09/11] virtio-net: update the head descriptor in a chain lastly

2019-02-19 Thread Wei Xu
On Tue, Feb 19, 2019 at 09:09:33PM +0800, Jason Wang wrote: > > On 2019/2/19 下午6:51, Wei Xu wrote: > >On Tue, Feb 19, 2019 at 03:23:01PM +0800, Jason Wang wrote: > >>On 2019/2/14 下午12:26, w...@redhat.com wrote: > >>>From: Wei Xu > >>> > >>>This is a helper for packed ring. > >>> > >>>To support

Re: [Qemu-devel] [PATCH v2 3/3] pc-dimm: revert "introduce realize callback"

2019-02-19 Thread Wei Yang
On Wed, Feb 20, 2019 at 02:26:16AM +0100, Philippe Mathieu-Daudé wrote: >On 2/20/19 1:51 AM, Wei Yang wrote: >> realize callback in introduced to check if the backend memory is large >> enough to contain label data and init its memory region, while this task >> is handled in pre_plug stage. >> >>

Re: [Qemu-devel] [PATCH v2 3/3] pc-dimm: revert "introduce realize callback"

2019-02-19 Thread Philippe Mathieu-Daudé
On 2/20/19 1:51 AM, Wei Yang wrote: > realize callback in introduced to check if the backend memory is large > enough to contain label data and init its memory region, while this task > is handled in pre_plug stage. > > Now it's time to remove it. Good cleanup! Michael, can you add: "This

Re: [Qemu-devel] [PATCH v2 2/3] mem/nvdimm: remove nvdimm_realize

2019-02-19 Thread Philippe Mathieu-Daudé
On 2/20/19 1:51 AM, Wei Yang wrote: > nvdimm_realize is used to prepare its memory region, while this is done > in pre_plug stage. Via the device parent: pc_dimm_pre_plug() -> memory_device_pre_plug() -> MemoryDeviceClass::get_memory_region() nvdimm_md_get_memory_region() > >

[Qemu-devel] [PATCH v3 22/25] s390x/sclp: Let write_console_data() take a size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Since all callers provide an unsigned value, we can safely use a size_t argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sclpconsole-lm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index

[Qemu-devel] [PATCH v3 24/25] chardev: Let qemu_chr_fe_write[_all] use size_t type argument

2019-02-19 Thread Philippe Mathieu-Daudé
All caller have been audited and call these functions with unsigned arguments. Most of them use a size_t argument, or directly pass sizeof(). One case is unclear: the mux_chr_write() call in chardev/char-mux.c. There we add an assert (which will be removed in few patches) and cast the parameter

[Qemu-devel] [PATCH] doc: update .gitignore and fix typos for docs in tree

2019-02-19 Thread Like Xu
Signed-off-by: Like Xu --- .gitignore | 1 + docs/COLO-FT.txt | 2 +- docs/amd-memory-encryption.txt | 2 +- docs/can.txt | 2 +- docs/colo-proxy.txt| 6 +++--- docs/cpu-hotplug.rst | 2 +- docs/qcow2-cache.txt |

Re: [Qemu-devel] [PATCH v2 1/3] pc-dimm: remove check on pc-dimm hotpluggable

2019-02-19 Thread Philippe Mathieu-Daudé
On 2/20/19 1:51 AM, Wei Yang wrote: > Function acpi_memory_plug_cb() is only invoked when dev is a PCDIMM, > which is hotpluggable. This means it is not necessary to check this > property again. > > This patch removes this check. > > Signed-off-by: Wei Yang > Reviewed-by: Philippe Mathieu-Daudé

[Qemu-devel] [PATCH v3 21/25] s390x/sclp: Use size_t in process_mdb()

2019-02-19 Thread Philippe Mathieu-Daudé
Since it is unlikely we have sizeof(mdbo->mto.message) < 0, we can convert this variable to an unsigned type. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sclpconsole-lm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/char/sclpconsole-lm.c

[Qemu-devel] [PATCH v3 18/25] s390x/3270: Let insert_IAC_escape_char() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
This function takes size_t argument and return a size_t. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/terminal3270.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/char/terminal3270.c b/hw/char/terminal3270.c index 35b079d5c4..1cb48a3c6f 100644 ---

[Qemu-devel] [PATCH v3 16/25] tpm: Use size_t to hold sizes

2019-02-19 Thread Philippe Mathieu-Daudé
Avoid to use a signed type to hold an unsigned value. Signed-off-by: Philippe Mathieu-Daudé --- hw/tpm/tpm_emulator.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/tpm/tpm_emulator.c b/hw/tpm/tpm_emulator.c index 70f4b10284..931e56f6ed 100644 ---

[Qemu-devel] [PATCH v3 00/25] chardev: Convert qemu_chr_write() to take a size_t argument

2019-02-19 Thread Philippe Mathieu-Daudé
Hi, This series convert the chardev::qemu_chr_write() to take unsigned length argument. To do so I went through all caller and checked if there are no negative value possible. I'm having headaches with the Xen backend, talking with Marc-André he suggested I ask help to the Xen maintainers.

[Qemu-devel] [PATCH v3 04/25] chardev: Let qemu_chr_be_can_write() return a size_t types

2019-02-19 Thread Philippe Mathieu-Daudé
In the previous commit we added an assert to be sure than qemu_chr_be_can_write() will never return a negative value. We can now change its prototype to return a size_t. Adapt the backends accordingly. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- chardev/baum.c

[Qemu-devel] [PATCH v3 01/25] chardev: Simplify IOWatchPoll::fd_can_read as a GSourceFunc

2019-02-19 Thread Philippe Mathieu-Daudé
IOWatchPoll::fd_can_read() really is a GSourceFunc type, it simply returns a boolean value. Update the backends to return a boolean, whether there is data to read from the source or not. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- chardev/char-fd.c | 4 ++--

[Qemu-devel] [PATCH v3 25/25] chardev: Let qemu_chr_write[_all] use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
We now know all callers use a size_t argument. We can convert qemu_chr_write() and qemu_chr_write_all() to use a size_t argument. Signed-off-by: Philippe Mathieu-Daudé --- chardev/char.c | 8 include/chardev/char.h | 2 +- include/sysemu/replay.h | 2 +- replay/replay-char.c

[Qemu-devel] [PATCH v3 02/25] chardev: Assert IOCanReadHandler can not be negative

2019-02-19 Thread Philippe Mathieu-Daudé
The backend should not return a negative length to read. We will later change the prototype of IOCanReadHandler to return an unsigned length. Meanwhile make sure the return length is positive. Suggested-by: Paolo Bonzini Signed-off-by: Philippe Mathieu-Daudé --- chardev/char.c | 5 - 1

[Qemu-devel] [PATCH v3 03/25] chardev/wctablet: Use unsigned type to hold unsigned value

2019-02-19 Thread Philippe Mathieu-Daudé
TabletChardev::query is an array of uint8_t. Use the same type to hold it (this also silent a -Wsign-conversion warning in the trace function). Signed-off-by: Philippe Mathieu-Daudé --- chardev/trace-events | 2 +- chardev/wctablet.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)

[Qemu-devel] [PATCH v3 09/25] vhost-user: Express sizeof with size_t

2019-02-19 Thread Philippe Mathieu-Daudé
VHOST_USER_HDR_SIZE uses offsetof(), thus is an expression of type size_t. Update the format string accordingly. Signed-off-by: Philippe Mathieu-Daudé --- hw/virtio/vhost-user.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/virtio/vhost-user.c

[Qemu-devel] [PATCH v3 05/25] gdbstub: Use size_t for strlen() return value

2019-02-19 Thread Philippe Mathieu-Daudé
Since strlen() returns an unsigned value, it is pointless to convert it to a signed one. Use size_t to hold its return value. Signed-off-by: Philippe Mathieu-Daudé --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index

[Qemu-devel] [PATCH v3 08/25] ui/gtk: Remove pointless cast

2019-02-19 Thread Philippe Mathieu-Daudé
The 'size' value is of type 'guint' which is already unsigned. Remove the useless cast. Signed-off-by: Philippe Mathieu-Daudé --- ui/gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 949b143e4e..b5879fdece 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@

[Qemu-devel] [PATCH v3 11/25] xen: Let xencons_send() take a 'size' argument

2019-02-19 Thread Philippe Mathieu-Daudé
The single caller of xencons_send(), con_event() already use the difference 'con->buffer.size - con->buffer.consumed'. Deduplicate by passing the difference as an argument. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 12 +++- 1 file changed, 7 insertions(+), 5

[Qemu-devel] [PATCH v3 07/25] gdbstub: Let put_buffer() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
All callers provide a size_t argument, we can safely use size_t for this function. Signed-off-by: Philippe Mathieu-Daudé --- gdbstub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 69340d7cd1..860e9bb7c7 100644 --- a/gdbstub.c +++

[Qemu-devel] [PATCH v3 12/25] xen: Let buffer_append() return the size consumed

2019-02-19 Thread Philippe Mathieu-Daudé
The buffer.size and buffer.consumed fields are only updated within the buffer_append() body. We can simply let buffer_append() return the difference (the buffer consumed). Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 13 - 1 file changed, 8 insertions(+), 5

[Qemu-devel] [PATCH v3 23/25] hw/ipmi: Assert outlen > outpos

2019-02-19 Thread Philippe Mathieu-Daudé
A througfull audit show that all time data is added to outbuf[], 'outlen' is incremented. Then at creation and each time continue_send() returns it pass thru check_reset which resets 'outpos', thus we always have 'outlen >= outpos'. Also due to the check on entry, we know outlen != 0. We can then

[Qemu-devel] [RFC PATCH v3 13/25] xen: Let buffer_append() return a size_t

2019-02-19 Thread Philippe Mathieu-Daudé
To the Xen team: this is not trivial to me to demonstrate this assertion can never happen, but then the whole series is justified and I can convert qemu_chr_fe_write() to use size_t argument. Can you help me here? Signed-off-by: Philippe Mathieu-Daudé --- hw/char/xen_console.c | 1 + 1 file

[Qemu-devel] [PATCH v3 14/25] virtio-serial: Let VirtIOSerialPortClass::have_data() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Both callers in hw/char/virtio-serial-bus.c provide unsigned values, even the trace event display an unsigned value. Convert the have_data() handler to take an unsigned value. Signed-off-by: Philippe Mathieu-Daudé --- It is funny/scary that there are big comments about how to treat errors to set

[Qemu-devel] [PATCH v3 15/25] spapr-vty: Let vty_putchars() use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Both callers (h_put_term_char and rtas_display_character) use an unsigned value. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/spapr_vty.c| 2 +- include/hw/ppc/spapr_vio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/char/spapr_vty.c

[Qemu-devel] [PATCH v3 10/25] usb-redir: Verify usbredirparser_write get called with positive count

2019-02-19 Thread Philippe Mathieu-Daudé
The usbredirparser_write handler should never be called with a negative size payload, return an error if this is not the case. Now that we are sure the 'count' value is positive, make it obvious by casting it to a size_t. Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/redirect.c | 6 +- 1

[Qemu-devel] [PATCH v3 06/25] gdbstub: Use size_t to hold GDBState::last_packet_len

2019-02-19 Thread Philippe Mathieu-Daudé
In put_packet_binary() we have: uint8_t *p; for(;;) { p = s->last_packet; *(p++) = ... s->last_packet_len = p - s->last_packet; put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len); The 'p' pointer start at s->last_packet, then is only incremented.

[Qemu-devel] [PATCH v3 20/25] s390x/sclp: Use a const variable to improve readability

2019-02-19 Thread Philippe Mathieu-Daudé
We will reuse this variable in the next patch. Signed-off-by: Philippe Mathieu-Daudé --- hw/char/sclpconsole-lm.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c index dbc91a1e5b..49543e2c83 100644 ---

[Qemu-devel] [PATCH v3 19/25] s390/ebcdic: Use size_t to iterate over arrays

2019-02-19 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/s390x/ebcdic.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/s390x/ebcdic.h b/include/hw/s390x/ebcdic.h index 69a04cab62..d89174e113 100644 --- a/include/hw/s390x/ebcdic.h +++

[Qemu-devel] [PATCH v3 17/25] net/filter-mirror: Use size_t

2019-02-19 Thread Philippe Mathieu-Daudé
Since iov_size() returns a size_t, no need to use a signed type. Signed-off-by: Philippe Mathieu-Daudé --- net/filter-mirror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/filter-mirror.c b/net/filter-mirror.c index 3a61cf21e8..97b52d0544 100644 ---

[Qemu-devel] [PATCH v2 2/3] mem/nvdimm: remove nvdimm_realize

2019-02-19 Thread Wei Yang
nvdimm_realize is used to prepare its memory region, while this is done in pre_plug stage. This is time to remove it. Signed-off-by: Wei Yang --- v2: split nvdimm part here --- hw/mem/nvdimm.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c

[Qemu-devel] [PATCH v2 0/3] PCDIMM cleanup

2019-02-19 Thread Wei Yang
Three trivial cleanup for pc-dimm. Patch [1] remove the check on class->hotpluggable since pc-dimm is always hotpluggable. Patch [2] remove nvdimm_realize Patch [2] remove pcdimm realize-callback v2: * fix warning in Patch 1 * split Patch 2 into two Wei Yang (3): pc-dimm: remove check on

[Qemu-devel] [PATCH v2 1/3] pc-dimm: remove check on pc-dimm hotpluggable

2019-02-19 Thread Wei Yang
Function acpi_memory_plug_cb() is only invoked when dev is a PCDIMM, which is hotpluggable. This means it is not necessary to check this property again. This patch removes this check. Signed-off-by: Wei Yang Reviewed-by: Philippe Mathieu-Daudé --- v2: * remove unused dc ---

[Qemu-devel] [PATCH v2 3/3] pc-dimm: revert "introduce realize callback"

2019-02-19 Thread Wei Yang
realize callback in introduced to check if the backend memory is large enough to contain label data and init its memory region, while this task is handled in pre_plug stage. Now it's time to remove it. Signed-off-by: Wei Yang --- hw/mem/pc-dimm.c | 5 - include/hw/mem/pc-dimm.h | 3

Re: [Qemu-devel] [PATCH v4 11/11] virtio: CLI and provide packed ring feature bit by default

2019-02-19 Thread Wei Xu
On Tue, Feb 19, 2019 at 09:33:40PM +0800, Jason Wang wrote: > > On 2019/2/19 下午7:23, Wei Xu wrote: > >On Tue, Feb 19, 2019 at 03:32:19PM +0800, Jason Wang wrote: > >>On 2019/2/14 下午12:26,w...@redhat.com wrote: > >>>From: Wei Xu > >>> > >>>Add userspace and vhost kernel/user support. > >>> >

[Qemu-devel] [PATCH v2 1/2] CODING_STYLE: specify the indent rule for multiline code

2019-02-19 Thread Wei Yang
We didn't specify the indent rule for multiline code here, which may misleading users. And in current code, the code use different rules. Add this rule in CODING_STYLE to make sure this is clear to every one. Signed-off-by: Wei Yang Suggested-by: Igor Mammedov --- v2: * rephrase changelog

[Qemu-devel] [PATCH v2 0/2] CODING_STYLE: trivial update

2019-02-19 Thread Wei Yang
The first one is suggested by Igor Mammedov to provide rule for multiline code. The second is a trivial fix to make example code all indented with 4 spaces. v2: * adjust Patch 1 as suggested by Eric Wei Yang (2): CODING_STYLE: specify the indent rule for multiline code CODING_STYLE:

[Qemu-devel] [PATCH v2 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Wei Yang
All the example code are indented with four spaces except this one. Fix this by adding four spaces here. Signed-off-by: Wei Yang Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé --- CODING_STYLE | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

Re: [Qemu-devel] [PATCH v2 0/3] target/arm: Reduce overhead of cpu_get_tb_cpu_state

2019-02-19 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190219233421.388-1-richard.hender...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190219233421.388-1-richard.hender...@linaro.org Subject: [Qemu-devel] [PATCH v2 0/3]

Re: [Qemu-devel] [PATCH v2 0/3] target/arm: Reduce overhead of cpu_get_tb_cpu_state

2019-02-19 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190219233421.388-1-richard.hender...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20190219233421.388-1-richard.hender...@linaro.org Subject: [Qemu-devel] [PATCH v2 0/3]

[Qemu-devel] [PATCH] block/iscsi: Restrict Linux-specific code

2019-02-19 Thread Philippe Mathieu-Daudé
Some Linux specific code is missing guards, leading to build failure on OSX: $ sudo brew install libiscsi $ ./configure && make [...] CC block/iscsi.o qemu/block/iscsi.c:338:24: error: 'iscsi_aiocb_info' defined but not used [-Werror=unused-const-variable=] static const

Re: [Qemu-devel] [PATCH 2/2] CODING_STYLE: indent example code as all others

2019-02-19 Thread Philippe Mathieu-Daudé
On 2/19/19 11:20 PM, Wei Yang wrote: > On Tue, Feb 19, 2019 at 07:55:31PM +0100, Philippe Mathieu-Daudé wrote: >> On 2/19/19 6:56 PM, Eric Blake wrote: >>> On 2/19/19 11:38 AM, Philippe Mathieu-Daudé wrote: >>> > +if (a == 1) { > +/* Reads like: "If a equals 1" */ I

[Qemu-devel] [PATCH v2 3/3] target/arm: Rely on hflags correct in cpu_get_tb_cpu_state

2019-02-19 Thread Richard Henderson
This is the payoff. >From perf record -g data of ubuntu 18 boot and shutdown: BEFORE: - 23.02% 2.82% qemu-system-aar [.] helper_lookup_tb_ptr - 20.22% helper_lookup_tb_ptr + 10.05% tb_htable_lookup - 9.13% cpu_get_tb_cpu_state 3.20% aa64_va_parameters_both

[Qemu-devel] [PATCH v2 1/3] target/arm: Split out recompute_hflags et al

2019-02-19 Thread Richard Henderson
We will use these to minimize the computation for every call to cpu_get_tb_cpu_state. For now, the env->hflags variable is not used. Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/cpu.h | 22 +++- target/arm/helper.h| 3 + target/arm/internals.h | 3 +

[Qemu-devel] [PATCH v2 2/3] target/arm: Rebuild hflags at el changes and MSR writes

2019-02-19 Thread Richard Henderson
Now setting, but not relying upon, env->hflags. Signed-off-by: Richard Henderson --- v2: Fixed partial conversion to assignment to env->hflags. --- target/arm/internals.h | 1 + linux-user/syscall.c | 1 + target/arm/cpu.c | 1 + target/arm/helper-a64.c| 3 +++

[Qemu-devel] [PATCH v2 0/3] target/arm: Reduce overhead of cpu_get_tb_cpu_state

2019-02-19 Thread Richard Henderson
Changes since v1: * Apparently I had started a last-minute API change, and failed to covert all of the users, and also failed to re-test afterward. * Retain assertions for --enable-debug-tcg. r~ Richard Henderson (3): target/arm: Split out recompute_hflags et al target/arm: Rebuild

Re: [Qemu-devel] [PATCH] hw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs

2019-02-19 Thread Paolo Bonzini
> > Makes sense, but it is also abstraction time. :) What if instead there > > was a function > > > > void msi_allocate_irqs(PCIDevice *pdev, int num, bool fallback_to_intx); > > > > and then ich.c did > > > > irqs = msi_allocate_irqs(pdev, 1, true); > > s->irq = irqs[0]; > >

Re: [Qemu-devel] [PATCH 4/4] target/arm: Rely on hflags correct in cpu_get_tb_cpu_state

2019-02-19 Thread Richard Henderson
On 2/19/19 12:17 PM, Alex Bennée wrote: > While debugging I came up with this monstrosity: > > if (FIELD_EX32(flags, TBFLAG_ANY, AARCH64_STATE)) { > #ifdef CONFIG_DEBUG_TCG > static uint32_t tb_state = 0; > uint32_t recalc_flags = rebuild_hflags_a64(env, arm_current_el(env));

[Qemu-devel] [PATCH v5 1/5] target/arm: Add helpers for FMLAL

2019-02-19 Thread Richard Henderson
Note that float16_to_float32 rightly squashes SNaN to QNaN. But of course pickNaNMulAdd, for ARM, selects SNaNs first. So we have to preserve SNaN long enough for the correct NaN to be selected. Thus float16_to_float32_by_bits. Signed-off-by: Richard Henderson --- target/arm/helper.h | 9

  1   2   3   4   5   >