[Qemu-devel] [PATCH v7 15/16] gdbstub: add multiprocess extension support

2018-11-23 Thread Luc Michel
Add multiprocess extension support by enabling multiprocess mode when the peer requests it, and by replying that we actually support it in the qSupported reply packet. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Acked-by: Alistair Francis Reviewed-by: Edgar E. Iglesias

[Qemu-devel] [PATCH v7 16/16] arm/xlnx-zynqmp: put APUs and RPUs in separate CPU clusters

2018-11-23 Thread Luc Michel
Create two separate CPU clusters for APUs and RPUs. Signed-off-by: Luc Michel Reviewed-by: Edgar E. Iglesias --- include/hw/arm/xlnx-zynqmp.h | 3 +++ hw/arm/xlnx-zynqmp.c | 21 + 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/hw/arm/xlnx

[Qemu-devel] [PATCH v7 07/16] gdbstub: add multiprocess support to (f|s)ThreadInfo and ThreadExtraInfo

2018-11-23 Thread Luc Michel
Change the thread info related packets handling to support multiprocess extension. Add the CPUs class name in the extra info to help differentiate them in multiprocess mode. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé --- gdbstub.c | 37

[Qemu-devel] [PATCH v7 04/16] gdbstub: add multiprocess support to 'H' and 'T' packets

2018-11-23 Thread Luc Michel
by the peer. This function supports the multiprocess extension thread-id syntax. The return value specifies if the parsing failed, or if a special case was encountered (all processes or all threads). Use them in 'H' and 'T' packets handling to support the multiprocess extension.

Re: [Qemu-devel] [PATCH v1 1/4] hw/arm: versal: Remove bogus virtio-mmio creation

2018-11-30 Thread Luc Michel
On 11/29/18 5:36 PM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Remove bogus virtio-mmio creation. This was an accidental > left-over an experiment. > > Signed-off-by: Edgar E. Iglesias Reviewed-by: Luc Michel Luc > --- > hw/arm/xlnx-versal

Re: [Qemu-devel] [PATCH v7 01/16] hw/cpu: introduce CPU clusters

2018-12-03 Thread Luc Michel
On 11/30/18 5:52 PM, Peter Maydell wrote: > On Mon, 26 Nov 2018 at 13:27, Eduardo Habkost wrote: >> >> On Sun, Nov 25, 2018 at 10:27:04PM +0100, Philippe Mathieu-Daudé wrote: >>> Hi Eduardo, >>> >>> On 23/11/18 19:10, Eduardo Habkost wrote: If you really want to do this and assign cluster_id

Re: [Qemu-devel] [PATCH v7 01/16] hw/cpu: introduce CPU clusters

2018-12-03 Thread Luc Michel
On 12/3/18 12:23 PM, Peter Maydell wrote: > On Mon, 3 Dec 2018 at 11:21, Luc Michel wrote: >> >> On 11/30/18 5:52 PM, Peter Maydell wrote: >>> Luc: what are the requirements on boards using CPU cluster >>> objects? I assume these are both OK: >>&

Re: [Qemu-devel] [PATCH v8 00/16] gdbstub: support for the multiprocess extension

2018-12-17 Thread Luc Michel
Hi all, What do you think of this re-roll? Is it in good shape for upstreaming? Thanks! -- Luc On 12/7/18 10:01 AM, Luc Michel wrote: > changes since v7: > - patch 1Add documentation about cpu-cluster [Eduardo, Peter] > > - patch 1Remove the cluster-id auto-assi

[Qemu-devel] [PATCH] gdbstub: fix gdb_get_cpu(s, pid, tid) when pid and/or tid are 0

2019-01-19 Thread Luc Michel
istent. When PID is specified but TID is 0, the function returns the first CPU in the process, or NULL if the process does not exist or is not attached. In other cases, it returns the corresponding CPU, while ignoring the PID check when PID is 0. Reported-by: Peter Maydell Signed-off-by: Luc Mi

Re: [Qemu-devel] [RFC PATCH] gdbstub: Avoid NULL dereference in gdb_handle_packet()

2019-01-19 Thread Luc Michel
On 1/18/19 12:22 PM, Philippe Mathieu-Daudé wrote: > The "Hg" GDB packet is used to select the current thread, and can fail. > GDB doesn't not check for failure and emits further packets that can > access and dereference s->c_cpu or s->g_cpu. > > Add a check that returns "E22" (EINVAL) when those

Re: [Qemu-devel] [PATCH v1 1/2] hw/microblaze: s3adsp1800: Create an unimplemented GPIO area

2019-01-07 Thread Luc Michel
On 1/4/19 3:28 PM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Create an unimplemented GPIO area instead of leaving it unassigned. > > Signed-off-by: Edgar E. Iglesias Reviewed-by: Luc Michel > --- > hw/microblaze/petalogix_s3adsp1800_mmu.

Re: [Qemu-devel] [PATCH v1 2/2] target/microblaze: Add props enabling exceptions on failed bus accesses

2019-01-07 Thread Luc Michel
On 1/4/19 3:28 PM, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Add MicroBlaze CPU properties to enable exceptions on failed > bus accesses. > > Signed-off-by: Edgar E. Iglesias Reviewed-by: Luc Michel > --- > target/microblaze/cpu.c | 12 +

Re: [Qemu-devel] [PATCH v8 00/16] gdbstub: support for the multiprocess extension

2019-01-07 Thread Luc Michel
On 1/4/19 4:12 PM, Peter Maydell wrote: > On Fri, 7 Dec 2018 at 09:01, Luc Michel wrote: >> This series adds support for the multiprocess extension of the GDB >> remote protocol in the QEMU GDB stub. >> >> This extension is useful to split QEMU emulated CPUs in diff

Re: [Qemu-devel] [PATCH 1/4] hw/arm/xlx-zynqmp: Realize cluster after putting RPUs in it

2019-01-10 Thread Luc Michel
child objects are added, so move > the realize of rpu_cluster. (The apu_cluster is already > realized after child population.) > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > hw/arm/xlnx-zynqmp.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >

Re: [Qemu-devel] [PATCH 2/4] qom/cpu: Add cluster_index to CPUState

2019-01-10 Thread Luc Michel
s one. > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > include/hw/cpu/cluster.h | 19 +++ > include/qom/cpu.h| 7 +++ > hw/cpu/cluster.c | 33 + > qom/cpu.c| 1 + > 4

Re: [Qemu-devel] [PATCH 3/4] accel/tcg: Add cluster number to TCG TB hash

2019-01-10 Thread Luc Michel
d > more bits in cflags for other purposes, we could make > tb_hash_func() take more data (and expand qemu_xxhash7() > to qemu_xxhash8()). > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel > --- > include/exec/exec-all.h | 4 +++- > accel/tcg/cpu-exec.c | 4 +++

Re: [Qemu-devel] [PATCH 4/4] gdbstub: Simplify gdb_get_cpu_pid() to use cpu->cluster_index

2019-01-10 Thread Luc Michel
On 1/8/19 5:30 PM, Peter Maydell wrote: > Now we're keeping the cluster index in the CPUState, we don't > need to jump through hoops in gdb_get_cpu_pid() to find the > associated cluster object. Aah better :-) > > Signed-off-by: Peter Maydell Reviewed-by: Luc Michel

Re: [Qemu-devel] [PATCH v2] hw/intc/arm_gic: Document QEMU interface

2018-08-27 Thread Luc Michel
gt; should > + *implement the virtualization extensions > + * + unnamed GPIO inputs: (where P is number of PPIs, i.e. num-irq - 32) I think here it's "where P is the number of SPIs". Apart from that: Reviewed-by: Luc Michel -- Luc > + *[0..P-1] SPI

[Qemu-devel] [PATCH 10/15] gdbstub: add support for extended mode packet

2018-09-01 Thread Luc Michel
Add support for the '!' extended mode packet. This is required for the multiprocess extension. Signed-off-by: Luc Michel --- gdbstub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdbstub.c b/gdbstub.c index af8864e251..4bed0a85f3 100644 --- a/gdbstub.c +++ b/gdbstub.c @

[Qemu-devel] [PATCH 03/15] gdbstub: add multiprocess support to 'H' and 'T' packets

2018-09-01 Thread Luc Michel
by the peer. This function supports the multiprocess extension thread-id syntax. The return value specifies if the parsing failed, or if a special case was encountered (all processes or all threads). Use them in 'H' and 'T' packets handling to support the multiprocess extension.

[Qemu-devel] [PATCH 11/15] gdbstub: add support for vAttach packets

2018-09-01 Thread Luc Michel
Add support for the vAttach packets. In multiprocess mode, GDB sends them to attach to additional processes. Signed-off-by: Luc Michel --- gdbstub.c | 32 1 file changed, 32 insertions(+) diff --git a/gdbstub.c b/gdbstub.c index 4bed0a85f3..4874d65a30 100644

[Qemu-devel] [PATCH 08/15] gdbstub: add multiprocess support to gdb_vm_state_change()

2018-09-01 Thread Luc Michel
Add support for multiprocess extension in gdb_vm_state_change() function. Signed-off-by: Luc Michel --- gdbstub.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 761cb051c8..4ccd1153ce 100644 --- a/gdbstub.c +++ b/gdbstub.c

[Qemu-devel] [PATCH 06/15] gdbstub: add multiprocess support to (f|s)ThreadInfo and ThreadExtraInfo

2018-09-01 Thread Luc Michel
Change the thread info related packets handling to support multiprocess extension. Add the CPUs class name in the extra info to help differentiate them in multiprocess mode. Signed-off-by: Luc Michel --- gdbstub.c | 32 ++-- 1 file changed, 22 insertions(+), 10

[Qemu-devel] [PATCH 05/15] gdbstub: add multiprocess support to 'sC' packets

2018-09-01 Thread Luc Michel
Change the sC packet handling to support the multiprocess extension. Instead of returning the first thread, we return the first thread of the current process. Signed-off-by: Luc Michel --- gdbstub.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gdbstub.c b

[Qemu-devel] [PATCH 07/15] gdbstub: add multiprocess support to Xfer:features:read:

2018-09-01 Thread Luc Michel
a parameter, and use a buffer in the process structure to store the generated description. It takes the first CPU of the process to generate the description. Signed-off-by: Luc Michel --- gdbstub.c | 44 1 file changed, 24 insertions(+), 20 deletions

[Qemu-devel] [PATCH 12/15] gdbstub: processes initialization on new peer connection

2018-09-01 Thread Luc Michel
When a new connection is established, we set the first process to be attached, and the others detached. The first CPU of the first process is selected as the current CPU. Signed-off-by: Luc Michel --- gdbstub.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff

[Qemu-devel] [PATCH 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups

2018-09-01 Thread Luc Michel
Create two separate QOM containers for APUs and RPUs to indicate to the GDB stub that those CPUs should be put in different processes. Signed-off-by: Luc Michel --- hw/arm/xlnx-zynqmp.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx

[Qemu-devel] [PATCH 13/15] gdbstub: gdb_set_stop_cpu: ignore request when process is not attached

2018-09-01 Thread Luc Michel
When gdb_set_stop_cpu() is called with a CPU associated to a process currently not attached by the GDB client, return without modifying the stop CPU. Otherwise, GDB get confused if it receives packets with a thread-id it does not know about. Signed-off-by: Luc Michel --- gdbstub.c | 9

[Qemu-devel] [PATCH 02/15] gdbstub: add multiprocess support to '?' packets

2018-09-01 Thread Luc Michel
?' request. Signed-off-by: Luc Michel --- gdbstub.c | 46 -- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 5c86218f49..ec3105dbc1 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -640,10 +640,37 @@ static int m

[Qemu-devel] [PATCH 00/15] gdbstub: support for the multiprocess extension

2018-09-01 Thread Luc Michel
ation and their prototype implementation. Luc Michel (15): gdbstub: introduce GDB processes gdbstub: add multiprocess support to '?' packets gdbstub: add multiprocess support to 'H' and 'T' packets gdbstub: add multiprocess support to vCont packets gdbst

[Qemu-devel] [PATCH 01/15] gdbstub: introduce GDB processes

2018-09-01 Thread Luc Michel
esses do not make much sense for now. Signed-off-by: Luc Michel --- include/exec/gdbstub.h | 8 + gdbstub.c | 67 ++ 2 files changed, 75 insertions(+) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index 08363969c1..a3e41

[Qemu-devel] [PATCH 04/15] gdbstub: add multiprocess support to vCont packets

2018-09-01 Thread Luc Michel
Add the gdb_first_cpu() and gdb_next_cpu() to iterate over all the CPUs in currently attached processes. Add the gdb_first_cpu_in_process() and gdb_next_cpu_in_process() to iterate over CPUs of a given process. Use them to add multiprocess extension support to vCont packets. Signed-off-by: Luc

[Qemu-devel] [PATCH 14/15] gdbstub: add multiprocess extension support

2018-09-01 Thread Luc Michel
Add multiprocess extension support by enabling multiprocess mode when the peer requests it, and by replying that we actually support it in the qSupported reply packet. Signed-off-by: Luc Michel --- gdbstub.c | 4 1 file changed, 4 insertions(+) diff --git a/gdbstub.c b/gdbstub.c index

[Qemu-devel] [PATCH 09/15] gdbstub: add multiprocess support to 'D' packets

2018-09-01 Thread Luc Michel
'D' packets are used by GDB to detach from a process. In multiprocess mode, the PID to detach from is sent in the request. Signed-off-by: Luc Michel --- gdbstub.c | 55 --- 1 file changed, 48 insertions(+), 7 deletions(-) di

Re: [Qemu-devel] [PATCH] hw/intc/arm_gic: Drop GIC_BASE_IRQ macro

2018-09-07 Thread Luc Michel
On 8/24/18 6:18 PM, Peter Maydell wrote: > The GIC_BASE_IRQ macro is a leftover from when we shared code > between the GICv2 and the v7M NVIC. Since the NVIC is now > split off, GIC_BASE_IRQ is always 0, and we can just delete it. > > Signed-off-by: Peter Maydell Reviewed

Re: [Qemu-devel] [PATCH v3 20/20] arm/virt: Add support for GICv2 virtualization extensions

2018-07-05 Thread Luc Michel
On 07/05/2018 10:00 AM, Jan Kiszka wrote: > On 2018-07-05 08:51, Jan Kiszka wrote: >> On 2018-06-29 15:29, Luc Michel wrote: >>> Add support for GICv2 virtualization extensions by mapping the necessary >>> I/O regions and connecting the maintenance IRQ lines. >>

Re: [Qemu-devel] [PATCH for-3.0 1/2] hw/intc/arm_gic: Check interrupt number in gic_deactivate_irq()

2018-07-13 Thread Luc Michel
nly from irq_state[] into the following > irq_target[] array which the guest can already manipulate. > > Signed-off-by: Peter Maydell > --- > hw/intc/arm_gic.c | 16 +++- > 1 file changed, 15 insertions(+), 1 deletion(-) Reviewed-by: Luc Michel -- Luc signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH for-3.0 2/2] hw/intc/arm_gic: Fix handling of GICD_ITARGETSR

2018-07-13 Thread Luc Michel
0 for IRQs 0..28 unless this > is an 11MPCore GIC. > > Reported-by: Jan Kiszka > Signed-off-by: Peter Maydell > --- > hw/intc/arm_gic.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Luc Michel -- Luc signature.asc Description: OpenPGP digital signature

Re: [Qemu-devel] [PATCH v3 16/20] intc/arm_gic: Implement gic_update_virt() function

2018-07-13 Thread Luc Michel
On 07/12/2018 03:56 PM, Peter Maydell wrote: > On 29 June 2018 at 14:29, Luc Michel wrote: >> Add the gic_update_virt() function to update the vCPU interface states >> and raise vIRQ and vFIQ as needed. This commit renames gic_update() to >> gic_update_internal() and gen

Re: [Qemu-devel] [PATCH v3 14/20] intc/arm_gic: Wire the vCPU interface

2018-07-13 Thread Luc Michel
On 07/12/2018 03:37 PM, Peter Maydell wrote: > On 29 June 2018 at 14:29, Luc Michel wrote: >> Add the read/write functions to handle accesses to the vCPU interface. >> Those accesses are forwarded to the real CPU interface, with the CPU id >> being converted to the corres

[Qemu-devel] [PATCH v4 00/20] arm_gic: add virtualization extensions support

2018-07-14 Thread Luc Michel
Fix Memory region size for GICv2 virtual interface and vCPU iface. [Peter] Luc Michel (20): intc/arm_gic: Refactor operations on the distributor intc/arm_gic: Implement GICD_ISACTIVERn and GICD_ICACTIVERn registers intc/arm_gic: Remove some dead code and put some functions static vmstate.

[Qemu-devel] [PATCH v4 03/20] intc/arm_gic: Remove some dead code and put some functions static

2018-07-14 Thread Luc Michel
Some functions are now only used in arm_gic.c, put them static. Some of them where only used by the NVIC implementation and are not used anymore, so remove them. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 23

[Qemu-devel] [PATCH v4 02/20] intc/arm_gic: Implement GICD_ISACTIVERn and GICD_ICACTIVERn registers

2018-07-14 Thread Luc Michel
Implement GICD_ISACTIVERn and GICD_ICACTIVERn registers in the GICv2. Those registers allow to set or clear the active state of an IRQ in the distributor. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 61 +++ 1 file changed, 57 insertions(+), 4

[Qemu-devel] [PATCH v4 06/20] intc/arm_gic: Add virtual interface register definitions

2018-07-14 Thread Luc Michel
Add the register definitions for the virtual interface of the GICv2. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/gic_internal.h | 65 ++ 1 file changed, 65 insertions(+) diff --git a/hw/intc/gic_internal.h b/hw/intc/gic_internal.h

[Qemu-devel] [PATCH v4 04/20] vmstate.h: Provide VMSTATE_UINT16_SUB_ARRAY

2018-07-14 Thread Luc Michel
Provide a VMSTATE_UINT16_SUB_ARRAY macro to save a uint16_t sub-array in a VMState. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- include/migration/vmstate.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index

[Qemu-devel] [PATCH v4 08/20] intc/arm_gic: Refactor secure/ns access check in the CPU interface

2018-07-14 Thread Luc Michel
tributor is not exposed to vCPUs at all. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 1ac0fe740c..53cc257ed8 1006

[Qemu-devel] [PATCH v4 10/20] intc/arm_gic: Implement virtualization extensions in gic_(activate_irq|drop_prio)

2018-07-14 Thread Luc Michel
virtual interface, in h_apr. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 50 +++ 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index ad241d12c2..60704cabbb 100644 --- a/hw/intc/arm_gic.c +++ b

[Qemu-devel] [PATCH v4 12/20] intc/arm_gic: Implement virtualization extensions in gic_(deactivate|complete_irq)

2018-07-14 Thread Luc Michel
-by: Luc Michel --- hw/intc/arm_gic.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index be9e2594d9..50cbbfbe24 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -590,6 +590,15 @@ static void gic_deactivate_irq(GICState *s, int

[Qemu-devel] [PATCH v4 17/20] intc/arm_gic: Implement maintenance interrupt generation

2018-07-14 Thread Luc Michel
Implement the maintenance interrupt generation that is part of the GICv2 virtualization extensions. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 97 +++ 1 file changed, 97 insertions(+) diff --git a/hw/intc/arm_gic.c

[Qemu-devel] [PATCH v4 07/20] intc/arm_gic: Add virtualization extensions helper macros and functions

2018-07-14 Thread Luc Michel
given (vCPU, irq) pair. It is meant to be used in contexts where we know for sure that the entry exists, so we assert that entry is actually found, and the caller can avoid the NULL check on the returned pointer. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 5 +++ hw/intc/gic_internal.h

[Qemu-devel] [PATCH v4 11/20] intc/arm_gic: Implement virtualization extensions in gic_acknowledge_irq

2018-07-14 Thread Luc Michel
case in gic_clear_pending_sgi() to enhance code readability as the virtualization extensions support adds a if-else level. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 52 ++- 1 file changed, 33 insertions(+), 19 deletions

[Qemu-devel] [PATCH v4 01/20] intc/arm_gic: Refactor operations on the distributor

2018-07-14 Thread Luc Michel
In preparation for the virtualization extensions implementation, refactor the name of the functions and macros that act on the GIC distributor to make that fact explicit. It will be useful to differentiate them from the ones that will act on the virtual interfaces. Signed-off-by: Luc Michel

[Qemu-devel] [PATCH v4 20/20] arm/virt: Add support for GICv2 virtualization extensions

2018-07-14 Thread Luc Michel
Add support for GICv2 virtualization extensions by mapping the necessary I/O regions and connecting the maintenance IRQ lines. Declare those additions in the device tree and in the ACPI tables. Signed-off-by: Luc Michel --- hw/arm/virt-acpi-build.c | 6 +++-- hw/arm/virt.c| 52

[Qemu-devel] [PATCH v4 13/20] intc/arm_gic: Implement virtualization extensions in gic_cpu_(read|write)

2018-07-14 Thread Luc Michel
Implement virtualization extensions in the gic_cpu_read() and gic_cpu_write() functions. Those are the last bits missing to fully support virtualization extensions in the CPU interface path. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 20 +++- 1

[Qemu-devel] [PATCH v4 18/20] intc/arm_gic: Improve traces

2018-07-14 Thread Luc Michel
generation. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c| 31 +-- hw/intc/trace-events | 12 ++-- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw

[Qemu-devel] [PATCH v4 09/20] intc/arm_gic: Add virtualization enabled IRQ helper functions

2018-07-14 Thread Luc Michel
effect on the distributor, even in the vCPU case, when the correponding LR has the HW field set. Use those functions in the CPU interface code path to prepare for the vCPU interface implementation. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 32 +++- hw/intc/gic_internal.h | 83

[Qemu-devel] [PATCH v4 14/20] intc/arm_gic: Wire the vCPU interface

2018-07-14 Thread Luc Michel
fetches the current vCPU id using the current_cpu global variable, and one mirror region per vCPU which maps to that specific vCPU id. This is required by the GIC architecture specification. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 37 +++-- 1 file changed

[Qemu-devel] [PATCH v4 19/20] xlnx-zynqmp: Improve GIC wiring and MMIO mapping

2018-07-14 Thread Luc Michel
information. Signed-off-by: Luc Michel --- hw/arm/xlnx-zynqmp.c | 92 include/hw/arm/xlnx-zynqmp.h | 4 +- 2 files changed, 86 insertions(+), 10 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 29df35fb75..42c29b8d06 100644

[Qemu-devel] [PATCH v4 15/20] intc/arm_gic: Implement the virtual interface registers

2018-07-14 Thread Luc Michel
Implement the read and write functions for the virtual interface of the virtualization extensions in the GICv2. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 235 +- 1 file changed, 233 insertions(+), 2 deletions

[Qemu-devel] [PATCH v4 05/20] intc/arm_gic: Add the virtualization extensions to the GIC state

2018-07-14 Thread Luc Michel
implement the virtualization extensions, we report an error if the corresponding property is set to true. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c| 2 +- hw/intc/arm_gic_common.c | 148 ++- hw/intc/arm

[Qemu-devel] [PATCH v4 16/20] intc/arm_gic: Implement gic_update_virt() function

2018-07-14 Thread Luc Michel
The main difference between CPU and vCPU is the way we select the best IRQ. This part has been split into the gic_get_best_(v)irq functions. For the virt case, the LRs are iterated to find the best candidate. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c

Re: [Qemu-devel] [PATCH v4 12/20] intc/arm_gic: Implement virtualization extensions in gic_(deactivate|complete_irq)

2018-07-18 Thread Luc Michel
On 07/17/2018 03:32 PM, Peter Maydell wrote: > On 14 July 2018 at 18:15, Luc Michel wrote: >> Implement virtualization extensions in the gic_deactivate_irq() and >> gic_complete_irq() functions. When a guest tries to deactivat or end an > > "deactivate" >

Re: [Qemu-devel] [PATCH v4 14/20] intc/arm_gic: Wire the vCPU interface

2018-07-18 Thread Luc Michel
On 07/17/2018 04:26 PM, Peter Maydell wrote: > On 14 July 2018 at 18:15, Luc Michel wrote: >> Add the read/write functions to handle accesses to the vCPU interface. >> Those accesses are forwarded to the real CPU interface, with the CPU id >> being converted to the correspon

[Qemu-devel] [PATCH 6/6] xlnx-zynqmp: Improve GIC wiring and MMIO mapping

2018-06-06 Thread luc . michel
From: Luc MICHEL This commit improve the way the GIC is realized and connected in the ZynqMP SoC. The security extensions are enabled only if requested in the machine state. The same goes for the virtualization extensions. All the GIC to APU CPU(s) IRQ lines are now connected, including FIQ

[Qemu-devel] [PATCH 5/6] intc/arm_gic: Improve traces

2018-06-06 Thread luc . michel
From: Luc MICHEL Add some traces to the ARM GIC to catch register accesses (distributor, (v)cpu interface and virtual interface), and to take into account virtualization extensions (print `vcpu` instead of `cpu` when needed). Also add some virtualization extensions specific traces: LR updating

[Qemu-devel] [PATCH 2/6] intc/arm_gic: Remove some dead code and put some functions static

2018-06-06 Thread luc . michel
From: Luc MICHEL Some functions are now only used in arm_gic.c, put them static. Some of them where only used by the NVIC implementation and are not used anymore, so remove them. Signed-off-by: Luc MICHEL --- hw/intc/arm_gic.c | 23 ++- hw/intc/gic_internal.h | 4

[Qemu-devel] [PATCH 3/6] intc/arm_gic: Add the virtualization extensions to the GIC state

2018-06-06 Thread luc . michel
From: Luc MICHEL Add the necessary parts of the virtualization extensions state to the GIC state. We choose to increase the size of the CPU interfaces state to add space for the vCPU interfaces (the GIC_NCPU_VCPU macro). This way, we'll be able to reuse most of the CPU interface code fo

[Qemu-devel] [PATCH 1/6] intc/arm_gic: Refactor operations on the distributor

2018-06-06 Thread luc . michel
From: Luc MICHEL In preparation for the virtualization extensions implementation, refactor the name of the functions and macros that act on the GIC distributor to make that fact explicit. It will be useful to differentiate them from the ones that will act on the virtual interfaces. Signed-off

[Qemu-devel] [PATCH 4/6] intc/arm_gic: Add virtualization extensions logic

2018-06-06 Thread luc . michel
From: Luc MICHEL This commit adds the actual implementation of the GICv2 virtualization extensions logic. For the vCPU interfaces, most of the existing CPU interface code is reused. Calls to macros or functions modifying the distributor state are replaced with equivalent generic inline

[Qemu-devel] [PATCH 0/6] arm_gic: add virtualization extensions support

2018-06-06 Thread luc . michel
From: Luc MICHEL This patch series add support for the virtualization extensions in the ARM GICv2 interrupt controller. The first two commits do some refactoring to prepare for the implementation. Commits 3 and 4 are the actual implementation. The last commit updates the ZynqMP implementation

[Qemu-devel] [PATCH v5 03/20] intc/arm_gic: Remove some dead code and put some functions static

2018-07-27 Thread Luc Michel
Some functions are now only used in arm_gic.c, put them static. Some of them where only used by the NVIC implementation and are not used anymore, so remove them. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 23

[Qemu-devel] [PATCH v5 04/20] vmstate.h: Provide VMSTATE_UINT16_SUB_ARRAY

2018-07-27 Thread Luc Michel
Provide a VMSTATE_UINT16_SUB_ARRAY macro to save a uint16_t sub-array in a VMState. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- include/migration/vmstate.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index

[Qemu-devel] [PATCH v5 17/20] intc/arm_gic: Implement maintenance interrupt generation

2018-07-27 Thread Luc Michel
Implement the maintenance interrupt generation that is part of the GICv2 virtualization extensions. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 97 +++ 1 file changed, 97 insertions(+) diff --git a/hw/intc/arm_gic.c

[Qemu-devel] [PATCH v5 06/20] intc/arm_gic: Add virtual interface register definitions

2018-07-27 Thread Luc Michel
Add the register definitions for the virtual interface of the GICv2. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/gic_internal.h | 65 ++ 1 file changed, 65 insertions(+) diff --git a/hw/intc/gic_internal.h b/hw/intc/gic_internal.h

[Qemu-devel] [PATCH v5 12/20] intc/arm_gic: Implement virtualization extensions in gic_(deactivate|complete_irq)

2018-07-27 Thread Luc Michel
ite to V_DIR increments V_HCR.EOICount. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 51 +++ 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index d80acde989..3cddf65826 100644 --- a/hw/intc/arm_gi

[Qemu-devel] [PATCH v5 07/20] intc/arm_gic: Add virtualization extensions helper macros and functions

2018-07-27 Thread Luc Michel
given (vCPU, irq) pair. It is meant to be used in contexts where we know for sure that the entry exists, so we assert that entry is actually found, and the caller can avoid the NULL check on the returned pointer. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 5

[Qemu-devel] [PATCH v5 02/20] intc/arm_gic: Implement GICD_ISACTIVERn and GICD_ICACTIVERn registers

2018-07-27 Thread Luc Michel
Implement GICD_ISACTIVERn and GICD_ICACTIVERn registers in the GICv2. Those registers allow to set or clear the active state of an IRQ in the distributor. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 61 +++ 1 file

[Qemu-devel] [PATCH v5 00/20] arm_gic: add virtualization extensions support

2018-07-27 Thread Luc Michel
thesises. See commit message for the adopted behaviour. The main difference is that when EOIMode is true (EOI split is enabled), a write to V_EOIR never increments H_HCR.EOICount. [Peter] - Patch 14-15: fixed commit message regarding mirrored regions. [Peter] Luc Michel (20): intc/arm_gic: Re

[Qemu-devel] [PATCH v5 08/20] intc/arm_gic: Refactor secure/ns access check in the CPU interface

2018-07-27 Thread Luc Michel
tributor is not exposed to vCPUs at all. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 39 ++- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 41141fee53..94d5982e2a 1006

[Qemu-devel] [PATCH v5 10/20] intc/arm_gic: Implement virtualization extensions in gic_(activate_irq|drop_prio)

2018-07-27 Thread Luc Michel
virtual interface, in h_apr. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 50 +++ 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 26ed7ea58a..de73dc9f54 100644

[Qemu-devel] [PATCH v5 16/20] intc/arm_gic: Implement gic_update_virt() function

2018-07-27 Thread Luc Michel
The main difference between CPU and vCPU is the way we select the best IRQ. This part has been split into the gic_get_best_(v)irq functions. For the virt case, the LRs are iterated to find the best candidate. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c

[Qemu-devel] [PATCH v5 11/20] intc/arm_gic: Implement virtualization extensions in gic_acknowledge_irq

2018-07-27 Thread Luc Michel
case in gic_clear_pending_sgi() to enhance code readability as the virtualization extensions support adds a if-else level. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 52 ++- 1 file changed, 33 insertions(+), 19 deletions

[Qemu-devel] [PATCH v5 19/20] xlnx-zynqmp: Improve GIC wiring and MMIO mapping

2018-07-27 Thread Luc Michel
information. Signed-off-by: Luc Michel Reviewed-by: Edgar E. Iglesias --- hw/arm/xlnx-zynqmp.c | 92 include/hw/arm/xlnx-zynqmp.h | 4 +- 2 files changed, 86 insertions(+), 10 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index

[Qemu-devel] [PATCH v5 15/20] intc/arm_gic: Implement the virtual interface registers

2018-07-27 Thread Luc Michel
Implement the read and write functions for the virtual interface of the virtualization extensions in the GICv2. One mirror region per CPU is also created, which maps to that specific CPU id. This is required by the GIC architecture specification. Signed-off-by: Luc Michel Reviewed-by: Peter

[Qemu-devel] [PATCH v5 13/20] intc/arm_gic: Implement virtualization extensions in gic_cpu_(read|write)

2018-07-27 Thread Luc Michel
Implement virtualization extensions in the gic_cpu_read() and gic_cpu_write() functions. Those are the last bits missing to fully support virtualization extensions in the CPU interface path. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 20 +++- 1

[Qemu-devel] [PATCH v5 20/20] arm/virt: Add support for GICv2 virtualization extensions

2018-07-27 Thread Luc Michel
Add support for GICv2 virtualization extensions by mapping the necessary I/O regions and connecting the maintenance IRQ lines. Declare those additions in the device tree and in the ACPI tables. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/arm/virt-acpi-build.c | 6 +++-- hw

[Qemu-devel] [PATCH v5 14/20] intc/arm_gic: Wire the vCPU interface

2018-07-27 Thread Luc Michel
Add the read/write functions to handle accesses to the vCPU interface. Those accesses are forwarded to the real CPU interface, with the CPU id being converted to the corresponding vCPU id (vCPU id = CPU id + GIC_NCPU). Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 37

[Qemu-devel] [PATCH v5 18/20] intc/arm_gic: Improve traces

2018-07-27 Thread Luc Michel
generation. Signed-off-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c| 31 +-- hw/intc/trace-events | 12 ++-- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/hw/intc/arm_gic.c b/hw

[Qemu-devel] [PATCH v5 09/20] intc/arm_gic: Add virtualization enabled IRQ helper functions

2018-07-27 Thread Luc Michel
effect on the distributor, even in the vCPU case, when the correponding LR has the HW field set. Use those functions in the CPU interface code path to prepare for the vCPU interface implementation. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c | 32

[Qemu-devel] [PATCH v5 01/20] intc/arm_gic: Refactor operations on the distributor

2018-07-27 Thread Luc Michel
In preparation for the virtualization extensions implementation, refactor the name of the functions and macros that act on the GIC distributor to make that fact explicit. It will be useful to differentiate them from the ones that will act on the virtual interfaces. Signed-off-by: Luc Michel

[Qemu-devel] [PATCH v5 05/20] intc/arm_gic: Add the virtualization extensions to the GIC state

2018-07-27 Thread Luc Michel
implement the virtualization extensions, we report an error if the corresponding property is set to true. Signed-off-by: Luc Michel Reviewed-by: Peter Maydell --- hw/intc/arm_gic.c| 2 +- hw/intc/arm_gic_common.c | 148 ++- hw/intc/arm

Re: [Qemu-devel] [PATCH v2 5/7] intc/arm_gic: Add virtualization extensions logic

2018-06-26 Thread Luc Michel
On 06/25/2018 04:23 PM, Peter Maydell wrote: > On 19 June 2018 at 10:31, wrote: >> From: Luc MICHEL >> >> This commit adds the actual implementation of the GICv2 virtualization >> extensions logic. >> >> For the vCPU interfaces, most of the existing CP

Re: [Qemu-devel] [PATCH v2 0/7] arm_gic: add virtualization extensions support

2018-06-26 Thread Luc Michel
On 06/25/2018 01:12 PM, Peter Maydell wrote: > On 25 June 2018 at 05:55, Jan Kiszka wrote: >> On 2018-06-19 11:31, luc.mic...@greensocs.com wrote: >>> From: Luc MICHEL >>> >>> This patch series add support for the virtualization extensions in the >>>

Re: [Qemu-devel] [PATCH v2 0/7] arm_gic: add virtualization extensions support

2018-06-26 Thread Luc Michel
On 06/25/2018 06:55 AM, Jan Kiszka wrote: > On 2018-06-19 11:31, luc.mic...@greensocs.com wrote: >> From: Luc MICHEL >> >> This patch series add support for the virtualization extensions in the >> ARM GICv2 interrupt controller. >> >> The first two commits

[Qemu-devel] [PATCH v3 12/20] intc/arm_gic: Implement virtualization extensions in gic_complete_irq

2018-06-29 Thread Luc Michel
Implement virtualization extensions in the gic_complete_irq() function. When a guest tries to end an IRQ that does not exist in the LRs, the EOICount field of the virtual interface HCR register is incremented by one, and the request is ignored. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c

[Qemu-devel] [PATCH v3 17/20] intc/arm_gic: Implement maintenance interrupt generation

2018-06-29 Thread Luc Michel
Implement the maintenance interrupt generation that is part of the GICv2 virtualization extensions. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 89 +++ 1 file changed, 89 insertions(+) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index

[Qemu-devel] [PATCH v3 01/20] intc/arm_gic: Implement write to GICD_ISACTIVERn and GICD_ICACTIVERn registers

2018-06-29 Thread Luc Michel
Implement write access to GICD_ISACTIVERn and GICD_ICACTIVERn registers in the GICv2. Those registers allow to set or clear the active state of an IRQ in the distributor. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 41 +++-- 1 file changed, 39

[Qemu-devel] [PATCH v3 13/20] intc/arm_gic: Implement virtualization extensions in gic_cpu_(read|write)

2018-06-29 Thread Luc Michel
Implement virtualization extensions in the gic_cpu_read() and gic_cpu_write() functions. Those are the last bits missing to fully support virtualization extensions in the CPU interface path. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 20 +++- 1 file changed, 15 insertions

[Qemu-devel] [PATCH v3 14/20] intc/arm_gic: Wire the vCPU interface

2018-06-29 Thread Luc Michel
fetches the current vCPU id using the current_cpu global variable, and one mirror region per vCPU which maps to that specific vCPU id. This is required by the GIC architecture specification. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 71 ++- 1

[Qemu-devel] [PATCH v3 07/20] intc/arm_gic: Add virtualization extensions helper macros and functions

2018-06-29 Thread Luc Michel
a given (vCPU, irq) pair. gic_get_lr_entry_nofail() is meant to be used in contexts where we know for sure that the entry exists, so we can avoid the NULL check on the returned pointer. Signed-off-by: Luc Michel --- hw/intc/arm_gic.c | 5 hw/intc/gic_internal.h | 65

<    1   2   3   4   5   6   7   8   >