From patchwork Wed Oct 14 18:42:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1382299 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=eFY1C2t4; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBLrf3HlSz9sTq for ; Thu, 15 Oct 2020 05:42:58 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1kSljf-0003KA-US; Wed, 14 Oct 2020 18:42:51 +0000 Received: from mout.gmx.net ([212.227.15.15]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kSlje-0003JP-30 for fwts-devel@lists.ubuntu.com; Wed, 14 Oct 2020 18:42:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602700969; bh=MRv6ZBNWQ38ZZ25ZZZj5jcFX1v4SbTVIa3NY/tAkvMY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=eFY1C2t4z/0hXDMxolquhQpo+xtVdBw0mfxKCez+tIrXXAxdLLR1+tQ2h2Gkaa6CW T9BXlkJ4r5iVyh79kdnML+2CI0prBv0kJHaPeK6irv1+RCIB7EvTq8OMEf9viEWqqo d92Z1lTTUpR6gwIbJ7epUkE60nJXJuVCEiUsaXtk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([178.202.41.107]) by mail.gmx.com (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MsHns-1kCtXf0yr4-00tmdr; Wed, 14 Oct 2020 20:42:49 +0200 From: Heinrich Schuchardt To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/1] fwts-test: fwts-test: EFI_RT_PROPERTIES_TABLE Date: Wed, 14 Oct 2020 20:42:40 +0200 Message-Id: <20201014184240.23998-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:jTaKzHZASGjXM2r/fIKIeYZkR2lWVKc5rL3wZU/01UFSBhSRT7r XI0FPjj5vC9vUiquwvHtRTiPXykvuVUtG7CLByU2oKtTJuvzG6SHC8yfH7Qm9WSDe3LIeoO zCQAWx8J0ZAAP2WyhHDV8bsfA3whwfc6IeGuo+eMC4NRkqOmRJtHoAMa59O+EaePzqN5zLO 8PeXVPFB1eNPGo0lPmlEA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:3nx341WbD9w=:ja7kT9tmemK90np1pAdY1d tmIFyBHm3ZMSsM4JCpkPArOMMGxJBP6n74q+F3y5fq51TInp0ls3QcQrtXoq6ee3roQsziYjC IpF86kH9bo4xQrafzWJ+i5CDFX0l3eD4xaNFXWqDGN7tDPGjIRuHOTNkXVL4Mt84FElr6Ucoe DxEU+4ORhty9IcgDhMHUi0cHz8avaOOX74CfnD2FJlIax92oZPcvkStZRTZDdlMOqzBmpcw0l AEK38EEMVUUbh9guZ/xZsGRsF0gG6HkMbWoeOoRQW/fyVEMkMSW44DRt5TeP3OX1jcynvptHp YnQsSlKWSETAW1353Gwhad0Gzn939oITx/5HlT33wz16aKiXCrIYF+LbkOXxn2FUvpCmABkFt rglHjbrlU0syHFgIAqQ6ch7uTxF88sSO3MdNNriVv8UWnf610PzieUX+WVShqJ9Tg5rFbQQ0F k++6KjZZZ9av8X38jmLKFgwBCxZhfSXz6u9vTggc4JIkt3Ye1E+nD4tNLb38b6PJeS/0nSZIE fE2Wg1uRE/Lbz5TMDFMSP4IM4QSIfn8YTFRy0Lr+h5IYeJzX+rdCzxNeJLg/HXQ9jaTtbYOAW VrGJ1vKb5bYnuiVvrUrZ9OZ29EfMNXxHLZGYtSxcEnsRUUFjja7ieo3zoxHnNlP4ZBFj/jDKN 2KGvyxQJl3QNRiveSsjh81pV7yZ8X4kRYU1+SNLTxZ8Pezqyx0y/nsscZkXok1htUgXPf/2L9 ObTqYB8WrDp79uwmUGhVez7hvCQEgYo8JdHgVqrPdHcVUsvU6QkgA6+xwztH8Hicsh9gRPr8k KeivSDUPAAVmfnieJFv+RtMoKiCOEPQump64vBNegRHdrdKrWgvkFyUB1nD3U4Mn4nmGh/Fgn 8EE5gE/RMZuDUlz/eX9Q== X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heinrich Schuchardt , Ard Biesheuvel Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" The UEFI 2.8 specification introduced the RuntimeServicesSupported EFI variable. In the UEFI 2.8 specification (Errata A) this variable was marked invalid and replaced by the EFI_RT_PROPERTIES_TABLE configuration table. If a RuntimeServicesSupported variable is not found this does not indicate that runtime services are not avaiable. As of v5.9 the efi_test driver of the Linux kernel does not provide access to the EFI_RT_PROPERTIES_TABLE configuration table. So lets assume that all services are implemented. If they are not supported they will signal this by returning EFI_UNSUPPORTED. Signed-off-by: Heinrich Schuchardt --- src/lib/src/fwts_uefi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.28.0 diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c index 0fb6b799..aeddb153 100644 --- a/src/lib/src/fwts_uefi.c +++ b/src/lib/src/fwts_uefi.c @@ -543,6 +543,9 @@ bool fwts_uefi_efivars_iface_exist(void) * fwts_uefi_rt_support_status_get() * get the status of runtime service support and the value of * the RuntimeServicesSupported variable + * + * This variable only exists in UEFI 2.8 but not in UEFI 2.8 (Errata A) ff. + * TODO: evaluate the EFI_RT_PROPERTIES_TABLE configuration table. */ void fwts_uefi_rt_support_status_get(int fd, bool *getvar_supported, uint32_t *var_rtsupported) { @@ -569,11 +572,8 @@ void fwts_uefi_rt_support_status_get(int fd, bool *getvar_supported, uint32_t *v ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); if (ioret == -1) { - if (status == EFI_NOT_FOUND) { - *getvar_supported = true; - } else { - *getvar_supported = false; - } + *getvar_supported = true; + *var_rtsupported = 0x3fff; return; }