Re: [PATCH v4 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Marc-André Lureau
Hi On Wed, Nov 20, 2019 at 7:25 PM Marc-André Lureau wrote: > > Hi, > > QDEV_PROP_PTR is marked in multiple places as "FIXME/TODO/remove > me". In most cases, it can be easily replaced with QDEV_PROP_LINK when > the pointer points to an Object. > > There are a few places where such substitution i

[PATCH 02/26] qdev: remove duplicated qdev_property_add_static() doc

2019-12-01 Thread Marc-André Lureau
The function is already documented in the header. Signed-off-by: Marc-André Lureau --- hw/core/qdev.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index c7b3f0dec5..8b93b85727 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -717,16 +717,6 @@

[PATCH 00/26] Make QDev use class properties

2019-12-01 Thread Marc-André Lureau
Hi, QDev properties are registered per instances, although define statically with the class. With QOM default values support, and "link" class property, all QDev properties can be registered with the class. Various other small related fixes and improvements included. Based-on: <20191120152442.26

[PATCH 01/26] object: add extra sanity checks

2019-12-01 Thread Marc-André Lureau
Type system checked that children class_size >= parent class_size, but not instances. Fix that. Signed-off-by: Marc-André Lureau --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index d51b57fba1..935491d334 100644 --- a/qom/object.c +++ b/qom/objec

[PATCH 03/26] qdev: remove extraneous error

2019-12-01 Thread Marc-André Lureau
All callers use error_abort, and even the function itself calls with error_abort. Signed-off-by: Marc-André Lureau --- hw/core/qdev.c | 15 --- include/hw/qdev-properties.h | 3 +-- target/arm/cpu.c | 33 +++-- 3 files changed, 1

[PATCH 07/26] object: add object_property_get_defaut()

2019-12-01 Thread Marc-André Lureau
The new callback will be used in following "object: add object_property_set_defaut_{bool,str,int,uint}()" and "vl: print default value in object help" patches. Signed-off-by: Marc-André Lureau --- include/qom/object.h | 17 + qom/object.c | 9 + 2 files changed,

[PATCH 04/26] qdev: move helper function to monitor/misc

2019-12-01 Thread Marc-André Lureau
Move the one-user function to the place it is being used. Signed-off-by: Marc-André Lureau --- hw/core/qdev.c | 26 -- include/hw/qdev-core.h | 2 -- monitor/misc.c | 26 ++ 3 files changed, 26 insertions(+), 28 deletions(-) diff

[PATCH 08/26] object: make object_class_property_add* return property

2019-12-01 Thread Marc-André Lureau
This will help calling other ObjectProperty associated functions easily after. Signed-off-by: Marc-André Lureau --- include/qom/object.h | 24 +++-- qom/object.c | 64 ++-- 2 files changed, 60 insertions(+), 28 deletions(-) diff --git

[PATCH 06/26] object: add class property initializer

2019-12-01 Thread Marc-André Lureau
This callback is used to set default value in following patch "object: add object_property_set_defaut_{bool,str,int,uint}()". Signed-off-by: Marc-André Lureau --- include/qom/object.h | 16 ++-- qom/object.c | 14 ++ 2 files changed, 28 insertions(+), 2 deletions(

[PATCH 09/26] qstring: add qstring_free()

2019-12-01 Thread Marc-André Lureau
Similar to g_string_free(), optionally return the underlying char*. Signed-off-by: Marc-André Lureau --- include/qapi/qmp/qstring.h | 1 + qobject/qstring.c | 27 ++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/include/qapi/qmp/qstring.h b/in

[PATCH 05/26] object: avoid extra class property key duplication

2019-12-01 Thread Marc-André Lureau
Like object properties, no need to duplicate property name, as it is owned already by ObjectProperty value. Signed-off-by: Marc-André Lureau --- qom/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qom/object.c b/qom/object.c index 935491d334..f1e1e0947b 100644

qemu-devel@nongnu.org

2019-12-01 Thread Marc-André Lureau
The following patch is going to introduce more flags. Signed-off-by: Marc-André Lureau --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 55c690d62b..7e42fa0d99 100644 --- a/qom/object.c +++ b/qom/object.c @@ -1789,7 +1789,7 @@

[PATCH 10/26] object: add object_property_set_defaut_{bool, str, int, uint}()

2019-12-01 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- include/qom/object.h | 37 + qom/object.c | 56 2 files changed, 93 insertions(+) diff --git a/include/qom/object.h b/include/qom/object.h index 102d941ca5..03574473cd 100644 ---

[PATCH 11/26] object: do not free class properties

2019-12-01 Thread Marc-André Lureau
The release callback is called during object_property_del_all(), on a live instance. But class properties are common among all instances. It is not currently called, because we don't release classes, but it would not the right callback anyway. Signed-off-by: Marc-André Lureau --- qom/object.c |

[PATCH 13/26] object: rename link "child" to "target"

2019-12-01 Thread Marc-André Lureau
A child property is a different kind of property. Let's use "target" for the link target. Signed-off-by: Marc-André Lureau --- include/qom/object.h | 4 ++-- qom/object.c | 24 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/qom/object.h

[PATCH 15/26] object: express const link with link property

2019-12-01 Thread Marc-André Lureau
Let's not mix child property and link property callbacks, as this is confusing, use LinkProperty with DIRECT flag to hold the target pointer. Signed-off-by: Marc-André Lureau --- qom/object.c | 41 +++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff

[PATCH 18/26] object: return self in object_ref()

2019-12-01 Thread Marc-André Lureau
This allow for simpler assignment with ref: foo = object_ref(bar) Signed-off-by: Marc-André Lureau --- include/qom/object.h | 3 ++- qom/object.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/qom/object.h b/include/qom/object.h index 6cafc5f368..aa2cf1

[PATCH 14/26] object: add direct link flag

2019-12-01 Thread Marc-André Lureau
Allow the link property to hold the pointer to the target, instead of indirectly through another variable. Signed-off-by: Marc-André Lureau --- include/qom/object.h | 3 +++ qom/object.c | 26 -- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/inc

[PATCH 16/26] object: add object_class_property_add_link()

2019-12-01 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- include/qom/object.h | 9 + qom/object.c | 46 +++- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/include/qom/object.h b/include/qom/object.h index 9bef5783f1..6cafc5f368 100644 --- a/in

[PATCH 20/26] qdev: move instance properties to class properties

2019-12-01 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- hw/core/qdev.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 9e70b32c4b..dabf927eaa 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -944,14 +944,6 @@ static void device_

[PATCH 22/26] vl: print default value in object help

2019-12-01 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- qom/object_interfaces.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 46cd6eab5c..edb4cc4a3d 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -185,6 +185,7 @@ bool user_cr

[PATCH 24/26] qom: introduce object_property_help()

2019-12-01 Thread Marc-André Lureau
Let's factor out the code to format a help string for a property. We are going to reuse it in qdev next, which will bring some consistency. Signed-off-by: Marc-André Lureau --- include/qom/object.h| 14 ++ qom/object_interfaces.c | 39 +++ 2 fi

[PATCH 17/26] object: release all props

2019-12-01 Thread Marc-André Lureau
Class properties may have to release resources when the object is destroyed. Let's use the existing release() callback for that, but class properties must not release ObjectProperty, as it can be shared by various instances. Signed-off-by: Marc-André Lureau --- qom/object.c | 21 ++--

[PATCH 26/26] qdev: use object_property_help()

2019-12-01 Thread Marc-André Lureau
Use the common function introduced earlier, and report default value. Signed-off-by: Marc-André Lureau --- qdev-monitor.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/qdev-monitor.c b/qdev-monitor.c index e6b112eb0a..5a09031e53 100644 --- a/qdev-monitor.c

[PATCH 21/26] qdev: register properties as class properties

2019-12-01 Thread Marc-André Lureau
Use class properties facilities to add properties to the class during device_class_set_props(). qdev_property_add_static() must be adapted as PropertyInfo now operates with classes (and not instances), so we must set_default_value() on the ObjectProperty, before calling its init() method on the ob

[PATCH 23/26] qom: simplify qmp_device_list_properties()

2019-12-01 Thread Marc-André Lureau
All qdev properties are object properties, no need for make_device_property_info() helper. Signed-off-by: Marc-André Lureau --- qom/qom-qmp-cmds.c | 52 +- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-

[PATCH 25/26] qapi/qmp: add ObjectPropertyInfo.default-value

2019-12-01 Thread Marc-André Lureau
Report the default value associated with a property. Signed-off-by: Marc-André Lureau --- qapi/qom.json | 7 ++- qom/qom-qmp-cmds.c | 4 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/qapi/qom.json b/qapi/qom.json index 32db96ffc4..471e4b484b 100644 --- a/qapi/qom.j

Re: [PATCH v6 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Aleksandar Markovic
On Sunday, December 1, 2019, Marc-André Lureau wrote: > - "RFC: mips/cps: fix setting saar property" > > Perhaps I should have used FIX instead of RFC, because this should > actually be a real fix. However I could use someone help to exercise > the code path. > > Marc-André, hi. There is a work

[PATCH v2 0/5] target/arm: More EL2 trapping fixes

2019-12-01 Thread Marc Zyngier
Hi all, This series is a follow-up on [1], which tried to address the remaining missing HCR_EL2.TIDx traps. I've hopefully now adressed the comments that Peter and Edgar raised. I've also tried to tackle missing traps generated by HSTR_EL2, which got completely ignored so far. Note that this resu

[PATCH v2 5/5] target/arm: Add support for missing Jazelle system registers

2019-12-01 Thread Marc Zyngier
QEMU lacks the minimum Jazelle implementation that is required by the architecture (everything is RAZ or RAZ/WI). Add it together with the HCR_EL2.TID0 trapping that goes with it. Signed-off-by: Marc Zyngier --- target/arm/helper.c | 27 +++ 1 file changed, 27 insertions(

[PATCH v2 1/5] target/arm: Honor HCR_EL2.TID2 trapping requirements

2019-12-01 Thread Marc Zyngier
HCR_EL2.TID2 mandates that access from EL1 to CTR_EL0, CCSIDR_EL1, CCSIDR2_EL1, CLIDR_EL1, CSSELR_EL1 are trapped to EL2, and QEMU completely ignores it, making it impossible for hypervisors to virtualize the cache hierarchy. Do the right thing by trapping to EL2 if HCR_EL2.TID2 is set. Signed-of

[PATCH v2 4/5] target/arm: Handle AArch32 CP15 trapping via HSTR_EL2

2019-12-01 Thread Marc Zyngier
HSTR_EL2 offers a way to trap ranges of CP15 system register accesses to EL2, and it looks like this register is completely ignored by QEMU. To avoid adding extra .accessfn filters all over the place (which would have a direct performance impact), let's add a new TB flag that gets set whenever HST

[PATCH v2 3/5] target/arm: Handle trapping to EL2 of AArch32 VMRS instructions

2019-12-01 Thread Marc Zyngier
HCR_EL2.TID3 requires that AArch32 reads of MVFR[012] are trapped to EL2, and HCR_EL2.TID0 does the same for reads of FPSID. In order to handle this, introduce a new TCG helper function that checks for these control bits before executing the VMRC instruction. Tested with a hacked-up version of KVM

[PATCH v2 2/5] target/arm: Honor HCR_EL2.TID1 trapping requirements

2019-12-01 Thread Marc Zyngier
HCR_EL2.TID1 mandates that access from EL1 to REVIDR_EL1, AIDR_EL1 (and their 32bit equivalents) as well as TCMTR, TLBTR are trapped to EL2. QEMU ignores it, making it harder for a hypervisor to virtualize the HW (though to be fair, no known hypervisor actually cares). Do the right thing by trappi

Re: [PATCH v37 00/17] QEMU AVR 8 bit cores

2019-12-01 Thread Aleksandar Markovic
> > Renaming devices such hw/char/avr_usart.c -> hw/char/atmel_usart.c > (similarly with the macros) would be enough Aleksandar? > > On Thursday, November 28, 2019, Michael Rolnik wrote: > I will rename them. > AVR is the name of a microcontroller lineup, and Atmel is the name of the company tha

Re: [PATCH v37 00/17] QEMU AVR 8 bit cores

2019-12-01 Thread Aleksandar Markovic
On Sunday, December 1, 2019, Aleksandar Markovic < aleksandar.m.m...@gmail.com> wrote: > Renaming devices such hw/char/avr_usart.c -> hw/char/atmel_usart.c >> (similarly with the macros) would be enough Aleksandar? >> >> On Thursday, November 28, 2019, Michael Rolnik wrote: > >> I will rename the

Re: [PATCH 17/21] s390x: Fix latent query-cpu-model-FOO error handling bugs

2019-12-01 Thread Aleksandar Markovic
On Saturday, November 30, 2019, David Hildenbrand wrote: > > > > Am 30.11.2019 um 20:42 schrieb Markus Armbruster : > > > > cpu_model_from_info() is a helper for qmp_query_cpu_model_expansion(), > > qmp_query_cpu_model_comparison(), qmp_query_cpu_model_baseline(). It > > crashes when the visito

Re: [PATCH 17/21] s390x: Fix latent query-cpu-model-FOO error handling bugs

2019-12-01 Thread Aleksandar Markovic
On Sunday, December 1, 2019, Aleksandar Markovic < aleksandar.m.m...@gmail.com> wrote: > > > On Saturday, November 30, 2019, David Hildenbrand > wrote: > >> >> >> > Am 30.11.2019 um 20:42 schrieb Markus Armbruster : >> > >> > cpu_model_from_info() is a helper for qmp_query_cpu_model_expansion(),

Re: [PATCH 17/21] s390x: Fix latent query-cpu-model-FOO error handling bugs

2019-12-01 Thread David Hildenbrand
On 01.12.19 14:46, Aleksandar Markovic wrote: > > > On Saturday, November 30, 2019, David Hildenbrand > wrote: > > > > > Am 30.11.2019 um 20:42 schrieb Markus Armbruster > mailto:arm...@redhat.com>>: > > > > cpu_model_from_info() is a helper for >

Re: [PATCH 17/21] s390x: Fix latent query-cpu-model-FOO error handling bugs

2019-12-01 Thread Aleksandar Markovic
On Sunday, December 1, 2019, Aleksandar Markovic < aleksandar.m.m...@gmail.com> wrote: > > > On Sunday, December 1, 2019, Aleksandar Markovic < > aleksandar.m.m...@gmail.com> wrote: > >> >> >> On Saturday, November 30, 2019, David Hildenbrand >> wrote: >> >>> >>> >>> > Am 30.11.2019 um 20:42 schr

Re: [PATCH 13/21] memory-device: Fix latent memory pre-plug error handling bugs

2019-12-01 Thread David Hildenbrand
On 30.11.19 20:42, Markus Armbruster wrote: > memory_device_get_free_addr() crashes when > memory_device_check_addable() fails and its @errp argument is null. > Messed up in commit 1b6d6af21b "pc-dimm: factor out capacity and slot > checks into MemoryDevice". > > The bug can't bite as no caller ac

Re: [PATCH 16/21] s390/cpu_modules: Fix latent realize() error handling bugs

2019-12-01 Thread David Hildenbrand
On 30.11.19 20:42, Markus Armbruster wrote: > get_max_cpu_model() crashes when kvm_s390_get_host_cpu_model() fails > and its @errp argument is null. > > apply_cpu_model() crashes when kvm_s390_apply_cpu_model() fails and > its @errp argument is null. > > s390_realize_cpu_model() crashes when get_

Re: [PATCH 00/21] Error handling fixes, may contain 4.2 material

2019-12-01 Thread Michael S. Tsirkin
On Sat, Nov 30, 2019 at 08:42:19PM +0100, Markus Armbruster wrote: > PATCH 2-4 fix crash bugs. Including them would be a no-brainer at > -rc0. But we're post -rc3, and even for crash bugs we require a > certain likelihood of users getting bitten. > > Jens, please assess impact of PATCH 2's crash

Re: [PATCH v6 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Marc-André Lureau
Hi Aleksandar On Sun, Dec 1, 2019 at 4:15 PM Aleksandar Markovic wrote: > > > > On Sunday, December 1, 2019, Marc-André Lureau > wrote: > >> >> - "RFC: mips/cps: fix setting saar property" >> >> Perhaps I should have used FIX instead of RFC, because this should >> actually be a real fix. Howeve

Re: [PATCH 0/2] RFC: add -mem-shared option

2019-12-01 Thread Marc-André Lureau
Hi On Sat, Nov 30, 2019 at 12:23 AM Eduardo Habkost wrote: > > On Fri, Nov 29, 2019 at 10:31:36AM +0100, Paolo Bonzini wrote: > > On 28/11/19 17:10, Eduardo Habkost wrote: > > > On Thu, Nov 28, 2019 at 06:15:16PM +0400, Marc-André Lureau wrote: > > >> Hi, > > >> > > >> Setting up shared memory fo

Re: [RFC net-next 07/18] tun: set offloaded xdp program

2019-12-01 Thread David Ahern
On 11/26/19 4:07 AM, Prashant Bhole wrote: > From: Jason Wang > > This patch introduces an ioctl way to set an offloaded XDP program > to tun driver. This ioctl will be used by qemu to offload XDP program > from virtio_net in the guest. > > Signed-off-by: Jason Wang > Signed-off-by: Prashant Bh

Re: [RFC net-next 08/18] tun: run offloaded XDP program in Tx path

2019-12-01 Thread David Ahern
On 11/26/19 4:07 AM, Prashant Bhole wrote: > run offloaded XDP program as soon as packet is removed from the ptr > ring. Since this is XDP in Tx path, the traditional handling of > XDP actions XDP_TX/REDIRECT isn't valid. For this reason we call > do_xdp_generic_core instead of do_xdp_generic. do_x

Re: [RFC net-next 07/18] tun: set offloaded xdp program

2019-12-01 Thread David Ahern
On 11/26/19 4:07 AM, Prashant Bhole wrote: > From: Jason Wang > > This patch introduces an ioctl way to set an offloaded XDP program > to tun driver. This ioctl will be used by qemu to offload XDP program > from virtio_net in the guest. > Seems like you need to set / reset the SOCK_XDP flag on

Re: [RFC net-next 00/18] virtio_net XDP offload

2019-12-01 Thread David Ahern
On 11/27/19 10:18 PM, Jason Wang wrote: > We try to follow what NFP did by starting from a fraction of the whole > eBPF features. It would be very hard to have all eBPF features > implemented from the start.  It would be helpful to clarify what's the > minimal set of features that you want to have

Re: [PATCH v4 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Peter Maydell
On Sun, 1 Dec 2019 at 10:19, Marc-André Lureau wrote: > > - "serial: register vmsd with DeviceClass" > > This is standard qdev-ification, however it breaks backward migration, > but that's just how qdev_set_legacy_instance_id() works. I don't understand this part. Surely the whole point of settin

Re: [PATCH v4 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Marc-André Lureau
Hi On Sun, Dec 1, 2019 at 9:18 PM Peter Maydell wrote: > > On Sun, 1 Dec 2019 at 10:19, Marc-André Lureau > wrote: > > > > - "serial: register vmsd with DeviceClass" > > > > This is standard qdev-ification, however it breaks backward migration, > > but that's just how qdev_set_legacy_instance_id

Re: [PATCH 0/2] RFC: add -mem-shared option

2019-12-01 Thread Paolo Bonzini
On 01/12/19 16:40, Marc-André Lureau wrote: >>> The original idea was to always support one NUMA node, so that you could >>> do "-numa node,memdev=..." to specify a memory backend with -object. >>> However, this is not possible anymore since >>> >>> if (!mc->cpu_index_to_instance_props || >>>

Re: [PATCH v4 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Peter Maydell
On Sun, 1 Dec 2019 at 17:27, Marc-André Lureau wrote: > > Hi > > On Sun, Dec 1, 2019 at 9:18 PM Peter Maydell wrote: > > > > On Sun, 1 Dec 2019 at 10:19, Marc-André Lureau > > wrote: > > > > > > - "serial: register vmsd with DeviceClass" > > > > > > This is standard qdev-ification, however it br

Re: [PATCH 11/21] hw/ipmi: Fix latent realize() error handling bugs

2019-12-01 Thread Corey Minyard
On Sat, Nov 30, 2019 at 08:42:30PM +0100, Markus Armbruster wrote: > isa_ipmi_bt_realize(), ipmi_isa_realize(), pci_ipmi_bt_realize(), and > pci_ipmi_kcs_realize() crash when IPMIInterfaceClass method init() > fails and their @errp argument is null. First messed up in commit > 0719029c47 "ipmi: Ad

Re: [PATCH v6 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Aleksandar Markovic
On Sunday, December 1, 2019, Marc-André Lureau wrote: > Hi Aleksandar > > On Sun, Dec 1, 2019 at 4:15 PM Aleksandar Markovic > wrote: > > > > > > > > On Sunday, December 1, 2019, Marc-André Lureau < > marcandre.lur...@gmail.com> wrote: > > > >> > >> - "RFC: mips/cps: fix setting saar property" >

Re: [PATCH v6 00/37] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR

2019-12-01 Thread Aleksandar Markovic
On Sunday, December 1, 2019, Aleksandar Markovic < aleksandar.m.m...@gmail.com> wrote: > > > On Sunday, December 1, 2019, Marc-André Lureau > wrote: > >> Hi Aleksandar >> >> On Sun, Dec 1, 2019 at 4:15 PM Aleksandar Markovic >> wrote: >> > >> > >> > >> > On Sunday, December 1, 2019, Marc-André L

Re: [PATCH 01/26] object: add extra sanity checks

2019-12-01 Thread Philippe Mathieu-Daudé
On 12/1/19 12:15 PM, Marc-André Lureau wrote: Type system checked that children class_size >= parent class_size, but not instances. Fix that. Signed-off-by: Marc-André Lureau --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index d51b57fba1..93

Re: [PATCH 04/26] qdev: move helper function to monitor/misc

2019-12-01 Thread Philippe Mathieu-Daudé
On 12/1/19 12:15 PM, Marc-André Lureau wrote: Move the one-user function to the place it is being used. Signed-off-by: Marc-André Lureau --- hw/core/qdev.c | 26 -- include/hw/qdev-core.h | 2 -- monitor/misc.c | 26 ++ 3 fil

Re: [PATCH v2 05/14] gdbstub: add helper for 128 bit registers

2019-12-01 Thread Philippe Mathieu-Daudé
On 11/30/19 9:45 AM, Alex Bennée wrote: Signed-off-by: Alex Bennée --- v2 - take care of endianess of the whole 128 bit word --- include/exec/gdbstub.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 08363969c14..59e

Re: [PATCH v2 06/14] target/arm: use gdb_get_reg helpers

2019-12-01 Thread Philippe Mathieu-Daudé
On 11/30/19 9:45 AM, Alex Bennée wrote: This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée --- v2 - make sure we pass hi/lo correctly as quads are stored in LE order --- target/arm/helper.c | 18 +++--- 1 file changed,

Re: [PATCH] target/arm: Allow loading elf from aliased ROM regions

2019-12-01 Thread Richard Henderson
On 11/25/19 12:41 PM, Jean-Hugues Deschênes wrote: > initial_msp = ldl_p(rom); > initial_pc = ldl_p(rom + 4); > } else { > -/* Address zero not covered by a ROM blob, or the ROM blob > - * is in non-modifiable memory and this is a second re

Re: [PATCH 2/5] mips: malta: Renovate coding style

2019-12-01 Thread Philippe Mathieu-Daudé
Hi Filip, On 11/25/19 2:04 PM, Filip Bozuta wrote: The script checkpatch.pl located in scripts folder was used to detect all errors and warrnings in files: hw/mips/mips_malta.c hw/mips/gt64xxx_pci.c tests/acceptance/linux_ssh_mips_malta.py All these mips malta machine files were

Re: [RFC net-next 08/18] tun: run offloaded XDP program in Tx path

2019-12-01 Thread David Miller
From: David Ahern Date: Sun, 1 Dec 2019 09:39:54 -0700 > Below you just drop the packet which is going to be a bad user > experience. A better user experience is to detect XDP return codes a > program uses, catch those that are not supported for this use case and > fail the install of the program

Re: [RFC net-next 08/18] tun: run offloaded XDP program in Tx path

2019-12-01 Thread Michael S. Tsirkin
On Sun, Dec 01, 2019 at 12:56:21PM -0800, David Miller wrote: > From: David Ahern > Date: Sun, 1 Dec 2019 09:39:54 -0700 > > > Below you just drop the packet which is going to be a bad user > > experience. A better user experience is to detect XDP return codes a > > program uses, catch those that

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-12-01 Thread Richard Henderson
On 11/27/19 6:36 PM, Fangrui Song wrote: > On 2019-11-20, Fangrui Song wrote: >> On 2019-11-15, Fangrui Song wrote: >>> For lld, --image-base is the preferred way to set the base address. >>> lld does not actually implement -Ttext-segment, but treats it as an alias >>> for >>> -Ttext. -Ttext-segme

Re: [RFC net-next 08/18] tun: run offloaded XDP program in Tx path

2019-12-01 Thread David Miller
From: "Michael S. Tsirkin" Date: Sun, 1 Dec 2019 16:40:22 -0500 > Right. But it is helpful to expose the supported functionality > to guest in some way, if nothing else then so that > guests can be moved between different hosts. > > Also, we need a way to report this kind of event to guest > so

Re: [PATCH] target/arm: Allow loading elf from aliased ROM regions

2019-12-01 Thread Peter Maydell
On Sun, 1 Dec 2019 at 20:13, Richard Henderson wrote: > > On 11/25/19 12:41 PM, Jean-Hugues Deschênes wrote: > > initial_msp = ldl_p(rom); > > initial_pc = ldl_p(rom + 4); > > } else { > > -/* Address zero not covered by a ROM blob, or the ROM blob >

RE: [PATCH] target/arm: Allow loading elf from aliased ROM regions

2019-12-01 Thread Jean-Hugues Deschênes
> No. This is a reset ordering problem. The CPU reset happens before the > 'rom blob loader' reset, so at this point the rom data (usually an ELF file > segment) has not been written into ram, and doing an > address_space_read() will just read zeroes. This is also why the aliasing > issue happens

Re: [PATCH] target/arm: Allow loading elf from aliased ROM regions

2019-12-01 Thread Peter Maydell
On Sun, 1 Dec 2019 at 22:50, Jean-Hugues Deschênes wrote: > > My preference for fixing this properly is: > > * get Damien's three-phase-reset patchset into master > > * make the ROM blob loader write its data into ram > >in phase 2 ('hold') > > * make the arm CPU reset read the data in phase

Re: [RFC] exec: flush CPU TB cache when breakpoint address translation fails

2019-12-01 Thread Richard Henderson
On 11/26/19 10:26 PM, Max Filippov wrote: > When a breakpoint is inserted at location for which there's currently no > virtual to physical translation no action is taken on CPU TB cache. If a > TB for that virtual address already exists but is not visible ATM the > breakpoint won't be hit next time

Re: [PATCH 1/2] exec: flush CPU TB cache in breakpoint_invalidate

2019-12-01 Thread Richard Henderson
On 11/27/19 10:06 PM, Max Filippov wrote: > When a breakpoint is inserted at location for which there's currently no > virtual to physical translation no action is taken on CPU TB cache. If a > TB for that virtual address already exists but is not visible ATM the > breakpoint won't be hit next time

Re: [PATCH 5/5] mips: fulong 2e: Renovate coding style

2019-12-01 Thread Aleksandar Markovic
On Monday, November 25, 2019, Filip Bozuta wrote: > The script checkpatch.pl located in scripts folder was > used to detect all errors and warrnings in files: > hw/mips/mips_fulong2e.c > hw/isa/vt82c686.c > hw/pci-host/bonito.c > include/hw/isa/vt82c686.h > > These mips Fulong 2E

Re: [PATCH 2/2] exec: drop tb_invalidate_phys_addr

2019-12-01 Thread Richard Henderson
On 11/27/19 10:06 PM, Max Filippov wrote: > The only remaining user of tb_invalidate_phys_addr is target/xtensa > instruction breakpoint code and it is better to use tb_flush there. > > Drop tb_invalidate_phys_addr implementations and declarations. > Use tb_flush in xtensa IBREAK helpers. > > Sig

Re: [PATCH 4/5] mips: r4000: Renovate coding style

2019-12-01 Thread Aleksandar Markovic
On Monday, November 25, 2019, Filip Bozuta wrote: > The script checkpatch.pl located in scripts folder was > used to detect all errors and warrnings in file: > hw/mips/mips_r4k.c > > This mips r4000 machine file was edited and > all the errors and warrings generated by the checkpatch.pl > scr

Re: [PATCH v37 10/17] target/avr: Add instruction disassembly function

2019-12-01 Thread Aleksandar Markovic
On Wednesday, November 27, 2019, Michael Rolnik wrote: > Provide function disassembles executed instruction when `-d in_asm` is > provided > > Example: > `./avr-softmmu/qemu-system-avr -bios > free-rtos/Demo/AVR_ATMega2560_GCC/demo.elf > -d in_asm` will produce something like the following > > `

Re: [PATCH v1 1/5] linux-user: convert target_mprotect debug to tracepoint

2019-12-01 Thread Richard Henderson
On 11/28/19 7:45 PM, Alex Bennée wrote: > -#ifdef DEBUG_MMAP > -printf("mprotect: start=0x" TARGET_ABI_FMT_lx > - "len=0x" TARGET_ABI_FMT_lx " prot=%c%c%c\n", start, len, > - prot & PROT_READ ? 'r' : '-', > - prot & PROT_WRITE ? 'w' : '-', > - prot & PROT

Re: [PATCH v1 2/5] linux-user: convert target_mmap debug to tracepoint

2019-12-01 Thread Richard Henderson
On 11/28/19 7:46 PM, Alex Bennée wrote: > +if (TRACE_TARGET_MMAP_ENABLED) { > +char prot_str[4]; > +g_autoptr(GString) flag_str = g_string_new(NULL); > + > +pp_prot(&prot_str, prot); > + > +if (flags & MAP_FIXED) { > +g_string_append(flag_str, "MAP_FI

Re: [PATCH v1 3/5] linux-user: add target_mmap_complete tracepoint

2019-12-01 Thread Richard Henderson
On 11/28/19 7:46 PM, Alex Bennée wrote: > For full details we also want to see where the mmaps end up. > > Signed-off-by: Alex Bennée > --- > linux-user/mmap.c | 2 +- > linux-user/trace-events | 1 + > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderson r~

[PATCH] virtio-input: fix memory leak in virtio_input_device_unrealize()

2019-12-01 Thread pannengyuan
From: PanNengyuan vdev->vq[i] is forgot to cleanup in virtio_input_device_unrealize, the memory leak stack is as bellow: Direct leak of 3584 byte(s) in 1 object(s) allocated from: #0 0x7f84a49f6560 in calloc (/usr/lib64/libasan.so.3+0xc7560) #1 0x7f84a3b3e015 in g_malloc0 (/usr/lib64/lib

Re: [PATCH v1 4/5] linux-user: log page table changes under -d page

2019-12-01 Thread Richard Henderson
On 11/28/19 7:46 PM, Alex Bennée wrote: > +if (qemu_loglevel_mask(CPU_LOG_PAGE)) { > +qemu_log_lock(); > +qemu_log("new page @ 0x"TARGET_ABI_FMT_lx" updates page map:\n", > start); > +log_page_dump(); > +qemu_log_unlock(); > +} Hmm. The language used here

Re: [PATCH v1 5/5] linux-user: convert target_munmap debug to a tracepoint

2019-12-01 Thread Richard Henderson
On 11/28/19 7:46 PM, Alex Bennée wrote: > Convert the final bit of DEBUG_MMAP to a tracepoint and remove the > last remanents of the #ifdef hackery. > > Signed-off-by: Alex Bennée > --- > linux-user/mmap.c | 9 ++--- > linux-user/trace-events | 1 + > 2 files changed, 3 insertions(+),

Re: [PATCH v7] Implement backend program convention command for vhost-user-blk

2019-12-01 Thread Micky C
Ping On Mon, Nov 25, 2019 at 1:17 PM Micky Yun Chan(michiboo) < chanmicky...@gmail.com> wrote: > From: Micky Yun Chan > > This patch is to add standard commands defined in > docs/interop/vhost-user.rst > For vhost-user-* program > > Signed-off-by: Micky Yun Chan (michiboo) > --- > contrib/vhos

Re: [PATCH v2 01/14] gdbstub: make GDBState static and have common init function

2019-12-01 Thread Richard Henderson
On 11/30/19 8:45 AM, Alex Bennée wrote: > -static GDBState *gdbserver_state; > +static GDBState gdbserver_state; > + > +static void init_gdbserver_state(void) > +{ > +g_assert(!gdbserver_state.init); > +memset(&gdbserver_state, 0, sizeof(GDBState)); > +gdbserver_state.init = true; > +}

Re: [PATCH v2 02/14] gdbstub: stop passing GDBState * around and use global

2019-12-01 Thread Richard Henderson
On 11/30/19 8:45 AM, 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 | 539 +++--- > 1 fi

Re: [PATCH v2 05/14] gdbstub: add helper for 128 bit registers

2019-12-01 Thread Richard Henderson
On 11/30/19 8:45 AM, Alex Bennée wrote: > Signed-off-by: Alex Bennée > > --- > v2 > - take care of endianess of the whole 128 bit word > --- > include/exec/gdbstub.h | 13 + > 1 file changed, 13 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v2 06/14] target/arm: use gdb_get_reg helpers

2019-12-01 Thread Richard Henderson
On 11/30/19 8:45 AM, Alex Bennée wrote: > This is cleaner than poking memory directly and will make later > clean-ups easier. > > Signed-off-by: Alex Bennée > > --- > v2 > - make sure we pass hi/lo correctly as quads are stored in LE order > --- > target/arm/helper.c | 18 +++--- >

Re: [PATCH v2 08/14] gdbstub: extend GByteArray to read register helpers

2019-12-01 Thread Richard Henderson
On 11/30/19 8:45 AM, Alex Bennée wrote: > -static int cpu_read_virt_reg(CPUS390XState *env, uint8_t *mem_buf, int n) > +static int cpu_read_virt_reg(CPUS390XState *env, GByteArray *mem_buf, int n) > { > switch (n) { > case S390_VIRT_CKC_REGNUM: > @@ -296,9 +296,9 @@ static int cpu_write_

Re: [PATCH v6] ppc: well form kvmppc_hint_smt_possible error hint helper

2019-12-01 Thread David Gibson
On Wed, Nov 27, 2019 at 10:14:34PM +0300, Vladimir Sementsov-Ogievskiy wrote: > Make kvmppc_hint_smt_possible hint append helper well formed: > rename errp to errp_in, as it is IN-parameter here (which is unusual > for errp), rename function to be kvmppc_error_append_*_hint. I'm not entirely convi

Re: [PATCH v2 11/14] target/arm: default SVE length to 64 bytes for linux-user

2019-12-01 Thread Richard Henderson
On 11/30/19 8:45 AM, Alex Bennée wrote: > The Linux kernel chooses the default of 64 bytes for SVE registers on > the basis that it is the largest size that won't grow the signal > frame. When debugging larger sizes are also unwieldy in gdb as each > zreg will take over a page of terminal to displa

Re: [RFC net-next 07/18] tun: set offloaded xdp program

2019-12-01 Thread Jason Wang
On 2019/12/2 上午12:35, David Ahern wrote: On 11/26/19 4:07 AM, Prashant Bhole wrote: From: Jason Wang This patch introduces an ioctl way to set an offloaded XDP program to tun driver. This ioctl will be used by qemu to offload XDP program from virtio_net in the guest. Signed-off-by: Jason Wa

Re: [RFC net-next 08/18] tun: run offloaded XDP program in Tx path

2019-12-01 Thread Jason Wang
On 2019/12/2 上午12:39, David Ahern wrote: On 11/26/19 4:07 AM, Prashant Bhole wrote: run offloaded XDP program as soon as packet is removed from the ptr ring. Since this is XDP in Tx path, the traditional handling of XDP actions XDP_TX/REDIRECT isn't valid. For this reason we call do_xdp_generi

Re: [RFC net-next 07/18] tun: set offloaded xdp program

2019-12-01 Thread Jason Wang
On 2019/12/2 上午12:45, David Ahern wrote: On 11/26/19 4:07 AM, Prashant Bhole wrote: From: Jason Wang This patch introduces an ioctl way to set an offloaded XDP program to tun driver. This ioctl will be used by qemu to offload XDP program from virtio_net in the guest. Seems like you need to

Re: [RFC net-next 00/18] virtio_net XDP offload

2019-12-01 Thread Jason Wang
On 2019/12/2 上午12:54, David Ahern wrote: On 11/27/19 10:18 PM, Jason Wang wrote: We try to follow what NFP did by starting from a fraction of the whole eBPF features. It would be very hard to have all eBPF features implemented from the start.  It would be helpful to clarify what's the minimal

Re: [RFC net-next 08/18] tun: run offloaded XDP program in Tx path

2019-12-01 Thread Jason Wang
On 2019/12/2 上午5:54, David Miller wrote: From: "Michael S. Tsirkin" Date: Sun, 1 Dec 2019 16:40:22 -0500 Right. But it is helpful to expose the supported functionality to guest in some way, if nothing else then so that guests can be moved between different hosts. Also, we need a way to repo

Re: [PATCH] virtio-input: fix memory leak in virtio_input_device_unrealize()

2019-12-01 Thread Marc-André Lureau
On Mon, Dec 2, 2019 at 5:20 AM wrote: > > From: PanNengyuan > > vdev->vq[i] is forgot to cleanup in > virtio_input_device_unrealize, the memory leak stack is as bellow: > > Direct leak of 3584 byte(s) in 1 object(s) allocated from: > #0 0x7f84a49f6560 in calloc (/usr/lib64/libasan.so.3+0xc756

Re: Network connection with COLO VM

2019-12-01 Thread Daniel Cho
Hi Zhang, We use qemu-4.1.0 release on this case. I think we need use block mirror to sync the disk to secondary node first, then stop the primary VM and build COLO system. In the stop moment, you need add some netfilter and chardev socket node for COLO, maybe you need re-check this part. Our

Re: [PATCH] configure: Use lld --image-base for --disable-pie user mode binaries

2019-12-01 Thread Fangrui Song
Thanks for reviewing this patch! On 2019-12-01, Richard Henderson wrote: On 11/27/19 6:36 PM, Fangrui Song wrote: On 2019-11-20, Fangrui Song wrote: On 2019-11-15, Fangrui Song wrote: For lld, --image-base is the preferred way to set the base address. lld does not actually implement -Ttext-

Re: [PATCH 17/21] s390x: Fix latent query-cpu-model-FOO error handling bugs

2019-12-01 Thread Markus Armbruster
David Hildenbrand writes: > On 01.12.19 14:46, Aleksandar Markovic wrote: >> >> >> On Saturday, November 30, 2019, David Hildenbrand > > wrote: >> >> >> >> > Am 30.11.2019 um 20:42 schrieb Markus Armbruster >> mailto:arm...@redhat.com>>: >> > >> >

Re: [PATCH 16/21] s390/cpu_modules: Fix latent realize() error handling bugs

2019-12-01 Thread Markus Armbruster
David Hildenbrand writes: > On 30.11.19 20:42, Markus Armbruster wrote: >> get_max_cpu_model() crashes when kvm_s390_get_host_cpu_model() fails >> and its @errp argument is null. >> >> apply_cpu_model() crashes when kvm_s390_apply_cpu_model() fails and >> its @errp argument is null. >> >> s390_

Re: [PATCH 13/21] memory-device: Fix latent memory pre-plug error handling bugs

2019-12-01 Thread Markus Armbruster
David Hildenbrand writes: > On 30.11.19 20:42, Markus Armbruster wrote: >> memory_device_get_free_addr() crashes when >> memory_device_check_addable() fails and its @errp argument is null. >> Messed up in commit 1b6d6af21b "pc-dimm: factor out capacity and slot >> checks into MemoryDevice". >> >

  1   2   >