From patchwork Wed Jan 28 19:57:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5734691 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E8095BF440 for ; Thu, 29 Jan 2015 02:17:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 283B2201EC for ; Thu, 29 Jan 2015 02:17:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4E26C201BB for ; Thu, 29 Jan 2015 02:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757877AbbA2CQO (ORCPT ); Wed, 28 Jan 2015 21:16:14 -0500 Received: from mout.kundenserver.de ([212.227.17.24]:64034 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755192AbbA2CQL (ORCPT ); Wed, 28 Jan 2015 21:16:11 -0500 Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue103) with ESMTPSA (Nemesis) id 0Lpyfn-1XnI2H22yN-00fjil; Wed, 28 Jan 2015 22:50:34 +0100 From: Arnd Bergmann To: Marc Zyngier , Christoffer Dall Cc: Russell King , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: randconfig bug: ARM/KVM link error in hyp_idmap section Date: Wed, 28 Jan 2015 20:57:19 +0100 Message-ID: <3919069.MpPCrczKD2@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 X-Provags-ID: V03:K0:hQOhm5v6eTTRxLQYYqRU5K51yOEZfPgnhFx/TNv5B/MFmbIl0nk 8BI+GJkZvj/KGD7plye75wNm2FM7YPhld+Dk+QLnushA6ImCORyFNEGlYOa69uRxWZQsosc yBheSlaY9svB4APcVg1wo34gOznK7zWVht3GfklKr6R2wJFNnjjhY7Y1+URlv/vBuS3G+xH BMp3dC8NXCeCuYhPe/Ipg== X-UI-Out-Filterresults: notjunk:1; Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 Since 0394e1f60520 ("ARM: KVM: enforce maximum size for identity mapped code"), some randconfigs started failing because the hyp_idmap section grows too large. I've tracked this down to the problem of veneers getting erroneously added to this section, but I'm not sure about the fix. The patch below is what I came up with. Any other ideas? Arnd 8<---- Subject: [PATCH] ARM: KVM: avoid "HYP init code too big" error 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 always copied into a separate page first. I am unsure if I wrote this the correct way though, so it needs to be reviewed carefully. Signed-off-by: Arnd Bergmann --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index ce01a2d3339f..f4de6e16d951 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -23,10 +23,14 @@ VMLINUX_SYMBOL(__idmap_text_start) = .; \ *(.idmap.text) \ VMLINUX_SYMBOL(__idmap_text_end) = .; \ - . = ALIGN(32); \ + . = ALIGN(32); + +#define IDMAP_RODATA \ + .rodata : { \ 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) @@ -123,6 +127,7 @@ SECTIONS . = ALIGN(1<