[Qemu-devel] [PATCH 14/15] hw/intc/arm_gic: Break out gic_update() function

2014-08-22 Thread Fabian Aggeler
Prepare to split gic_update() in two functions, one for GICs with interrupt grouping and one without grouping (existing). Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 11 --- hw/intc/gic_internal.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw

[Qemu-devel] [PATCH 03/15] hw/intc/arm_gic: Add Security Extensions property

2014-08-22 Thread Fabian Aggeler
GICs which implement Security Extensions. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c| 5 - hw/intc/arm_gic_common.c | 1 + include/hw/intc/arm_gic_common.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c

[Qemu-devel] [PATCH 01/15] hw/intc/arm_gic: Request FIQ sources

2014-08-22 Thread Fabian Aggeler
Preparing for FIQ lines from GIC to CPUs, which is needed for GIC Security Extensions. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c| 3 +++ include/hw/intc/arm_gic_common.h | 1 + 2 files changed, 4 insertions(+) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index

[Qemu-devel] [PATCH 07/15] hw/intc/arm_gic: Make ICCICR/GICC_CTLR banked

2014-08-22 Thread Fabian Aggeler
bits like AckCtl and FIQEn by changing the type from bool to uint32. Since the field does not only store the enable bit anymore and since we are touching the vmstate, we use the opportunity to rename the field to cpu_control. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c| 54

[Qemu-devel] [PATCH 13/15] hw/intc/arm_gic: Restrict priority view

2014-08-22 Thread Fabian Aggeler
GICs with Security Extensions restrict the non-secure view of the interrupt priority and priority mask registers. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 66 +- hw/intc/gic_internal.h | 3 +++ 2 files changed, 63 insertions

[Qemu-devel] [PATCH 12/15] hw/intc/arm_gic: Change behavior of IAR writes

2014-08-22 Thread Fabian Aggeler
Grouping (GICv2) and Security Extensions change the behavior of IAR reads. Acknowledging Group0 interrupts is only allowed from Secure state and acknowledging Group1 interrupts from Secure state is only allowed if AckCtl bit is set. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 24

[Qemu-devel] [PATCH 11/15] hw/intc/arm_gic: Change behavior of EOIR writes

2014-08-22 Thread Fabian Aggeler
Grouping (GICv2) and Security Extensions change the behavior of EOIR writes. Completing Group0 interrupts is only allowed from Secure state and completing Group1 interrupts from Secure state is only allowed if AckCtl bit is set. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 15

[Qemu-devel] [PATCH 06/15] hw/intc/arm_gic: Make ICDDCR/GICD_CTLR banked

2014-08-22 Thread Fabian Aggeler
. Since this bit (Enable Non-secure) is present in the integrated IC of the Cortex-A9 MPCore, which implements the GICv1 profile, we support this bit in GICv1 too. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c| 34 ++ hw/intc/arm_gic_common.c

[Qemu-devel] [PATCH 09/15] hw/intc/arm_gic: Implement Non-secure view of RPR

2014-08-22 Thread Fabian Aggeler
For GICs with Security Extensions Non-secure reads have a restricted view on the current running priority. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 17 - hw/intc/gic_internal.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/hw/intc

[Qemu-devel] [PATCH 04/15] hw/intc/arm_gic: Add ns_access() function

2014-08-22 Thread Fabian Aggeler
: Fabian Aggeler --- hw/intc/arm_gic.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 75b5121..9b83af0 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -45,6 +45,13 @@ static inline int gic_get_current_cpu(GICState *s) return 0

[Qemu-devel] [PATCH 05/15] hw/intc/arm_gic: Add Interrupt Group Registers

2014-08-22 Thread Fabian Aggeler
. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c| 47 +--- hw/intc/arm_gic_common.c | 1 + hw/intc/gic_internal.h | 4 include/hw/intc/arm_gic_common.h | 1 + 4 files changed, 50 insertions(+), 3 deletions(-) diff

[Qemu-devel] [PATCH 08/15] hw/intc/arm_gic: Make ICCBPR/GICC_BPR banked

2014-08-22 Thread Fabian Aggeler
This register is banked in GICs with Security Extensions. Storing the non-secure copy of BPR in the abpr, which is an alias to the non-secure copy for secure access. ABPR itself is only accessible from secure state if the GIC implements Security Extensions. Signed-off-by: Fabian Aggeler --- hw

[Qemu-devel] [PATCH 02/15] hw/arm/vexpress.c: Wire FIQ between CPU <> GIC

2014-08-22 Thread Fabian Aggeler
Connect FIQ output of the GIC CPU interfaces to the CPUs. Signed-off-by: Fabian Aggeler --- hw/arm/vexpress.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index a88732c..bafe8d2 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -229,6

[Qemu-devel] [PATCH 15/15] hw/intc/arm_gic: add gic_update() for grouping

2014-08-22 Thread Fabian Aggeler
GICs with grouping (GICv2 or GICv1 with Security Extensions) have a different exception generation model which is more complicated than without interrupt grouping. We add a new function to handle this model. Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 87

[Qemu-devel] [PATCH 00/15] target-arm: Add GICv1/SecExt and GICv2/Grouping

2014-08-22 Thread Fabian Aggeler
Fabian Aggeler (15): hw/intc/arm_gic: Request FIQ sources hw/arm/vexpress.c: Wire FIQ between CPU <> GIC hw/intc/arm_gic: Add Security Extensions property hw/intc/arm_gic: Add ns_access() function hw/intc/arm_gic: Add Interrupt Group Registers hw/intc/arm_gic: Make ICDDCR/GICD_CTLR

[Qemu-devel] [PATCH 10/15] hw/intc/arm_gic: Handle grouping for GICC_HPPIR

2014-08-22 Thread Fabian Aggeler
Grouping (GICv2) and Security Extensions change the behaviour of reads of the highest priority pending interrupt register (ICCHPIR/GICC_HPPIR). Signed-off-by: Fabian Aggeler --- hw/intc/arm_gic.c | 29 - hw/intc/gic_internal.h | 1 + 2 files changed, 29

[Qemu-devel] [PATCH v3 1/2] hw/misc/arm_sp810: Create SP810 device

2014-08-17 Thread Fabian Aggeler
This adds a device model for the PrimeXsys System Controller (SP810) which is present in the Versatile Express motherboards. It is so far read-only but allows to read the SCCTRL register. Signed-off-by: Fabian Aggeler --- default-configs/arm-softmmu.mak | 1 + hw/misc/Makefile.objs

[Qemu-devel] [PATCH v3 2/2] hw/arm/vexpress: add SP810 to the vexpress

2014-08-17 Thread Fabian Aggeler
register (SCCTRL) to TIMCLK (1). Signed-off-by: Fabian Aggeler --- hw/arm/vexpress.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index a88732c..086f68a 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -34,6 +34,7

[Qemu-devel] [PATCH v3 0/2] Add SP810 to Versatile Express boards

2014-08-17 Thread Fabian Aggeler
org/archive/html/qemu-devel/2014-08/msg00629.html v1 -> v2: * TIMERENXSEL prefixed with register name * removed casts * created header file v1: https://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg02572.html Fabian Aggeler (2): hw/misc/arm_sp810: Create SP810 device hw/arm/vexpres

[Qemu-devel] [PATCH v2 1/2] hw/misc/arm_sp810: Create SP810 device

2014-08-05 Thread Fabian Aggeler
This adds a device model for the PrimeXsys System Controller (SP810) which is present in the Versatile Express motherboards. It is so far read-only but allows to set the SCCTRL register. Signed-off-by: Fabian Aggeler --- default-configs/arm-softmmu.mak | 1 + hw/misc/Makefile.objs

[Qemu-devel] [PATCH v2 0/2] Add SP810 to Versatile Express boards

2014-08-05 Thread Fabian Aggeler
tml Fabian Aggeler (2): hw/misc/arm_sp810: Create SP810 device hw/arm/vexpress: add SP810 to the vexpress default-configs/arm-softmmu.mak | 1 + hw/arm/vexpress.c | 6 ++- hw/misc/Makefile.objs | 1 + hw/misc/arm_sp810.c |

[Qemu-devel] [PATCH v2 2/2] hw/arm/vexpress: add SP810 to the vexpress

2014-08-05 Thread Fabian Aggeler
register (SCCTRL) to TIMCLK (1). Signed-off-by: Fabian Aggeler --- hw/arm/vexpress.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index a88732c..0b6d31a 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -34,6 +34,7 @@ #include

[Qemu-devel] [PATCH 2/2] hw/arm/vexpress: add SP810 to the vexpress

2014-07-16 Thread Fabian Aggeler
register (SCCTRL) to TIMCLK (1). Signed-off-by: Fabian Aggeler --- hw/arm/vexpress.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index a88732c..b96c3fd 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -512,7 +512,7

[Qemu-devel] [PATCH 1/2] hw/misc/arm_sp810: Create SP810 device

2014-07-16 Thread Fabian Aggeler
This adds a device model for the PrimeXsys System Controller (SP810) which is present in the Versatile Express motherboards. It is so far read-only but allows to set the SCCTRL register. Signed-off-by: Fabian Aggeler --- default-configs/arm-softmmu.mak | 1 + hw/misc/Makefile.objs

[Qemu-devel] [PATCH 0/2] Add SP810 to Versatile Express boards

2014-07-16 Thread Fabian Aggeler
the SCCTRL register so that software that queries this register behaves as expected. Feedback is greatly appreciated! Best, Fabian Fabian Aggeler (2): hw/misc/arm_sp810: Create SP810 device hw/arm/vexpress: add SP810 to the vexpress default-configs/arm-softmmu.mak | 1 + hw/arm/vexpress.c

[Qemu-devel] [PATCH v3 20/32] target-arm: arrayfying fieldoffset for banking

2014-06-10 Thread Fabian Aggeler
Prepare ARMCPRegInfo to support specifying two fieldoffsets per register definition. This will allow us to keep one register definition for banked registers (different offsets for secure/ non-secure world). Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 16 +--- target-arm

[Qemu-devel] [PATCH v3 05/32] target-arm: reject switching to monitor mode

2014-06-10 Thread Fabian Aggeler
From: Sergey Fedorov ...from non-secure state. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index d8d6637..ace8d8b 100644 --- a/target-arm/helper.c +++ b

[Qemu-devel] [PATCH v3 19/32] target-arm: insert Aarch32 cpregs twice into hashtable

2014-06-10 Thread Fabian Aggeler
Prepare for cp register banking by inserting every cp register twice, once for secure world and once for non-secure world. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 14 +++--- target-arm/helper.c| 20 target-arm/translate.c | 19

[Qemu-devel] [PATCH v3 14/32] target-arm: Respect SCR.FW, SCR.AW and SCTLR.NMFI

2014-06-10 Thread Fabian Aggeler
bits when modifying CPSR. Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 42 +++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 2fbecfa..f6ff4aa 100644 --- a/target-arm/helper.c +++ b

[Qemu-devel] [PATCH v3 09/32] target-arm: extend Aarch32 async excp masking

2014-06-10 Thread Fabian Aggeler
This patch extends arm_excp_unmasked() according to ARM ARMv7 and ARM ARMv8 (all EL running in Aarch32) and adds comments. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 77 1 file changed, 61 insertions(+), 16 deletions(-) diff

[Qemu-devel] [PATCH v3 08/32] target-arm: A32: Emulate the SMC instruction

2014-06-10 Thread Fabian Aggeler
Implements SMC instruction in Aarch32 using the A32 syndrome. When executing SMC instruction from monitor CPU mode SCR.NS bit is reset. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/helper.c| 11 +++ target-arm/internals.h | 5 + target-arm

[Qemu-devel] [PATCH v3 11/32] target-arm: add async excp target_el&mode function

2014-06-10 Thread Fabian Aggeler
Adds a dedicated function for IRQ and FIQ exceptions to determine target_el and mode (Aarch32) according to tables in ARM ARMv8 and ARM ARM v7. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 3 ++ target-arm/helper.c | 137 2 files

[Qemu-devel] [PATCH v3 25/32] target-arm: make c2_mask and c2_base_mask banked

2014-06-10 Thread Fabian Aggeler
Since TTBCR is banked we will bank c2_mask and c2_base_mask too. This avoids recalculating them on switches from secure to non-secure world. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 10 -- target-arm/helper.c | 19 --- 2 files changed, 20 insertions(+), 9

[Qemu-devel] [PATCH v3 24/32] target-arm: add TCR_EL3 and make TTBCR banked

2014-06-10 Thread Fabian Aggeler
Adds TCR_EL3 system register and makes existing TTBCR banked. Adjust translation functions to use TCR/TTBCR instance depending on CPU state. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 11 ++- target-arm/helper.c | 46 ++ 2 files

[Qemu-devel] [PATCH v3 31/32] target-arm: make VBAR banked

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) VBAR has a secure and a non-secure instance, which are mapped to VBAR_EL1 and VBAR_EL3. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 12 +++- target-arm/helper-a64.c | 6 +- target-arm/helper.c

[Qemu-devel] [PATCH v3 30/32] target-arm: make PAR banked

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) PAR has a secure and a non-secure instance. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 10 +- target-arm/helper.c | 25 ++--- 2 files changed, 23 insertions(+), 12 deletions(-) diff

[Qemu-devel] [PATCH v3 29/32] target-arm: make IFAR/DFAR banked

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) IFAR and DFAR have a secure and a non-secure instance. Signed-off-by: Fabian Aggeler Conflicts: target-arm/helper.c --- target-arm/cpu.c| 2 +- target-arm/cpu.h| 21 - target-arm

[Qemu-devel] [PATCH v3 27/32] target-arm: make IFSR banked

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) IFSR has a secure and a non-secure instance. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 10 +- target-arm/helper.c | 9 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/target-arm

[Qemu-devel] [PATCH v3 32/32] target-arm: make c13 cp regs banked (FCSEIDR, ...)

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) FCSEIDR, CONTEXTIDR, TPIDRURW, TPIDRURO and TPIDRPRW have a secure and a non-secure instance. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 45 - target-arm/helper.c | 27

[Qemu-devel] [PATCH v3 23/32] target-arm: add TTBR0_EL3 and make TTBR0/1 banked

2014-06-10 Thread Fabian Aggeler
Add TTBR0 and maps secure/non-secure instance of ttbr0 and ttbr1 accordingly (translation table base register). Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 21 +++-- target-arm/helper.c | 45 +++-- 2 files changed, 54

[Qemu-devel] [PATCH v3 28/32] target-arm: make DFSR banked

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) DFSR has a secure and a non-secure instance. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 13 - target-arm/helper-a64.c | 17 ++--- target-arm/helper.c | 15 --- 3 files

[Qemu-devel] [PATCH v3 22/32] target-arm: make CSSELR banked

2014-06-10 Thread Fabian Aggeler
Rename CSSELR (cache size selection register) and add secure instance (Aarch32). Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 10 +- target-arm/helper.c | 9 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index

[Qemu-devel] [PATCH v3 26/32] target-arm: make DACR banked

2014-06-10 Thread Fabian Aggeler
When EL3 is running in Aarch32 (or ARMv7 with Security Extensions) DACR has a secure and a non-secure instance. Signed-off-by: Fabian Aggeler --- hw/arm/pxa2xx.c | 2 +- target-arm/cpu.h| 13 +++-- target-arm/helper.c | 19 +++ 3 files changed, 23 insertions

[Qemu-devel] [PATCH v3 21/32] target-arm: add SCTLR_EL3 and make SCTLR banked

2014-06-10 Thread Fabian Aggeler
Implements SCTLR_EL3 and uses secure/non-secure instance when needed. Signed-off-by: Fabian Aggeler --- hw/arm/pxa2xx.c| 2 +- target-arm/cpu.c | 5 ++-- target-arm/cpu.h | 13 - target-arm/helper.c| 78 +- target

[Qemu-devel] [PATCH v3 04/32] target-arm: add arm_is_secure() function

2014-06-10 Thread Fabian Aggeler
arm_is_secure() function allows to determine CPU security state if the CPU implements Security Extensions/EL3. arm_is_secure_below_el3() returns true if CPU is in secure state below EL3. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 38

[Qemu-devel] [PATCH v3 12/32] target-arm: use dedicated target_el function

2014-06-10 Thread Fabian Aggeler
Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index 8333b52..b9b458e 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -3429,14 +3429,10

[Qemu-devel] [PATCH v3 06/32] target-arm: make arm_current_pl() return PL3

2014-06-10 Thread Fabian Aggeler
Make arm_current_pl() return PL3 for secure PL1 and monitor mode. Increase MMU modes since mmu_index is directly infered from arm_ current_pl(). Changes assertion in arm_el_is_aa64() to allow EL3. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 15 +-- 1 file changed, 9

[Qemu-devel] [PATCH v3 18/32] target-arm: add macros to access banked registers

2014-06-10 Thread Fabian Aggeler
to the Aarch64 EL register. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 35 +++ 1 file changed, 35 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 221b847..0b8042c 100644 --- a/target-arm/cpu.h +++ b

[Qemu-devel] [PATCH v3 16/32] target-arm: add SDER definition

2014-06-10 Thread Fabian Aggeler
From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 1 + target-arm/helper.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index bc9edaa..c76a31c 100644 --- a/target-arm/cpu.h +++ b/target-arm

[Qemu-devel] [PATCH v3 15/32] target-arm: add NSACR register

2014-06-10 Thread Fabian Aggeler
Implements NSACR register with corresponding read/write functions for ARMv7 and ARMv8. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 6 + target-arm/helper.c | 68 - 2 files changed, 73 insertions

[Qemu-devel] [PATCH v3 13/32] target-arm: implement IRQ/FIQ routing to Monitor mode

2014-06-10 Thread Fabian Aggeler
SCR.{IRQ/FIQ} bits allow to route IRQ/FIQ exceptions to monitor CPU mode. When taking IRQ exception to monitor mode FIQ exception is additionally masked. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 9 + 1 file changed, 9 insertions(+) diff

[Qemu-devel] [PATCH v3 17/32] target-arm: add MVBAR support

2014-06-10 Thread Fabian Aggeler
Use MVBAR register as exception vector base address for exceptions taken to CPU monitor mode. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 1 + target-arm/helper.c | 15 +-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a

[Qemu-devel] [PATCH v3 02/32] target-arm: move Aarch32 SCR into security reglist

2014-06-10 Thread Fabian Aggeler
Define a new ARM CP register info list for the ARMv7 Security Extension feature. Register that list only for ARM cores with Security Extension/EL3 support. Moving Aarch32 SCR into Security Extension register group. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm

[Qemu-devel] [PATCH v3 03/32] target-arm: increase arrays of registers R13 & R14

2014-06-10 Thread Fabian Aggeler
Increasing banked_r13 and banked_r14 to store LR_mon and SP_mon (bank index 7). Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 4 ++-- target-arm/machine.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 060664f

[Qemu-devel] [PATCH v3 07/32] target-arm: add non-secure Translation Block flag

2014-06-10 Thread Fabian Aggeler
different TCG code depending on CPU secure state. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 10 ++ target-arm/translate-a64.c | 1 + target-arm/translate.c | 3 +++ target-arm/translate.h | 1 + 4 files changed, 15 insertions

[Qemu-devel] [PATCH v3 10/32] target-arm: extend Aarch64 SCR.{FIQ|IRQ} handling

2014-06-10 Thread Fabian Aggeler
If EL3 is using Aarch64 IRQ/FIQ masking is ignored in all exception levels other than EL3 if SCR.{FIQ|IRQ} is set to 1 (routed to EL3). Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 98 +--- 1 file changed, 72 insertions(+), 26

[Qemu-devel] [PATCH v3 00/32] target-arm: add Security Extensions for CPUs

2014-06-10 Thread Fabian Aggeler
ecurity_cp_reginfo * extended arm_is_secure() with EL3 handling * rewrote nsacr patch * removed MMU split for secure/nonsecure world * removed arm_current_sctlr * new banking scheme v2: http://lists.gnu.org/archive/html/qemu-devel/2014-05/msg02522.html Thanks, Fabian Fabian Aggeler (29): t

[Qemu-devel] [PATCH v3 01/32] target-arm: add cpu feature EL3 to CPUs with Security Extensions

2014-06-10 Thread Fabian Aggeler
Set ARM_FEATURE_EL3 feature for CPUs that implement Security Extensions. Signed-off-by: Fabian Aggeler --- target-arm/cpu.c | 4 1 file changed, 4 insertions(+) diff --git a/target-arm/cpu.c b/target-arm/cpu.c index cd7a5df..bd581e6 100644 --- a/target-arm/cpu.c +++ b/target-arm/cpu.c

[Qemu-devel] [PATCH v2] target-arm: implement PD0/PD1 bits for TTBCR

2014-06-10 Thread Fabian Aggeler
Corrected handling of writes to TTBCR for ARMv8 (previously UNK/SBZP bits are not RES0) and ARMv7 (new bits PD0/PD1 for CPUs with Security Extensions). Bits PD0/PD1 are now respected in get_phys_addr_v6/v5() and get_level1_table_address. Signed-off-by: Fabian Aggeler --- v2 -> v3: * reba

[Qemu-devel] [PATCH v2] target-arm: implement PD0/PD1 bits for TTBCR

2014-06-05 Thread Fabian Aggeler
Corrected handling of writes to TTBCR for ARMv8 (previously UNK/SBZP bits are not RES0) and ARMv7 (new bits PD0/PD1 for CPUs with Security Extensions). Bits PD0/PD1 are now respected in get_phys_addr_v6/v5() and get_level1_table_address. Signed-off-by: Fabian Aggeler --- v1 -> v2: * drop

[Qemu-devel] [PATCH v2] target-arm: Prepare cpreg writefns/readfns for EL3/SecExt

2014-06-05 Thread Fabian Aggeler
This patch changes some readfns/writefns to use raw_write and raw_read functions, which use the fieldoffset specified in ARMCPRegInfo instead of directly accessing the field. This will simplify patches for EL3 & Security Extensions. Reviewed-by: Peter Crosthwaite Signed-off-by: Fabian Agg

[Qemu-devel] [PATCH] target-arm: set SBOP/SBZP bits of SCTLR

2014-05-30 Thread Fabian Aggeler
ARM ARM v7 specifies SBOP/SBZP bits for v5/v6/v7. This patch sets these bits on every sctlr_write(). In ARMv8 most of them are RES0/RES1. Signed-off-by: Fabian Aggeler --- Previously part of TZ patchset but now includes handling for SBOP/SBZP bits in ARMv5/v6/v7. Not sure whether using the

[Qemu-devel] [PATCH] target-arm: implement PD0/PD1 bits for TTBCR

2014-05-30 Thread Fabian Aggeler
to be zero anymore. Bits PD0/PD1 are now respected in get_phys_addr_lpae() and get_phys_addr_v6/v5(). Signed-off-by: Fabian Aggeler --- Parts of this patch were previously part of the TZ patchset but were rewritten to include ARMv8 RES0 and PD0/PD1 handling. target-arm/cpu.h| 16

[Qemu-devel] [PATCH v2] target-arm: implement CPACR register logic for ARMv7

2014-05-19 Thread Fabian Aggeler
implement a trace macrocell nor a CP14 interface to the trace macrocell registers. Since CPACR bits for VFP/Neon access are honoured with the CPACR_FPEN bit in the TB flags, flushing the TLB is not necessary anymore. Signed-off-by: Fabian Aggeler --- v1 -> v2: * Removed unnecessary checks

[Qemu-devel] [PATCH] target-arm: Prepare cpreg writefns/readfns for EL3/SecExt

2014-05-16 Thread Fabian Aggeler
This patch changes some readfns/writefns to use raw_write and raw_read functions, wich use the fieldoffset specified in ARMCPRegInfo instead of directly accessing the field. This will simplify patches for EL3 & Security Extensions. Signed-off-by: Fabian Aggeler --- This patch was previously

[Qemu-devel] [PATCH] target-arm: implement CPACR register logic

2014-05-16 Thread Fabian Aggeler
orov Signed-off-by: Fabian Aggeler --- This patch was previously part of the Security Extensions patchset and got separated because it is not Sec-Ext specific. In addition to a style fix of the comment I added qemu_log_mask() as suggested. target-arm/helper.c| 6 ++ target-arm/transla

Re: [Qemu-devel] [PATCH v2 10/23] target-arm: implement CPACR register logic

2014-05-15 Thread Fabian Aggeler
On 14/05/14 20:39, Fedorov Sergey wrote: 14.05.2014 10:06, Sergey Fedorov пишет: On 13.05.2014 20:15, Fabian Aggeler wrote: From: Sergey Fedorov CPACR register allows to control access rights to coprocessor 0-13 interfaces. Bits corresponding to unimplemented coprocessors should be RAZ/WI

[Qemu-devel] [PATCH v2 09/23] target-arm: add non-secure Translation Block flag

2014-05-13 Thread Fabian Aggeler
code depending on CPU secure state. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 7 +++ target-arm/translate.c | 3 +++ target-arm/translate.h | 1 + 3 files changed, 11 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 717b2e7

[Qemu-devel] [PATCH v2 04/23] target-arm: preserve RAO/WI bits of ARMv7 SCTLR

2014-05-13 Thread Fabian Aggeler
From: Svetlana Fedoseeva Signed-off-by: Svetlana Fedoseeva Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 5 + 1 file changed, 5 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index 9c3269f..2b57ad9 100644 --- a/target-arm

[Qemu-devel] [PATCH v2 21/23] target-arm: implement SMC instruction

2014-05-13 Thread Fabian Aggeler
From: Sergey Fedorov SMC instruction is implemented similar to SVC instruction. When executing SMC instruction from monitor CPU mode SCR.NS bit is reset. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 1 + target-arm/helper.c| 11

[Qemu-devel] [PATCH v2 19/23] target-arm: maintain common bits of banked CP registers

2014-05-13 Thread Fabian Aggeler
Some of SCTRL bits are common for secure and non-secure state. Translation table base masks are updated on NS-bit switch as well as on TTBCR writes. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 10 ++ target-arm/helper.c | 39

[Qemu-devel] [PATCH v2 11/23] target-arm: add NSACR support

2014-05-13 Thread Fabian Aggeler
NSACR allows to control non-secure access to coprocessor interfaces 0-13 and CPACR bits. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 1 + target-arm/helper.c| 29 + target-arm/translate.c | 7 +++ 3 files

[Qemu-devel] [PATCH v2 08/23] target-arm: adjust arm_current_pl() for Security Extensions

2014-05-13 Thread Fabian Aggeler
From: Sergey Fedorov Make arm_current_pl() return PL3 for secure PL1 and monitor mode. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 6ea0432

[Qemu-devel] [PATCH v2 03/23] target-arm: adjust TTBCR for Security Extension feature

2014-05-13 Thread Fabian Aggeler
From: Sergey Fedorov TTBCR has additional fields PD0 and PD1 when using Short-descriptor translation table format on a CPU with Security Extension support. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 5 + 1 file changed, 5 insertions(+) diff

[Qemu-devel] [PATCH v2 00/23] target-arm: add Security Extensions for CPUs

2014-05-13 Thread Fabian Aggeler
with the recent effort towards EL3 in A64. Thanks, Fabian Fabian Aggeler (12): target-arm: add arm_is_secure() function target-arm: add NSACR support target-arm: Split TLB for secure state and EL3 in Aarch64 target-arm: add banked coprocessor register type and macros target-arm

[Qemu-devel] [PATCH v2 23/23] target-arm: Respect SCR.FW, SCR.AW and SCTLR.NMFI

2014-05-13 Thread Fabian Aggeler
bits when modifying CPSR. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 2 ++ target-arm/helper.c | 41 ++--- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 212cb64..5de0c77 100644 --- a

[Qemu-devel] [PATCH v2 20/23] target-arm: add MVBAR support

2014-05-13 Thread Fabian Aggeler
Use MVBAR register as exception vector base address for exceptions taken to CPU monitor mode. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 1 + target-arm/helper.c | 12 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/target

[Qemu-devel] [PATCH v2 18/23] target-arm: Convert banked coprocessor registers

2014-05-13 Thread Fabian Aggeler
registers using A32_BANKED_REG_GET macro or A32_MAPPED_EL3_REG_GET for registers which we map to EL3 registers. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- linux-user/main.c | 2 +- target-arm/cpu.h| 32 ++ target-arm/helper-a64.c | 3 +- target-arm

[Qemu-devel] [PATCH v2 17/23] target-arm: Use raw_write/raw_read whenever possible

2014-05-13 Thread Fabian Aggeler
This way less case distinctions are necessary for different modes/worlds as the reginfos already point at the correct offset. Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/target-arm

[Qemu-devel] [PATCH v2 13/23] target-arm: Split TLB for secure state and EL3 in Aarch64

2014-05-13 Thread Fabian Aggeler
. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 42 +++- target-arm/helper.c| 2 +- target-arm/translate-a64.c | 9 +- target-arm/translate.c | 247 +++-- target-arm/translate.h | 1 + 5

[Qemu-devel] [PATCH v2 06/23] target-arm: add arm_is_secure() function

2014-05-13 Thread Fabian Aggeler
arm_is_secure() function allows to determine CPU security state if the CPU implements Security Extensions. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h

[Qemu-devel] [PATCH v2 05/23] target-arm: add CPU Monitor mode

2014-05-13 Thread Fabian Aggeler
From: Svetlana Fedoseeva Define CPU monitor mode. Adjust core registers banking. Adjust CPU VM state info. Provide CPU mode name for monitor mode. Signed-off-by: Svetlana Fedoseeva Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 7 --- target-arm

[Qemu-devel] [PATCH v2 10/23] target-arm: implement CPACR register logic

2014-05-13 Thread Fabian Aggeler
orov Signed-off-by: Fabian Aggeler --- target-arm/helper.c| 6 ++ target-arm/translate.c | 26 +++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index cf1f88c..4e82259 100644 --- a/target-arm/helper.c +++ b/ta

[Qemu-devel] [PATCH v2 16/23] target-arm: Use arm_current_sctlr to access SCTLR

2014-05-13 Thread Fabian Aggeler
Add SCTLR_EL3 and introduce new function to access correct instance of SCTLR in different modes/worlds. Signed-off-by: Fabian Aggeler --- hw/arm/pxa2xx.c| 2 +- target-arm/cpu-qom.h | 1 + target-arm/cpu.c | 4 +-- target-arm/cpu.h | 14 ++- target-arm/helper.c

[Qemu-devel] [PATCH v2 15/23] target-arm: Restrict EL3 to Aarch32 state

2014-05-13 Thread Fabian Aggeler
This behaviour can be changed after all needed Aarch64 (_EL3) registers are implemented and respected at locations where behaviour is different when EL3 is in Aarch64 state. Signed-off-by: Fabian Aggeler --- target-arm/cpu.h | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff

[Qemu-devel] [PATCH v2 14/23] target-arm: add banked coprocessor register type and macros

2014-05-13 Thread Fabian Aggeler
: Fabian Aggeler --- target-arm/cpu.h | 121 + target-arm/helper.c| 64 -- target-arm/translate.c | 19 +--- 3 files changed, 184 insertions(+), 20 deletions(-) diff --git a/target-arm/cpu.h b/target-arm/cpu.h

[Qemu-devel] [PATCH v2 22/23] target-arm: implement IRQ/FIQ routing to Monitor mode

2014-05-13 Thread Fabian Aggeler
SCR.{IRQ/FIQ} bits allows to route IRQ/FIQ exceptions to monitor CPU mode. When taking IRQ exception to monitor mode FIQ exception is additionally masked. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 2 ++ target-arm/helper.c | 9 + 2 files

[Qemu-devel] [PATCH v2 02/23] target-arm: move SCR into Security Extensions register list

2014-05-13 Thread Fabian Aggeler
From: Sergey Fedorov Define a new ARM CP register info list for the Security Extension feature. Register that list only for ARM cores with Security Extension support. Moving SCR into Security Extension register group. Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm

[Qemu-devel] [PATCH v2 12/23] target-arm: add SDER definition

2014-05-13 Thread Fabian Aggeler
From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.h| 1 + target-arm/helper.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/target-arm/cpu.h b/target-arm/cpu.h index fb72cfa..76c9e90 100644 --- a/target-arm/cpu.h +++ b/target-arm

[Qemu-devel] [PATCH v2 07/23] target-arm: reject switching to monitor mode from non-secure state

2014-05-13 Thread Fabian Aggeler
From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index c1388eb..cf1f88c 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -2903,6

[Qemu-devel] [PATCH v2 01/23] target-arm: add new CPU feature for Security Extensions

2014-05-13 Thread Fabian Aggeler
From: Svetlana Fedoseeva Define Security Extensions CPU feature. Set that feature for relevant CPUs. Signed-off-by: Svetlana Fedoseeva Signed-off-by: Sergey Fedorov Signed-off-by: Fabian Aggeler --- target-arm/cpu.c | 4 target-arm/cpu.h | 1 + 2 files changed, 5 insertions(+) diff