From patchwork Thu Oct 15 18:48:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1382864 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=HmDMAeor; 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 4CByxC1TtDz9sT6 for ; Fri, 16 Oct 2020 05:49:03 +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 1kT8J7-0004XU-02; Thu, 15 Oct 2020 18:48:57 +0000 Received: from mout.gmx.net ([212.227.17.21]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kT8J4-0004XM-Te for fwts-devel@lists.ubuntu.com; Thu, 15 Oct 2020 18:48:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1602787734; bh=z9I1seN29p3Mbbd8ia4YEaLuSmjxQDVnFODLRrA79NI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=HmDMAeora3VUIQzbbe+HASwmVKLQRcho3DY7GfNCQkgkHwhJaUEjrNt5jBI3tShVT A9RgTQtMw4t3/AcAckwcnPBT7lGB6D+mMBgFnPXf/7u4I7OMkhgl40q8JQtolFcpbY XE/j/sS57CEI7EGaPKMmX+y1v5WFsSS1Uz4s7S9I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([178.202.41.107]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MpUUm-1k5uRd41im-00pxVa; Thu, 15 Oct 2020 20:48:54 +0200 From: Heinrich Schuchardt To: fwts-devel@lists.ubuntu.com Subject: [fwts PATCH v2 1/1] use EFI_RT_PROPERTIES_TABLE, not variable Date: Thu, 15 Oct 2020 20:48:41 +0200 Message-Id: <20201015184841.4339-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:9XrwBCpBK+0dlrXV5aa1RIL3tta0VaNVYyXUyYPAIrsv9yFu63Q y26L1O51pxtisMdvzRie4DEpFAlNTrgTNR6v2j17GE7cbCh9WChr27k11BtZ+iS2ykw6yOs mYO33TpVqPALJYj4ef1IyHpkPiXWWn7jcwoF1xGDo/ZUUDrkkyhDDpVOJDVjLC0EOatsXAU HBBgdGHhfcBWeFoNWzYgQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:reG4a1H5PDQ=:tEv1hHnjMpQ6nKzxZkVzh8 Fh0nkcLUA7Amynwcxt5fH+wq87NO2JGy+CVK0ctUr6cfGUJP7XL4XgYw+k2y6sL2308vynv9m UAHlt0vWC/OqaYGh9Sh0PCqqVS+CwAy7jrCnBxyJ2AwNEUqiXYa1pZv3GfsQkRKqkLdKuWMsZ 2KWCjiQta8qxc1tXgsMzWlmL1hrXtul+Hmh/10C6/ADs4ZlVWefVv+rhYrIcFhPPo3gAFIYnK RaeZUd5vu79Lt4nq2PatvgxqCHODDJ8774uZDD/9xSypbJD79mlC88/CytygTm9kb0KRKDKNG geUSglQJUg3G4TWk39gIsQbntEs/EaaGeWdjmYFzcNQ6s4NL6hw5TNlTw+8YYF9Q4Uhle67ua TXOWhWdOd8+jTgOEQKfl1SLErDH2+pd7CeDli6Z0cvVrbv1kv8CHXssMvSZHRlZSaQTq/wg8M DXE/JYKasIFiYVkyVRxVObZquEWLCvGgrKd23Yo5SVzIRZeqjV98EBrIfUV0IxaVPviQRO5bs EJyF51ik52eUHHRb7ormzaOVLUxc3jMDpnfd1DYspZXvEWKj5wIm6/ra6VMt08wfFvNnAGBxF mhszCWuXSrixq2DJINAUwgXuZnfqaXKChR0owA8AUR1dbr3KELtB0r3gRVoa21UY2e9PWcdp7 0QPPoCg/19/Z8U5kPBDRGtYUrmo6D9o1n2mEgkIUrTvojjiSAsPDkgo/T6f7MBv49hWCz+ixZ 42dKDSD6w1QQzwIBXrt/3sdFY4N5PIPtiUA5sYlgn/tPeslmkfSHrP3gr8F5GkjZKIaBYF7oZ HPuEt0xOXToD68aLCP+fVjLN5dSCiokHeZPLyECBkJOIBNjKN5UmmZZGLQ4hEd1If5o++bq0K lX7QDD8pqVbTYrx63x2g== 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 Acked-by: Colin Ian King --- v2: correct subject line --- 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; }