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",