From patchwork Tue Mar 10 18:52:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45607 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 61250214BF for ; Tue, 10 Mar 2015 18:56:06 +0000 (UTC) Received: by wggy19 with SMTP id y19sf2908319wgg.2 for ; Tue, 10 Mar 2015 11:56:05 -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:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=AzdGSzGnIqnEvn2rxXzVI5nAbSCxSNNSsO79FeQx5Fg=; b=mOndSVP5+Yy4N9XzfHcQypigxaI/VcoZj6gL9PWLXbBh8atbfxp+ir/xx6nk8oXYv3 8iGvu4NeBpWuzzsPmTw747CVbR8VkIgj8RhMupzN8odhnkEsvS10rOc0dHYeDYOO2L52 ne80qJtLAEcFB0RmBwPmgGci8o8NM7l6fZIYcNDCxwMZbS6xEjtT5mmf90PL4JhKDjRr RZLYSCp7qWIcVLDaZUjjq9qBgnr0ncIzUbWRZ0xTW1ZMluhEvAfperb0EKuQguneX64B r3XfKCsc3YoZDcbiLfadDL2ZudOwfVMNy/t91EYzaRQ4DLsnQZrtkLNyJkOyBI064fZw +G8g== X-Gm-Message-State: ALoCoQmhbWMKqNriokGFjDhXUEn8VpGye9kNbS8FkPFqcZmu7yj5P9jsgieT/364nKxFiTAN0N0n X-Received: by 10.152.6.232 with SMTP id e8mr4940786laa.2.1426013765343; Tue, 10 Mar 2015 11:56:05 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.87.163 with SMTP id az3ls59916lab.64.gmail; Tue, 10 Mar 2015 11:56:05 -0700 (PDT) X-Received: by 10.152.6.163 with SMTP id c3mr31259306laa.69.1426013765200; Tue, 10 Mar 2015 11:56:05 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id ck5si961564lbc.19.2015.03.10.11.56.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 11:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbvp9 with SMTP id p9so3901296lbv.8 for ; Tue, 10 Mar 2015 11:56:05 -0700 (PDT) X-Received: by 10.152.26.201 with SMTP id n9mr31330986lag.29.1426013765071; Tue, 10 Mar 2015 11:56:05 -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 h5csp2320836lbj; Tue, 10 Mar 2015 11:56:04 -0700 (PDT) X-Received: by 10.107.8.215 with SMTP id h84mr34688308ioi.89.1426013763137; Tue, 10 Mar 2015 11:56:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id mt7si2340872pdb.190.2015.03.10.11.56.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2015 11:56:03 -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 1YVPIP-0000iN-Un; Tue, 10 Mar 2015 18:54:25 +0000 Received: from mail-wg0-f43.google.com ([74.125.82.43]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVPHf-000085-0t for linux-arm-kernel@lists.infradead.org; Tue, 10 Mar 2015 18:53:39 +0000 Received: by wghl18 with SMTP id l18so3906678wgh.11 for ; Tue, 10 Mar 2015 11:53:17 -0700 (PDT) X-Received: by 10.180.104.200 with SMTP id gg8mr40450587wib.8.1426013597158; Tue, 10 Mar 2015 11:53:17 -0700 (PDT) Received: from ards-macbook-pro.local ([213.143.60.209]) by mx.google.com with ESMTPSA id ew5sm21466156wic.14.2015.03.10.11.53.14 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Mar 2015 11:53:16 -0700 (PDT) From: Ard Biesheuvel To: will.deacon@arm.com, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, linux@arm.linux.org.uk Subject: [PATCH v4 2/4] ARM: KVM: avoid "HYP init code too big" error Date: Tue, 10 Mar 2015 19:52:55 +0100 Message-Id: <1426013577-32081-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426013577-32081-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426013577-32081-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150310_115339_261074_8DF62C75 X-CRM114-Status: GOOD ( 10.57 ) 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 [74.125.82.43 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.43 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: arnd@arndb.de, Ard Biesheuvel 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: , MIME-Version: 1.0 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.217.182 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 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: use __hyp_idmap_rodata section instead adding a duplicate .rodata, move the ALIGN() to __hyp_idmap_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..7029c8e5b1b5 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 HYP_IDMAP_RODATA \ + __hyp_idmap_rodata : { \ . = ALIGN(32); \ VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ *(.hyp.idmap.text) \ - VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; + VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; \ + } #ifdef CONFIG_HOTPLUG_CPU #define ARM_CPU_DISCARD(x) @@ -151,6 +155,7 @@ SECTIONS } #endif + HYP_IDMAP_RODATA NOTES _etext = .; /* End of text and rodata section */