From patchwork Thu Mar 8 08:00:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130978 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6177766lja; Thu, 8 Mar 2018 00:05:13 -0800 (PST) X-Google-Smtp-Source: AG47ELtYnqyA9P8I4XAcMZkvVFDSBQRKSGssKfs0iFyGHNv4IXT6y8YgOQ8SmcyIzinbQ1FUabyu X-Received: by 2002:a17:902:ab91:: with SMTP id f17-v6mr12885397plr.114.1520496313056; Thu, 08 Mar 2018 00:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496313; cv=none; d=google.com; s=arc-20160816; b=CiotJvx2M3/EuBnIc+UWC6a2ZP8mxh8C6SaiquiURYuUSbwAteP3Mu1RdxKMm676U0 2XABwBqqrMGOk40oQOM/O62ek7NZQecEtaox5/0Md+9M44hlHqhiM7uoQV0ypjZipqHM 7gqFCevoFTcpbD8UDwPc+ayvJPDh+iA5D6Z/MhtgSM0nZBruOMaD2UUGAOBB9xbMGTbW kgx0EDyIw2+IUEiJhlzwHyU71dDc3JeSVEot6EkItGoPqTit5vFTDfp6L5020viCJnI5 w5VuCbLD7Tm6fwnuwaSnx4Tfj0rOXnTX748vQ/9mmQ1tqTmXUV0MA3o9JzMRX/pmLnJ7 5imw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=obciHh3d5Hc4X+duCPF5C7EdnBElRJnu5alRW+0c53s=; b=VOxJ21D9ak1VlFwTpNOy43HWwb/jsadzRbZfeMqK6RiTkqs/og0MTlpDobn8A2j2X6 L1Wh4Nge8ajJMGTtBUkbRM9lRJbAvNvbIFlYDKQEOp4g/EjBkXCB8lFdieDVd2tzKsfk XZ8t/94T1Vpa+WuApFV33eGsYJ7JVx5D0+oc3ye4xMa2FVUjYvrC4nwRguHsJpBW6JLh oUBQfA9bsfhkRyldYCOFqm/d1An7fFlqX85yjgPiLVsmlepLlERPmnGd9taB7YH03Z2X TsytgFGWJOXcu0Si8TNA8atf0wKY8insofqiDlidTp66reunus/bikbn1wgcS0zZBz82 ScvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PD53cVkF; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8-v6si14513041plh.219.2018.03.08.00.05.12; Thu, 08 Mar 2018 00:05:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=PD53cVkF; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935525AbeCHIB5 (ORCPT + 2 others); Thu, 8 Mar 2018 03:01:57 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:32825 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964971AbeCHIB4 (ORCPT ); Thu, 8 Mar 2018 03:01:56 -0500 Received: by mail-wm0-f68.google.com with SMTP id s206so26129687wme.0 for ; Thu, 08 Mar 2018 00:01:56 -0800 (PST) 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=MO+bfvGDZOQjAlt1G5SDVIXTGY7SP8MqWMcb+HyUtwA=; b=PD53cVkFikR/fBSKcXHztM05EquYHeOTozzou3OroK4X0TH16XcD7GVii7QRrCyU0s +VKYCvDsot6h4rcHfSw+ZWUTtwuAmd8TXUXazm+LQ0I+f+yiVLgPpCd8TX8gRSqh4pAd gppEtAtPNFL2SOP/gvf3Ywihay+ODJ/ywBl8g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=MO+bfvGDZOQjAlt1G5SDVIXTGY7SP8MqWMcb+HyUtwA=; b=Qi0zi4tEE5cDDqKfVf0Le9y9uJ7ceGGsmnnCQQ4kH98+aywjPsdAI/rPgV9YvbKTG+ Wz6UDcPM8yMpv8PRQC0cAoZHCik30CJDK71hG9Vt5kgH6RrFgmC4dvDi/4pRd2bLjD2v TVzLe9ufPua9oSMTLTWdWCAewr83qKf/raFHecHoeGeQvS0o+oNlfQDvAc4w+ls20RSq BebMWIUHutPoP65aPj/Lk8du4cCg05Iyqd1wuMaGG5wnIERllhrR+S3p0UtiOAR4OS93 6DMtNnjIkj+z5Y+aTJ/ggj/JCOTx7gmeWTebA+51FCYMd7AwdrzKSICWd41s180QAxxQ orDA== X-Gm-Message-State: AElRT7HM/XiARMShnbFu21IxohT32WWuFlOpeFn9DwMzzEb1Y5Va3n09 nwNjkLK8b4LrW/bpO8IaemaPPOOFgrE= X-Received: by 10.28.35.14 with SMTP id j14mr15097861wmj.43.1520496115187; Thu, 08 Mar 2018 00:01:55 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.01.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:01:54 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Andy Shevchenko , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 02/12] efi/apple-properties: Device core takes care of empty properties Date: Thu, 8 Mar 2018 08:00:10 +0000 Message-Id: <20180308080020.22828-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Andy Shevchenko There is no need to artificially supply a property length and fake data if property has type of boolean. Remove redundant piece of data and code. Signed-off-by: Andy Shevchenko Reviewed-and-tested-by: Lukas Wunner Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/apple-properties.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c index 9f6bcf173b0e..b9602e0d7b50 100644 --- a/drivers/firmware/efi/apple-properties.c +++ b/drivers/firmware/efi/apple-properties.c @@ -52,8 +52,6 @@ struct properties_header { struct dev_header dev_header[0]; }; -static u8 one __initdata = 1; - static void __init unmarshal_key_value_pairs(struct dev_header *dev_header, struct device *dev, void *ptr, struct property_entry entry[]) @@ -95,14 +93,9 @@ static void __init unmarshal_key_value_pairs(struct dev_header *dev_header, key_len - sizeof(key_len)); entry[i].name = key; - entry[i].is_array = true; entry[i].length = val_len - sizeof(val_len); + entry[i].is_array = !!entry[i].length; entry[i].pointer.raw_data = ptr + key_len + sizeof(val_len); - if (!entry[i].length) { - /* driver core doesn't accept empty properties */ - entry[i].length = 1; - entry[i].pointer.raw_data = &one; - } if (dump_properties) { dev_info(dev, "property: %s\n", entry[i].name); From patchwork Thu Mar 8 08:00:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130968 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6174842lja; Thu, 8 Mar 2018 00:02:06 -0800 (PST) X-Google-Smtp-Source: AG47ELsAuyhl4tZZo/TnlRZwFbzNAyNy5kOH+GSvGgYBGz/vITzVCVNMJHGcwVJoxiDhs703rIw/ X-Received: by 10.98.200.131 with SMTP id i3mr25645958pfk.40.1520496125784; Thu, 08 Mar 2018 00:02:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496125; cv=none; d=google.com; s=arc-20160816; b=Bsxr/vx/8lWen2HuyotavsCniGXAcg/F9/cah3BDfJeV6iC5qAe6z9xk6YLTzQ4M9y 6UjcmN+jnE4mz3ViMxl8UqigOfrpt6Kygt+vHRHJXyYBjtVEaXwHAx5XySjUBOg2RZN3 6euSUN5eo9fm+plhMWvhh6tzSdU1YG1IFmuCopH9gRXBpzKNJrjcR1OuCngem6m5ujha fxmsJ/qjvnhJPo/Zq8h1ecAQj/ldwgWyZJEFryG+sW4s2+lKltKlQ6DdmPv9nwHG1xzd 2gr8m3N0yLs4gdnP7NYVSjbSSMFK7a0hdCTHnFy0LSftFJamTEUuuaXf65sG+oupjp00 i8Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VUhVHISegwgY/azHU7r74dfhaPsMuwVLazlZnmpo6E0=; b=izvije7RlmIaq35JeLjB44p0nSPfuZgu98pD3cCcRhlkfVv4tCftA2TimzftyKyujc NnC9mu1eiPcSnEbbDSDHC6GRQEVv9nNGsBREUWs02ahuVsFD/ikjZwqx5spfNzwX2DXi UMKVs41GSNDBJ1NTH/rzQHIZPuldv2ps5FM0VRobWs/1m7GXtg3Foac5rLdqqvmAF95c JzDPl61Y70Z0UlLcqL95K+//x+P97l6GKI3vsxNs3BmFuHbXlKsxEpAblN9iJmKQst1q /l3+PYW2QRMYq4wENzqxROCcka+VcngzqdkXWDhDaTQdyHM2RRc1NNczWLnIoRX1xZGc k5Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P3QkZ2dQ; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2si12662799pgf.530.2018.03.08.00.02.05; Thu, 08 Mar 2018 00:02:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P3QkZ2dQ; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965237AbeCHICE (ORCPT + 2 others); Thu, 8 Mar 2018 03:02:04 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36320 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965160AbeCHICB (ORCPT ); Thu, 8 Mar 2018 03:02:01 -0500 Received: by mail-wr0-f194.google.com with SMTP id v111so4681306wrb.3 for ; Thu, 08 Mar 2018 00:02:01 -0800 (PST) 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=mr5Ft6RA5tfYTWD2o/zCyOmLHc2gwlAVMFKmmC4FOAE=; b=P3QkZ2dQZG9yRMz0bgmW0vWCRz0Xx1ufLYIEKulCSGXYN75BMjPDlPoay7/tcqL9Qm LoxZjPX7G/YYkkJlMClcYyIelka48GzIwTTfDF/IuB013BO7tt8MhsvW5n5tADmTixdV 7KtrLPhU76IiPiX8r+dn2BFKIL/ZMPOhQEjVY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mr5Ft6RA5tfYTWD2o/zCyOmLHc2gwlAVMFKmmC4FOAE=; b=oNwIPA/6jW80myQXYobeUvAnTDVxV+cQ+6lbSx6msuLg7giq3G/CKxuezEETwiYDw8 g7z8ml+nfFkCT/wTtvm76qkDG7UMN4HzIo5+HpkEcit1XNaRNq2T6eGcp3E+/410U69J JV7hfCvzqollNu6RrF6cMIhufcynsLi3D40wZK7uBaSTLN/GIbRQ2tx4nipsmk2vIuHO 7BumX2CTQR+Q1tyLUKHSAlXtlMEH6aA/x8bwRxMY34GpK413D5zpZGh5m5k2hQdm6XF4 StxYBPz8FlFKChiTdhHxNejVWBK9hU9feeGEvE+BVUpfRRtgvQGnemcAzFk5LNYVTkEN kwxg== X-Gm-Message-State: APf1xPBM2LX6KvHflLx85R7TOS7SlJdLpqsrneCNRNm8P+l7RVv2WtMk /lgSMeSLZeVXVZDad8uki81hwRt4Fw4= X-Received: by 10.223.166.135 with SMTP id t7mr20851279wrc.260.1520496120066; Thu, 08 Mar 2018 00:02:00 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.01.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:01:58 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Luis de Bethencourt , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 04/12] efi/x86: Fix trailing semicolons Date: Thu, 8 Mar 2018 08:00:12 +0000 Message-Id: <20180308080020.22828-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Luis de Bethencourt The trailing semicolon is an empty statement that does no operation. Removing them since they don't do anything. Signed-off-by: Luis de Bethencourt Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/eboot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 353e20c3f114..886a9115af62 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -439,7 +439,7 @@ setup_uga32(void **uga_handle, unsigned long size, u32 *width, u32 *height) struct efi_uga_draw_protocol *uga = NULL, *first_uga; efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; unsigned long nr_ugas; - u32 *handles = (u32 *)uga_handle;; + u32 *handles = (u32 *)uga_handle; efi_status_t status = EFI_INVALID_PARAMETER; int i; @@ -484,7 +484,7 @@ setup_uga64(void **uga_handle, unsigned long size, u32 *width, u32 *height) struct efi_uga_draw_protocol *uga = NULL, *first_uga; efi_guid_t uga_proto = EFI_UGA_PROTOCOL_GUID; unsigned long nr_ugas; - u64 *handles = (u64 *)uga_handle;; + u64 *handles = (u64 *)uga_handle; efi_status_t status = EFI_INVALID_PARAMETER; int i; From patchwork Thu Mar 8 08:00:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130976 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6176662lja; Thu, 8 Mar 2018 00:04:05 -0800 (PST) X-Google-Smtp-Source: AG47ELv9SOI5wsdTfiZmmf+OCo51RCf/ui4wWXAenj7YMxhK8vo/6Y1nWgvbC5IUvNRXeRU8uxrP X-Received: by 10.99.173.79 with SMTP id y15mr20341381pgo.136.1520496245013; Thu, 08 Mar 2018 00:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496245; cv=none; d=google.com; s=arc-20160816; b=WD0T5wUuW0CFmPIca9PCrrNvSAfbiwok+lX4F5BRz7iywKBI4PhUexCL7CFjjn4ogd hAqZkK1mYnDApz70DFhASPPBdSaWQE40Z5svHEXof/Uoc/ELvxOu2KlhYFDz9VsiWn/X QOWZAdbmR2/n2lyFnS8m2PV9FjxFXf1ofotu8ckXbs7E6yTyQcU/QQcwKKyu0Mcv+SmP sjTFnltQscg6jpbSAPCf8NyfLeeYaCtGZ0G0CHZZTDdB9UAnqDHPsjTy7sEuEN+Bu6uD Gva45w4Wq/OmNK/lzaRo8caWXO7xSc4RPJiIrVrrIgEn2IvmBJ6rh6Cp47cGvws4iQKI yE/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=MRLim3ZkIfbDgyR1+KCSDkYZPlgoQqYoYVCXNi6qz1g=; b=WfbsZw9vNxIGMNIARM0xaQ71tu+RUgmd3SV+2zXU5X2O9JTvMMIP2TglAyz/DyE6qO GWrPSCm0gwn1j4eoMKlUYwMyHxR0ISc7RB95lrMfQedNHf7gIOZAaf4DliEjsQO25t0P 3gMwrQsvyJnTIloJyf8nIid9XlruFllaLxD+BxSfEEa0brcDUFRCpuXu4cfqfQlFOfx7 U8shdf0qbJ+2rdAokdejUa+AG86LmRrkuykHFbK4kardRY1zCxQN17OKve410y/tZaDP kDu92aRo48LQgXGaf+VKzgc0yW6mS1Nx5XoasJZ2VaQO+WIzqQi21hYCGGpiNm+TfqnM XzVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LT/WNNYL; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h11si12597573pgq.28.2018.03.08.00.04.04; Thu, 08 Mar 2018 00:04:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LT/WNNYL; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965446AbeCHICN (ORCPT + 2 others); Thu, 8 Mar 2018 03:02:13 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:39598 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965298AbeCHICG (ORCPT ); Thu, 8 Mar 2018 03:02:06 -0500 Received: by mail-wr0-f196.google.com with SMTP id w77so4670754wrc.6 for ; Thu, 08 Mar 2018 00:02:06 -0800 (PST) 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=bfSGqmiQjjK1wgLQG8o9oc0lbvhcCoXxBgjjKuFI7yc=; b=LT/WNNYL9zqtovW+Kpl/sZGZIstlQaN3ReLl38itTPiX1txro58L6+TibF5TPRXAWf RrR32ROowziGwNDdmZ3iLeyxNpj1l26lnwAbMxU455Svr9jlAs4PTiT57xsrHUdI8kTC qPkgfrUBzvkb3esGcMnRgbko0e97E0ihc70Mk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bfSGqmiQjjK1wgLQG8o9oc0lbvhcCoXxBgjjKuFI7yc=; b=cBsvVj6pMW4b/qrTB6gyIbh/gyAdlGbFhv8uka1aeWMldxQJ/gK8RUjbdnqpR0g20T qJ6rHY1l7iRL0lcKEkbIzUcD5jcI3rAjaSd+MnfDPX7VvoCq6vWW7by8303cKXSKXpEn 0YStI3RPV1M4aTfzJ1jJo90oZZMDSzO7+Vk4OjC/Xu0ZmHZvuJO35ZTC+03W5GJ5P+i3 cytj2a1WWgqptlOGEIXZziMs7rhHHARrN00C+OHtn9yag+wTQDNEFW048VbrWC2BIspZ NJbJtMg1XVkEeMkKVum7UE9ZHjDCon6H23wuBAX9YPVko1AmFmG9Z2tftUtAO1Jk4UmM S/4w== X-Gm-Message-State: APf1xPDN+uTrD6ZO/ee/6Y2WeOs9CZb18YBMcdh3cVFDddbYK0VNI2y+ /Rv5UsferGp2/mYs1pvEBBryezBm17E= X-Received: by 10.223.195.147 with SMTP id p19mr22742403wrf.224.1520496125031; Thu, 08 Mar 2018 00:02:05 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.02.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:02:03 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Jia-Ju Bai , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 06/12] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store Date: Thu, 8 Mar 2018 08:00:14 +0000 Message-Id: <20180308080020.22828-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Jia-Ju Bai The function kzalloc here is not called in atomic context. If nonblocking in efi_query_variable_store is true, namely it is in atomic context, efi_query_variable_store will return before this kzalloc is called. Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai Reviewed-by: Ingo Molnar Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index 5b513ccffde4..1ef11c26f79b 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -177,7 +177,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size, * that by attempting to use more space than is available. */ unsigned long dummy_size = remaining_size + 1024; - void *dummy = kzalloc(dummy_size, GFP_ATOMIC); + void *dummy = kzalloc(dummy_size, GFP_KERNEL); if (!dummy) return EFI_OUT_OF_RESOURCES; From patchwork Thu Mar 8 08:00:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130971 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6175035lja; Thu, 8 Mar 2018 00:02:20 -0800 (PST) X-Google-Smtp-Source: AG47ELurlnyZ6/HMkPc+3aqsDuMMT332RD4yPmxcMgLXbuZ+djFt3zXcR3RbihKNgcQ7eQkF+dso X-Received: by 10.101.102.21 with SMTP id w21mr21106344pgv.247.1520496140150; Thu, 08 Mar 2018 00:02:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496140; cv=none; d=google.com; s=arc-20160816; b=Ctr5cUz1is1ag7PuNueDPMtGP0809BrE8z0sw7OZPIOUJscwcRHbyPibAtWR0709dQ k4lxb75uSjwEVQlh/YUA3ofz6z7vZVq2tsCoGt7m0S/SFUTWt2H+aiLWerveWvZWk7ty lwL9EyJW2BD027rL36CF0svmNqEDq7RPRhIzw3Y6m6Sujwpeo6U3jo79ej+t2EbinkMJ 3K0UgtE9k4/WBNwB+BDp43kHNBXmOAjssVTy7i5/4EJpl7SS3ANzyxmD0LQ7JX9c0kje 71mlppoysfiLZim0PeBYhbrC5pyi6fcvxOR3FOTtLAsVMPmJzvoWXjw3wLOG2J7jsWIt jMiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Z5noG1Pz8bHSORdqMFYJR7ecnbEzJGGDdzA2OMLi/EI=; b=cfP8q+MeAV0mfURXmFiGZKGUwmI0WjyK1FjdOzsxwb4YMvqpdexSW0YONp6qqKVKiO s+18BAfIp30UCrtbHdd62VHnBngoB2zZpz/VrfxWNPVLzn3Omf8iqHWWvI+9t/thuRWM m+4CEdGkYMCzaJe1NcOsT89OdQoVdpfJKdJZA8vBLhjstVV6nzdNzuxIOBiLXP9P1YRZ tPrEDVnIyBnYx3ljjJNR6hrEp+XosTtBToCoCrA10H1M+AImp5IURhMGs+Xrp/u4YqWd 2GMpNrixTVmW27WO3CjHw+TXbBmrCxJSg1mzFkmpJdEtC9i6hmF0bxVYPuEV2IO1EYH2 LKNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q/+XPkpi; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si12462852pgv.121.2018.03.08.00.02.19; Thu, 08 Mar 2018 00:02:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Q/+XPkpi; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965513AbeCHICQ (ORCPT + 2 others); Thu, 8 Mar 2018 03:02:16 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:56214 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965379AbeCHICN (ORCPT ); Thu, 8 Mar 2018 03:02:13 -0500 Received: by mail-wm0-f65.google.com with SMTP id q83so9504578wme.5 for ; Thu, 08 Mar 2018 00:02:13 -0800 (PST) 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=FsGL2UN03rY/SFjoYK6O3R2gchi1rSfwLQrQv4evXYE=; b=Q/+XPkpilVwdFZ1Vdhfx4LIKdxwrzfD7yLvBknwXbFud8HSXsrMqk1o0Xe9ijzNlTs RZ6BXbYL9qB9BUxtiG+wjBSjDWaa8LKRF4x5Go+W7SzemaLhDnOCooQG+sk3x7M1r0CR U9uWv17aCtxK9cFgvHLZTacceP2aTv++sJPtg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FsGL2UN03rY/SFjoYK6O3R2gchi1rSfwLQrQv4evXYE=; b=b9ORDC9LzjYJm2Ecaxyh+qXxTft7n3Xp5QGlknY921SK3TaBcJcHldTb2byQarQH6/ zkzpNa/+oEXlXtbWJBcLrlw2VMgU1HkXhf+HfcVN4y8qHeNocghsL3JjrFIjfMvKh9nt +gRx0THuHW2/oS0aE7aW//Jydl8a/4nvEg4YdcblmLjKWAPCUhIPHLQaxJ8T4NqnqTey HTHzotJHU3cwVvWm7LpAyKMB3wkIn1RyxJbZpUzwYiPUK5ucfTpLCaxCp4FawkfWrx0V 48lOO0IfJoYUxs67zgDow0d2eFjLGK063sx9NK0IuZRoQJ8N4jQoL65x/DydXMC9JzJv JSKw== X-Gm-Message-State: AElRT7HIUPhvhQtvAIDJSIjGfLKNpkIH5mhiC9fGB7asqCxxUWctUdu9 MF5VDF6gofXu3pnS/rT2B4eoWFlG4ZM= X-Received: by 10.28.118.20 with SMTP id r20mr7109451wmc.145.1520496131916; Thu, 08 Mar 2018 00:02:11 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:02:11 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Sai Praneeth , Ard Biesheuvel , linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Borislav Petkov , Tony Luck , Andy Lutomirski , "Michael S . Tsirkin" , Bhupesh Sharma , Ricardo Neri , Ravi Shankar Subject: [PATCH 08/12] x86/efi: Replace efi_pgd with efi_mm.pgd Date: Thu, 8 Mar 2018 08:00:16 +0000 Message-Id: <20180308080020.22828-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Sai Praneeth Since the previous patch added support for efi_mm, let's handle efi_pgd through efi_mm and remove global variable efi_pgd. Signed-off-by: Sai Praneeth Prakhya Cc: "Lee, Chun-Yi" Cc: Borislav Petkov Cc: Tony Luck Cc: Andy Lutomirski Cc: Michael S. Tsirkin Cc: Bhupesh Sharma Cc: Ricardo Neri Cc: Ravi Shankar Tested-by: Bhupesh Sharma Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/efi_64.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index 0045efe9947b..8881e601c32d 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c @@ -190,8 +190,6 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) early_code_mapping_set_exec(0); } -static pgd_t *efi_pgd; - /* * We need our own copy of the higher levels of the page tables * because we want to avoid inserting EFI region mappings (EFI_VA_END @@ -203,7 +201,7 @@ static pgd_t *efi_pgd; */ int __init efi_alloc_page_tables(void) { - pgd_t *pgd; + pgd_t *pgd, *efi_pgd; p4d_t *p4d; pud_t *pud; gfp_t gfp_mask; @@ -231,6 +229,7 @@ int __init efi_alloc_page_tables(void) return -ENOMEM; } + efi_mm.pgd = efi_pgd; mm_init_cpumask(&efi_mm); init_new_context(NULL, &efi_mm); @@ -246,6 +245,7 @@ void efi_sync_low_kernel_mappings(void) pgd_t *pgd_k, *pgd_efi; p4d_t *p4d_k, *p4d_efi; pud_t *pud_k, *pud_efi; + pgd_t *efi_pgd = efi_mm.pgd; if (efi_enabled(EFI_OLD_MEMMAP)) return; @@ -339,7 +339,7 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) unsigned long pfn, text, pf; struct page *page; unsigned npages; - pgd_t *pgd; + pgd_t *pgd = efi_mm.pgd; if (efi_enabled(EFI_OLD_MEMMAP)) return 0; @@ -349,8 +349,7 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages) * this value is loaded into cr3 the PGD will be decrypted during * the pagetable walk. */ - efi_scratch.efi_pgt = (pgd_t *)__sme_pa(efi_pgd); - pgd = efi_pgd; + efi_scratch.efi_pgt = (pgd_t *)__sme_pa(pgd); /* * It can happen that the physical address of new_memmap lands in memory @@ -420,7 +419,7 @@ static void __init __map_region(efi_memory_desc_t *md, u64 va) { unsigned long flags = _PAGE_RW; unsigned long pfn; - pgd_t *pgd = efi_pgd; + pgd_t *pgd = efi_mm.pgd; if (!(md->attribute & EFI_MEMORY_WB)) flags |= _PAGE_PCD; @@ -524,7 +523,7 @@ void __init parse_efi_setup(u64 phys_addr, u32 data_len) static int __init efi_update_mappings(efi_memory_desc_t *md, unsigned long pf) { unsigned long pfn; - pgd_t *pgd = efi_pgd; + pgd_t *pgd = efi_mm.pgd; int err1, err2; /* Update the 1:1 mapping */ @@ -621,7 +620,7 @@ void __init efi_dump_pagetable(void) if (efi_enabled(EFI_OLD_MEMMAP)) ptdump_walk_pgd_level(NULL, swapper_pg_dir); else - ptdump_walk_pgd_level(NULL, efi_pgd); + ptdump_walk_pgd_level(NULL, efi_mm.pgd); #endif } From patchwork Thu Mar 8 08:00:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130974 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6175471lja; Thu, 8 Mar 2018 00:02:49 -0800 (PST) X-Google-Smtp-Source: AG47ELsiNHIVnUZtSEkBaTTMWXkmVlVQG5djJdCxkgALwZPvlPdUg6Ik7K49U7qfg7cKU9XGEwSG X-Received: by 10.99.117.24 with SMTP id q24mr20233397pgc.53.1520496169512; Thu, 08 Mar 2018 00:02:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496169; cv=none; d=google.com; s=arc-20160816; b=HRmeZpiSd1FJ1TVqv8didMMrt6K4jf3d2aMYPNta3QJ4jZOinr4eyg2/X39T8fPjYq cG4wiAS09bozpqYwqHDMXdH7xz8h7PS6ed1G+37S/RxQETSUNOxnwTRgV8HqEvRo6mOj mnuT09LD9QVvKbuJmv/V5r/kjNvuZPe1d6DiYdj475q0IXM/SM3FFQfsXKaOcI5fzEiK /zmbIy56T9NVf29e9UjnXY+YBCN8I975Qt1HOC+QDyFErotbpaLjXT7QOl4bzZEgqs6p Mj8+fwa/vN0EJPwrFAe1dkQd+taQYN1YkDIMemH2QczgDprjzcPeTt7ymtysPtudMSIr 9nzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=a36y9OIXpZ81tPrrB6Z9gpbHv/t6nj082T6eNRHtWqU=; b=jVwmI3MuMFMvTP5WhFI5XdKGouWiOMvyDSC55SpGVzQJsRIBiKecqL6HhkOTHPhkYB iMQqoEiaeoFlUpYgt90A7aeR00+TpmBgln41flZ8p7y/pm0fzhPPoxVqLscB6AcLvFUu Sxsiu1mHS1LV2n2y2Zwz6UiUCciIX4XNU/4wyjYe3x+aRB3rUITxSOF2T4xYz/9PjtPS 0DmiMqc6qS2MsHRzY3w8dUq86bmZf/lWWwxb5F3RFIWDZ1jNQLBSIhLQBT1m40Ch4YRn s9s4aj3CZv/UOYUf4AxUvA2kbD1O14SloHfNqECHcGi0NEV5/DB/QeTT4xwEruauDMjn 7HNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SQgBxuDZ; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si12710532pgc.12.2018.03.08.00.02.49; Thu, 08 Mar 2018 00:02:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SQgBxuDZ; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755268AbeCHICs (ORCPT + 2 others); Thu, 8 Mar 2018 03:02:48 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35520 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965586AbeCHICV (ORCPT ); Thu, 8 Mar 2018 03:02:21 -0500 Received: by mail-wm0-f66.google.com with SMTP id x7so9289343wmc.0 for ; Thu, 08 Mar 2018 00:02:20 -0800 (PST) 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=/VS1eMqAKOvzHYMSXdeRKhYt4fFw3teK9uqsKXoRHIk=; b=SQgBxuDZXj0GvS7bc/cbDNTXLLVXRm1rWOmwYnYRAOEjfoRu5E9IUJciH7Q1MeRbi9 1EaGXsIbxKO3GQVkgRX+oMZmS7YjOEDx3w+ISyaQy8kYGWtoB0ocd3Igf/s+Kz/DV+Mw ZRvaiK3vVMaiBExN5eHtTFVs/Hd1dGHApogBE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/VS1eMqAKOvzHYMSXdeRKhYt4fFw3teK9uqsKXoRHIk=; b=CLXPGfhtsoYeGjVnYtnIZMB8njROTgqe4iyP6lwNFbL9foFJQeZnmf/hXtS8uaP1xU Wazb3w/+y/qmxHk/C394OGnBLlLkfi0pDVzd7DlfngxPLrEavEs1b2QsNPKzsAqG98jl qNtXu6XHkXEMHa0Z/JO2e9AW24Zx63bKxLEjCVxtQz92S5DiEnYN+pHcVBXhIJ6XVERy Bd5kDHcEJshtWc2Id9aR+P1m38id7zJLTb93AIYZ5Y2hM7DaV/mVyMNOWo52OeNxlaNy 6hOVmOiE1KOEJLNlqEHjEtpxZfgjnzeaQ1nLn4XkrOOS3csVukTy3cKNhmex2rSMKp/U RoFQ== X-Gm-Message-State: AElRT7GYAdorgChVYDSw1wbE07xCUxrBh2Tl5fLhprqMo88ur33nltJt /mSrDRGsXNd7Wh1UUjRHmeEcjcca3Fg= X-Received: by 10.28.87.211 with SMTP id l202mr15296337wmb.32.1520496139695; Thu, 08 Mar 2018 00:02:19 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.02.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:02:18 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Andy Shevchenko , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 11/12] efi/apple-properties: Use memremap() instead of ioremap() Date: Thu, 8 Mar 2018 08:00:19 +0000 Message-Id: <20180308080020.22828-12-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Andy Shevchenko The memory we are accessing through virtual address has no IO side effects. Moreover, for IO memory we have to use special accessors, which we don't use. Due to above, convert the driver to use memremap() instead of ioremap(). Signed-off-by: Andy Shevchenko Tested-by: Lukas Wunner Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/apple-properties.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/firmware/efi/apple-properties.c b/drivers/firmware/efi/apple-properties.c index b9602e0d7b50..adaa9a3714b9 100644 --- a/drivers/firmware/efi/apple-properties.c +++ b/drivers/firmware/efi/apple-properties.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -189,7 +190,7 @@ static int __init map_properties(void) pa_data = boot_params.hdr.setup_data; while (pa_data) { - data = ioremap(pa_data, sizeof(*data)); + data = memremap(pa_data, sizeof(*data), MEMREMAP_WB); if (!data) { pr_err("cannot map setup_data header\n"); return -ENOMEM; @@ -197,14 +198,14 @@ static int __init map_properties(void) if (data->type != SETUP_APPLE_PROPERTIES) { pa_data = data->next; - iounmap(data); + memunmap(data); continue; } data_len = data->len; - iounmap(data); + memunmap(data); - data = ioremap(pa_data, sizeof(*data) + data_len); + data = memremap(pa_data, sizeof(*data) + data_len, MEMREMAP_WB); if (!data) { pr_err("cannot map setup_data payload\n"); return -ENOMEM; @@ -229,7 +230,7 @@ static int __init map_properties(void) * to avoid breaking the chain of ->next pointers. */ data->len = 0; - iounmap(data); + memunmap(data); free_bootmem_late(pa_data + sizeof(*data), data_len); return ret; From patchwork Thu Mar 8 08:00:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 130972 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp6175118lja; Thu, 8 Mar 2018 00:02:26 -0800 (PST) X-Google-Smtp-Source: AG47ELs8jW4QNrmkjE8wcCPd1yMEfvgWKw1IGxIHoxwai2ToMhSBdu7bSpBIXTselwoayuNmapTj X-Received: by 10.99.152.10 with SMTP id q10mr15142939pgd.62.1520496146151; Thu, 08 Mar 2018 00:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520496146; cv=none; d=google.com; s=arc-20160816; b=gJ2VvrO2PzHOlEF+RpeUBq/rSD/9D0EAMzbVGBrPmCItNRpiL4crS62f/SYKKGcwzM T4SW7XdEuNENkcbCnHMB5hswoYZZMH61IdqVw0wjKL9IgHztvH+L18RmwsHy6dbPGVZX kow1gyzcuXvj56KK5aqm7zgd5JtRi1QQYtRhmyz1Nut6nh10+wRZVyZn13dyg2A84y53 diuwjCmSFCotmuM43/CZG2Sjno+pluomIgkj373Z+W83GEv+hkkYbmuflyyMeQOGUEl7 OWSVQxnxbB8TrROm2ZjQcSVYxVnBeYVs7G+7xAbJYCdar2UBOIVxGtyvL+NvAegdm2fb 9Qjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Gvl45ns3L8l/RxScRBPxwSlq2lbhJKYQisQf+2okqAw=; b=hLKA7tEOKuT+x3MELAgvzKmqF/n/VRPQRubnCu5YxNg7PTOAozZZQnLW30M+VvcHrE k19fC4NZSELnldQDJmsE9vIDjmB/Qk6zO9Id2H1GuXDVJ72KupphuKsMTkhQs9ggu/Rv nP6IkmGMs4jVjDBAaCCTVoi4L88S4edJ5hKIviQudhOIAcCmhDcGJawkXzSh5se6hj1p ET/km8ntxqHNCo31d5wLTXFeLXjy2nGKYOrgZXGZs576NDIJQ0MsNSw91JhgH3vxZVoj 4K8erlsWraDkRoe15zxJH37r845iWnhcPCQEkJ3PVNDdrfh0YZtJ/PsEH8RPk0vLYmAn AjrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OBza15zg; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u23si12462852pgv.121.2018.03.08.00.02.25; Thu, 08 Mar 2018 00:02:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OBza15zg; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755221AbeCHICZ (ORCPT + 2 others); Thu, 8 Mar 2018 03:02:25 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43307 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755188AbeCHICX (ORCPT ); Thu, 8 Mar 2018 03:02:23 -0500 Received: by mail-wr0-f193.google.com with SMTP id a63so1055437wrc.10 for ; Thu, 08 Mar 2018 00:02:22 -0800 (PST) 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=DryN1MulhEi08ukDo8t3pz2u/vhKTbPyQLj9sKDCE/U=; b=OBza15zgnQJcvFQ/8CXon92dBw2mPaM409cQGB9M+WnbvWwZGtMIH58iEcWQGxw4E/ 2X0C7blF6oQGEVyIwtthgPxqCePSvvOjv5jwFHVyPsHqweMKlHWOt+R4BhhiZQRhozZa oKBDU9puEbTBfqVF3+022VfM9kjJTu6VUxIcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DryN1MulhEi08ukDo8t3pz2u/vhKTbPyQLj9sKDCE/U=; b=L7rRskSPoL3iy2/suE+Z28OZCTx2CzlWFYYYBgoXPXUl6tGA1/BBnhFcUK7dhzpaJs 5pM81uqL5Cneb8OeeSos566sNVGUpBW7SAkQHzsWEf062i4HyPVmdqEwsGXdYDZs2/T9 IQtdcSDJ9TWWNYoWPi4htPtEDVLeOvOQxRFlF9lbbfWiUzGZk4wfmePAZzPP/H4RYO3l E1ktGpYe1S9rC2MZc+lY5dD8xeKCavKMKWjkbp4y0mF1uk+dZWd8BEJ36sTJaE5i4jmH JwSz72UJRo1BLQGJkIk724c0pgIDVNEWR8qD8JhSDeQbl4frOaWm5err0d40/1HO/9AI Sb4Q== X-Gm-Message-State: APf1xPAjEzEmxfdNu2wm4+fwkDlfrTTi118eCEQlf5ybdt15hLNcaZZh ntr2/LUvbElYy+fqT0V69QgGPgWB48Q= X-Received: by 10.223.179.82 with SMTP id k18mr21875708wrd.173.1520496142016; Thu, 08 Mar 2018 00:02:22 -0800 (PST) Received: from localhost.localdomain ([160.89.73.46]) by smtp.gmail.com with ESMTPSA id e191sm11223361wmg.12.2018.03.08.00.02.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 00:02:21 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Colin Ian King , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 12/12] efi: make const array 'apple' static Date: Thu, 8 Mar 2018 08:00:20 +0000 Message-Id: <20180308080020.22828-13-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180308080020.22828-1-ard.biesheuvel@linaro.org> References: <20180308080020.22828-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Colin Ian King Don't populate the const read-only array 'buf' on the stack but instead make it static. Makes the object code smaller by 64 bytes: Before: text data bss dec hex filename 9264 1 16 9281 2441 arch/x86/boot/compressed/eboot.o After: text data bss dec hex filename 9200 1 16 9217 2401 arch/x86/boot/compressed/eboot.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King Signed-off-by: Ard Biesheuvel --- arch/x86/boot/compressed/eboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 886a9115af62..f2251c1c9853 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -423,7 +423,7 @@ static void retrieve_apple_device_properties(struct boot_params *boot_params) static void setup_quirks(struct boot_params *boot_params) { - efi_char16_t const apple[] = { 'A', 'p', 'p', 'l', 'e', 0 }; + static efi_char16_t const apple[] = { 'A', 'p', 'p', 'l', 'e', 0 }; efi_char16_t *fw_vendor = (efi_char16_t *)(unsigned long) efi_table_attr(efi_system_table, fw_vendor, sys_table);