From owner-freebsd-arm@FreeBSD.ORG Fri Feb 13 14:45:00 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E615A68 for ; Fri, 13 Feb 2015 14:45:00 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F33FF9AE for ; Fri, 13 Feb 2015 14:44:59 +0000 (UTC) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [127.0.1.5]) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9) with ESMTP id t1DEixM5050521 for ; Fri, 13 Feb 2015 14:44:59 GMT (envelope-from root@phabric-backend.isc.freebsd.org) Received: (from root@localhost) by phabric-backend.isc.freebsd.org (8.14.9/8.14.9/Submit) id t1DEixd9050520; Fri, 13 Feb 2015 14:44:59 GMT (envelope-from root) Date: Fri, 13 Feb 2015 14:44:59 +0000 To: freebsd-arm@freebsd.org From: "ian (Ian Lepore)" Subject: [Differential] [Commented On] D1810: Leave HYP mode upon startup Message-ID: X-Priority: 3 Thread-Topic: D1810: Leave HYP mode upon startup X-Herald-Rules: none X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: In-Reply-To: References: Thread-Index: ZjlkNDcyMzZlMWIyNDBkZTI1NTY5ZjZiZGRjIFTeDes= X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Feb 2015 14:45:00 -0000 ian added inline comments. INLINE COMMENTS sys/arm/arm/locore-v6.S:88 What is the value in spsr at this point? Previous debugging experience tells me it's random bits, at least on some cortex-a processors. I think the right sequence would be to just manipulate the state of cpsr that's already in r0 and save it as spsr. Except... once that occurred to me, it then popped into my head that we don't need this entire sequence (from #if through #endif), instead we should replace the very first instruction above with: cpsid ifa, #(PSR_SVC32_MODE) And the same in mpentry below. That should work on all armv6/v7 no matter what the entry-time processor mode is, right? REVISION DETAIL https://reviews.freebsd.org/D1810 To: zbb, andrew, ian Cc: imp, freebsd-arm