From patchwork Mon Jun 23 14:18:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 32365 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3BAF7203AC for ; Mon, 23 Jun 2014 14:20:32 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf22156309qcq.4 for ; Mon, 23 Jun 2014 07:20:32 -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:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=7A0a1Yx1IWpbP7sMAKq/IXEgqQw/eJ3aGJhZy9WwXqU=; b=YstGyWQWHgxGmAIa6gJFDKOOuguobtatdamq++V/CRwB23xm2sOSOkJTkJDKKwHro2 oy3iQQMBUEu9bqOjq5nPb2SyN/pDiXOkKiqvNkzzVLK49z2GFrEIqC7Kt/q/kIzYC1I7 KtXCgUy4k9S+ojzTfW5JFt0qGTg8LBMU4ISTC2yk3dqZd432k64Koj2Mtd2cyzQQycxi 3G2zWLLAtvJUPdo7/Feb2YYMLMfA9U4Ch6X1quCR5brvjahSQ7yKPgCs7PDGa1XNVO4E 9t+n3UEl5B7+pPYHNYVpZ0BnTN46u+2q/zyo5eOZPrvmn/Q+2YfsiLw8kohSyEhZPxLt nVNw== X-Gm-Message-State: ALoCoQk90GYOewyHhT1c0MBmZ59x/YHyFNKIOvwzwn80DjbZXZlz1UWRhQwVb6cKD5mzHvguXttj X-Received: by 10.224.41.74 with SMTP id n10mr9645210qae.1.1403533231923; Mon, 23 Jun 2014 07:20:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.112 with SMTP id n103ls1860332qga.86.gmail; Mon, 23 Jun 2014 07:20:31 -0700 (PDT) X-Received: by 10.52.233.9 with SMTP id ts9mr430705vdc.96.1403533231816; Mon, 23 Jun 2014 07:20:31 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id s2si3295435vew.76.2014.06.23.07.20.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 07:20:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.175 as permitted sender) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id jx11so6152718veb.6 for ; Mon, 23 Jun 2014 07:20:31 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr1173793vca.45.1403533231697; Mon, 23 Jun 2014 07:20:31 -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.221.37.5 with SMTP id tc5csp134173vcb; Mon, 23 Jun 2014 07:20:31 -0700 (PDT) X-Received: by 10.140.51.175 with SMTP id u44mr16044931qga.69.1403533231185; Mon, 23 Jun 2014 07:20:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id k10si6972997qaz.103.2014.06.23.07.20.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2014 07:20:31 -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 1Wz55e-00052q-CQ; Mon, 23 Jun 2014 14:19:22 +0000 Received: from mail-wi0-f174.google.com ([209.85.212.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wz55G-0004mj-1f for linux-arm-kernel@lists.infradead.org; Mon, 23 Jun 2014 14:19:00 +0000 Received: by mail-wi0-f174.google.com with SMTP id bs8so4360634wib.13 for ; Mon, 23 Jun 2014 07:18:31 -0700 (PDT) X-Received: by 10.180.207.9 with SMTP id ls9mr26451688wic.32.1403533110807; Mon, 23 Jun 2014 07:18:30 -0700 (PDT) Received: from ards-macbook-pro.local ([109.114.69.166]) by mx.google.com with ESMTPSA id ht5sm36595999wjb.49.2014.06.23.07.18.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 07:18:30 -0700 (PDT) From: Ard Biesheuvel To: matt.fleming@intel.com, x86@kernel.org Subject: [PATCH 2/2] efi/arm64: preserve NEON registers on UEFI runtime services calls Date: Mon, 23 Jun 2014 16:18:15 +0200 Message-Id: <1403533095-2611-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1403533095-2611-1-git-send-email-ard.biesheuvel@linaro.org> References: <1403533095-2611-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140623_071858_289838_F0FD203E X-CRM114-Status: GOOD ( 10.94 ) 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 [209.85.212.174 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.174 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: marksalter@redhat.com, linux-efi@vger.kernel.org, Ard Biesheuvel , catalin.marinas@arm.com, leif.lindholm@linaro.org, roy.franz@linaro.org, hpa@zytor.com, linux-arm-kernel@lists.infradead.org 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.128.175 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 UEFI Runtime Services function calls may clobber the contents of the NEON register file, so we need to make sure that we preserve/restore them when performing such a function call. Signed-off-by: Ard Biesheuvel --- arch/arm64/include/asm/efi.h | 21 +++++++++++++++++++++ arch/arm64/kernel/efi.c | 14 +------------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index 5a46c4e7f539..375ba342dca6 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -2,6 +2,7 @@ #define _ASM_EFI_H #include +#include #ifdef CONFIG_EFI extern void efi_init(void); @@ -11,4 +12,24 @@ extern void efi_idmap_init(void); #define efi_idmap_init() #endif +#define efi_call_virt(f, ...) \ +({ \ + efi_##f##_t *__f = efi.systab->runtime->f; \ + efi_status_t __s; \ + \ + kernel_neon_begin(); \ + __s = __f(__VA_ARGS__); \ + kernel_neon_end(); \ + __s; \ +}) + +#define __efi_call_virt(f, ...) \ +({ \ + efi_##f##_t *__f = efi.systab->runtime->f; \ + \ + kernel_neon_begin(); \ + __f(__VA_ARGS__); \ + kernel_neon_end(); \ +}) + #endif /* _ASM_EFI_H */ diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 14db1f6e8d7f..56c3327bbf79 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -449,19 +449,7 @@ static int __init arm64_enter_virtual_mode(void) /* Set up runtime services function pointers */ runtime = efi.systab->runtime; - efi.get_time = runtime->get_time; - efi.set_time = runtime->set_time; - efi.get_wakeup_time = runtime->get_wakeup_time; - efi.set_wakeup_time = runtime->set_wakeup_time; - efi.get_variable = runtime->get_variable; - efi.get_next_variable = runtime->get_next_variable; - efi.set_variable = runtime->set_variable; - efi.query_variable_info = runtime->query_variable_info; - efi.update_capsule = runtime->update_capsule; - efi.query_capsule_caps = runtime->query_capsule_caps; - efi.get_next_high_mono_count = runtime->get_next_high_mono_count; - efi.reset_system = runtime->reset_system; - + efi_native_runtime_setup(); set_bit(EFI_RUNTIME_SERVICES, &efi.flags); return 0;