From patchwork Fri May 7 09:56:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1475444 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=) 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 4Fc5Sf1CKcz9ssP for ; Fri, 7 May 2021 19:56:33 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lexDh-0006q6-UE; Fri, 07 May 2021 09:56:29 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lexDf-0006q0-Jv for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:27 +0000 Received: from [175.181.154.193] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lexDe-0007kX-Nt for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:27 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 1/4] uefirttime: only test the unsupported status with RuntimeServicesSupported Date: Fri, 7 May 2021 17:56:20 +0800 Message-Id: <20210507095623.34254-1-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Currently, kernel efi driver will set the RuntimeServicesSupported mask all supported as default when RTPROT table not found. And from the UEFI spec., RTPROT table should be published by a platform if it no longer supports all EFI runtime services once ExitBootServices() has been called by the OS. And the platform is still required to provide callable implementations of unsupported runtime services that simply return EFI_UNSUPPORTED. So do not test the supported status which might get RuntimeServicesSupported mask from kernel default value in case we get false alarm, only test the upsupported status which can make sure is from RTPROT table for the GetTime, SetTime, GetWakeupTime and SetWakeupTime runtime services. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/uefi/uefirttime/uefirttime.c | 250 +++++++++++-------------------- 1 file changed, 90 insertions(+), 160 deletions(-) diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c index fa157736..00326139 100644 --- a/src/uefi/uefirttime/uefirttime.c +++ b/src/uefi/uefirttime/uefirttime.c @@ -1159,202 +1159,132 @@ static int uefirttime_test38(fwts_framework *fw) EFI_TIME efi_time; EFI_TIME_CAPABILITIES efi_time_cap; - if (!have_rtsupported) { - fwts_skipped(fw, "Cannot get the RuntimeServicesSupported " - "mask from the kernel. This IOCTL was " - "introduced in Linux v5.11."); - return FWTS_SKIP; - } - - gettime.Capabilities = &efi_time_cap; - gettime.Time = &efi_time; - gettime.status = &status; - ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", - "Get the GetTime runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware."); - } else { + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME)) { + gettime.Capabilities = &efi_time_cap; + gettime.Time = &efi_time; + gettime.status = &status; + + ioret = ioctl(fd, EFI_RUNTIME_GET_TIME, &gettime); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) fwts_passed(fw, "UEFI GetTime runtime service " - "supported status test passed."); + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", + "Get the GetTime runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS ) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { - fwts_passed(fw, "UEFI GetTime runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", "Get the GetTime runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); - } - } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_TIME) { - fwts_passed(fw, "UEFI GetTime runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetTime", - "Get the GetTime runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); - } - } + } else + fwts_skipped(fw, "GetTime runtime service supported, skip test."); - settime.Time = &efi_time; - status = ~0ULL; - settime.status = &status; + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME)) { + settime.Time = &efi_time; + status = ~0ULL; + settime.status = &status; - ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, &settime); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", - "Get the SetTime runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware."); - } else { + ioret = ioctl(fd, EFI_RUNTIME_SET_TIME, &settime); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) { fwts_passed(fw, "UEFI SetTime runtime service " - "supported status test passed."); + "unsupported status test passed."); + } else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", + "Get the SetTime runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS ) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { - fwts_passed(fw, "UEFI SetTime runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", "Get the SetTime runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); - } - } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; } - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_TIME) { - fwts_passed(fw, "UEFI SetTime runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetTime", - "Get the SetTime runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); - } - } - - setwakeuptime.Time = &efi_time; - status = ~0ULL; - setwakeuptime.status = &status; - setwakeuptime.Enabled = false; - - ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, &setwakeuptime); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", - "Get the SetWakeupTime runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware"); - - } else { - fwts_passed(fw, "UEFI SetWakeupTime runtime service " - "supported status test passed."); + } else + fwts_skipped(fw, "SetTime runtime service supported, skip test."); + + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME)) { + setwakeuptime.Time = &efi_time; + status = ~0ULL; + setwakeuptime.status = &status; + setwakeuptime.Enabled = false; + + ioret = ioctl(fd, EFI_RUNTIME_SET_WAKETIME, &setwakeuptime); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) + fwts_passed(fw, "UEFI SetWakeupTime runtime service " + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", + "Get the SetWakeupTime runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS ) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { - fwts_passed(fw, "UEFI SetWakeupTime runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", "Get the SetWakeupTime runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); - } - } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_WAKEUP_TIME) { - fwts_passed(fw, "UEFI SetWakeupTime runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetWakeupTime", - "Get the SetWakeupTime runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); } } - - getwakeuptime.Enabled = &enabled; - getwakeuptime.Pending = &pending; - getwakeuptime.Time = &efi_time; - getwakeuptime.status = &status; - - ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, &getwakeuptime); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", - "Get the GetWakeupTime runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware"); - } else { - fwts_passed(fw, "UEFI GetWakeupTime runtime service " - "supported status test passed."); + else + fwts_skipped(fw, "SetWakeupTime runtime service supported, skip test."); + + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME)) { + getwakeuptime.Enabled = &enabled; + getwakeuptime.Pending = &pending; + getwakeuptime.Time = &efi_time; + getwakeuptime.status = &status; + + ioret = ioctl(fd, EFI_RUNTIME_GET_WAKETIME, &getwakeuptime); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) + fwts_passed(fw, "UEFI GetWakeupTime runtime service " + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", + "Get the GetWakeupTime runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware"); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS ) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { - fwts_passed(fw, "UEFI GetWakeupTime runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", "Get the GetWakeupTime runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware"); - } - } - } else { - if (status != EFI_SUCCESS ){ - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_WAKEUP_TIME) { - fwts_passed(fw, "UEFI GetWakeupTime runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetWakeupTime", - "Get the GetWakeupTime runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware"); - } - } + } else + fwts_skipped(fw, "GetWakeupTime runtime service supported, skip test."); return FWTS_OK; } @@ -1404,7 +1334,7 @@ static fwts_framework_minor_test uefirttime_tests[] = { #if UEFI_IGNORE_UNSET_BITS { uefirttime_test37, "Test UEFI RT service set wakeup time interface, invalid daylight 0xfc." }, #endif - { uefirttime_test38, "Test UEFI RT time services supported status." }, + { uefirttime_test38, "Test UEFI RT time services unsupported status." }, { NULL, NULL } }; From patchwork Fri May 7 09:56:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1475445 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=) 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 4Fc5Sj6hWhz9ssP for ; Fri, 7 May 2021 19:56:37 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lexDn-0006qf-16; Fri, 07 May 2021 09:56:35 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lexDj-0006qR-Ua for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:31 +0000 Received: from [175.181.154.193] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lexDj-0007l6-4k for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:31 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/4] uefirtvariable: only test the unsupported status with RuntimeServicesSupported Date: Fri, 7 May 2021 17:56:21 +0800 Message-Id: <20210507095623.34254-2-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210507095623.34254-1-ivan.hu@canonical.com> References: <20210507095623.34254-1-ivan.hu@canonical.com> MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Currently, kernel efi driver will set the RuntimeServicesSupported mask all supported as default when RTPROT table not found. And from the UEFI spec., RTPROT table should be published by a platform if it no longer supports all EFI runtime services once ExitBootServices() has been called by the OS. And the platform is still required to provide callable implementations of unsupported runtime services that simply return EFI_UNSUPPORTED. So do not test the supported status which might get RuntimeServicesSupported mask from kernel default value in case we get false alarm, only test the upsupported status which can make sure is from RTPROT table for the GetVariable, SetVariable, GetNextVariable and QueryVariableInfo runtime services. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/uefi/uefirtvariable/uefirtvariable.c | 261 +++++++++-------------- 1 file changed, 96 insertions(+), 165 deletions(-) diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index 5c016108..2b677513 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -2044,112 +2044,74 @@ static int uefirtvariable_test9(fwts_framework *fw) uint64_t getdatasize = sizeof(testdata); uint32_t attr; - if (!have_rtsupported) { - fwts_skipped(fw, "Cannot get the RuntimeServicesSupported " - "mask from the kernel. This IOCTL was " - "introduced in Linux v5.11."); - return FWTS_SKIP; - } - - setvariable.VariableName = variablenametest; - setvariable.VendorGuid = >estguid1; - setvariable.Attributes = attributes; - setvariable.DataSize = datasize; - setvariable.Data = &data; - setvariable.status = &status; - - ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetVariable", - "Get the Setvariable runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware."); - } else { + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE)) { + setvariable.VariableName = variablenametest; + setvariable.VendorGuid = >estguid1; + setvariable.Attributes = attributes; + setvariable.DataSize = datasize; + setvariable.Data = &data; + setvariable.status = &status; + + ioret = ioctl(fd, EFI_RUNTIME_SET_VARIABLE, &setvariable); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) fwts_passed(fw, "UEFI SetVariable runtime service " - "supported status test passed."); + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetVariable", + "Get the SetVariable runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { - fwts_passed(fw, "UEFI SetVariable runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetVariable", "Get the SetVariable runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); - } - } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_SET_VARIABLE) { - fwts_passed(fw, "UEFI SetVariable runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeSetVariable", - "Get the SetVariable runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); } } + else + fwts_skipped(fw, "SetVariable runtime service supported, skip test."); - getvariable.VariableName = variablenametest; - getvariable.VendorGuid = >estguid1; - getvariable.Attributes = &attr; - getvariable.DataSize = &getdatasize; - getvariable.Data = testdata; - getvariable.status = &status; + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE)) { + getvariable.VariableName = variablenametest; + getvariable.VendorGuid = >estguid1; + getvariable.Attributes = &attr; + getvariable.DataSize = &getdatasize; + getvariable.Data = testdata; + getvariable.status = &status; - ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", - "Get the GetVariable runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware."); - } else { + ioret = ioctl(fd, EFI_RUNTIME_GET_VARIABLE, &getvariable); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) fwts_passed(fw, "UEFI GetVariable runtime service " - "supported status test passed."); + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", + "Get the GetVariable runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { - fwts_passed(fw, "UEFI GetVariable runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", "Get the GetVariable runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); - } } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_VARIABLE) { - fwts_passed(fw, "UEFI GetVariable runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetVariable", - "Get the GetVariable runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); - } - } + } else + fwts_skipped(fw, "GetVariable runtime service supported, skip test."); /* delete the variable which was set */ setvariable.DataSize = 0; @@ -2161,108 +2123,77 @@ static int uefirtvariable_test9(fwts_framework *fw) fwts_skipped(fw, "Unable to alloc memory for variable name"); return FWTS_SKIP; } - getnextvariablename.VariableNameSize = &variablenamesize; - getnextvariablename.VariableName = variablename; - getnextvariablename.VendorGuid = &guid; - getnextvariablename.status = &status; - variablename[0] = '\0'; - status = ~0ULL; - ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVarName", - "Get the GetNextVarName runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware."); - } else { + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) { + getnextvariablename.VariableNameSize = &variablenamesize; + getnextvariablename.VariableName = variablename; + getnextvariablename.VendorGuid = &guid; + getnextvariablename.status = &status; + variablename[0] = '\0'; + status = ~0ULL; + + ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTVARIABLENAME, &getnextvariablename); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) fwts_passed(fw, "UEFI GetNextVarName runtime service " - "supported status test passed."); + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVarName", + "Get the GetNextVarName runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { - fwts_passed(fw, "UEFI GetNextVarName runtime service " - "supported status test passed."); - } else { + else fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVarName", "Get the GetNextVarName runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); - } - } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME) { - fwts_passed(fw, "UEFI GetNextVarName runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextVarName", - "Get the GetNextVarName runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); - } - } - - queryvariableinfo.Attributes = attributes; - queryvariableinfo.MaximumVariableStorageSize = &maxvarstoragesize; - queryvariableinfo.RemainingVariableStorageSize = &remvarstoragesize; - queryvariableinfo.MaximumVariableSize = &maxvariablesize; - queryvariableinfo.status = &status; - status = ~0ULL; + } else + fwts_skipped(fw, "GetNextVarName runtime service supported, skip test."); + + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO)) { + queryvariableinfo.Attributes = attributes; + queryvariableinfo.MaximumVariableStorageSize = &maxvarstoragesize; + queryvariableinfo.RemainingVariableStorageSize = &remvarstoragesize; + queryvariableinfo.MaximumVariableSize = &maxvariablesize; + queryvariableinfo.status = &status; + status = ~0ULL; - ioret = ioctl(fd, EFI_RUNTIME_QUERY_VARIABLEINFO, &queryvariableinfo); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeQueryVarInfo", - "Get the QueryVarInfo runtime service supported " - "via RuntimeServicesSupported mask. " - "But actually is not supported by firmware."); - } else { + ioret = ioctl(fd, EFI_RUNTIME_QUERY_VARIABLEINFO, &queryvariableinfo); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) fwts_passed(fw, "UEFI QueryVarInfo runtime service " - "supported status test passed."); + "unsupported status test passed."); + else { + if (status == ~0ULL) + fwts_skipped(fw, "Unknown error occurred, skip test."); + else + fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeQueryVarInfo", + "Get the QueryVarInfo runtime service unsupported " + "via RuntimeServicesSupported mask. " + "But actually is supported by firmware."); } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS) fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { - fwts_passed(fw, "UEFI QueryVarInfo runtime service " - "supported status test passed."); - } else { + else { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeQueryVarInfo", "Get the QueryVarInfo runtime service unsupported " "via RuntimeServicesSupported mask. " "But actually is supported by firmware."); } } - } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_QUERY_VARIABLE_INFO) { - fwts_passed(fw, "UEFI QueryVarInfo runtime service " - "supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeQueryVarInfo", - "Get the QueryVarInfo runtime service unsupported " - "via RuntimeServicesSupported mask. " - "But actually is supported by firmware."); - } - } + } else + fwts_skipped(fw, "QueryVarInfo runtime service supported, skip test."); return FWTS_OK; - } static int options_check(fwts_framework *fw) @@ -2336,7 +2267,7 @@ static fwts_framework_minor_test uefirtvariable_tests[] = { { uefirtvariable_test6, "Test UEFI RT service set variable interface stress test." }, { uefirtvariable_test7, "Test UEFI RT service query variable info interface stress test." }, { uefirtvariable_test8, "Test UEFI RT service get variable interface, invalid parameters." }, - { uefirtvariable_test9, "Test UEFI RT variable services supported status." }, + { uefirtvariable_test9, "Test UEFI RT variable services unsupported status." }, { NULL, NULL } }; From patchwork Fri May 7 09:56:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1475446 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=) 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 4Fc5Sm4WC1z9ssP for ; Fri, 7 May 2021 19:56:40 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lexDq-0006rM-4a; Fri, 07 May 2021 09:56:38 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lexDn-0006qy-Vi for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:35 +0000 Received: from [175.181.154.193] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lexDn-0007lV-33 for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:35 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 3/4] uefirtmisc: only test the unsupported status with RuntimeServicesSupported Date: Fri, 7 May 2021 17:56:22 +0800 Message-Id: <20210507095623.34254-3-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210507095623.34254-1-ivan.hu@canonical.com> References: <20210507095623.34254-1-ivan.hu@canonical.com> MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Currently, kernel efi driver will set the RuntimeServicesSupported mask all supported as default when RTPROT table not found. And from the UEFI spec., RTPROT table should be published by a platform if it no longer supports all EFI runtime services once ExitBootServices() has been called by the OS. And the platform is still required to provide callable implementations of unsupported runtime services that simply return EFI_UNSUPPORTED. So do not test the supported status which might get RuntimeServicesSupported mask from kernel default value in case we get false alarm, only test the upsupported status which can make sure is from RTPROT table for the GetNextHighMonotonicCount runtime services. Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/uefi/uefirtmisc/uefirtmisc.c | 67 ++++++++++++-------------------- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c index 67c49bd3..bdeaf76d 100644 --- a/src/uefi/uefirtmisc/uefirtmisc.c +++ b/src/uefi/uefirtmisc/uefirtmisc.c @@ -253,65 +253,48 @@ static int uefirtmisc_test4(fwts_framework *fw) { long ioret; uint64_t status; - struct efi_getnexthighmonotoniccount getnexthighmonotoniccount; uint32_t highcount; - if (!have_rtsupported) { - fwts_skipped(fw, "Cannot get the RuntimeServicesSupported " - "mask from the kernel. This IOCTL was " - "introduced in Linux v5.11."); - return FWTS_SKIP; - } + if (!(runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT)) { + getnexthighmonotoniccount.HighCount = &highcount; + getnexthighmonotoniccount.status = &status; + status = ~0ULL; - getnexthighmonotoniccount.HighCount = &highcount; - getnexthighmonotoniccount.status = &status; - status = ~0ULL; - ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT, &getnexthighmonotoniccount); - if (ioret == -1) { - if (status == EFI_UNSUPPORTED) { - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { - fwts_failed(fw, LOG_LEVEL_HIGH, - "UEFIRuntimeGetNextHighMonotonicCount", - "Get the GetNextHighMonotonicCount runtime " - "service supported via RuntimeServicesSupported " - "mask. But actually is not supported by " - "firmware."); - } else { + ioret = ioctl(fd, EFI_RUNTIME_GET_NEXTHIGHMONOTONICCOUNT, &getnexthighmonotoniccount); + if (ioret == -1) { + if (status == EFI_UNSUPPORTED) fwts_passed(fw, "UEFI GetNextHighMonotonicCount runtime " - "service supported status test passed."); + "service unsupported status test passed."); + else { + if (status == ~0ULL) { + fwts_skipped(fw, "Unknown error occurred, skip test."); + return FWTS_SKIP; + } else { + fwts_failed(fw, LOG_LEVEL_HIGH, + "UEFIRuntimeGetNextHighMonotonicCount", + "Get the GetNextHighMonotonicCount runtime " + "service unsupported via RuntimeServicesSupported " + "mask. But actually is supported by firmware."); + return FWTS_ERROR; + } } } else { - if (status == ~0ULL) { + if (status != EFI_SUCCESS ) { fwts_skipped(fw, "Unknown error occurred, skip test."); return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { - fwts_passed(fw, "UEFI GetNextHighMonotonicCount runtime " - "service supported status test passed."); } else { fwts_failed(fw, LOG_LEVEL_HIGH, "UEFIRuntimeGetNextHighMonotonicCount", "Get the GetNextHighMonotonicCount runtime " "service unsupported via RuntimeServicesSupported " "mask. But actually is supported by firmware."); + return FWTS_ERROR; } } } else { - if (status != EFI_SUCCESS ) { - fwts_skipped(fw, "Unknown error occurred, skip test."); - return FWTS_SKIP; - } - if (runtimeservicessupported & EFI_RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT) { - fwts_passed(fw, "UEFI GetNextHighMonotonicCount runtime " - "service supported status test passed."); - } else { - fwts_failed(fw, LOG_LEVEL_HIGH, - "UEFIRuntimeGetNextHighMonotonicCount", - "Get the GetNextHighMonotonicCount runtime " - "service unsupported via RuntimeServicesSupported " - "mask. But actually is supported by firmware."); - } + fwts_skipped(fw, "GetNextHighMonotonicCount runtime service supported, skip test."); + return FWTS_SKIP; } return FWTS_OK; @@ -322,7 +305,7 @@ static fwts_framework_minor_test uefirtmisc_tests[] = { { uefirtmisc_test1, "Test for UEFI miscellaneous runtime service interfaces." }, { uefirtmisc_test2, "Stress test for UEFI miscellaneous runtime service interfaces." }, { uefirtmisc_test3, "Test GetNextHighMonotonicCount with invalid NULL parameter." }, - { uefirtmisc_test4, "Test UEFI miscellaneous runtime services supported status." }, + { uefirtmisc_test4, "Test UEFI miscellaneous runtime services unsupported status." }, { NULL, NULL } }; From patchwork Fri May 7 09:56:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Hu X-Patchwork-Id: 1475447 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=) 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 4Fc5Sq5wkjz9ssP for ; Fri, 7 May 2021 19:56:43 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1lexDt-0006sy-9A; Fri, 07 May 2021 09:56:41 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lexDs-0006sa-2j for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:40 +0000 Received: from [175.181.154.193] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1lexDr-0007lg-7c for fwts-devel@lists.ubuntu.com; Fri, 07 May 2021 09:56:39 +0000 From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 4/4] uefi: remove unused have_rtsupported Date: Fri, 7 May 2021 17:56:23 +0800 Message-Id: <20210507095623.34254-4-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210507095623.34254-1-ivan.hu@canonical.com> References: <20210507095623.34254-1-ivan.hu@canonical.com> MIME-Version: 1.0 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: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Ivan Hu Acked-by: Colin Ian King Acked-by: Alex Hung --- src/lib/include/fwts_uefi.h | 2 +- src/lib/src/fwts_uefi.c | 8 ++------ src/uefi/uefirtmisc/uefirtmisc.c | 4 +--- src/uefi/uefirttime/uefirttime.c | 4 +--- src/uefi/uefirtvariable/uefirtvariable.c | 4 +--- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h index 8d7a711b..cb6c297c 100644 --- a/src/lib/include/fwts_uefi.h +++ b/src/lib/include/fwts_uefi.h @@ -682,7 +682,7 @@ char *fwts_uefi_attribute_info(uint32_t attr); bool fwts_uefi_efivars_iface_exist(void); -void fwts_uefi_rt_support_status_get(int fd, bool *have_rtsupported, uint32_t *rtservicessupported); +void fwts_uefi_rt_support_status_get(int fd, uint32_t *rtservicessupported); PRAGMA_POP #endif diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c index 03ff8356..101d04cf 100644 --- a/src/lib/src/fwts_uefi.c +++ b/src/lib/src/fwts_uefi.c @@ -550,17 +550,13 @@ bool fwts_uefi_efivars_iface_exist(void) * this bitmask can be read via an IOCTL call. Before Linux 5.11 the value * cannot be determined. */ -void fwts_uefi_rt_support_status_get(int fd, bool *have_rtsupported, uint32_t *rtservicessupported) +void fwts_uefi_rt_support_status_get(int fd, uint32_t *rtservicessupported) { long ioret; ioret = ioctl(fd, EFI_RUNTIME_GET_SUPPORTED_MASK, rtservicessupported); - if (ioret == -1) { - *have_rtsupported = false; + if (ioret == -1) *rtservicessupported = EFI_RT_SUPPORTED_ALL; - } else { - *have_rtsupported = true; - } return; } diff --git a/src/uefi/uefirtmisc/uefirtmisc.c b/src/uefi/uefirtmisc/uefirtmisc.c index bdeaf76d..580f92ac 100644 --- a/src/uefi/uefirtmisc/uefirtmisc.c +++ b/src/uefi/uefirtmisc/uefirtmisc.c @@ -43,7 +43,6 @@ static int fd; static EFI_GUID gEfiCapsuleHeaderGuid = EFI_CAPSULE_GUID; -static bool have_rtsupported; static uint32_t runtimeservicessupported; static int uefirtmisc_init(fwts_framework *fw) @@ -51,8 +50,7 @@ static int uefirtmisc_init(fwts_framework *fw) if (fwts_lib_efi_runtime_module_init(fw, &fd) == FWTS_ABORTED) return FWTS_ABORTED; - fwts_uefi_rt_support_status_get(fd, &have_rtsupported, - &runtimeservicessupported); + fwts_uefi_rt_support_status_get(fd, &runtimeservicessupported); return FWTS_OK; } diff --git a/src/uefi/uefirttime/uefirttime.c b/src/uefi/uefirttime/uefirttime.c index 00326139..e2ab7d61 100644 --- a/src/uefi/uefirttime/uefirttime.c +++ b/src/uefi/uefirttime/uefirttime.c @@ -38,7 +38,6 @@ static int fd; static const uint32_t dayofmonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; -static bool have_rtsupported; static uint32_t runtimeservicessupported; static bool dayvalid(EFI_TIME *Time) @@ -175,8 +174,7 @@ static int uefirttime_init(fwts_framework *fw) if (fwts_lib_efi_runtime_module_init(fw, &fd) == FWTS_ABORTED) return FWTS_ABORTED; - fwts_uefi_rt_support_status_get(fd, &have_rtsupported, - &runtimeservicessupported); + fwts_uefi_rt_support_status_get(fd, &runtimeservicessupported); return FWTS_OK; } diff --git a/src/uefi/uefirtvariable/uefirtvariable.c b/src/uefi/uefirtvariable/uefirtvariable.c index 2b677513..db0e80bb 100644 --- a/src/uefi/uefirtvariable/uefirtvariable.c +++ b/src/uefi/uefirtvariable/uefirtvariable.c @@ -64,7 +64,6 @@ static uint16_t variablenametest[] = {'T', 'e', 's', 't', 'v', 'a', 'r', '\0'}; static uint16_t variablenametest2[] = {'T', 'e', 's', 't', 'v', 'a', 'r', ' ', '\0'}; static uint16_t variablenametest3[] = {'T', 'e', 's', 't', 'v', 'a', '\0'}; -static bool have_rtsupported; static uint32_t runtimeservicessupported; static void uefirtvariable_env_cleanup(void) @@ -103,8 +102,7 @@ static int uefirtvariable_init(fwts_framework *fw) uefirtvariable_env_cleanup(); - fwts_uefi_rt_support_status_get(fd, &have_rtsupported, - &runtimeservicessupported); + fwts_uefi_rt_support_status_get(fd, &runtimeservicessupported); return FWTS_OK; }