From patchwork Tue Jan 2 18:10:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 123194 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9253334qgn; Tue, 2 Jan 2018 10:11:05 -0800 (PST) X-Google-Smtp-Source: ACJfBovk0xk1VIQseTJOXRWoPTP79UGTMwUqplrU/hXP1OUMa5OXKalpqyxuFojcxGeJq6f5SJyw X-Received: by 10.159.198.1 with SMTP id f1mr45852397plo.450.1514916665203; Tue, 02 Jan 2018 10:11:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514916665; cv=none; d=google.com; s=arc-20160816; b=Qiyl2zuy+eNFrmiWkJ7KSW2ueuhAlJISFfHr0VCr8+hUfkSJdg+TTryAYDi6VIv7kU fsRgAfF2KdI6Ht7hH8uLzh4Jl65aRpss2LvNm52fkzcXi32VEIuI7hNPI++COh71em8I yKWoTam629G4GW2rA+gnrM+SH5Iukjbxq1hoZsTSqQW0OUzkHS8mkcuWzEZtV+3kdCid hiC3eEbx7sVnPe5qwFeW67A+AY8dlvBsPsL5DVZlOGk59uMtCjA93eahLDpWUVf1FL9f p1oIlNfhu9gYHQmk0XQ4/Brty9ButeD/zWAKa6G+BN9Q+MJXfbv6mS2FxroOUgolL/BX KcZg== 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=LOS6qPCDYXjb+pJilC4l2A23cDqTHpdBBU2ggoiGoFE=; b=NaagIbiisHJukZ7gKWRyGhv/FqmKPZlo6dJerwd3nFyqIVmQsA3AXq/hVmwLxyltw0 pCtT3UtW9kr2EUFNkie8AywK7WGs86r8qUQInqk5kxHgB/i/J0QardigMgWKRy7vjpjF s8f9YEoRP9+Gt33xjyoXrCFmy3Je6Nyp3UM1QxS5V8iwD6EJlAGeqoHEOijXExNpMPab YDgraAFVWoXX6bsrHpVeMyV6yvjYWlRd+gXKhQZDZSqYLY4eotrAS6vm/tevVjYycFwB VLiQPjOJemCajENDwJYNtJo2O5dAF850GN+1ntTIo4WzEs4dbVLrQ6fEycav6xbCm7G4 C3aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Yw6PgYoN; 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 33si33959766ply.166.2018.01.02.10.11.04; Tue, 02 Jan 2018 10:11: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=Yw6PgYoN; 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 S1751034AbeABSLE (ORCPT + 2 others); Tue, 2 Jan 2018 13:11:04 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:46568 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751372AbeABSLC (ORCPT ); Tue, 2 Jan 2018 13:11:02 -0500 Received: by mail-wm0-f67.google.com with SMTP id r78so62839260wme.5 for ; Tue, 02 Jan 2018 10:11:02 -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=xp1elusisRVDeN7DQpjK1u4KD5rJ0GDj8DU23g21t0g=; b=Yw6PgYoNXb/sW0TJYEZDsituZfwDysJQhSA2TJjm0Q/vYFDZ9abUVqD7c/J3ilt9w/ wVxFefzdfiidegSVprWE5piKfEPF2d5CDIuQDo3Usl7Yp+oUDnOTNQ7sFn4H+bo0MXzv 8aluzSfCfQsJFGo/H2A3DT+OUtQ9V4P/b280U= 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=xp1elusisRVDeN7DQpjK1u4KD5rJ0GDj8DU23g21t0g=; b=IIXt9ZbK8ENXwI+JDTYqvfljAIwJo5TrMmDTn1tS+KV8MJ9Abtu52FFw2sOHdKoSoE ZkPlC8hXEZ2mm3h8aFLntxQJ/DxzJRnMv4vVJt4LLYJC2tEjuVRNWbfaZAo+NKVcapyr 7qUeNX8e2qlJMcLQO2zjQ4Af8wm/mFqoxk0IsjokmnzGGJHHx32CoYtvgh2gAOupTUve gNI4NC/g114+DRCpRk2IqHIp5l+l9dO/yJNVZz1An9BLbJs5WyRkdT4OS785/27GrLDr DKHERc3rYCFnphZ20+dRfVIf+swxNc1hksDm/wL99MMgBIp0gbzyd7rvf1eh1WrJH/mr Xqvw== X-Gm-Message-State: AKGB3mKXV4mRfGt8yRiaYucOAy5dM+XzFQvEP4lUcU0KZ7d/We65neR2 MKpllFpQeauoGa3bpsp/U9j06u6j0ws= X-Received: by 10.28.152.74 with SMTP id a71mr33686597wme.22.1514916661351; Tue, 02 Jan 2018 10:11:01 -0800 (PST) Received: from localhost.localdomain ([160.89.138.198]) by smtp.gmail.com with ESMTPSA id f5sm16496643wrh.24.2018.01.02.10.10.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 10:11:00 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Arvind Yadav , Matt Fleming , Stephen Boyd , Tyler Baicar , Vasyl Gomonovych Subject: [PATCH 1/5] efi/capsule-loader: pr_err() strings should end with newlines Date: Tue, 2 Jan 2018 18:10:38 +0000 Message-Id: <20180102181042.19074-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180102181042.19074-1-ard.biesheuvel@linaro.org> References: <20180102181042.19074-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: Arvind Yadav pr_err() messages should terminated with a new-line to avoid other messages being concatenated onto the end. Signed-off-by: Arvind Yadav Signed-off-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/capsule-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 -- 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/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c index ec8ac5c4dd84..51d2874942a2 100644 --- a/drivers/firmware/efi/capsule-loader.c +++ b/drivers/firmware/efi/capsule-loader.c @@ -49,7 +49,7 @@ int __efi_capsule_setup_info(struct capsule_info *cap_info) pages_needed = ALIGN(cap_info->total_size, PAGE_SIZE) / PAGE_SIZE; if (pages_needed == 0) { - pr_err("invalid capsule size"); + pr_err("invalid capsule size\n"); return -EINVAL; } From patchwork Tue Jan 2 18:10:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 123195 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9253469qgn; Tue, 2 Jan 2018 10:11:13 -0800 (PST) X-Google-Smtp-Source: ACJfBotxVZTOdF5zTLaug+3U/JPeS2l8DPE63FdZZu3bEOkedVV1UvZCT6+Kgb+qmYty3QQFo4HA X-Received: by 10.159.235.135 with SMTP id f7mr45871815plr.228.1514916672936; Tue, 02 Jan 2018 10:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514916672; cv=none; d=google.com; s=arc-20160816; b=jhFboThjBvRCS/gMDzhMITxqMu5zsRAIZS0qxaI/dM29rp+pIToY7D4PIbyChY7ZoQ gp38xpuLbg7aTzLdSlSlgi86nYFqCiEyr4LoVMcV8pePBl+3q4ZS+hZflqjjkK0z0YhA f6nYwbaYWXWAy9P1+3uILrrfh9lZ4QMyy5tG4zzkL58NVPepWrEWwbQKFGe/U21SZ0Rn aK3wO+ilHnbvuiFKKMvIi65b7HvcGiUDmeuGgaeiPMsZ4rQ7ACYO3C9Dl/GqyEAsoHyo ET6uvOmzDTiKM78jrkhdOtmqYapRSKUNZBTd6uwSq1+WAZDXn4BZVz2Vaj+oa7jwa8zw op3Q== 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=9z5H0QG8Wjxm/keo1S0I8S9W0YmKb9IT8oC5BQTQfSg=; b=uYOOrAdIpLHb0fK7lCFgPDuP2WX98nAK8smJrU4rSjj6+ANGSQwgG2AhY5qcw7F0f1 LzZvnawleAhiyH+Sua2Exy30hIiQliT1aJ7ZMNQl6nccQrF51Yr0UzbWMIeqI5QnPW+m UCFOufLy7LQP0UYEHrq9VcVgiElDJV0wXne2W7oGMCgSd3yha760FRhMV9MmUamyQTxf R0XARTlS9ckcaQkeywahkgkC/QsakvnT6sA8ZT5ehLVo0hIbluauAIICGz35JiRCcJu2 Eujw5SiSNXyPNfWnJ03goKnwGFwgea73zPn54QQKIh6m8FzrSkKa7Waxh3CnDccsezgD cPIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Ut9BvO9B; 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 u9si20616653pgb.632.2018.01.02.10.11.12; Tue, 02 Jan 2018 10:11:12 -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=Ut9BvO9B; 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 S1751471AbeABSLL (ORCPT + 2 others); Tue, 2 Jan 2018 13:11:11 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:42156 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751382AbeABSLJ (ORCPT ); Tue, 2 Jan 2018 13:11:09 -0500 Received: by mail-wm0-f65.google.com with SMTP id b141so15937552wme.1 for ; Tue, 02 Jan 2018 10:11:09 -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=Ap7PIDbdP0kIKFsfZFoJSupgqHYzbJtDhY/MY+lu04Y=; b=Ut9BvO9BvkQqD3J9LyX01Y5d0n7HZgQQGtTTXAkTobsxWBia92wGecnfzhXKbLAPV/ BHM9EakU8Cx0l9I9xWlKAoy1rt1x/Zb+ldbs5rnotr6kXoXxIoizZzX+ounXXXDqID7K ULNkJkPgesfNny5ZV64fCqQXK+kUnrfZGMNAs= 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=Ap7PIDbdP0kIKFsfZFoJSupgqHYzbJtDhY/MY+lu04Y=; b=IGK4qqBO3pzr3O87e6+u3FZO6iTrEor9+DMzmEtRB2FtviqvxvwrzFGwhntB1fsLN3 IpXl3A+Ed6Md4n+xirhynAvtWHw4hARntdgUb8qBjEVX9SQ2/FWw92XuJcXO91bceyqr zOZ/n7s5EZlDmma+t27Yt1+VZ2FQvjoHcKQFDv+Xg5fYvN13hLRc6ta8ztIG9Yuf2dlM ohRP4cQvg2ZG6xGmKoP9G1StcZ3hKIzUe8bLLiGuBzz51ml6LBLBW7Xc1TR9L0lNHKLS B2GPq15ClFPa+MjJo0V27L0rqha/Z4rDQwhw6u6yO8wcIuod7GbriRg7SJEertp1RyT/ bBHw== X-Gm-Message-State: AKGB3mIk+LHM0OEcBbL/LE4t6hvgHKAFutrPhw8ivVSVKDDGwvY3KPzV mO5NS+CG9XXaHOLGyDG1gQmzjL9vjDU= X-Received: by 10.28.230.138 with SMTP id e10mr29153740wmi.141.1514916666992; Tue, 02 Jan 2018 10:11:06 -0800 (PST) Received: from localhost.localdomain ([160.89.138.198]) by smtp.gmail.com with ESMTPSA id f5sm16496643wrh.24.2018.01.02.10.11.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 10:11:06 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Arvind Yadav , Matt Fleming , Stephen Boyd , Tyler Baicar , Vasyl Gomonovych Subject: [PATCH 3/5] efi: Use PTR_ERR_OR_ZERO() Date: Tue, 2 Jan 2018 18:10:40 +0000 Message-Id: <20180102181042.19074-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180102181042.19074-1-ard.biesheuvel@linaro.org> References: <20180102181042.19074-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: Vasyl Gomonovych Fix ptr_ret.cocci warnings: drivers/firmware/efi/efi.c:610:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych Signed-off-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 -- 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/efi.c b/drivers/firmware/efi/efi.c index 557a47829d03..8ce70c2e73d5 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -608,7 +608,7 @@ static int __init efi_load_efivars(void) return 0; pdev = platform_device_register_simple("efivars", 0, NULL, 0); - return IS_ERR(pdev) ? PTR_ERR(pdev) : 0; + return PTR_ERR_OR_ZERO(pdev); } device_initcall(efi_load_efivars); #endif From patchwork Tue Jan 2 18:10:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 123196 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp9253512qgn; Tue, 2 Jan 2018 10:11:15 -0800 (PST) X-Google-Smtp-Source: ACJfBov+XpPAD94w+9tv/jWwVlE8OeQ6j99talKKl/YImvdSC2etN6g0N+6vWBVf5tJLTynXQEH0 X-Received: by 10.84.241.15 with SMTP id a15mr47091716pll.103.1514916675859; Tue, 02 Jan 2018 10:11:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514916675; cv=none; d=google.com; s=arc-20160816; b=H6TCcOetw9uczWoKMbwjU4PoKlrg1uzw/+R0x5mHLyiu2NHQqMP/FfpKV+K59klYNj bON7m864jbKQtxe450dUPsYhcPfquRNTKS+MgB41d0ObJmVUClRfI7pUk4X/vT69Z48f ylH+ArDaOUdsKVWypOlv/sgLsqTwgUkMHVXGx1VrJFlH7/BVI50+g1bk1qECnDbMyPJs GbI9F2CHLjVPDFRCiTJMbbOR1cTq0fKXAGaDQx0S6XbMtggfyrOE9ceTZYIfqCT1aubu jlOkBdrrZ3pCsEQoeADywbmwD8sbpDg7Yd2kxKtlV1qgOXXB8DHdSdlPofziPOCoJ67q Zz0w== 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=0mRCA4iQeSz1sKOCwpTMfIgIghngbX85a4faytXVWok=; b=sekxe6HP9hIvlgnl7zWS7tPgU+bVTd2zMIVtMo82ub4FFqMu7hcznTA9LPMJJpz2Im LnbW7Ru1Z1IBMg23jqdwXnD8aDpeVeaIR/deo01tWNMuosgzJbPpbmmqtrsayxUPifVf borIhtkaGMRt9v5AOAeA64HmdzGLB2wsfZ7K3GqFGQT2RnysIbyWz3F/+h716TBEoI4y GqmwozhUJLStt668Y6Zx6a0y/bsoiYgcflOx0/Q/erfkJ0F1sVjotZkC7RcU8kyv548x OxoUmlDWD5SiHOgaT38h+RfqNu2R6M1W5qkXtQBsnZZALQCnUE6WEKVU0nRe176nw9Yc pZHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=FRMTaNBC; 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 g70si15665327pgc.477.2018.01.02.10.11.15; Tue, 02 Jan 2018 10:11:15 -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=FRMTaNBC; 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 S1751463AbeABSLO (ORCPT + 2 others); Tue, 2 Jan 2018 13:11:14 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38105 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbeABSLL (ORCPT ); Tue, 2 Jan 2018 13:11:11 -0500 Received: by mail-wm0-f67.google.com with SMTP id 64so62136383wme.3 for ; Tue, 02 Jan 2018 10:11:11 -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=Rve89n4XSWFN1mrS4E8xm+h4xWvX1lLQ5wewiBG/48g=; b=FRMTaNBCfaPcRp12jWw8xVSTj+APSm4GYa7v/ULh1SJRSOisElFOgT5Fs+k5tOfKTl cM6eUBDHIL39LNkrKIy9j8Irlzbo1/yLTMJ2Cv5cEmiTLWAdklfJ4bRqRLyoT3wmyU62 jyLZuaFWqo734581GPvg33vr2LUwe0tu+40vc= 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=Rve89n4XSWFN1mrS4E8xm+h4xWvX1lLQ5wewiBG/48g=; b=Kp7qqctL33D1kKWFzBCWxdDhY/ZlMnW5fgerGMblXhsQWPP5ZmAx7E2o0JaL/X/Ova fGZ4snCjJv9Fp1/fqOGedP2MNpiBYWP8GMOLCaN9DYtOl88w05XIeLAgOmFOGbhLr6dD xzpG3QgA1cOuXQgY9YtLd6VnU6i0YPGqjussL1xeQKp300+5ViXGV9jpfIeZIV4DavZT HgidSfeWv6nemP9EQkK42DOox/LW4H8Ef/x8ZP6xCJbRtldrNheq+2Vt5kdZwQXaHoYG UN1yOXXbs34CbC5tmPBTDRED0JGNeIYTjG9JMhmJTCSNI2Yzsezhs/b6g7NzsHTL+nlc +K9A== X-Gm-Message-State: AKGB3mKfATy2GH7mHm2WrQiC6kZ306U0Vauti26fGfkhpVKhgC7owZ10 rkk/EeXBzuLo6tLYfB2PpDcTC+1/7e8= X-Received: by 10.28.147.8 with SMTP id v8mr4216684wmd.136.1514916670162; Tue, 02 Jan 2018 10:11:10 -0800 (PST) Received: from localhost.localdomain ([160.89.138.198]) by smtp.gmail.com with ESMTPSA id f5sm16496643wrh.24.2018.01.02.10.11.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jan 2018 10:11:09 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Arvind Yadav , Matt Fleming , Stephen Boyd , Tyler Baicar , Vasyl Gomonovych Subject: [PATCH 4/5] efi: move ARM CPER code to new file Date: Tue, 2 Jan 2018 18:10:41 +0000 Message-Id: <20180102181042.19074-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180102181042.19074-1-ard.biesheuvel@linaro.org> References: <20180102181042.19074-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: Tyler Baicar The ARM CPER code is currently mixed in with the other CPER code. Move it to a new file to separate it from the rest of the CPER code. Signed-off-by: Tyler Baicar Cc: Matt Fleming Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/Kconfig | 5 ++ drivers/firmware/efi/Makefile | 1 + drivers/firmware/efi/cper-arm.c | 147 ++++++++++++++++++++++++++++++++++++++++ drivers/firmware/efi/cper.c | 122 +-------------------------------- include/linux/cper.h | 4 ++ 5 files changed, 160 insertions(+), 119 deletions(-) create mode 100644 drivers/firmware/efi/cper-arm.c -- 2.11.0 -- 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/Kconfig b/drivers/firmware/efi/Kconfig index 2b4c39fdfa91..aab108e82f78 100644 --- a/drivers/firmware/efi/Kconfig +++ b/drivers/firmware/efi/Kconfig @@ -166,6 +166,11 @@ endmenu config UEFI_CPER bool +config UEFI_CPER_ARM + bool + depends on UEFI_CPER && ( ARM || ARM64 ) + default y + config EFI_DEV_PATH_PARSER bool depends on ACPI diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile index 269501dfba53..a3e73d6e8a43 100644 --- a/drivers/firmware/efi/Makefile +++ b/drivers/firmware/efi/Makefile @@ -30,3 +30,4 @@ arm-obj-$(CONFIG_EFI) := arm-init.o arm-runtime.o obj-$(CONFIG_ARM) += $(arm-obj-y) obj-$(CONFIG_ARM64) += $(arm-obj-y) obj-$(CONFIG_EFI_CAPSULE_LOADER) += capsule-loader.o +obj-$(CONFIG_UEFI_CPER_ARM) += cper-arm.o diff --git a/drivers/firmware/efi/cper-arm.c b/drivers/firmware/efi/cper-arm.c new file mode 100644 index 000000000000..4afbfed52163 --- /dev/null +++ b/drivers/firmware/efi/cper-arm.c @@ -0,0 +1,147 @@ +/* + * UEFI Common Platform Error Record (CPER) support + * + * Copyright (C) 2017, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define INDENT_SP " " + +static const char * const arm_reg_ctx_strs[] = { + "AArch32 general purpose registers", + "AArch32 EL1 context registers", + "AArch32 EL2 context registers", + "AArch32 secure context registers", + "AArch64 general purpose registers", + "AArch64 EL1 context registers", + "AArch64 EL2 context registers", + "AArch64 EL3 context registers", + "Misc. system register structure", +}; + +void cper_print_proc_arm(const char *pfx, + const struct cper_sec_proc_arm *proc) +{ + int i, len, max_ctx_type; + struct cper_arm_err_info *err_info; + struct cper_arm_ctx_info *ctx_info; + char newpfx[64]; + + printk("%sMIDR: 0x%016llx\n", pfx, proc->midr); + + len = proc->section_length - (sizeof(*proc) + + proc->err_info_num * (sizeof(*err_info))); + if (len < 0) { + printk("%ssection length: %d\n", pfx, proc->section_length); + printk("%ssection length is too small\n", pfx); + printk("%sfirmware-generated error record is incorrect\n", pfx); + printk("%sERR_INFO_NUM is %d\n", pfx, proc->err_info_num); + return; + } + + if (proc->validation_bits & CPER_ARM_VALID_MPIDR) + printk("%sMultiprocessor Affinity Register (MPIDR): 0x%016llx\n", + pfx, proc->mpidr); + + if (proc->validation_bits & CPER_ARM_VALID_AFFINITY_LEVEL) + printk("%serror affinity level: %d\n", pfx, + proc->affinity_level); + + if (proc->validation_bits & CPER_ARM_VALID_RUNNING_STATE) { + printk("%srunning state: 0x%x\n", pfx, proc->running_state); + printk("%sPower State Coordination Interface state: %d\n", + pfx, proc->psci_state); + } + + snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP); + + err_info = (struct cper_arm_err_info *)(proc + 1); + for (i = 0; i < proc->err_info_num; i++) { + printk("%sError info structure %d:\n", pfx, i); + + printk("%snum errors: %d\n", pfx, err_info->multiple_error + 1); + + if (err_info->validation_bits & CPER_ARM_INFO_VALID_FLAGS) { + if (err_info->flags & CPER_ARM_INFO_FLAGS_FIRST) + printk("%sfirst error captured\n", newpfx); + if (err_info->flags & CPER_ARM_INFO_FLAGS_LAST) + printk("%slast error captured\n", newpfx); + if (err_info->flags & CPER_ARM_INFO_FLAGS_PROPAGATED) + printk("%spropagated error captured\n", + newpfx); + if (err_info->flags & CPER_ARM_INFO_FLAGS_OVERFLOW) + printk("%soverflow occurred, error info is incomplete\n", + newpfx); + } + + printk("%serror_type: %d, %s\n", newpfx, err_info->type, + err_info->type < ARRAY_SIZE(cper_proc_error_type_strs) ? + cper_proc_error_type_strs[err_info->type] : "unknown"); + if (err_info->validation_bits & CPER_ARM_INFO_VALID_ERR_INFO) + printk("%serror_info: 0x%016llx\n", newpfx, + err_info->error_info); + if (err_info->validation_bits & CPER_ARM_INFO_VALID_VIRT_ADDR) + printk("%svirtual fault address: 0x%016llx\n", + newpfx, err_info->virt_fault_addr); + if (err_info->validation_bits & CPER_ARM_INFO_VALID_PHYSICAL_ADDR) + printk("%sphysical fault address: 0x%016llx\n", + newpfx, err_info->physical_fault_addr); + err_info += 1; + } + + ctx_info = (struct cper_arm_ctx_info *)err_info; + max_ctx_type = ARRAY_SIZE(arm_reg_ctx_strs) - 1; + for (i = 0; i < proc->context_info_num; i++) { + int size = sizeof(*ctx_info) + ctx_info->size; + + printk("%sContext info structure %d:\n", pfx, i); + if (len < size) { + printk("%ssection length is too small\n", newpfx); + printk("%sfirmware-generated error record is incorrect\n", pfx); + return; + } + if (ctx_info->type > max_ctx_type) { + printk("%sInvalid context type: %d (max: %d)\n", + newpfx, ctx_info->type, max_ctx_type); + return; + } + printk("%sregister context type: %s\n", newpfx, + arm_reg_ctx_strs[ctx_info->type]); + print_hex_dump(newpfx, "", DUMP_PREFIX_OFFSET, 16, 4, + (ctx_info + 1), ctx_info->size, 0); + len -= size; + ctx_info = (struct cper_arm_ctx_info *)((long)ctx_info + size); + } + + if (len > 0) { + printk("%sVendor specific error info has %u bytes:\n", pfx, + len); + print_hex_dump(newpfx, "", DUMP_PREFIX_OFFSET, 16, 4, ctx_info, + len, true); + } +} diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index d2fcafcea07e..c165933ebf38 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -122,7 +122,7 @@ static const char * const proc_isa_strs[] = { "ARM A64", }; -static const char * const proc_error_type_strs[] = { +const char * const cper_proc_error_type_strs[] = { "cache error", "TLB error", "bus error", @@ -157,8 +157,8 @@ static void cper_print_proc_generic(const char *pfx, if (proc->validation_bits & CPER_PROC_VALID_ERROR_TYPE) { printk("%s""error_type: 0x%02x\n", pfx, proc->proc_error_type); cper_print_bits(pfx, proc->proc_error_type, - proc_error_type_strs, - ARRAY_SIZE(proc_error_type_strs)); + cper_proc_error_type_strs, + ARRAY_SIZE(cper_proc_error_type_strs)); } if (proc->validation_bits & CPER_PROC_VALID_OPERATION) printk("%s""operation: %d, %s\n", pfx, proc->operation, @@ -188,122 +188,6 @@ static void cper_print_proc_generic(const char *pfx, printk("%s""IP: 0x%016llx\n", pfx, proc->ip); } -#if defined(CONFIG_ARM64) || defined(CONFIG_ARM) -static const char * const arm_reg_ctx_strs[] = { - "AArch32 general purpose registers", - "AArch32 EL1 context registers", - "AArch32 EL2 context registers", - "AArch32 secure context registers", - "AArch64 general purpose registers", - "AArch64 EL1 context registers", - "AArch64 EL2 context registers", - "AArch64 EL3 context registers", - "Misc. system register structure", -}; - -static void cper_print_proc_arm(const char *pfx, - const struct cper_sec_proc_arm *proc) -{ - int i, len, max_ctx_type; - struct cper_arm_err_info *err_info; - struct cper_arm_ctx_info *ctx_info; - char newpfx[64]; - - printk("%sMIDR: 0x%016llx\n", pfx, proc->midr); - - len = proc->section_length - (sizeof(*proc) + - proc->err_info_num * (sizeof(*err_info))); - if (len < 0) { - printk("%ssection length: %d\n", pfx, proc->section_length); - printk("%ssection length is too small\n", pfx); - printk("%sfirmware-generated error record is incorrect\n", pfx); - printk("%sERR_INFO_NUM is %d\n", pfx, proc->err_info_num); - return; - } - - if (proc->validation_bits & CPER_ARM_VALID_MPIDR) - printk("%sMultiprocessor Affinity Register (MPIDR): 0x%016llx\n", - pfx, proc->mpidr); - - if (proc->validation_bits & CPER_ARM_VALID_AFFINITY_LEVEL) - printk("%serror affinity level: %d\n", pfx, - proc->affinity_level); - - if (proc->validation_bits & CPER_ARM_VALID_RUNNING_STATE) { - printk("%srunning state: 0x%x\n", pfx, proc->running_state); - printk("%sPower State Coordination Interface state: %d\n", - pfx, proc->psci_state); - } - - snprintf(newpfx, sizeof(newpfx), "%s%s", pfx, INDENT_SP); - - err_info = (struct cper_arm_err_info *)(proc + 1); - for (i = 0; i < proc->err_info_num; i++) { - printk("%sError info structure %d:\n", pfx, i); - - printk("%snum errors: %d\n", pfx, err_info->multiple_error + 1); - - if (err_info->validation_bits & CPER_ARM_INFO_VALID_FLAGS) { - if (err_info->flags & CPER_ARM_INFO_FLAGS_FIRST) - printk("%sfirst error captured\n", newpfx); - if (err_info->flags & CPER_ARM_INFO_FLAGS_LAST) - printk("%slast error captured\n", newpfx); - if (err_info->flags & CPER_ARM_INFO_FLAGS_PROPAGATED) - printk("%spropagated error captured\n", - newpfx); - if (err_info->flags & CPER_ARM_INFO_FLAGS_OVERFLOW) - printk("%soverflow occurred, error info is incomplete\n", - newpfx); - } - - printk("%serror_type: %d, %s\n", newpfx, err_info->type, - err_info->type < ARRAY_SIZE(proc_error_type_strs) ? - proc_error_type_strs[err_info->type] : "unknown"); - if (err_info->validation_bits & CPER_ARM_INFO_VALID_ERR_INFO) - printk("%serror_info: 0x%016llx\n", newpfx, - err_info->error_info); - if (err_info->validation_bits & CPER_ARM_INFO_VALID_VIRT_ADDR) - printk("%svirtual fault address: 0x%016llx\n", - newpfx, err_info->virt_fault_addr); - if (err_info->validation_bits & CPER_ARM_INFO_VALID_PHYSICAL_ADDR) - printk("%sphysical fault address: 0x%016llx\n", - newpfx, err_info->physical_fault_addr); - err_info += 1; - } - - ctx_info = (struct cper_arm_ctx_info *)err_info; - max_ctx_type = ARRAY_SIZE(arm_reg_ctx_strs) - 1; - for (i = 0; i < proc->context_info_num; i++) { - int size = sizeof(*ctx_info) + ctx_info->size; - - printk("%sContext info structure %d:\n", pfx, i); - if (len < size) { - printk("%ssection length is too small\n", newpfx); - printk("%sfirmware-generated error record is incorrect\n", pfx); - return; - } - if (ctx_info->type > max_ctx_type) { - printk("%sInvalid context type: %d (max: %d)\n", - newpfx, ctx_info->type, max_ctx_type); - return; - } - printk("%sregister context type: %s\n", newpfx, - arm_reg_ctx_strs[ctx_info->type]); - print_hex_dump(newpfx, "", DUMP_PREFIX_OFFSET, 16, 4, - (ctx_info + 1), ctx_info->size, 0); - len -= size; - ctx_info = (struct cper_arm_ctx_info *)((long)ctx_info + size); - } - - if (len > 0) { - printk("%sVendor specific error info has %u bytes:\n", pfx, - len); - print_hex_dump(newpfx, "", DUMP_PREFIX_OFFSET, 16, 4, ctx_info, - len, true); - } -} -#endif - static const char * const mem_err_type_strs[] = { "unknown", "no error", diff --git a/include/linux/cper.h b/include/linux/cper.h index 723e952fde0d..3299e43c76eb 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -494,6 +494,8 @@ struct cper_sec_pcie { /* Reset to default packing */ #pragma pack() +extern const char * const cper_proc_error_type_strs[4]; + u64 cper_next_record_id(void); const char *cper_severity_str(unsigned int); const char *cper_mem_err_type_str(unsigned int); @@ -503,5 +505,7 @@ void cper_mem_err_pack(const struct cper_sec_mem_err *, struct cper_mem_err_compact *); const char *cper_mem_err_unpack(struct trace_seq *, struct cper_mem_err_compact *); +void cper_print_proc_arm(const char *pfx, + const struct cper_sec_proc_arm *proc); #endif