From patchwork Sat Oct 6 16:00:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 1558781 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id B80E9DF238 for ; Sat, 6 Oct 2012 16:03:25 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TKWnz-0008HT-C4; Sat, 06 Oct 2012 16:00:43 +0000 Received: from mho-04-ewr.mailhop.org ([204.13.248.74] helo=mho-02-ewr.mailhop.org) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TKWnv-0008H6-ON for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2012 16:00:40 +0000 Received: from c-98-234-237-12.hsd1.ca.comcast.net ([98.234.237.12] helo=localhost.localdomain) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1TKWnt-0001Bc-J2; Sat, 06 Oct 2012 16:00:37 +0000 Received: from Mutt by mutt-smtp-wrapper.pl 1.2 (www.zdo.com/articles/mutt-smtp-wrapper.shtml) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 98.234.237.12 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18RbcFKm23LfT3DR5lazfOg Date: Sat, 6 Oct 2012 09:00:32 -0700 From: Tony Lindgren To: Marc Zyngier Subject: Re: [PATCH v2 2/7] ARM: virt: allow the kernel to be entered in HYP mode Message-ID: <20121006160031.GC3874@atomide.com> References: <1347036934-8519-1-git-send-email-marc.zyngier@arm.com> <1347036934-8519-3-git-send-email-marc.zyngier@arm.com> <20121005200822.GQ3874@atomide.com> <6d3553bfe8a2d1ac88cab852100616a7@localhost> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6d3553bfe8a2d1ac88cab852100616a7@localhost> User-Agent: Mutt/1.5.20 (2009-06-14) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [204.13.248.74 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines Cc: Dave Martin , linux-omap@vger.kernel.org, Russell King - ARM Linux , linux-arm-kernel@lists.infradead.org, Nicolas Pitre X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org * Marc Zyngier [121006 03:19]: > > If so, that indicates some side effect of the safe_svcmode_maskall macro, > and I suspect the "movs pc, lr" bit. > > Can you try the attached patch? It basically falls back to the previous > behaviour if not entered in HYP mode. ... > diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h > index 658a15d..b21b97f 100644 > --- a/arch/arm/include/asm/assembler.h > +++ b/arch/arm/include/asm/assembler.h > @@ -254,16 +254,17 @@ > mov lr , \reg > and lr , lr , #MODE_MASK > cmp lr , #HYP_MODE > - orr \reg , \reg , #PSR_A_BIT | PSR_I_BIT | PSR_F_BIT > + orr \reg , \reg , #PSR_I_BIT | PSR_F_BIT > bic \reg , \reg , #MODE_MASK > orr \reg , \reg , #SVC_MODE > THUMB( orr \reg , \reg , #PSR_T_BIT ) > - msr spsr_cxsf, \reg > - adr lr, BSYM(2f) > bne 1f > + orr \reg, \reg, #PSR_A_BIT > + adr lr, BSYM(2f) > + msr spsr_cxsf, \reg > __MSR_ELR_HYP(14) > __ERET > -1: movs pc, lr > +1: msr cpsr_c, \reg > 2: > .endm > The minimal version of this that still boots on my n800 is just the last change of the above patch: --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h @@ -263,7 +263,7 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) bne 1f __MSR_ELR_HYP(14) __ERET -1: movs pc, lr +1: msr cpsr_c, \reg 2: .endm