From patchwork Mon Apr 25 20:07:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 66617 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1233529qge; Mon, 25 Apr 2016 13:09:03 -0700 (PDT) X-Received: by 10.66.118.7 with SMTP id ki7mr51464658pab.152.1461614943342; Mon, 25 Apr 2016 13:09:03 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si4466552pfi.174.2016.04.25.13.09.03; Mon, 25 Apr 2016 13:09:03 -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 S965154AbcDYUIr (ORCPT + 29 others); Mon, 25 Apr 2016 16:08:47 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:36501 "EHLO mail-wm0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933534AbcDYUIb (ORCPT ); Mon, 25 Apr 2016 16:08:31 -0400 Received: by mail-wm0-f41.google.com with SMTP id v188so111857720wme.1 for ; Mon, 25 Apr 2016 13:08:30 -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=BH1dD44irByqxx+cbGVBqx8s/1AX9qge5alANJSWXY0=; b=yfK68f4ep8+WmKvDrF8g+zwggBV2A99NSn2UyhRRz9nlX70NRpLjinZCB7SQOJfGmE TisgRrpzScRq3+94x7wE8O6EGrW+JzPFHOin6yYPESgNKRwNFCN3FpaY8vXDOTJk6ZRR 9qmYt/trRJZ5Qf5YC0lnmulF8VeUu0Ls72DLajOleDLtW8F1V+VT7k39vtgovWkmk337 o7FqM2Ps6W8TVqpZLce81uxvg8y/gHF4iGYERpnJwufj1Z/id33Op1Zrn6Dfgn3Q7QnG 6E4in0hoLYaWdWN8MLPOMTY8P3btDjsZwyc8xZdNOkdEjAW3uRowi1e/Mc9bjpuy6MNF iNCA== 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=BH1dD44irByqxx+cbGVBqx8s/1AX9qge5alANJSWXY0=; b=KR4ajODTPrISVklXFAZeRmLkjizPxjboPmk9uLFTI/POgXi9NZ1KlB8n/5sz0sJA9R f8UYIagSiFWsANFZKwge3TqxNKrOFfpxr0Dw/Nso+IABgPniYJeAp15B7U+BaFOUh5cQ lnjVB/FPNulBI1xqhhPo/HE12TZ5ttKyUuUDUzMDnc6aJqFbbxnwv8kG28UITE5sPRs+ 32cNHF94Oit3hOfCl2eXLp0fUUSsFcQ+9mV+6pfgehPCwPLOZvTFSIVdEnKaxDr5SaEz XH/VUQFpB72VQRJTN8iMmgTyVcHPL7Du72t4xc5rFWxTvgzX69LxcpFibLM6KRSQMs31 AlJw== X-Gm-Message-State: AOPr4FXM9ZI/utLydhLV9pfV/qvhmsbkgSbELYMoeTquNRJWd25BKOD7HQOAMW2E1qfM1g== X-Received: by 10.28.130.133 with SMTP id e127mr15248577wmd.48.1461614909943; Mon, 25 Apr 2016 13:08:29 -0700 (PDT) Received: from localhost (bcdc58e5.skybroadband.com. [188.220.88.229]) by smtp.gmail.com with ESMTPSA id m14sm20338516wmc.4.2016.04.25.13.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Apr 2016 13:08:29 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Mark Rutland , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Ben Hutchings , Catalin Marinas , Christoph Hellwig , Darren Hart , David Herrmann , David Howells , Greg KH , Hannes Reinecke , Ingo Molnar , James Bottomley , Kweh Hock Leong , Leif Lindholm , Peter Jones , Peter Zijlstra , Raphael Hertzog , Russell King , Will Deacon Subject: [PATCH 39/40] x86/efi: Enable runtime call flag checking Date: Mon, 25 Apr 2016 21:07:11 +0100 Message-Id: <1461614832-17633-40-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: Mark Rutland Define ARCH_EFI_IRQ_FLAGS_MASK for x86, which will enable the generic runtime wrapper code to detect when firmware erroneously modifies flags over a runtime services function call. For x86 (both 32-bit and 64-bit), we only need check the interrupt flag. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Catalin Marinas Cc: Leif Lindholm Cc: Russell King Cc: Will Deacon Cc: Greg KH Cc: James Bottomley Cc: David Howells Cc: Harald Hoyer harald@redhat.com Cc: Kweh Hock Leong Cc: Christoph Hellwig Cc: Hannes Reinecke Cc: Raphael Hertzog Cc: Ben Hutchings Cc: David Herrmann Cc: Darren Hart Cc: Peter Zijlstra Cc: Peter Jones Signed-off-by: Matt Fleming --- arch/x86/include/asm/efi.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.3 diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index fb085ce00bd2..78d1e7467eae 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -3,6 +3,7 @@ #include #include +#include #include /* @@ -28,8 +29,9 @@ #define MAX_CMDLINE_ADDRESS UINT_MAX -#ifdef CONFIG_X86_32 +#define ARCH_EFI_IRQ_FLAGS_MASK X86_EFLAGS_IF +#ifdef CONFIG_X86_32 extern unsigned long asmlinkage efi_call_phys(void *, ...);