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: 45570 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1235B214BF for ; Tue, 10 Mar 2015 09:58:59 +0000 (UTC) Received: by wivr20 with SMTP id r20sf934586wiv.0 for ; Tue, 10 Mar 2015 02:58:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=KLffTK5WMMROnDM+X2wCnWxMlFqOyXhT+b+uU9Ak6o0=; b=OwsVolCpa3S9dxeWbMstL6vQMOuMxknCd7hB6TeVWe9hoWTa3QcmtQrrnECcdfJDad JlGqWF5LeaH8DxQGz27y5qEEQ3dvZp3irqOETRXFR5VoY2S4z4D+hpBqw1AeR3X/aT2/ tKKf41zZ6vzaR7KcfBbJoN3Fde1wnr7+sQeHXjISdofaILqdcX0bD4eHlTh998S3y2Ue p6QcFqWLl/JQgWPucqhJYXS8hkndFmH1RhQsE8yrFiAHlCvaFfgxSF0r0GjklHMaEpYs 47jz1fOc7JF6V9m4DNf4sdJoa552joB9RDytsskDYt8ajS+/0W47rAUqPw+oc1rK8R8v +/3w== X-Gm-Message-State: ALoCoQmZk8iaq9dG9WXaUh9qKqBgQ/EYAhDPYl/EgbsZul9nwwxEWKJzH06e2WhQhNx00NIL09/a X-Received: by 10.152.45.7 with SMTP id i7mr4538950lam.9.1425981538272; Tue, 10 Mar 2015 02:58:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.132 with SMTP id b4ls3776lah.33.gmail; Tue, 10 Mar 2015 02:58:57 -0700 (PDT) X-Received: by 10.112.63.165 with SMTP id h5mr29337212lbs.16.1425981537736; Tue, 10 Mar 2015 02:58:57 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id cr5si29785lad.41.2015.03.10.02.58.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 02:58:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labmn12 with SMTP id mn12so440588lab.8 for ; Tue, 10 Mar 2015 02:58:57 -0700 (PDT) X-Received: by 10.152.28.5 with SMTP id x5mr29296341lag.112.1425981537642; Tue, 10 Mar 2015 02:58:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp2015650lbj; Tue, 10 Mar 2015 02:58:56 -0700 (PDT) X-Received: by 10.70.101.226 with SMTP id fj2mr21935170pdb.23.1425981534904; Tue, 10 Mar 2015 02:58:54 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v6si5815981pdp.187.2015.03.10.02.58.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 02:58:54 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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) 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 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.223.175 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.223.175 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 (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