From patchwork Sat May 25 11:25:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 165176 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp4724831ili; Sat, 25 May 2019 04:26:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsHESkFtH/b1/udaSTzx2UAZPZJUgGSPDPebu5JeowMXuaCAepRJpYSOsrIX/PI288dzOK X-Received: by 2002:a17:902:54f:: with SMTP id 73mr111857085plf.140.1558783569994; Sat, 25 May 2019 04:26:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558783569; cv=none; d=google.com; s=arc-20160816; b=CIIHZPsPNDA2ZuLDQFlpGk7xNT4E4yJK9C7qjAYLtkajUr1YBRT7pE+rf6HdjFc037 5n9Pi6q0UFB+2G3vIV1vSGxCG9JhKbVyCqFIAMfqiIhd+OK4WALDGugbZaqCSaawqXsL HGToW7Vp8FrUE/6FIfgv8Ps/VCOip+RdKavBBhidel3w49MhreG6AiUFaGIZi4aAoBEu B3bhce6n7t2u0Lt/Ys6nnkzf6yPSxe2m40ks/lcUqmuie/m5DMbFDKqdG+NsYftBXH3u +/rW/YQTTy9+sCUHh9BC9fTkwDHJtSVpE86rE2vZrcq5eTQq4eLbtxszc3dX9lHD6H2T ovIg== 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=OUI4/EWFs7dysvkWkmT8oqHBgaMA7PctBGeEQk1P8DM=; b=Xm9FhNMQL6SPJkeWK+efFlUcc09q2qXE8DEwl/cD/ln3OIt56SMQep8PAcnSBw4JOW yTdeDvXDxLdnJxHmg0/9NqodzOG1giJvt4VigbudlNxxIhf5mCT45EFV+Btd6Qf6tthu 2hYEXkAAgNO6MnMqAGz1lw6hP35asR5GyiDGHzGdV44AzsiOTxTJ/3ev6/sxG93ohBKL PG8p0LQsO7Iem0fsmxWNnHbHiWO/gKFZ+gvlq3KWkuhDvxKWpFLn29Vb4sp4Nz3f1fPA NHFsL0pUH5dp2Qp0WNi18O+9Pd/Q+8jVwDFlsBNVnKWNLjSlLvq69rug+lo1vCNt4zyz Aewg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xk7crZ3S; 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 l11si6982687pgp.438.2019.05.25.04.26.09; Sat, 25 May 2019 04:26:09 -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=Xk7crZ3S; 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 S1726653AbfEYL0J (ORCPT + 3 others); Sat, 25 May 2019 07:26:09 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36479 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbfEYL0I (ORCPT ); Sat, 25 May 2019 07:26:08 -0400 Received: by mail-wm1-f68.google.com with SMTP id v22so4267160wml.1 for ; Sat, 25 May 2019 04:26:07 -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=OUI4/EWFs7dysvkWkmT8oqHBgaMA7PctBGeEQk1P8DM=; b=Xk7crZ3SgaYp2op+gqS6Fwuo61nMeTjeaMhkrpOXWcTSb1xfkjUrv4qgMftwU/IlHy dmd71IcLoKhv3YHnv8AZmZuTsg4jpSLsGXYM6/1C+zs43ioBxvvNoHRI/5JwgHN+XYdg j/Z7lCyFj5QKDWn53ydL4gVFUQZpsjutjJhKEWcpqQMQugKiz2kR5VuJx1KGOo3E+Nda Npzq01tKsupdUU7myMcCnFUImgtIcE5+zDslXII4YBhFm6GEiQYQcSsxAhKCxl9s7mTw WcR43lBzU4NZLs10wB6Id/eI0J9TqsVC/wEVtt9E0FK78MoO54vaPBFBfACfaURgaczz QSYg== 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=OUI4/EWFs7dysvkWkmT8oqHBgaMA7PctBGeEQk1P8DM=; b=VQ3XnrIrNrg+VWPd418apSJcX4zMVtZy7WhNzIjqw2pqoOeyTTe2b1/x2IqUbVpKlp odS8eMzuKxB6lm09lO13ViJyBg1W3HBBWCxkyeHGooRvMaafD2SMGJE42v1gJe+c4Jdz Fz8kbrLSi4xoUnhmXr9/iFV3KHBlmQY3I4x7sYpPt0l35N+azW/LaXR3U3zmWS8XK4Q9 e80lPZn9Qw9FF0xHU8P2zPcEI8fUJV+kyg6i2RNmkZP3pbX7ZhpU2BHdYSA3qaVOOET1 BuuVPDcFN8EoNvmeljJwFg115UDWqHFNv9umJNlYbjaPszOUS19GKG1RrE/dEaEr9u8e vlhQ== X-Gm-Message-State: APjAAAUPLs3OtnBnLbe/C5u8z/g5hAMNQAlXMKV20Yskw2FKueP3FYAO Sdz7zCvEYboA7bQQDnouj8G/In5FXhQ+Gg== X-Received: by 2002:a1c:1a47:: with SMTP id a68mr3134852wma.88.1558783566097; Sat, 25 May 2019 04:26:06 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:3ccc:7074:9336:6a6e]) by smtp.gmail.com with ESMTPSA id y16sm4942010wru.28.2019.05.25.04.26.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 May 2019 04:26:05 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Gen Zhang , Rob Bradford Subject: [PATCH 2/2] efi: Allow the number of EFI configuration tables entries to be zero Date: Sat, 25 May 2019 13:25:59 +0200 Message-Id: <20190525112559.7917-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190525112559.7917-1-ard.biesheuvel@linaro.org> References: <20190525112559.7917-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: Rob Bradford Only try and access the EFI configuration tables if there there are any reported. This allows EFI to be continued to used on systems where there are no configuration table entries. Signed-off-by: Rob Bradford Signed-off-by: Ard Biesheuvel --- arch/x86/platform/efi/quirks.c | 3 +++ drivers/firmware/efi/efi.c | 3 +++ 2 files changed, 6 insertions(+) -- 2.20.1 diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c index a25a9fd987a9..e92ab8002dc5 100644 --- a/arch/x86/platform/efi/quirks.c +++ b/arch/x86/platform/efi/quirks.c @@ -512,6 +512,9 @@ int __init efi_reuse_config(u64 tables, int nr_tables) void *p, *tablep; struct efi_setup_data *data; + if (nr_tables == 0) + return 0; + if (!efi_setup) return 0; diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 55b77c576c42..521a541d02ad 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -636,6 +636,9 @@ int __init efi_config_init(efi_config_table_type_t *arch_tables) void *config_tables; int sz, ret; + if (efi.systab->nr_tables == 0) + return 0; + if (efi_enabled(EFI_64BIT)) sz = sizeof(efi_config_table_64_t); else