qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] arm: enable TZ support for the GIC
@ 2015-06-30 13:07 Peter Maydell
  2015-06-30 13:07 ` [Qemu-devel] [PATCH 1/5] hw/intc/arm_gic_common.c: Reset all registers Peter Maydell
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Peter Maydell @ 2015-06-30 13:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Edgar E. Iglesias, Peter Crosthwaite, Andreas Färber,
	patches

This patchset enables the TZ support in the GIC for the systems
where we enable TZ support in the CPU. In practice that means
just the "virt" and "vexpress" boards, since all the others
disable the CPU TZ support.

Patch 1 I've already put out on list as a bugfix targeting 2.4.

The main interesting part in this is that we need some special
handling for the case where both the CPU and the GIC have TZ
support but we want to directly boot a kernel in NonSecure
(this only happens with the "virt" board). In this case our
hw/arm/boot.c minimalist bootloader needs to do the work of
configuring the GIC that would normally be done by Secure
firmware before it started the NS kernel. I've opted to do this
by adding a property on the GIC which says "reset yourself as
if you'd been configured by firmware to make all the IRQs NS",
and then set that property from boot.c if appropriate.

The other possible approach would be to have the code that
boot.c runs in the guest do this reconfiguration, but that
would be awkward because we'd need to start both the primary
and secondary CPUs in Secure and have them do the step-down-to-NS
themselves after messing with the GIC. If people strongly prefer
that I can have a go at it, but I'd really rather not :-)

Andreas, I cc'd you in case you wanted to have a look at whether
I got the property-which-can-be-set-after-realize right (patch 2).

thanks
-- PMM

Peter Maydell (5):
  hw/intc/arm_gic_common.c: Reset all registers
  hw/intc/arm_gic_common: Provide property to make IRQs reset as
    NonSecure
  hw/arm/boot: Configure secure GIC to make IRQs NS if booting an NS
    kernel
  hw/cpu/{a15mpcore,a9mpcore}: enable TrustZone in GIC if it is enabled
    in CPUs
  hw/arm/virt: Enable TZ extensions on the GIC if we are using them

 hw/arm/boot.c                    | 39 ++++++++++++++++++++++
 hw/arm/virt.c                    |  7 ++--
 hw/cpu/a15mpcore.c               | 13 ++++++++
 hw/cpu/a9mpcore.c                | 11 ++++++
 hw/intc/arm_gic_common.c         | 72 +++++++++++++++++++++++++++++++++++++---
 include/hw/intc/arm_gic_common.h |  1 +
 6 files changed, 137 insertions(+), 6 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-07-07 13:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-30 13:07 [Qemu-devel] [PATCH 0/5] arm: enable TZ support for the GIC Peter Maydell
2015-06-30 13:07 ` [Qemu-devel] [PATCH 1/5] hw/intc/arm_gic_common.c: Reset all registers Peter Maydell
2015-06-30 13:07 ` [Qemu-devel] [PATCH 2/5] hw/intc/arm_gic_common: Provide property to make IRQs reset as NonSecure Peter Maydell
2015-06-30 13:07 ` [Qemu-devel] [PATCH 3/5] hw/arm/boot: Configure secure GIC to make IRQs NS if booting an NS kernel Peter Maydell
2015-06-30 19:01   ` Peter Crosthwaite
2015-06-30 19:42     ` Peter Maydell
2015-06-30 20:10       ` Peter Crosthwaite
2015-06-30 20:16         ` Peter Maydell
2015-06-30 20:24           ` Peter Crosthwaite
2015-07-02 12:41         ` Peter Maydell
2015-07-04 19:08           ` Peter Crosthwaite
2015-06-30 13:07 ` [Qemu-devel] [PATCH 4/5] hw/cpu/{a15mpcore, a9mpcore}: enable TrustZone in GIC if it is enabled in CPUs Peter Maydell
2015-06-30 13:07 ` [Qemu-devel] [PATCH 5/5] hw/arm/virt: Enable TZ extensions on the GIC if we are using them Peter Maydell
2015-07-07 13:27 ` [Qemu-devel] [PATCH 0/5] arm: enable TZ support for the GIC Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).