From patchwork Mon Apr 25 20:06:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66611 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1233133qge; Mon, 25 Apr 2016 13:08:15 -0700 (PDT) X-Received: by 10.98.32.211 with SMTP id m80mr51340896pfj.3.1461614891047; Mon, 25 Apr 2016 13:08:11 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qg6si8615165pac.60.2016.04.25.13.08.10; Mon, 25 Apr 2016 13:08:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeblueprint-co-uk.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933508AbcDYUID (ORCPT + 29 others); Mon, 25 Apr 2016 16:08:03 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:36193 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964965AbcDYUH5 (ORCPT ); Mon, 25 Apr 2016 16:07:57 -0400 Received: by mail-wm0-f45.google.com with SMTP id v188so111840359wme.1 for ; Mon, 25 Apr 2016 13:07:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeblueprint-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Th0K1uy8+GcYhuqci5IpOdCCZrPPhNnKegqdoZ0+6gg=; b=W52YEkg1WIvUOc14Qr9oyZl+LeWD4d3nujnJmlQvOVyZN1bCJILvQt0BVupHtRTygU j4cLQ/aw4kpwlyQjprXJaEO/PG3uL3BiQJ8hK3GJqno4EwVfzcnQCdA+o5WbGmsJnglU SgHGyLw3RTAqtOHcf3XLrQHTb6NUuQZKrXHK7cRysfHUbngghj2hdj8VFcKirafdeFGR xYpcIdnMXwgsBdvqq05nOyl148QTknQCiYRsd0uTbeyFBWPbzobtrDebRdUR8Q9aa3D0 rDLENqe+MCgWxQZne9CECN4ZU6U2uwEwkZlPu1+YYtpRvKzea1AGInrqrpV8ovfMiwCt akVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Th0K1uy8+GcYhuqci5IpOdCCZrPPhNnKegqdoZ0+6gg=; b=WCbnjW+X4iiNIyOW4byl7NhhWCNh8bzmQ9BAyLQxf0ErI7ByFsOuJguarDasOn+2Qt KTTdGwDLtpqSNItNp4ySlSHkXyrsfRiRLJFykw4F6IyptL8AnWiaKhaPtTPROMdZiPSA 9nLKj5BxCqz2bSjfmkfvNDQ39ew6MkYlZU8/Fsvww7D3gylPiMpq14FACCiWreUKQIL4 lhqgp8ut9ZCsyGGWuG1wEworXUIpr8/4WKYJwbcSqLJ5AYhlA0SWm4Ntqv8xTSEBsG6E QxSsfh3bgGQOecL+boGoobQOg1oP3o69sOSJPW5t3XNlrvYI/LE+z47Qx4R+p3evHP5F CDcw== X-Gm-Message-State: AOPr4FVCx2FaiDm1usHfxfQqQM2EiR4CQEq4raL81e7OlCeCM4ySbsJpQr1fY8xsBgZTVg== X-Received: by 10.194.175.168 with SMTP id cb8mr36941261wjc.56.1461614876095; Mon, 25 Apr 2016 13:07:56 -0700 (PDT) Received: from localhost (bcdc58e5.skybroadband.com. [188.220.88.229]) by smtp.gmail.com with ESMTPSA id s6sm25196142wjy.31.2016.04.25.13.07.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 13:07:55 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , David Herrmann , Mark Rutland , Peter Jones , Will Deacon Subject: [PATCH 20/40] arm64/efi: libstub: Make screen_info accessible to the UEFI stub Date: Mon, 25 Apr 2016 21:06:52 +0100 Message-Id: <1461614832-17633-21-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel Unlike on 32-bit ARM, where we need to pass the stub's version of struct screen_info to the kernel proper via a configuration table, on 64-bit ARM it simply involves making the core kernel's copy of struct screen_info visible to the stub by exposing an __efistub_ alias for it. Signed-off-by: Ard Biesheuvel Acked-by: Will Deacon Cc: Mark Rutland Cc: David Herrmann Cc: Peter Jones Signed-off-by: Matt Fleming --- arch/arm64/include/asm/efi.h | 3 +++ arch/arm64/kernel/efi.c | 3 +++ arch/arm64/kernel/image.h | 1 + 3 files changed, 7 insertions(+) -- 2.7.3 diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index af40baa5d53f..fa09886f72e6 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -56,6 +56,9 @@ int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md); #define __efi_call_early(f, ...) f(__VA_ARGS__) #define efi_is_64bit() (true) +#define alloc_screen_info(x...) &screen_info +#define free_screen_info(x...) + #define EFI_ALLOC_ALIGN SZ_64K /* diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 33a6da160a50..78f52488f9ff 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -56,6 +56,9 @@ static __init pteval_t create_mapping_protection(efi_memory_desc_t *md) return pgprot_val(PAGE_KERNEL_EXEC); } +/* we will fill this structure from the stub, so don't put it in .bss */ +struct screen_info screen_info __section(.data); + int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md) { pteval_t prot_val = create_mapping_protection(md); diff --git a/arch/arm64/kernel/image.h b/arch/arm64/kernel/image.h index 5e360ce88f10..1428849aece8 100644 --- a/arch/arm64/kernel/image.h +++ b/arch/arm64/kernel/image.h @@ -112,6 +112,7 @@ __efistub___memset = KALLSYMS_HIDE(__pi_memset); __efistub__text = KALLSYMS_HIDE(_text); __efistub__end = KALLSYMS_HIDE(_end); __efistub__edata = KALLSYMS_HIDE(_edata); +__efistub_screen_info = KALLSYMS_HIDE(screen_info); #endif