From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: [PATCH v4 02/32] arm64: KVM: HYP mode idmap support Date: Tue, 14 May 2013 15:13:30 +0100 Message-ID: <1368540840-26750-3-git-send-email-marc.zyngier@arm.com> References: <1368540840-26750-1-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Cc: catalin.marinas@arm.com, will.deacon@arm.com, pbonzini@redhat.com, gleb@redhat.com To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Return-path: Received: from service87.mimecast.com ([91.220.42.44]:48172 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754994Ab3ENOOX (ORCPT ); Tue, 14 May 2013 10:14:23 -0400 In-Reply-To: <1368540840-26750-1-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: Add the necessary infrastructure for identity-mapped HYP page tables. Idmap-ed code must be in the ".hyp.idmap.text" linker section. The rest of the HYP ends up in ".hyp.text". Signed-off-by: Marc Zyngier --- arch/arm64/kernel/vmlinux.lds.S | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.ld= s.S index 3fae2be..9635391 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -17,6 +17,19 @@ ENTRY(stext) =20 jiffies =3D jiffies_64; =20 +#define HYPERVISOR_TEXT=09=09=09=09=09\ +=09/*=09=09=09=09=09=09\ +=09 * Force the alignment to be compatible with=09\ +=09 * the vectors requirements=09=09=09\ +=09 */=09=09=09=09=09=09\ +=09. =3D ALIGN(2048);=09=09=09=09\ +=09VMLINUX_SYMBOL(__hyp_idmap_text_start) =3D .;=09\ +=09*(.hyp.idmap.text)=09=09=09=09\ +=09VMLINUX_SYMBOL(__hyp_idmap_text_end) =3D .;=09\ +=09VMLINUX_SYMBOL(__hyp_text_start) =3D .;=09=09\ +=09*(.hyp.text)=09=09=09=09=09\ +=09VMLINUX_SYMBOL(__hyp_text_end) =3D .; + SECTIONS { =09/* @@ -49,6 +62,7 @@ SECTIONS =09=09=09TEXT_TEXT =09=09=09SCHED_TEXT =09=09=09LOCK_TEXT +=09=09=09HYPERVISOR_TEXT =09=09=09*(.fixup) =09=09=09*(.gnu.warning) =09=09. =3D ALIGN(16); @@ -124,3 +138,9 @@ SECTIONS =09STABS_DEBUG =09.comment 0 : { *(.comment) } } + +/* + * The HYP init code can't be more than a page long. + */ +ASSERT(((__hyp_idmap_text_start + PAGE_SIZE) >=3D __hyp_idmap_text_end), + "HYP init code too big") --=20 1.8.2.3