From patchwork Thu Mar 28 19:34:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 161334 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1122688jan; Thu, 28 Mar 2019 12:35:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9ENmrEAQiToIP/3k0Gew1SaWTu9O7cYeJNu80G8To6rMHL9CldkbZebPStbGm2otj1fO9 X-Received: by 2002:a65:5685:: with SMTP id v5mr40551543pgs.365.1553801702862; Thu, 28 Mar 2019 12:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553801702; cv=none; d=google.com; s=arc-20160816; b=wWHmml6hu7rolWCE5uaxFfHXIBDDlfkOlFGiuusSDmQQ9OWxl3uvPOYAgyaUoo6TYR 0rW6qxUCAXmOTe26N9ElJTgli/QRGFQKLj/cztnO1CWWBYq36UuReueWs3Zei9eFj6nt XTTlpliPeKM7uNYG2KbvAMHRAXZ6aO64khlWykuvEJZFg8N/g77AkN4IZ6UaiyRzUEsD 9twNI7piTPr8+mTBkZ742k+PZMChgY/L+1SdKF6Nk3uOaBbNxZYMrBXipt8Oy259rDZo JBRt6LHIQKgkiR0njnGrii6M79u0DJ44sbRwC+0yMkHTNtTFXzsPxSIFppu9xKCyXPx2 YJkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VZSQTQ1ZP4ZmuIHcXxYVuYkA6kF+7ceY+tTJP+fs9dA=; b=u0IicqvSXLZj5FiN3pknDTOczp6MxsvzH4bqWr1WwcB0M71GIYdpSJs0mkuGhsrO1M WZXypIp+SDCdR6ts1fV/4N2nx3xPVyLFQRdnR3K6FWJs5BtskcfRM9QoDEFHrytGwPBN +Z2KqJZCEUlvvAPPCIRuN9mgIRVgjf0LYcdfhDLBMPi+rxBaDOaX557DDxVXRMOsmoe8 ZwbAol5hibUCODmGyeBzvzaFR1b33/aQxbGvd0cCUNJIBhbIV2hEet+NuaLHeWUre/ws ascGatBKeRg8j4gQCyGJvP4YgrmChMXmX/ZkpVPRI+zLRu0TJ8kkI0Ksr0mLUqlbGlRb Wwzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JyfizXZ5; 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=pass (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 e11si1132324pfd.88.2019.03.28.12.35.02; Thu, 28 Mar 2019 12:35:02 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=JyfizXZ5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726321AbfC1TfB (ORCPT + 3 others); Thu, 28 Mar 2019 15:35:01 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35578 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbfC1Tem (ORCPT ); Thu, 28 Mar 2019 15:34:42 -0400 Received: by mail-wm1-f66.google.com with SMTP id y197so82611wmd.0 for ; Thu, 28 Mar 2019 12:34:41 -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 :mime-version:content-transfer-encoding; bh=VZSQTQ1ZP4ZmuIHcXxYVuYkA6kF+7ceY+tTJP+fs9dA=; b=JyfizXZ5jMFVmhU5oTPLaxiFKORKEfxLz9XGyIkmVXkwhAr3usQVtcIOhhYzpmHM/J PkkEYCe3XLpPLln3/3j5AtL6/hhro1QcM+VxpxNrWmpjsrrwYlxggpoD6GXPDb4TEUht Xn6YtWKCg6aGH5A3mWqefXHYdeIRFE5C2aQcHI8F5b8VI4G8n3+7d0EaOTq3xpqvF1Zy 0ZnCYjpmU31TNJAWmB/JnJCeSBbgq/uMmuinQHBwVsZ9I0HlKmVgGs1hQ+eNb9UJfK9P JeafZWIseM4ljxDoIw7v2DjEF4frcbDhlPv9zD0kUVpXj5Oca9FpCzIGfcGIDA5Js2EX Qdbg== 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:mime-version:content-transfer-encoding; bh=VZSQTQ1ZP4ZmuIHcXxYVuYkA6kF+7ceY+tTJP+fs9dA=; b=H0XYTdYzsu+I/FEUPzCZpO53+yqKWdpCrh/5Y4KDBOC+UJ0zTW0ATb5cB+frrQ4BLX pSSFwypmkJxglrhAb2Ga0slGS7dKUezUwTSl+EOodvqRVD5FafUdVoRFm4eaP5MZp4Oj JcyzA8XiCUq8FkD9Mw8X9D44mW34sklpgcuqWF/kmgOwGl7TMPuIS3IPZOURxsv70SbP LiOgfyRpIjHbgjb1wKnOdN5Nqty5pV9X1ElNQqM3C3T1+YjPXgefSM7hfeq8lIzDbQHR sxpD8nj5I4qPJtSz1QHzVQCoOL+OUYMgp26rfXGEx9GwnLeOVDSCwzszagpu1l4GC/Sc plMw== X-Gm-Message-State: APjAAAULRMi9fRN4TvolSOys9lSRHXiMjrqrBYf3WONAxudw8ZuVoBwv wKpkFE4JdxFqOvTdXx1WWVZBeuoBvb6wXQ== X-Received: by 2002:a1c:eb14:: with SMTP id j20mr1150854wmh.32.1553801680174; Thu, 28 Mar 2019 12:34:40 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:dd62:8a50:1468:989d]) by smtp.gmail.com with ESMTPSA id d6sm27739186wrx.62.2019.03.28.12.34.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 12:34:39 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Peter Jones , Takashi Iwai Subject: [PATCH 2/5] efifb: omit memory map check on legacy boot Date: Thu, 28 Mar 2019 20:34:26 +0100 Message-Id: <20190328193429.21373-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328193429.21373-1-ard.biesheuvel@linaro.org> References: <20190328193429.21373-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Since 38ac0287b7f4 ("fbdev/efifb: Honour UEFI memory map attributes when mapping the FB"), efifb_probe() checks its memory range via efi_mem_desc_lookup(), and this leads to a spurious error message "EFI_MEMMAP is not enabled" at every boot on KVM. This is quite annoying since the error message appears even if you set "quiet" boot option. Since this happens on legacy boot, which strangely enough exposes a EFI framebuffer via screen_info, let's double check that we are doing an EFI boot before attempting to access the EFI memory map. Cc: Peter Jones Tested-by: Takashi Iwai Reported-by: Takashi Iwai Signed-off-by: Ard Biesheuvel --- drivers/video/fbdev/efifb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c index ba906876cc45..9e529cc2b4ff 100644 --- a/drivers/video/fbdev/efifb.c +++ b/drivers/video/fbdev/efifb.c @@ -464,7 +464,8 @@ static int efifb_probe(struct platform_device *dev) info->apertures->ranges[0].base = efifb_fix.smem_start; info->apertures->ranges[0].size = size_remap; - if (!efi_mem_desc_lookup(efifb_fix.smem_start, &md)) { + if (efi_enabled(EFI_BOOT) && + !efi_mem_desc_lookup(efifb_fix.smem_start, &md)) { if ((efifb_fix.smem_start + efifb_fix.smem_len) > (md.phys_addr + (md.num_pages << EFI_PAGE_SHIFT))) { pr_err("efifb: video memory @ 0x%lx spans multiple EFI memory regions\n", From patchwork Thu Mar 28 19:34:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 161331 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1122413jan; Thu, 28 Mar 2019 12:34:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyT8bQuHJtQ2Ybyr2L8jBiSnMr3lxE8l0v9pMOIITxxEW4hH8lJRq+RgADSTtf9/Xd/ONH3 X-Received: by 2002:a17:902:f81:: with SMTP id 1mr10320219plz.216.1553801684906; Thu, 28 Mar 2019 12:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553801684; cv=none; d=google.com; s=arc-20160816; b=UCoS8TgFg9Oizaz7vFqCyjgvKHO1Q2+B11i9DLDU2kjm8eL8RVD8Cu4cMJD7rvjzTc FcKAoFnnMbYF47YtC6HHKqQGq3nYWPAAZ4yYl6grGEDlmN24/2xSylPqq5SwdWOemotE iHPfiNR6MIYGj/+gr4xc24Hamr9t0AcjoE6tbjL9O80EAFpWiVWrR9PviwzL7H2ZkIOe MPGxVThISRRSWBrRpLK2kSSXS6rfOgaF0hkgqu3lyeu2PHwTXKRbl1Fo9iwhc9/8HsS5 yolvAFX1pzcYh67bprd0MGdkaz55OeA6mnPmYrefzBxBOKHJnqKFVC7+CFxo3tyqpFK+ Kr6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gWnbQGQJOqdaM9GqZg5HDHDpO0vrT5dYlIu9zqFadZk=; b=dMSPbmSUiRkT+xb6dsRrkWuwARHyCb5PW0ttcccyfjr5e+unSL6GZsTWUHYoyb2o4h YlHPjcCevtvvkTWP81M3VQtQyfxnjTM93nZlHQ/xFiic/DehjDdwdAGmjoquJPTRPCNh rt3vZO+nE2QFfZbAsEQ1ohzdjDNGLAjDGXu+6NGf8E0r/9zkE6WocrOz8Kr2vQ9jZKkP xdxh1cxvKs8hCDADuHpqy3g7KhDFr1FW0JqBo8j2v3tOOLUSif0aei7Oct93XvCo6aZS cQZnB0hMmqkCFhLNQ3rsjFRTTf5DNGGy0KGvJyjuds2BEP9TCx8mvBoJab0f/jztZSvS MZ7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KUzptJy9; 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=pass (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 f12si19606591plt.418.2019.03.28.12.34.44; Thu, 28 Mar 2019 12:34:44 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=KUzptJy9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbfC1Ten (ORCPT + 3 others); Thu, 28 Mar 2019 15:34:43 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:53668 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbfC1Ten (ORCPT ); Thu, 28 Mar 2019 15:34:43 -0400 Received: by mail-wm1-f67.google.com with SMTP id q16so56498wmj.3 for ; Thu, 28 Mar 2019 12:34:42 -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 :mime-version:content-transfer-encoding; bh=gWnbQGQJOqdaM9GqZg5HDHDpO0vrT5dYlIu9zqFadZk=; b=KUzptJy9UipXep89qvMvbGfXDUdDjdr+6nPFKmj7/gSzBurxTWQjI79XXsGWlcKkX8 eUI91hE5IICTaY3qNcONeuO/qm2ENp6uk84COKYgw/fmTHXQXDhs43SU925LF93Xym/B eJBG6475ZjyWL9xuN/JcrrOXlkCiJmx8O4Am25RbaZIpIxjerGr4Ko8c3zdY78LmUu1y AcUrEfM8tOaC6+EuEAEvn17racR8i318hzoi1Zf5o/F1ot+XipNqNYwz3Xfze2OjC+Jd TWVj5ME6fK5b0U/HCAAM0rGu3UmpFsMdl2uCyNkpJD+pBqFWTsTMfaoqfosuaY8EYRDS Bkzg== 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:mime-version:content-transfer-encoding; bh=gWnbQGQJOqdaM9GqZg5HDHDpO0vrT5dYlIu9zqFadZk=; b=s0wr0Nk6UR7IhMGeXbWSu6roDegtGZbJ5k6yJkV4tZWuzUIIV6ib94euB7Y4o5cWLL xMFXntUK2M7h+7ZYemGlH4A7ZNTveVPVgTvZ0mZXMpiR/yg/SnkLY4Sd1dqafuoRliWX +JltE5QLvynDMWgCda7bCawFMtr6eG5d1bx4X0igGeba+r9NdN0tkQzGe1SGB800jaub FW4F4Z9sVQuEKFki7iHu7Xa1l/U3uckKcbQC1L8BFr+q8vCKVF7/o96cq8NbvvfiakVv nDMA9RusIT63RyjAs/iVhc4bZnoYOMZfLOQFvK+q08F13sTc6XDq6gTJf5xNLDYjGeR2 t0wA== X-Gm-Message-State: APjAAAVDmG4Y2RhAPbOcWDsrnovYWx9RwUQ5led1ger6kilqClEttQTa 4mxtoa26VIdUaUW56JUyVNx7dYp44SKH+g== X-Received: by 2002:a1c:1aca:: with SMTP id a193mr1140540wma.40.1553801681532; Thu, 28 Mar 2019 12:34:41 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:dd62:8a50:1468:989d]) by smtp.gmail.com with ESMTPSA id d6sm27739186wrx.62.2019.03.28.12.34.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 12:34:40 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Marcin Benka , Ard Biesheuvel , linux-kernel@vger.kernel.org, Robert Richter Subject: [PATCH 3/5] efi/arm: Show SMBIOS bank/device location in cper and ghes error logs Date: Thu, 28 Mar 2019 20:34:27 +0100 Message-Id: <20190328193429.21373-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328193429.21373-1-ard.biesheuvel@linaro.org> References: <20190328193429.21373-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Marcin Benka Run dmi_memdev_walk() for arch arm* as other archs do. This improves error logging as the memory device handle is translated now to the DIMM entry's name provided by the DMI handle. Before: {1}[Hardware Error]: DIMM location: not present. DMI handle: 0x0038 After: {1}[Hardware Error]: DIMM location: N0 DIMM_A0 Signed-off-by: Marcin Benka Signed-off-by: Robert Richter Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/arm-runtime.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 0c1af675c338..4a0dfe4ab829 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -167,6 +167,7 @@ static int __init arm_dmi_init(void) * itself, depends on dmi_scan_machine() having been called already. */ dmi_scan_machine(); + dmi_memdev_walk(); if (dmi_available) dmi_set_dump_stack_arch_desc(); return 0; From patchwork Thu Mar 28 19:34:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 161333 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1122565jan; Thu, 28 Mar 2019 12:34:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqynhOl87btbwpYtVLoZgr7yl08JrtxfoVRutue/Avli0emFebOwg//E7RBAC/XUOv/hOvjf X-Received: by 2002:a17:902:3f83:: with SMTP id a3mr42399599pld.6.1553801695762; Thu, 28 Mar 2019 12:34:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553801695; cv=none; d=google.com; s=arc-20160816; b=LDLMndPGNSvUP4GkHsyLkPbKTlzNVB2UNoNdoLdq2jMLFNILbST4yAaUIWWVLF98q8 S2NUsEzcFEUYx+qxwV+Mp/eW8Yd/X6J8eprsnk4sUSVzlklGmBwtCPP7UcOL3mBFIlsY OJ9adKggFM6xZdOC4CbAUV8pQScj4VaAIKmxu/GOFOtuNLs6XgvJEWNcFk5uyVXkkdZg bRPqJicHKKCxpsOLekOyFz/soehvH7cfgvz1oCdpS0llenCmwmXvwOhMR2Z6+flWYoOu QHl9/UIm5rcW7FwDtkduRcRx2nf/UFATIYZpAhLwuBkodsHsWw+VISDZ1Qvr+S4HQv4K yXTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BLhZJfqzPBQPaOfw6+hXJCxqv7TmfGdAb1ivjJuJyjA=; b=dV8tLhLdFMiwkTsyzPiwVYTPTeDUu9/gcOa9Xh9pvDLdfBWGZ49NNIJE9PCLJX75VR W3ybvZnRlfUGchCOD/Tpk7lZllLmcN8RqCjWDl6S3sHutlaiKEjyDEPu+aNrZMvJp/sx /pNQNSsjAp4Sz0sRxdwbaSF9J6HCFjha3fkpnupOuC1s/rQUeEeK6pLOpg8aEP88l5Dd +RBYxNLjil7OO+hGJuqmoXybsygN1wV0kH/hIo/0J5NHtGMYPFcJb8KQbC8EowCJD5UW QhlWue0wiJTuUxI694MFV+mZhbLsOHQdKfFzgWMGkPCwsBEe4i2pZ3W4Il2obrtCMZd9 SeaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MWPZv7J6; 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=pass (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 w7si21069172pgs.155.2019.03.28.12.34.55; Thu, 28 Mar 2019 12:34:55 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=MWPZv7J6; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726195AbfC1Tey (ORCPT + 3 others); Thu, 28 Mar 2019 15:34:54 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54869 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbfC1Tep (ORCPT ); Thu, 28 Mar 2019 15:34:45 -0400 Received: by mail-wm1-f66.google.com with SMTP id f3so50503wmj.4 for ; Thu, 28 Mar 2019 12:34:44 -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 :mime-version:content-transfer-encoding; bh=BLhZJfqzPBQPaOfw6+hXJCxqv7TmfGdAb1ivjJuJyjA=; b=MWPZv7J6oPHLFpXOfSZPgQsHD4lk1Ew1EFrZb4EvnJPQrkQweJ5QKwXNSYAUFsWm4G qvvoRChx5c+Xo71Hw4slvs2orT5RxOZLxX+0gvRisUe590glKi3J6HYDMbGM+myrZM5B uV8Be09ACwfaXSyTBOF2E/B52k25wrzumpZfhIRXFf4lL5dNk2cXczXwttNRQV8zBXkD bYZtiIQPjGB1FXi06Gdg99bncrmAkki7uTXWDPOdST/OsAeHkeSbVli2Zgy61ZUGyyve 10q3U0nQrRJQ7OlW3akOZ3Ic3pN6MdKh/wiOw1hUBaygeVaeuldnyrk4NWBITbK0tDU7 Q+Jw== 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:mime-version:content-transfer-encoding; bh=BLhZJfqzPBQPaOfw6+hXJCxqv7TmfGdAb1ivjJuJyjA=; b=EzSoWKm5+QoOxGSjHxFUj1EPEkRiiGoK88mkrlNIyfmOiRFsEsImgYnlQ2AVw4h65d frZQje6P0TIXONpQoXVuRpFADLkTQCi6oqUqWszA+rtX4wMhL/LwClEr4NRKQxFWJ6mY iCuAfToyQQEz7pAR3teQehCYoUBgDg14jYrcNMr5JKneXs8hfiYcgMgzKzxOdRcMzrzu wOj4guSH1vPC3EmWvxfDTCI/iWdnU14Kck5l31YvW7Pq7CIkshlsh27D7Knsjhm5tMKv iFOnFnjaweP21qQnVWQdLrfTtKlp2ispMKq+lJz2xs4/svGId3xgojR9SYyYHuAULV87 YsRQ== X-Gm-Message-State: APjAAAUAt1m2EzxGQfVH+17gOTifkLKkhEBLW78hh+Xkntf748fLdpz8 Unl9SgAcmHYUAyZjIa40OegaXK6brCno3w== X-Received: by 2002:a1c:2b41:: with SMTP id r62mr1046476wmr.94.1553801683104; Thu, 28 Mar 2019 12:34:43 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:dd62:8a50:1468:989d]) by smtp.gmail.com with ESMTPSA id d6sm27739186wrx.62.2019.03.28.12.34.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Mar 2019 12:34:42 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Robert Richter , Ard Biesheuvel , linux-kernel@vger.kernel.org, Jean Delvare Subject: [PATCH 4/5] efi: Unify dmi setup code over architectures arm/arm64, ia64 and x86 Date: Thu, 28 Mar 2019 20:34:28 +0100 Message-Id: <20190328193429.21373-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190328193429.21373-1-ard.biesheuvel@linaro.org> References: <20190328193429.21373-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Robert Richter All architectures (arm/arm64, ia64 and x86) do the same here, so unify the code. Note: We do not need to call dump_stack_set_arch_desc() in case of !dmi_available. Both strings, dmi_ids_string and dump_stack_arch_ desc_str are initialized zero and thus nothing would change. Signed-off-by: Robert Richter Reviewed-by: Jean Delvare Signed-off-by: Ard Biesheuvel --- arch/ia64/kernel/setup.c | 4 +--- arch/x86/kernel/setup.c | 6 ++---- drivers/firmware/dmi_scan.c | 28 +++++++++++++++------------- drivers/firmware/efi/arm-runtime.c | 7 ++----- include/linux/dmi.h | 8 ++------ 5 files changed, 22 insertions(+), 31 deletions(-) -- 2.20.1 diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 583a3746d70b..c9cfa760cd57 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -1058,9 +1058,7 @@ check_bugs (void) static int __init run_dmi_scan(void) { - dmi_scan_machine(); - dmi_memdev_walk(); - dmi_set_dump_stack_arch_desc(); + dmi_setup(); return 0; } core_initcall(run_dmi_scan); diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 3d872a527cd9..3773905cd2c1 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1005,13 +1005,11 @@ void __init setup_arch(char **cmdline_p) if (efi_enabled(EFI_BOOT)) efi_init(); - dmi_scan_machine(); - dmi_memdev_walk(); - dmi_set_dump_stack_arch_desc(); + dmi_setup(); /* * VMware detection requires dmi to be available, so this - * needs to be done after dmi_scan_machine(), for the boot CPU. + * needs to be done after dmi_setup(), for the boot CPU. */ init_hypervisor_platform(); diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 099d83e4e910..fae2d5c43314 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -416,11 +416,8 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v) nr++; } -void __init dmi_memdev_walk(void) +static void __init dmi_memdev_walk(void) { - if (!dmi_available) - return; - if (dmi_walk_early(count_mem_devices) == 0 && dmi_memdev_nr) { dmi_memdev = dmi_alloc(sizeof(*dmi_memdev) * dmi_memdev_nr); if (dmi_memdev) @@ -614,7 +611,7 @@ static int __init dmi_smbios3_present(const u8 *buf) return 1; } -void __init dmi_scan_machine(void) +static void __init dmi_scan_machine(void) { char __iomem *p, *q; char buf[32]; @@ -769,15 +766,20 @@ static int __init dmi_init(void) subsys_initcall(dmi_init); /** - * dmi_set_dump_stack_arch_desc - set arch description for dump_stack() + * dmi_setup - scan and setup DMI system information * - * Invoke dump_stack_set_arch_desc() with DMI system information so that - * DMI identifiers are printed out on task dumps. Arch boot code should - * call this function after dmi_scan_machine() if it wants to print out DMI - * identifiers on task dumps. + * Scan the DMI system information. This setups DMI identifiers + * (dmi_system_id) for printing it out on task dumps and prepares + * DIMM entry information (dmi_memdev_info) from the SMBIOS table + * for using this when reporting memory errors. */ -void __init dmi_set_dump_stack_arch_desc(void) +void __init dmi_setup(void) { + dmi_scan_machine(); + if (!dmi_available) + return; + + dmi_memdev_walk(); dump_stack_set_arch_desc("%s", dmi_ids_string); } @@ -841,7 +843,7 @@ static bool dmi_is_end_of_table(const struct dmi_system_id *dmi) * returns non zero or we hit the end. Callback function is called for * each successful match. Returns the number of matches. * - * dmi_scan_machine must be called before this function is called. + * dmi_setup must be called before this function is called. */ int dmi_check_system(const struct dmi_system_id *list) { @@ -871,7 +873,7 @@ EXPORT_SYMBOL(dmi_check_system); * Walk the blacklist table until the first match is found. Return the * pointer to the matching entry or NULL if there's no match. * - * dmi_scan_machine must be called before this function is called. + * dmi_setup must be called before this function is called. */ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list) { diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 4a0dfe4ab829..e2ac5fa5531b 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -162,14 +162,11 @@ void efi_virtmap_unload(void) static int __init arm_dmi_init(void) { /* - * On arm64/ARM, DMI depends on UEFI, and dmi_scan_machine() needs to + * On arm64/ARM, DMI depends on UEFI, and dmi_setup() needs to * be called early because dmi_id_init(), which is an arch_initcall * itself, depends on dmi_scan_machine() having been called already. */ - dmi_scan_machine(); - dmi_memdev_walk(); - if (dmi_available) - dmi_set_dump_stack_arch_desc(); + dmi_setup(); return 0; } core_initcall(arm_dmi_init); diff --git a/include/linux/dmi.h b/include/linux/dmi.h index c46fdb36700b..8de8c4f15163 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h @@ -102,9 +102,7 @@ const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); extern const char * dmi_get_system_info(int field); extern const struct dmi_device * dmi_find_device(int type, const char *name, const struct dmi_device *from); -extern void dmi_scan_machine(void); -extern void dmi_memdev_walk(void); -extern void dmi_set_dump_stack_arch_desc(void); +extern void dmi_setup(void); extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); extern int dmi_get_bios_year(void); extern int dmi_name_in_vendors(const char *str); @@ -122,9 +120,7 @@ static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; static inline const char * dmi_get_system_info(int field) { return NULL; } static inline const struct dmi_device * dmi_find_device(int type, const char *name, const struct dmi_device *from) { return NULL; } -static inline void dmi_scan_machine(void) { return; } -static inline void dmi_memdev_walk(void) { } -static inline void dmi_set_dump_stack_arch_desc(void) { } +static inline void dmi_setup(void) { } static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) { if (yearp)