Re: [PATCH v4 04/12] hw/i386/q35: Realize LPC PCI function before accessing it

2024-02-13 Thread Damien Hedde
;error_fatal); for (i = 0; i < IOAPIC_NUM_PINS; i++) { qdev_connect_gpio_out_named(lpc_dev, ICH9_GPIO_GSI, i, x86ms->gsi[i]); } -pci_realize_and_unref(lpc, host_bus, &error_fatal); rtc_state = ISA_DEVICE(object_resolve_path_component(OBJECT(lpc), "rtc")); Reviewed-by: Damien Hedde

Re: [PATCH v4 12/12] hw/sparc64/cpu: Initialize GPIO before realizing CPU devices

2024-02-13 Thread Damien Hedde
env->tick = cpu_timer_create("tick", cpu, tick_irq, Reviewed-by: Damien Hedde

Re: NVME hotplug support ?

2024-01-29 Thread Damien Hedde
On 1/24/24 08:47, Hannes Reinecke wrote: On 1/24/24 07:52, Philippe Mathieu-Daudé wrote: Hi Hannes, [+Markus as QOM/QDev rubber duck] On 23/1/24 13:40, Hannes Reinecke wrote: On 1/23/24 11:59, Damien Hedde wrote: Hi all, We are currently looking into hotplugging nvme devices and it is

Re: NVME hotplug support ?

2024-02-05 Thread Damien Hedde
On 1/29/24 16:35, Hannes Reinecke wrote: On 1/29/24 14:13, Damien Hedde wrote: On 1/24/24 08:47, Hannes Reinecke wrote: On 1/24/24 07:52, Philippe Mathieu-Daudé wrote: Hi Hannes, [+Markus as QOM/QDev rubber duck] On 23/1/24 13:40, Hannes Reinecke wrote: On 1/23/24 11:59, Damien Hedde

[PATCH v5 07/13] hw/core/qdev: update hotplug reset regarding resettable

2019-10-18 Thread Damien Hedde
This commit make use of the resettable API to reset the device being hotplugged during when it is realized. Also it make sure it is put in a reset state coherent with the parent it is plugged into. Signed-off-by: Damien Hedde --- I'm not sure I've done everything that's required

[PATCH v5 02/13] hw/core/qdev: add trace events to help with resettable transition

2019-10-18 Thread Damien Hedde
Adds trace events to reset procedure and when updating the parent bus of a device. Signed-off-by: Damien Hedde --- hw/core/qdev.c | 27 --- hw/core/trace-events | 9 + 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/hw/core/qdev.c b/hw/core

[PATCH v5 05/13] hw/core/resettable: add support for changing parent

2019-10-18 Thread Damien Hedde
parent under reset, the object goes in reset. + when an object is removed from a parent under reset, the object leaves reset. The added function avoid any glitch if both old and new parent are already in reset. Signed-off-by: Damien Hedde --- hw/core/resettable.c| 54

[PATCH v5 00/13] Multi-phase reset mechanism

2019-10-18 Thread Damien Hedde
t from hotplug). Thanks for your feedback, Damien Damien Hedde (13): add device_legacy_reset function to prepare for reset api change hw/core/qdev: add trace events to help with resettable transition hw/core: create Resettable QOM interface hw/core: add Resettable support to BusClass and Devi

[PATCH v5 10/13] vl: replace deprecated qbus_reset_all registration

2019-10-18 Thread Damien Hedde
local state and query information from the block backend. Signed-off-by: Damien Hedde --- The raspi reset change can be observed by using the following command (reset will occurs, then do Ctrl-C to end qemu; no firmware is given here). qemu-system-aarch64 -M raspi3 \ -trace

[PATCH v5 06/13] hw/core/qdev: handle parent bus change regarding resettable

2019-10-18 Thread Damien Hedde
sdbus_reparent_card(). This function is only used in the raspi machines, including during the sysbus reset procedure. This case will be fixed by a following commit before globally enabling resettable API for sysbus reset. Signed-off-by: Damien Hedde --- Exhaustive list of the 28 virtio caller to

[PATCH v5 01/13] add device_legacy_reset function to prepare for reset api change

2019-10-18 Thread Damien Hedde
buses as well as the specified device). Subsequent commits will make the changeover for each call site individually; once that is complete device_legacy_reset() will be removed. Signed-off-by: Damien Hedde Reviewed-by: Peter Maydell Acked-by: David Gibson --- Cc: Gerd Hoffmann Cc: Paolo

[PATCH v5 09/13] docs/devel/reset.txt: add doc about Resettable interface

2019-10-18 Thread Damien Hedde
Signed-off-by: Damien Hedde --- Should I add an entry into index.rst ? --- docs/devel/reset.rst | 282 +++ 1 file changed, 282 insertions(+) create mode 100644 docs/devel/reset.rst diff --git a/docs/devel/reset.rst b/docs/devel/reset.rst new file mode

[PATCH v5 08/13] hw/core: deprecate old reset functions and introduce new ones

2019-10-18 Thread Damien Hedde
(). Following patches will be needed to look at legacy reset call sites and switch to resettable api. The legacy functions will be removed when unused. Signed-off-by: Damien Hedde --- I've removed the general helpers + device_reset(DeviceState *dev, ResetType type) + bus_reset(BusState *dev, Rese

[PATCH v5 04/13] hw/core: add Resettable support to BusClass and DeviceClass

2019-10-18 Thread Damien Hedde
any transition because they do not override the legacy reset method. Signed-off-by: Damien Hedde --- hw/core/bus.c | 97 ++ hw/core/qdev.c | 97 ++ include/hw/qdev-core.h | 27 te

[PATCH v5 03/13] hw/core: create Resettable QOM interface

2019-10-18 Thread Damien Hedde
the 2nd phase which is executed in children-then-parent order inside a tree. This will allow to transition devices and buses smoothly while keeping the exact current qdev/qbus reset behavior for now. Documentation will be added in a following commit. Signed-off-by: Damien Hedde --- In this patch

[PATCH v5 11/13] hw/s390x/ipl: replace deprecated qdev_reset_all registration

2019-10-18 Thread Damien Hedde
. Signed-off-by: Damien Hedde --- Cc: Cornelia Huck Cc: qemu-s3...@nongnu.org Cc: Christian Borntraeger Cc: Thomas Huth --- hw/s390x/ipl.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index ca544d64c5..2689f7a017 100644 --- a/hw/s390x

[PATCH v5 12/13] hw/gpio/bcm2835_gpio: Isolate sdbus reparenting

2019-10-18 Thread Damien Hedde
Split gpfsel_set() in 2 so that the sdbus reparenting is done in a dedicated function. Signed-off-by: Damien Hedde --- Cc: Peter Maydell Cc: Andrew Baumann Cc: Philippe Mathieu-Daudé Cc: qemu-...@nongnu.org --- hw/gpio/bcm2835_gpio.c | 16 1 file changed, 12 insertions(+), 4

[PATCH v5 13/13] hw/gpio/bcm2835_gpio: Update to resettable

2019-10-18 Thread Damien Hedde
Transition the bcm2835_gpio device class to Resettable. The sdbus reparenting is delayed in hold phase to respect resettable side-effect rules. Signed-off-by: Damien Hedde --- Cc: Peter Maydell Cc: Andrew Baumann Cc: Philippe Mathieu-Daudé Cc: qemu-...@nongnu.org --- hw/gpio/bcm2835_gpio.c

Re: [PATCH v6 0/9] Clock framework API

2019-12-05 Thread Damien Hedde
On 12/4/19 9:34 PM, Philippe Mathieu-Daudé wrote: > On 12/4/19 5:40 PM, Damien Hedde wrote: >> On 12/2/19 5:15 PM, Peter Maydell wrote: >>> >>> The one topic I think we could do with discussing is whether >>> a simple uint64_t giving the frequency

[PATCH] gdbstub: change GDBState.last_packet to GByteArray

2019-12-06 Thread Damien Hedde
Remove the packet size upper limit by using a GByteArray instead of a statically allocated array for last_packet. Thus we can now send big packets. Also remove the last_packet_len field and use last_packet->len instead. Signed-off-by: Damien Hedde --- This patch is a follow-up of Alex'

Re: [PATCH v5 09/13] docs/devel/reset.txt: add doc about Resettable interface

2019-12-06 Thread Damien Hedde
On 11/29/19 8:00 PM, Peter Maydell wrote: > On Fri, 18 Oct 2019 at 16:07, Damien Hedde wrote: >> >> Signed-off-by: Damien Hedde > > Subject line still says ".txt". > >> --- >> >> Should I add an entry into index.rst ? > > Yes, ple

Re: [PATCH v5 09/13] docs/devel/reset.txt: add doc about Resettable interface

2019-12-06 Thread Damien Hedde
On 11/29/19 8:00 PM, Peter Maydell wrote: > On Fri, 18 Oct 2019 at 16:07, Damien Hedde wrote: >> >> Signed-off-by: Damien Hedde > > Subject line still says ".txt". > >> --- >> >> +Polling the reset state >> +

Re: qom device lifecycle interaction with hotplug/hotunplug ?

2019-12-11 Thread Damien Hedde
On 12/4/19 7:51 PM, Eduardo Habkost wrote: > On Wed, Dec 04, 2019 at 05:21:25PM +0100, Jens Freimann wrote: >> On Wed, Dec 04, 2019 at 11:35:37AM -0300, Eduardo Habkost wrote: >>> On Wed, Dec 04, 2019 at 10:18:24AM +0100, Jens Freimann wrote: On Tue, Dec 03, 2019 at 06:40:04PM -0300, Eduard

Re: [PATCH] gdbstub: change GDBState.last_packet to GByteArray

2019-12-11 Thread Damien Hedde
On 12/9/19 11:15 AM, Luc Michel wrote: > > > On 12/6/19 2:42 PM, Damien Hedde wrote: >> Remove the packet size upper limit by using a GByteArray >> instead of a statically allocated array for last_packet. >> Thus we can now send big packets. >> >> Also r

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

2019-12-11 Thread Damien Hedde
t; - * The type of the QOM property is derived from prop->info. > - */ > void qdev_property_add_static(DeviceState *dev, Property *prop, >Error **errp) > { > Reviewed-by: Damien Hedde Regards, -- Damien

[PATCH v2 1/2] gdbstub: change GDBState.last_packet to GByteArray

2019-12-11 Thread Damien Hedde
Remove the packet size upper limit by using a GByteArray instead of a statically allocated array for last_packet. Thus we can now send big packets. Also remove the last_packet_len field and use last_packet->len instead. Signed-off-by: Damien Hedde Reviewed-by: Philippe Mathieu-Da

[PATCH v2 2/2] gdbstub: do not split gdb_monitor_write payload

2019-12-11 Thread Damien Hedde
Since we can now send packets of arbitrary length: simplify gdb_monitor_write() and send the whole payload in one packet. Suggested-by: Luc Michel Signed-off-by: Damien Hedde --- gdbstub.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/gdbstub.c b

[PATCH v2 0/2] gdbstub: allow sending packet of arbitrary length

2019-12-11 Thread Damien Hedde
naro.org> v2: + patch 1: fix gdb_monitor_write() max_sz error (Luc) + patch 2: new patch (Luc) -- Damien Damien Hedde (2): gdbstub: change GDBState.last_packet to GByteArray gdbstub: do not split gdb_monitor_write payload gdbstub.c | 60 +--

Re: [PATCH 03/26] qdev: remove extraneous error

2019-12-11 Thread Damien Hedde
- > target/arm/cpu.c | 33 +++-- > 3 files changed, 16 insertions(+), 35 deletions(-) > Reviewed-by: Damien Hedde Regards, -- Damien

Re: [PATCH v3 08/20] gdbstub: extend GByteArray to read register helpers

2019-12-11 Thread Damien Hedde
Hi Alex, On 12/11/19 6:05 PM, Alex Bennée wrote: > Instead of passing a pointer to memory now just extend the GByteArray > to all the read register helpers. They can then safely append their > data through the normal way. We don't bother with this abstraction for > write registers as we have alr

Re: [PATCH v2 2/2] gdbstub: do not split gdb_monitor_write payload

2019-12-12 Thread Damien Hedde
On 12/11/19 7:58 PM, Philippe Mathieu-Daudé wrote: > On 12/11/19 5:05 PM, Damien Hedde wrote: >> Since we can now send packets of arbitrary length: >> simplify gdb_monitor_write() and send the whole payload >> in one packet. > > While we can send arbitrary lengt

Re: [PATCH v2 2/2] gdbstub: do not split gdb_monitor_write payload

2019-12-12 Thread Damien Hedde
On 12/11/19 7:59 PM, Alex Bennée wrote: > > Damien Hedde writes: > >> Since we can now send packets of arbitrary length: >> simplify gdb_monitor_write() and send the whole payload >> in one packet. > > Do we know gdb won't barf on us. Does the negotiate

Re: [PATCH v2 2/2] gdbstub: do not split gdb_monitor_write payload

2019-12-13 Thread Damien Hedde
On 12/12/19 11:52 AM, Alex Bennée wrote: > > Damien Hedde writes: > >> On 12/11/19 7:59 PM, Alex Bennée wrote: >>> >>> Damien Hedde writes: >>> >>>> Since we can now send packets of arbitrary length: >>>> simplify gdb_monitor

Re: [PATCH v3 04/20] gdbstub: move mem_buf to GDBState and use GByteArray

2019-12-13 Thread Damien Hedde
e size range. > > Signed-off-by: Alex Bennée > Reviewed-by: Richard Henderson > Reviewed-by: Damien Hedde > Tested-by: Damien Hedde > > --- > v3 > - fixed up email on Damien's tags > --- > gdbstub.c | 56 ++---

Re: qom device lifecycle interaction with hotplug/hotunplug ?

2019-11-29 Thread Damien Hedde
On 11/29/19 1:45 PM, Peter Maydell wrote: > On Fri, 29 Nov 2019 at 12:26, Igor Mammedov wrote: >> But from the my very limited understanding, on real hardware, >> once device is uplugged it's gone (finalized) from machine >> perspective, so it's unclear to my why someone would use >> realize->un

Re: [PATCH v5 03/13] hw/core: create Resettable QOM interface

2019-12-02 Thread Damien Hedde
On 11/29/19 7:32 PM, Peter Maydell wrote: > On Fri, 18 Oct 2019 at 16:07, Damien Hedde wrote: >> >> This commit defines an interface allowing multi-phase reset. This aims >> to solve a problem of the actual single-phase reset (built in >> DeviceClass and BusClass):

Re: [PATCH v5 04/13] hw/core: add Resettable support to BusClass and DeviceClass

2019-12-02 Thread Damien Hedde
On 11/29/19 7:36 PM, Peter Maydell wrote: > On Fri, 18 Oct 2019 at 16:07, Damien Hedde wrote: >> >> This commit adds support of Resettable interface to buses and devices: >> + ResettableState structure is added in the Bus/Device state >> + Resettable methods a

Re: [PATCH v5 05/13] hw/core/resettable: add support for changing parent

2019-12-02 Thread Damien Hedde
On 11/29/19 7:38 PM, Peter Maydell wrote: > On Fri, 18 Oct 2019 at 16:07, Damien Hedde wrote: >> >> Add a function resettable_change_parent() to do the required >> plumbing when changing the parent a of Resettable object. >> >> We need to make sure that the

Re: [PATCH v5 12/13] hw/gpio/bcm2835_gpio: Isolate sdbus reparenting

2019-12-02 Thread Damien Hedde
On 11/29/19 8:05 PM, Peter Maydell wrote: > On Fri, 18 Oct 2019 at 16:07, Damien Hedde wrote: >> >> Split gpfsel_set() in 2 so that the sdbus reparenting is done >> in a dedicated function. >> >> Signed-off-by: Damien Hedde >> --- >> Cc: Peter Ma

Re: [PATCH v5 12/13] hw/gpio/bcm2835_gpio: Isolate sdbus reparenting

2019-12-02 Thread Damien Hedde
On 12/2/19 1:33 PM, Peter Maydell wrote: > On Mon, 2 Dec 2019 at 12:27, Damien Hedde wrote: >> >> >> >> On 11/29/19 8:05 PM, Peter Maydell wrote: >>> On Fri, 18 Oct 2019 at 16:07, Damien Hedde >>> wrote: >>>> @@ -97,6 +101,7 @@ stat

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

2019-12-02 Thread Damien Hedde
> > Signed-off-by: Alex Bennée > Cc: Damien Hedde > Cc: Richard Henderson > > --- > v2 > - made entirely static, dropped dh/rth r-b tags due to changes Modulo Richard's remark about unnecessary memset, Reviewed-by: Damien Hedde

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

2019-12-02 Thread Damien Hedde
On 11/30/19 9: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

Re: [PATCH v2 03/14] gdbstub: move str_buf to GDBState and use GString

2019-12-02 Thread Damien Hedde
Richard Henderson > > --- > v2 > - fix conflict from status gdbserver_state > - add put_strbuf helper > --- > gdbstub.c | 195 +- > 1 file changed, 90 insertions(+), 105 deletions(-) > Reviewed-by: Damien Hedde -- Damien

Re: [PATCH v2 04/14] gdbstub: move mem_buf to GDBState and use GByteArray

2019-12-03 Thread Damien Hedde
y_cpu); > } > > @@ -2058,7 +2070,7 @@ static void handle_query_thread_extra(GdbCmdContext > *gdb_ctx, void *user_ctx) > } > trace_gdbstub_op_extra_info(rs->str); > memtohex(gdbserver_state.str_buf, (uint8_t *)rs->str, rs->len); > -put_strbuf();; > +put_strbuf(); > } > With the ";;" fix Reviewed/Tested-by: Damien Hedde -- Damien

Re: [PATCH v2 03/14] gdbstub: move str_buf to GDBState and use GString

2019-12-03 Thread Damien Hedde
27;t happen with in-tree targets, it works fine. So, Tested-by: Damien Hedde I'll work on the missing bits for bigger packet support I soon as I have some spare time. Regards, -- Damien

Re: [PATCH v6 9/9] hw/arm/xilinx_zynq: connect uart clocks to slcr

2019-12-03 Thread Damien Hedde
On 12/2/19 4:34 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Add the connection between the slcr's output clocks and the uarts inputs. >> >> Also add the main board clock 'ps_clk', which is hard-coded to 33.33MHz

Re: [PATCH v6 1/9] hw/core/clock: introduce clock objects

2019-12-03 Thread Damien Hedde
On 11/25/19 2:37 PM, Philippe Mathieu-Daudé wrote: > On 9/4/19 2:55 PM, Damien Hedde wrote: >> Introduce clock objects: ClockIn and ClockOut. >> >> These objects may be used to distribute clocks from an object to several >> other objects. Each ClockIn object contai

Re: [PATCH v6 1/9] hw/core/clock: introduce clock objects

2019-12-03 Thread Damien Hedde
On 12/2/19 2:42 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Introduce clock objects: ClockIn and ClockOut. >> >> These objects may be used to distribute clocks from an object to several >> other objects. Each ClockIn obj

Re: [PATCH v6 3/9] qdev: add clock input&output support to devices.

2019-12-03 Thread Damien Hedde
On 11/25/19 2:30 PM, Philippe Mathieu-Daudé wrote: > Nitpick: remove trailing dot in patch subject > > On 9/4/19 2:55 PM, Damien Hedde wrote: >> Add functions to easily add input or output clocks to a device. >> A clock objects is added as a child of the device. > &

Re: [PATCH v6 3/9] qdev: add clock input&output support to devices.

2019-12-04 Thread Damien Hedde
On 12/2/19 3:34 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Add functions to easily add input or output clocks to a device. >> A clock objects is added as a child of the device. > > "object" > >> The api i

Re: [PATCH v6 5/9] qdev-clock: introduce an init array to ease the device construction

2019-12-04 Thread Damien Hedde
On 12/2/19 4:13 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Introduce a function and macro helpers to setup several clocks >> in a device from a static array description. >> >> An element of the array describes the clock (

Re: [PATCH v6 3/9] qdev: add clock input&output support to devices.

2019-12-04 Thread Damien Hedde
On 12/4/19 10:53 AM, Philippe Mathieu-Daudé wrote: > On 12/4/19 10:05 AM, Damien Hedde wrote: >> On 12/2/19 3:34 PM, Peter Maydell wrote: >>> On Wed, 4 Sep 2019 at 13:56, Damien Hedde >>> wrote: >>>> > [...] >>>> +/** >>>> + *

Re: [PATCH v6 6/9] docs/clocks: add device's clock documentation

2019-12-04 Thread Damien Hedde
On 12/2/19 4:17 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Add the documentation about the clock inputs and outputs in devices. >> >> This is based on the original work of Frederic Konrad. >> >> Signed-off-by: Damien

Re: [PATCH v6 7/9] hw/misc/zynq_slcr: add clock generation for uarts

2019-12-04 Thread Damien Hedde
On 12/2/19 4:20 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Switch the slcr to multi-phase reset and add some clocks: >> + the main input clock (ps_clk) >> + the reference clock outputs for each uart (uart0 & 1) >>

Re: [PATCH v6 8/9] hw/char/cadence_uart: add clock support

2019-12-04 Thread Damien Hedde
On 12/2/19 4:24 PM, Peter Maydell wrote: > On Wed, 4 Sep 2019 at 13:56, Damien Hedde wrote: >> >> Switch the cadence uart to multi-phase reset and add the >> reference clock input. >> >> The input clock frequency is added to the migration structure. >&

Re: [PATCH v6 0/9] Clock framework API

2019-12-04 Thread Damien Hedde
On 12/2/19 5:15 PM, Peter Maydell wrote: > > The one topic I think we could do with discussing is whether > a simple uint64_t giving the frequency of the clock in Hz is > the right representation. In particular in your patch 9 the > board has a clock frequency that's not a nice integer number >

Re: [Qemu-devel] [PATCH v3 14/33] hw/s390x/s390-virtio-ccw.c: remove qdev_reset_all call

2019-08-09 Thread Damien Hedde
On 8/8/19 12:50 PM, Cornelia Huck wrote: > On Mon, 29 Jul 2019 16:56:35 +0200 > Damien Hedde wrote: > >> Replace deprecated qdev_reset_all by device_reset_warm. >> >> This does not impact the behavior. > > Not so sure about that; see below. In this case,

Re: [Qemu-devel] [PATCH v3 08/33] Add function to control reset with gpio inputs

2019-08-09 Thread Damien Hedde
On 8/9/19 7:51 AM, David Gibson wrote: > On Wed, Aug 07, 2019 at 11:37:51AM +0100, Peter Maydell wrote: >> On Wed, 31 Jul 2019 at 07:33, David Gibson >> wrote: >>> >>> On Mon, Jul 29, 2019 at 04:56:29PM +0200, Damien Hedde wrote: >>>> It adds the p

Re: [Qemu-devel] [PATCH v3 02/33] add temporary device_legacy_reset function to replace device_reset

2019-08-09 Thread Damien Hedde
On 8/7/19 4:27 PM, Peter Maydell wrote: > On Mon, 29 Jul 2019 at 15:58, Damien Hedde wrote: >> >> Provide a temporary function doing what device_reset does to do the >> transition with Resettable API which will trigger a prototype change >> of device_reset. >

Re: [Qemu-devel] [PATCH v3 12/33] hw/pci/: remove qdev/qbus_reset_all call

2019-08-09 Thread Damien Hedde
On 8/7/19 5:31 PM, Peter Maydell wrote: > On Mon, 29 Jul 2019 at 15:59, Damien Hedde wrote: >> >> Replace deprecated qdev/bus_reset_all by device/bus_reset_warm. >> >> This does not impact the behavior. >> >> Signed-off-by: Damien Hedde > > I

Re: [Qemu-devel] [PATCH v3 07/33] automatically add vmstate for reset support in devices

2019-08-09 Thread Damien Hedde
On 8/9/19 12:07 PM, Peter Maydell wrote: > On Thu, 8 Aug 2019 at 16:42, Dr. David Alan Gilbert > wrote: >> >> * Peter Maydell (peter.mayd...@linaro.org) wrote: >>> On Mon, 29 Jul 2019 at 15:59, Damien Hedde >>> wrote: >>>> >>>> T

Re: [Qemu-devel] [PATCH v3 07/33] automatically add vmstate for reset support in devices

2019-08-09 Thread Damien Hedde
On 8/9/19 12:32 PM, Peter Maydell wrote: > On Fri, 9 Aug 2019 at 11:29, Damien Hedde wrote: >> >> One way to keep the feature without copy-pasting vmsd would be to add >> a new vmstate_register with an additional argument to pass the base >> class vmsd section and h

Re: [Qemu-devel] [PATCH v3 04/33] make Device and Bus Resettable

2019-08-12 Thread Damien Hedde
On 8/7/19 4:41 PM, Peter Maydell wrote: > On Mon, 29 Jul 2019 at 15:58, Damien Hedde wrote: >> >> >> +/** >> + * device_reset: >> + * Resets the device @dev, @cold tell whether to do a cold or warm reset. >> + * Base behavior is to reset the device and

[Qemu-devel] [PATCH v3 02/33] add temporary device_legacy_reset function to replace device_reset

2019-07-29 Thread Damien Hedde
Provide a temporary function doing what device_reset does to do the transition with Resettable API which will trigger a prototype change of device_reset. Signed-off-by: Damien Hedde --- hw/core/qdev.c | 6 +++--- include/hw/qdev-core.h | 9 +++-- 2 files changed, 10 insertions(+), 5

[Qemu-devel] [PATCH v3 03/33] Replace all call to device_reset by call to device_legacy_reset

2019-07-29 Thread Damien Hedde
Signed-off-by: Damien Hedde --- hw/audio/intel-hda.c | 2 +- hw/hyperv/hyperv.c | 2 +- hw/i386/pc.c | 2 +- hw/ide/microdrive.c | 8 hw/intc/spapr_xive.c | 2 +- hw/ppc/pnv_psi.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_vio.c

[Qemu-devel] [PATCH v3 00/33] Multi-phase reset mechanism

2019-07-29 Thread Damien Hedde
t calls - Patches 18 to 27 replace device_reset calls - Patch 28 cleans remaining legacy reset API - Patches 29 to 33 modify the xilinx_zynq to add 3-phases reset support in the uart and the slcr (the reset controller of the soc). Thanks, Damien Damien Hedde (33): Create Reset

[Qemu-devel] [PATCH v3 05/33] Switch to new api in qdev/bus

2019-07-29 Thread Damien Hedde
Deprecate old reset apis and make them use the new one while they are still used somewhere. Signed-off-by: Damien Hedde --- hw/core/qdev.c | 22 +++--- include/hw/qdev-core.h | 28 ++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff

[Qemu-devel] [PATCH v3 09/33] add doc about Resettable interface

2019-07-29 Thread Damien Hedde
Signed-off-by: Damien Hedde --- docs/devel/reset.txt | 165 +++ 1 file changed, 165 insertions(+) create mode 100644 docs/devel/reset.txt diff --git a/docs/devel/reset.txt b/docs/devel/reset.txt new file mode 100644 index 00..c7a1eb068f --- /dev

[Qemu-devel] [PATCH v3 01/33] Create Resettable QOM interface

2019-07-29 Thread Damien Hedde
-to-parent order. This will allow to replace current qdev_reset mechanism by this interface without side-effects on reset order. Note: I used an uint32 for the count. This match the type already used in the existing resetting counter in hw/scsi/vmw_pvscsi.c for the PVSCSIState. Signed-off-by: Da

[Qemu-devel] [PATCH v3 10/33] vl.c: remove qbus_reset_all registration

2019-07-29 Thread Damien Hedde
Replace deprecated qbus_reset_all by resettable_reset_cold_fn for the sysbus reset registration. This does not impact the behavior. Signed-off-by: Damien Hedde --- vl.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index b426b32134..5a465c8236 100644 --- a

[Qemu-devel] [PATCH v3 06/33] add the vmstate description for device reset state

2019-07-29 Thread Damien Hedde
. Signed-off-by: Damien Hedde --- hw/core/Makefile.objs | 1 + hw/core/qdev-vmstate.c | 45 ++ 2 files changed, 46 insertions(+) create mode 100644 hw/core/qdev-vmstate.c diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs index d9234aa98a

[Qemu-devel] [PATCH v3 04/33] make Device and Bus Resettable

2019-07-29 Thread Damien Hedde
ntly under reset and if the current reset is cold or not. Signed-off-by: Damien Hedde --- hw/core/bus.c | 85 ++ hw/core/qdev.c | 82 include/hw/qdev-c

[Qemu-devel] [PATCH v3 18/33] hw/audio/intel-hda.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace legacy's reset call by device_reset_warm. The new function propagates also the reset to the sub-buses tree but this has no impact since since HDACodecDevice has no child bus. Signed-off-by: Damien Hedde --- hw/audio/intel-hda.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[Qemu-devel] [PATCH v3 12/33] hw/pci/: remove qdev/qbus_reset_all call

2019-07-29 Thread Damien Hedde
Replace deprecated qdev/bus_reset_all by device/bus_reset_warm. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/pci/pci.c| 6 +++--- hw/pci/pci_bridge.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index

[Qemu-devel] [PATCH v3 08/33] Add function to control reset with gpio inputs

2019-07-29 Thread Damien Hedde
It adds the possibility to add 2 gpios to control the warm and cold reset. With theses ios, the reset can be maintained during some time. Each io is associated with a state to detect level changes. Vmstate subsections are also added to the existsing device_reset subsection. Signed-off-by: Damien

[Qemu-devel] [PATCH v3 15/33] hw/ide/piix.c: remove qdev_reset_all call

2019-07-29 Thread Damien Hedde
Replace deprecated qdev_reset_all by device_reset_warm. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/ide/piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/piix.c b/hw/ide/piix.c index b97e555072..64cb4a52ef 100644 --- a/hw/ide/piix.c

[Qemu-devel] [PATCH v3 07/33] automatically add vmstate for reset support in devices

2019-07-29 Thread Damien Hedde
This add the reset related sections for every QOM device. Signed-off-by: Damien Hedde --- hw/core/qdev-vmstate.c | 41 + hw/core/qdev.c | 12 +++- include/hw/qdev-core.h | 3 +++ stubs/Makefile.objs| 1 + stubs/device.c | 7

[Qemu-devel] [PATCH v3 21/33] hw/intc/spapr_xive.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace legacy's reset call by device_reset_warm. The new function propagates also the reset to the sub-buses tree but this has no impact since SpaprXive has no child bus. Signed-off-by: Damien Hedde --- hw/intc/spapr_xive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

[Qemu-devel] [PATCH v3 13/33] hw/scsi/: remove qdev/qbus_reset_all call

2019-07-29 Thread Damien Hedde
Replace deprecated qdev/bus_reset_all by device/bus_reset_warm. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/scsi/lsi53c895a.c | 4 ++-- hw/scsi/megasas.c | 2 +- hw/scsi/mptsas.c | 8 hw/scsi/spapr_vscsi.c | 2 +- hw/scsi/virtio-scsi.c | 6

[Qemu-devel] [PATCH v3 11/33] hw/s390x/ipl.c: remove qbus_reset_all registration

2019-07-29 Thread Damien Hedde
Replace deprecated qbus_reset_all by resettable_reset_cold_fn for the ipl registration in the main reset handlers. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/s390x/ipl.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/ipl.c b/hw

[Qemu-devel] [PATCH v3 19/33] hw/sd/pl181.c & omap_mmc.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace legacy's reset call by device_reset_warm. The new function propagates also the reset to the sub-buses tree but this has no impact since SDState has no child bus. Signed-off-by: Damien Hedde --- hw/sd/omap_mmc.c | 2 +- hw/sd/pl181.c| 2 +- 2 files changed, 2 insertions(

[Qemu-devel] [PATCH v3 16/33] hw/input/adb.c: remove qdev_reset_all call

2019-07-29 Thread Damien Hedde
Replace deprecated qdev_reset_all by device_reset_warm. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/input/adb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/input/adb.c b/hw/input/adb.c index 1446f32521..6b35682aba 100644 --- a/hw/input/adb.c

[Qemu-devel] [PATCH v3 17/33] hw/usb/dev-uas.c: remove qdev_reset_all call

2019-07-29 Thread Damien Hedde
Replace deprecated qdev_reset_all by device_reset_warm. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/usb/dev-uas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c index abd8070d0c..b3a6e470e4 100644 --- a/hw/usb

[Qemu-devel] [PATCH v3 25/33] hw/i386/pc.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace additional APIC legacy reset by device_reset_cold. The new function propagates also the reset to the sub-buses tree. APIC does not have any so it should have no impact on behavior. Signed-off-by: Damien Hedde --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[Qemu-devel] [PATCH v3 14/33] hw/s390x/s390-virtio-ccw.c: remove qdev_reset_all call

2019-07-29 Thread Damien Hedde
Replace deprecated qdev_reset_all by device_reset_warm. This does not impact the behavior. Signed-off-by: Damien Hedde --- hw/s390x/s390-virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 5b6a9a4e55

[Qemu-devel] [PATCH v3 22/33] hw/ppc/pnv_psi.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace legacy's reset call by device_reset_warm. The new function propagates also the reset to the sub-buses tree but this has no impact since XiveSource has no child bus. Signed-off-by: Damien Hedde --- hw/ppc/pnv_psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-devel] [PATCH v3 24/33] hw/ppc/spapr: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
es of a SpaprPhbState. If there is a device with a child bus, then this bus will now be reset (and all its qdev tree). Signed-off-by: Damien Hedde --- hw/ppc/spapr_pci.c | 2 +- hw/ppc/spapr_vio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/h

[Qemu-devel] [PATCH v3 28/33] qdev: Remove unused deprecated reset functions

2019-07-29 Thread Damien Hedde
Remove the functions now they are unused: + device_legacy_reset + qdev_reset_all[_fn] + qbus_reset_all[_fn] Signed-off-by: Damien Hedde --- hw/core/qdev.c | 30 -- include/hw/qdev-core.h | 29 - 2 files changed, 59 deletions

[Qemu-devel] [PATCH v3 23/33] hw/scsi/vmw_pvscsi.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace legacy's reset call by device_reset_warm. The new function propagates also the reset to the sub-buses tree but this has no impact since SCSIDevices have no child bus (neither generic device nor disks). Signed-off-by: Damien Hedde --- hw/scsi/vmw_pvscsi.c | 2 +- 1 file chang

[Qemu-devel] [PATCH v3 31/33] Convert zynq's slcr to 3-phases reset

2019-07-29 Thread Damien Hedde
Change the legacy reset function into the init phase and test the resetting flag in register accesses. Signed-off-by: Damien Hedde --- hw/misc/zynq_slcr.c | 39 +++ 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/hw/misc/zynq_slcr.c b/hw/misc

[Qemu-devel] [PATCH v3 27/33] hw/ide/microdrive.c: remove device_legacy_reset calls

2019-07-29 Thread Damien Hedde
implemented so resetting the qdev/qbus ide tree will have no effect. Keep the explicit call to ide_bus_reset (in md_reset function) since it is not called when using the standard reset method of the IDE_BUS object. Signed-off-by: Damien Hedde --- hw/ide/microdrive.c | 8 1 file changed, 4

[Qemu-devel] [PATCH v3 26/33] hw/s390x/s390-pci-inst.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace S390PCIBusDevice legacy reset by device_reset_warm. The new function propagates also the reset to the sub-buses tree. I'm not sure whether S390PCIBusDevice has bus children or not. Signed-off-by: Damien Hedde --- hw/s390x/s390-pci-inst.c | 2 +- 1 file changed, 1 insertion(

[Qemu-devel] [PATCH v3 33/33] Connect the uart reset gpios in the zynq platform

2019-07-29 Thread Damien Hedde
Connect the two uart reset inputs to the slcr corresponding outputs. Signed-off-by: Damien Hedde --- hw/arm/xilinx_zynq.c | 14 -- include/hw/char/cadence_uart.h | 10 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/hw/arm/xilinx_zynq.c b/hw/arm

[Qemu-devel] [PATCH v3 20/33] hw/hyperv/hyperv.c: remove device_legacy_reset call

2019-07-29 Thread Damien Hedde
Replace legacy's reset call by device_reset_warm in *hyperv_synic_reset*. The new function propagates also the reset to the sub-buses tree but this has no impact since SynICState has no child bus. Signed-off-by: Damien Hedde --- hw/hyperv/hyperv.c | 2 +- 1 file changed, 1 insertion(

[Qemu-devel] [PATCH v3 29/33] hw/misc/zynq_slcr: use standard register definition

2019-07-29 Thread Damien Hedde
Replace the zynq_slcr registers enum and macros using the hw/registerfields.h macros. Signed-off-by: Damien Hedde Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis --- hw/misc/zynq_slcr.c | 472 ++-- 1 file changed, 236 insertions

[Qemu-devel] [PATCH v3 32/33] Add uart reset support in zynq_slcr

2019-07-29 Thread Damien Hedde
Add two gpio outputs to control the uart resets. Signed-off-by: Damien Hedde --- hw/misc/zynq_slcr.c | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c index 6fcdbce4f0..b6c9a281c2 100644 --- a/hw

[Qemu-devel] [PATCH v3 30/33] convert cadence_uart to 3-phases reset

2019-07-29 Thread Damien Hedde
Split the existing reset procedure into 3 phases. Test the resetting flag to discard register accesses and character reception. Also adds a active high reset io. Signed-off-by: Damien Hedde --- hw/char/cadence_uart.c | 77 +++--- 1 file changed, 73 insertions

Re: [Qemu-devel] [PATCH v3 01/33] Create Resettable QOM interface

2019-07-30 Thread Damien Hedde
On 7/30/19 3:59 PM, Peter Maydell wrote: > On Tue, 30 Jul 2019 at 14:56, Cornelia Huck wrote: >> >> On Tue, 30 Jul 2019 14:44:21 +0100 >> Peter Maydell wrote: >> >>> On Tue, 30 Jul 2019 at 14:42, Cornelia Huck wrote: I'm having a hard time figuring out what a 'cold' or a 'warm' reset is >

Re: [Qemu-devel] [PATCH v3 04/33] make Device and Bus Resettable

2019-07-31 Thread Damien Hedde
On 7/31/19 7:56 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:25PM +0200, Damien Hedde wrote: >> This add Resettable interface implementation for both Bus and Device. >> >> *resetting* counter and *reset_is_cold* flag are added in DeviceState >> and BusStat

Re: [Qemu-devel] [PATCH v3 05/33] Switch to new api in qdev/bus

2019-07-31 Thread Damien Hedde
On 7/31/19 8:05 AM, David Gibson wrote: > On Mon, Jul 29, 2019 at 04:56:26PM +0200, Damien Hedde wrote: >> Deprecate old reset apis and make them use the new one while they >> are still used somewhere. >> >> Signed-off-by: Damien Hedde >> --

  1   2   3   4   5   6   >