From patchwork Tue Mar 10 09:56:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 5976111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B28B69F380 for ; Tue, 10 Mar 2015 09:59:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D8A45201F4 for ; Tue, 10 Mar 2015 09:59:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C6B6D201CD for ; Tue, 10 Mar 2015 09:59:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVGuc-0001R5-OJ; Tue, 10 Mar 2015 09:57:18 +0000 Received: from mail-ie0-f175.google.com ([209.85.223.175]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVGuZ-0001M7-AR for linux-arm-kernel@lists.infradead.org; Tue, 10 Mar 2015 09:57:15 +0000 Received: by iecvj10 with SMTP id vj10so7656190iec.0 for ; Tue, 10 Mar 2015 02:56:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=fnrRAWep2plu+DX+t84/uNpVmbcxatlUwKm6J0Lzt1o=; b=bf/6wu7cH7+8KknID9DCt+0eXed8pGeLaLrgxMpWfJ4LGYBIMtyl3lV8TcRHiep3Ue SnGLnwJ7iYtsbfNYP52avTqOpzVYdsmc6uRkjm1Z1T4AMD3LAUv1ZkBCXJOhgPX50F6v AMITFjtoxfFdpXlmIRAj4ZZTBaOeLqhR268LDhIJ0IvLjMEnLETcMovrKpLYQrfDrW/o dCoCRvvcnZUSFTZ4Vj4QAAPHITYEmLyw3AXc8EJQBZJu8FVBkIUUaB53gha3zBCdoWR7 GJJAWxuH+zu8GS0iXY7MY5Buu5iA3f5HQde26V2YaBD0yJIPYhlqU+PpEBJ7akvTBF7u AdTQ== X-Gm-Message-State: ALoCoQnA5TY8jdhgD7KNxmXLpdX+th56WxhBKxH1gSCZDX3droc6Uqj18wEcW6bT9XM9nznNq0io MIME-Version: 1.0 X-Received: by 10.50.4.97 with SMTP id j1mr19581554igj.46.1425981413599; Tue, 10 Mar 2015 02:56:53 -0700 (PDT) Received: by 10.36.125.21 with HTTP; Tue, 10 Mar 2015 02:56:53 -0700 (PDT) In-Reply-To: <20150309190947.GF8656@n2100.arm.linux.org.uk> References: <1425652482-31411-1-git-send-email-ard.biesheuvel@linaro.org> <1425652482-31411-3-git-send-email-ard.biesheuvel@linaro.org> <20150309190947.GF8656@n2100.arm.linux.org.uk> Date: Tue, 10 Mar 2015 10:56:53 +0100 Message-ID: Subject: Re: [PATCH roundup 2/4] ARM: KVM: avoid "HYP init code too big" error From: Ard Biesheuvel To: Russell King - ARM Linux X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150310_025715_407053_64338F2F X-CRM114-Status: GOOD ( 13.97 ) X-Spam-Score: -0.7 (/) Cc: Arnd Bergmann , Marc Zyngier , Will Deacon , Christoffer Dall , "kvmarm@lists.cs.columbia.edu" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP (resend with complete cc) On 9 March 2015 at 20:09, Russell King - ARM Linux wrote: > On Fri, Mar 06, 2015 at 03:34:40PM +0100, Ard Biesheuvel wrote: >> From: Arnd Bergmann >> >> When building large kernels, the linker will emit lots of veneers >> into the .hyp.idmap.text section, which causes it to grow beyond >> one page, and that triggers the build error. >> >> This moves the section into .rodata instead, which avoids the >> veneers and is safe because the code is not executed directly >> but remapped by the hypervisor into its own executable address >> space. >> >> Signed-off-by: Arnd Bergmann >> [ardb: move the ALIGN() to .rodata as well, update log s/copied/remapped/] >> Tested-by: Marc Zyngier >> Reviewed-by: Marc Zyngier >> Signed-off-by: Ard Biesheuvel >> --- >> arch/arm/kernel/vmlinux.lds.S | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S >> index b31aa73e8076..2787eb8d3616 100644 >> --- a/arch/arm/kernel/vmlinux.lds.S >> +++ b/arch/arm/kernel/vmlinux.lds.S >> @@ -22,11 +22,15 @@ >> ALIGN_FUNCTION(); \ >> VMLINUX_SYMBOL(__idmap_text_start) = .; \ >> *(.idmap.text) \ >> - VMLINUX_SYMBOL(__idmap_text_end) = .; \ >> + VMLINUX_SYMBOL(__idmap_text_end) = .; >> + >> +#define IDMAP_RODATA \ >> + .rodata : { \ > > We already have a .rodata section defined by RO_DATA(). Quite how this > interacts with the existing .rodata section, I don't know, but it > probably won't be right. Have you checked what effect this has? > Here's just the rodata lines from 'readelf -S vmlinux', with and without the patch applied [ 4] .rodata PROGBITS c0752000 552000 310620 00 A 0 0 64 [ 4] .rodata PROGBITS c0752000 552000 3106c0 00 AX 0 0 64 and there is only a single one, so it appears binutils is quite happy with this. If the A -> AX bothers you, we could fold in the following hunk as well. which takes care of that. --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -52,7 +52,7 @@ */ .text - .pushsection .hyp.idmap.text,"ax" + .pushsection .hyp.idmap.text,"a" .align 5 __kvm_hyp_init: .globl __kvm_hyp_init