From patchwork Fri Mar 27 10:18:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 46398 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 B073521597 for ; Fri, 27 Mar 2015 10:20:51 +0000 (UTC) Received: by wibgr10 with SMTP id gr10sf3582354wib.2 for ; Fri, 27 Mar 2015 03:20:51 -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=SvFInRjxvFZuNNu7Z1i+FMhhJWrZS9u/e+Lvh7PIj04=; b=RDZtA/iBYrnuiwai/l2IjZUyehMSN3BZ2MWWGOD9HykIv19w722PKJcof059aJfbIW gXZBkHfyIJNjl2mXnXx1D3xFSlbKjsJPdfJC8uDtWkr5ERKj2I5LkAAt4dXeXC+J5GaR soo9jdEBAwuibEUzoJFWiQ0WnDMc7yF1WsIRRntjjdnbGDYZ5tuBLU1gTttgNccC3H+D cUh5kXjhwXzcCrEX8nIVni1NqISwFbgjLK0Kb3cxcQVivh699t3esvwXNwvyvXAD2+YZ WC2+3URcQhbcX7IuJtHs+CA6gWRnFpKfERR5SgKBLtup3IgKRR5zHG7rrAYehxngdy9s Jmyw== X-Gm-Message-State: ALoCoQkI0me/RNqucaa2CKJDDf63XzH4jdqqaznyz9qL4v2AFdUCQ6M17ru7FpuMY6972Gp44jo0 X-Received: by 10.112.35.135 with SMTP id h7mr4391606lbj.23.1427451651036; Fri, 27 Mar 2015 03:20:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.103 with SMTP id s7ls300938lag.105.gmail; Fri, 27 Mar 2015 03:20:50 -0700 (PDT) X-Received: by 10.112.131.66 with SMTP id ok2mr17071451lbb.51.1427451650818; Fri, 27 Mar 2015 03:20:50 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id ba7si1108958lab.50.2015.03.27.03.20.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 03:20:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lboc7 with SMTP id c7so3333309lbo.1 for ; Fri, 27 Mar 2015 03:20:50 -0700 (PDT) X-Received: by 10.152.121.33 with SMTP id lh1mr17281818lab.86.1427451650679; Fri, 27 Mar 2015 03:20:50 -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.57.201 with SMTP id k9csp1161296lbq; Fri, 27 Mar 2015 03:20:49 -0700 (PDT) X-Received: by 10.68.180.3 with SMTP id dk3mr34076681pbc.103.1427451648868; Fri, 27 Mar 2015 03:20:48 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id w3si2251825pbs.178.2015.03.27.03.20.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 03:20:48 -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 1YbRLt-000616-MX; Fri, 27 Mar 2015 10:18:57 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YbRLR-0005eJ-56 for linux-arm-kernel@lists.infradead.org; Fri, 27 Mar 2015 10:18:30 +0000 Received: by wgra20 with SMTP id a20so93724580wgr.3 for ; Fri, 27 Mar 2015 03:18:07 -0700 (PDT) X-Received: by 10.194.76.146 with SMTP id k18mr37032357wjw.115.1427451487027; Fri, 27 Mar 2015 03:18:07 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.5.29]) by mx.google.com with ESMTPSA id wo10sm2138416wjb.35.2015.03.27.03.18.05 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Mar 2015 03:18:06 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: kvm: round HYP section to page size instead of log2 upper bound Date: Fri, 27 Mar 2015 11:18:01 +0100 Message-Id: <1427451481-16053-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1427451481-16053-1-git-send-email-ard.biesheuvel@linaro.org> References: <1427451481-16053-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150327_031829_386420_17AE91C9 X-CRM114-Status: GOOD ( 11.07 ) 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.41 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.41 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: will.deacon@arm.com, 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.176 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 Older binutils do not support expressions involving the values of external symbols so just round up the HYP region to the page size. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/vmlinux.lds.S | 31 +------------------------------ arch/arm/kvm/init.S | 3 --- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 808398ec024e..f2db429ea75d 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S @@ -12,26 +12,6 @@ #include #endif -/* - * Poor man's version of LOG2CEIL(), which is - * not available in binutils before v2.24. - */ -#define LOG2_ROUNDUP(size) ( \ - __LOG2_ROUNDUP(size, 2) \ - __LOG2_ROUNDUP(size, 3) \ - __LOG2_ROUNDUP(size, 4) \ - __LOG2_ROUNDUP(size, 5) \ - __LOG2_ROUNDUP(size, 6) \ - __LOG2_ROUNDUP(size, 7) \ - __LOG2_ROUNDUP(size, 8) \ - __LOG2_ROUNDUP(size, 9) \ - __LOG2_ROUNDUP(size, 10) \ - __LOG2_ROUNDUP(size, 11) \ - 12) - -#define __LOG2_ROUNDUP(size, order) \ - (size) <= (1 << order) ? order : - #define PROC_INFO \ . = ALIGN(4); \ VMLINUX_SYMBOL(__proc_info_begin) = .; \ @@ -43,20 +23,11 @@ VMLINUX_SYMBOL(__idmap_text_start) = .; \ *(.idmap.text) \ VMLINUX_SYMBOL(__idmap_text_end) = .; \ - . = ALIGN(1 << LOG2_ROUNDUP(__hyp_idmap_size)); \ + . = ALIGN(PAGE_SIZE); \ VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ *(.hyp.idmap.text) \ VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; -/* - * If the HYP idmap .text section is populated, it needs to be positioned - * such that it will not cross a page boundary in the final output image. - * So align it to the section size rounded up to the next power of 2. - * If __hyp_idmap_size is undefined, the section will be empty so define - * it as 0 in that case. - */ -PROVIDE(__hyp_idmap_size = 0); - #ifdef CONFIG_HOTPLUG_CPU #define ARM_CPU_DISCARD(x) #define ARM_CPU_KEEP(x) x diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 11fb1d56f449..3988e72d16ff 100644 --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -157,6 +157,3 @@ target: @ We're now in the trampoline code, switch page tables __kvm_hyp_init_end: .popsection - - .global __hyp_idmap_size - .set __hyp_idmap_size, __kvm_hyp_init_end - __kvm_hyp_init