From patchwork Sat Jul 12 13:23:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 33525 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f72.google.com (mail-qg0-f72.google.com [209.85.192.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2D35820672 for ; Sat, 12 Jul 2014 13:24:33 +0000 (UTC) Received: by mail-qg0-f72.google.com with SMTP id q108sf1882396qgd.11 for ; Sat, 12 Jul 2014 06:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=5uh7CXjm9hrEX2z5u/27j7WlvWdXtPew8Jx0wIun+W4=; b=DZLQ15WicttikaMA4RjmVxcxhoDatXkcbB4LeqCkFI8ShlBdAlHQFeuvXiIB+yQ11J vd3tq/A+cvPqb+ZVENBw1UzYKx5wBebYNp8MJrhf9plB0UhvaRMSBOY4Z5GkptnglfxA jvIqKrw9gCqPRTWv1Lg9E5Qk68IuUayHWkTjGf8rhyNAk1+5044YYX0tV1M6FlyA5hNs PX7C/potPjySva7M/eE/1MU6uEQgL2qcXOKG3Wb1RE/SJxfCxHsA/2rqMxADBAL2nswU 3A787s4stmCqPwKojaXzUXlfROHHkA0oBM6lXlb4bOqrezqJkSegWPTDI0UFM1+Ocszm IqhQ== X-Gm-Message-State: ALoCoQlbkyXJR6MIvA2Zk5tzMz2T6K+W9oP5j9xTbLFhZt/GTd893bIsSaOMsX2io3WUsZPm5S3D X-Received: by 10.236.230.106 with SMTP id i100mr2080577yhq.27.1405171473028; Sat, 12 Jul 2014 06:24:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.44.75 with SMTP id f69ls4685qga.96.gmail; Sat, 12 Jul 2014 06:24:32 -0700 (PDT) X-Received: by 10.52.253.140 with SMTP id aa12mr4547876vdd.11.1405171472727; Sat, 12 Jul 2014 06:24:32 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id dk1si3543895vdb.95.2014.07.12.06.24.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 12 Jul 2014 06:24:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id hy4so4177179vcb.20 for ; Sat, 12 Jul 2014 06:24:32 -0700 (PDT) X-Received: by 10.220.92.193 with SMTP id s1mr35009vcm.34.1405171472631; Sat, 12 Jul 2014 06:24:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp4977vcb; Sat, 12 Jul 2014 06:24:32 -0700 (PDT) X-Received: by 10.194.11.74 with SMTP id o10mr6880238wjb.82.1405171471790; Sat, 12 Jul 2014 06:24:31 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id e5si2819218wib.78.2014.07.12.06.24.31 for ; Sat, 12 Jul 2014 06:24:31 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E9AC9AB653; Sat, 12 Jul 2014 15:24:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oXMX3TAzVN9C; Sat, 12 Jul 2014 15:24:29 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A48CAB63F; Sat, 12 Jul 2014 15:24:18 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ABC57A7C94 for ; Sat, 12 Jul 2014 15:24:16 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id brK4Q4NJMn0S for ; Sat, 12 Jul 2014 15:24:16 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from benson.vm.bytemark.co.uk (benson.vm.bytemark.co.uk [212.110.190.137]) by theia.denx.de (Postfix) with ESMTPS id 2DBC6A78FB for ; Sat, 12 Jul 2014 15:24:13 +0200 (CEST) Received: from cpc22-cmbg14-2-0-cust482.5-4.cable.virginm.net ([86.6.25.227] helo=celaeno.hellion.org.uk) by benson.vm.bytemark.co.uk with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1X5xHf-0005bT-8O; Sat, 12 Jul 2014 14:24:11 +0100 Received: from dagon.hellion.org.uk ([192.168.1.7]) by celaeno.hellion.org.uk with smtp (Exim 4.80) (envelope-from ) id 1X5xHc-0000LE-QD; Sat, 12 Jul 2014 14:24:09 +0100 Received: by dagon.hellion.org.uk (sSMTP sendmail emulation); Sat, 12 Jul 2014 14:24:08 +0100 From: Ian Campbell To: u-boot@lists.denx.de, Albert Aribaud Date: Sat, 12 Jul 2014 14:23:58 +0100 Message-Id: <1405171448-27310-1-git-send-email-ijc@hellion.org.uk> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1405171421.11981.51.camel@dagon.hellion.org.uk> References: <1405171421.11981.51.camel@dagon.hellion.org.uk> Cc: Tom Rini , Marc Zyngier Subject: [U-Boot] [PATCH v5 01/11] ARM: HYP/non-sec: move switch to non-sec to the last boot phase X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ijc@hellion.org.uk X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Marc Zyngier Having the switch to non-secure in the "prep" phase is causing all kind of troubles, as that stage can be called multiple times. Instead, move the switch to non-secure to the last possible phase, when there is no turning back anymore. Signed-off-by: Marc Zyngier Acked-by: Ian Campbell --- v5: [ijc] Continue to call do_nonsec_virt_switch for arm64 too --- arch/arm/lib/bootm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index 47ee070..304210e 100644 --- a/arch/arm/lib/bootm.c +++ b/arch/arm/lib/bootm.c @@ -242,7 +242,6 @@ static void boot_prep_linux(bootm_headers_t *images) printf("FDT and ATAGS support not compiled in - hanging\n"); hang(); } - do_nonsec_virt_switch(); } /* Subcommand: GO */ @@ -260,8 +259,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag) announce_and_cleanup(fake); - if (!fake) + if (!fake) { + do_nonsec_virt_switch(); kernel_entry(images->ft_addr); + } #else unsigned long machid = gd->bd->bi_arch_number; char *s; @@ -287,8 +288,10 @@ static void boot_jump_linux(bootm_headers_t *images, int flag) else r2 = gd->bd->bi_boot_params; - if (!fake) + if (!fake) { + do_nonsec_virt_switch(); kernel_entry(0, machid, r2); + } #endif }