From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756795AbbHZKtN (ORCPT ); Wed, 26 Aug 2015 06:49:13 -0400 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:57970 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755943AbbHZKtL (ORCPT ); Wed, 26 Aug 2015 06:49:11 -0400 Date: Wed, 26 Aug 2015 11:48:39 +0100 From: Russell King - ARM Linux To: Dave Martin Cc: Christopher Covington , Mark Rutland , "Jon Medhurst (Tixy)" , Stephen Boyd , Linus Walleij , Will Deacon , Florian Fainelli , Nicolas Pitre , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Yingjoe Chen , Wang Nan , Kees Cook , Arnd Bergmann , Gregory CLEMENT , linux-arm-kernel@lists.infradead.org, Paul Bolle , Ard Biesheuvel , Nathan Lynch , linux-kernel@vger.kernel.org, Masahiro Yamada , Maxime Coquelin stm32 Subject: Re: [PATCH] arm: Handle starting up in secure mode Message-ID: <20150826104839.GC21084@n2100.arm.linux.org.uk> References: <1440424572-27116-1-git-send-email-cov@codeaurora.org> <20150826103940.GD6281@e103592.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150826103940.GD6281@e103592.cambridge.arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 26, 2015 at 11:39:42AM +0100, Dave Martin wrote: > On Mon, Aug 24, 2015 at 09:55:26AM -0400, Christopher Covington wrote: > > ARM Linux appears to have never been made aware of the ARMv7 security > > extensions. When CONFIG_ARM_SEC_EXT=y, have it probe for its security > > state by checking whether CNTFRQ is writeable and potentially make > > mode changes based on the information. The most features are available > > from hypervisor (HYP) mode, so switch to it possible. Failing that, > > prefer non-secure supervisor (SVC) mode to secure supervisor mode. > > Up to now we've steered clear of this, since it's a bit of a fig leaf > for broken firmware unless Linux actually has some valid use for the > Security Extensions itself. > > Shouldn't the bootloader or firmware be doing this stuff, and if not, > why not? > > > Some other things that would need to be considered in any case: > > * SoC-specific setup of the Non-secure view of the system: This has > to happen very early, so making it DT aware is going to be hard -- > failing that, we are effectively risking bringing back board files. > The split in responsibility between firmware/bootloader and kernel > needs to be clearly defined and (as far as possible) platform- > independent, otherwise we'll have total chaos. > > * Out of reset, generally the CPU state is only fully defined for the > highest exception level. You probably need to be doing more setup > than you're currently doing. > > * SMP, secondary boot and suspend/resume -- again involving board- > specific code. > > * You need to safely "park" the Secure World before running anything > in Non-Secure. As a minimum, you would need to quiesce any > Secure interrupt sources, disable all interrupt traps to Monitor > mode, and make sure that the Monitor vectors point somewhere > real, so that executing SMC doesn't send the CPU off into the > long grass... Another question is: has this been tested with kexec? -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net.