From patchwork Fri Mar 18 16:47:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64081 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp66788lbc; Fri, 18 Mar 2016 09:48:23 -0700 (PDT) X-Received: by 10.98.67.139 with SMTP id l11mr25091585pfi.112.1458319703622; Fri, 18 Mar 2016 09:48:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qz9si2578663pab.94.2016.03.18.09.48.22; Fri, 18 Mar 2016 09:48:23 -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; 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753661AbcCRQsI (ORCPT + 30 others); Fri, 18 Mar 2016 12:48:08 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36209 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751410AbcCRQsC (ORCPT ); Fri, 18 Mar 2016 12:48:02 -0400 Received: by mail-wm0-f54.google.com with SMTP id l124so38074071wmf.1 for ; Fri, 18 Mar 2016 09:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lLU/eOvsJEwofdhQA9a1CPYCxnXFpdGImtY2uBZd74U=; b=PeBxt72PyOkNl0WtJsmQyBQw0Cfu/rQQ8GzFwSsQ/y8easPyqXjj27PEn0FfUG0aei Oq6jMIXY79XS5dPaEs5hqXvbsxK3Od9xxP84cqOjWtT+EOj4STgbIAdU1qUhgwMeNaHx uTgIe77A+bG7ePGCR6KkIWIaoibZKbiUaFX4Y= 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=lLU/eOvsJEwofdhQA9a1CPYCxnXFpdGImtY2uBZd74U=; b=CK4iXdf1UqikLteyigo6tEPmRjE+UJi4rfNaOvvEp9k2AEvnQxlcZ1ttzt7GJFcGFk bLPM9jEPCDXJIHaUD2QOLQezq0WLcFQi2FoWB1Q3w0upcjprZm86qqVC6JDdFkfJCG/T +3EaOwbH7vlRvn/bPdpUEPGEx88dW6Z3wRZdfK41L5+F4TS9yKM7bIgmt8jWIfH5pPt/ nqEU9zH3kKh1CwSnWcvAPXPkyVnfpc9FLX5c4WGidbLJiT9R43t6gtmK+bC49hFEMcxe F9o1CEhKi1R/qf9eH2LBD+QuE2w3SddkkOhh2aEf5q6G9FWoDTKSTcdEOA4ymnSuNNMR 02HQ== X-Gm-Message-State: AD7BkJK3+ks6QMdNMWYwpuGcVz5Wy6I2qxNW20GboE4yv4qcWGjmnQJwnExztD+ULzPkoROG X-Received: by 10.194.249.42 with SMTP id yr10mr17137472wjc.12.1458319680716; Fri, 18 Mar 2016 09:48:00 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id c71sm118646wmd.4.2016.03.18.09.47.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Mar 2016 09:47:59 -0700 (PDT) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, catalin.marinas@arm.com, will.deacon@arm.com, linux@arm.linux.org.uk, pjones@redhat.com, dh.herrmann@gmail.com Cc: leif.lindholm@linaro.org, mark.rutland@arm.com, x86@kernel.org, Ard Biesheuvel Subject: [PATCH v2 5/9] efi/arm64: libstub: make screen_info accessible to the UEFI stub Date: Fri, 18 Mar 2016 17:47:37 +0100 Message-Id: <1458319661-19762-6-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458319661-19762-1-git-send-email-ard.biesheuvel@linaro.org> References: <1458319661-19762-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.5.0 diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index bb26f2205973..ed6c85d3a583 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -54,6 +54,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 b6abc852f2a1..6f4b3ea359db 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -17,6 +17,9 @@ #include +/* 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; 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