From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966048AbcAZOFG (ORCPT ); Tue, 26 Jan 2016 09:05:06 -0500 Received: from foss.arm.com ([217.140.101.70]:45415 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965459AbcAZOFC (ORCPT ); Tue, 26 Jan 2016 09:05:02 -0500 Subject: Re: [PATCH v2 20/21] arm64: VHE: Add support for running Linux in EL2 mode To: Marc Zyngier , Catalin Marinas , Will Deacon , Christoffer Dall References: <1453737235-16522-1-git-send-email-marc.zyngier@arm.com> <1453737235-16522-21-git-send-email-marc.zyngier@arm.com> Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu From: "Suzuki K. Poulose" Message-ID: <56A77D0B.50002@arm.com> Date: Tue, 26 Jan 2016 14:04:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: <1453737235-16522-21-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/01/16 15:53, Marc Zyngier wrote: > With ARMv8.1 VHE, the architecture is able to (almost) transparently > run the kernel at EL2, despite being written for EL1. > > This patch takes care of the "almost" part, mostly preventing the kernel > from dropping from EL2 to EL1, and setting up the HYP configuration. > #ifdef CONFIG_COMPAT > @@ -521,6 +542,15 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems > /* Stage-2 translation */ > msr vttbr_el2, xzr > > + cbz x2, install_el2_stub Though it is apparent, may be its worth adding a comment here that we don't drop to EL1 here ? > + > + setup_vtcr x4, x5 > + > + mov w20, #BOOT_CPU_MODE_EL2 // This CPU booted in EL2 > + isb > + ret > + > +install_el2_stub: And a comment here mentioning, install the hyp stub and drops to EL1 ? > /* Hypervisor stub */ > adrp x0, __hyp_stub_vectors > add x0, x0, #:lo12:__hyp_stub_vectors > Cheers Suzuki