Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2445379pxu; Sat, 28 Nov 2020 14:25:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJywd2zOgWT0YLf+AaTa1WtBI0umb2xOaZA6R99QwLcT3Kpf04Dc8aLIUV6Rmm8MNIXrx4SG X-Received: by 2002:a50:bb66:: with SMTP id y93mr15100266ede.244.1606602351969; Sat, 28 Nov 2020 14:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606602351; cv=none; d=google.com; s=arc-20160816; b=sIUF/CYXtGYUtJZb20WP21E65SJnwI2vyCmHrVHoy37YRJmMdU6o7q9ndDSoZWqP03 146RGhiWwUNohLnstvAWB90akTdTz+l/SZCsjO/MyJVeeRbmh8gVHf2+wf90nr//OuPK QD/SLASoEwCVP8ZGiG3AmxDNflU6DcGGF5hhMlAg2hRPZ4lfWiNp8ZcY1vVF38LSQ1wd h1MXfjqYFS0NGpt4BK5v7aeKlhtRdcDmLR80IH9Kkv7sNxKNc3ozhyuW4S/wpYRAI5S1 pHUJrlUyb9BmLlgvTm+rWHXO7Zo2WJGX29tdeQrSn0G/HbsH31PNvyCD/lUkjUTbRSpH yg3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kETDnJRS25E0UxTJ4iVC9ECWgxIbEG/PKStE74hNj7o=; b=sLlmDo09lP1zFZTeXOdC8uX81RbQKcalHkoD+3v7Uxf1VlHAYS6Xb9rPasu/ensBh/ CzHK7BdEzKlossFaklZwM+NotUfjJNV3JYSjnWgPP0ARWOcjtUtgeASZGWm5HOmr42nw Y1PGhcBr8n/9GWefxySUIPO8REKvdC3eI5S5C9Fx439vFPQIEcklsze7/HNDUdYijU1L GhUFKZhzsINZ94G+LYjmNZZYk1ZQ9VYNKS1PoGXGrFKv+rJ/uGxrMjYcjNbUAYkcmCXp 4N/lIEyMItvKCDFarL4fNAm1RyoqU0hkNYX1KgpUtj+/4LAd4w20ICHdnk/A2T2e1jtd gVRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oLLIUYhA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si9266492edw.311.2020.11.28.14.25.30; Sat, 28 Nov 2020 14:25:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oLLIUYhA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388003AbgK1VtS (ORCPT + 99 others); Sat, 28 Nov 2020 16:49:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:33164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730016AbgK0Tpr (ORCPT ); Fri, 27 Nov 2020 14:45:47 -0500 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D2EC24124; Fri, 27 Nov 2020 19:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606505378; bh=8QymvV5Hnh6tFqtBLh0j3rJoBCVR1S8omUbfnSVDUeg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=oLLIUYhA6GpbhNj2qR7MD4psdVtsmBPseexX/GY2TFosrpuEPbpwsT2G0SCF4846R Fptt4olt4YE28inoYnnVg6/DEtn4trVGGQNAp603+RsVNAoJ4QhA39uLlqt7dI8bM/ rS1NkODIQ8Hn+pojhY6qo7/a4/UnN0VzVz4jzdRI= Received: by mail-ot1-f49.google.com with SMTP id h39so5566433otb.5; Fri, 27 Nov 2020 11:29:38 -0800 (PST) X-Gm-Message-State: AOAM532J6wv/fAkAQt3OlFPnQ7oVWzTxSPjY/bWmQoOGhKNrK+uiXj+S bGskCWazF8d9afIPY/udXMs1WWcV3MDwp3yBXgU= X-Received: by 2002:a05:6830:214c:: with SMTP id r12mr7274707otd.90.1606505377691; Fri, 27 Nov 2020 11:29:37 -0800 (PST) MIME-Version: 1.0 References: <20201127192051.1430-1-xypron.glpk@gmx.de> <98faddb2-5acc-c228-d002-71341d1c558e@canonical.com> In-Reply-To: <98faddb2-5acc-c228-d002-71341d1c558e@canonical.com> From: Ard Biesheuvel Date: Fri, 27 Nov 2020 20:29:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: ACK: [PATCH 1/1] efi/efi_test: read RuntimeServicesSupported To: Colin Ian King Cc: Heinrich Schuchardt , Ivan Hu , linux-efi , Linux Kernel Mailing List , fwts-devel@lists.ubuntu.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 27 Nov 2020 at 20:28, Colin Ian King wrote: > > On 27/11/2020 19:20, Heinrich Schuchardt wrote: > > Since the UEFI 2.8A specification the UEFI enabled firmware provides a > > configuration table EFI_RT_PROPERTIES_TABLE which indicates which runtime > > services are enabled. The EFI stub reads this table and saves the value of > > the field RuntimeServicesSupported internally. > > > > The Firmware Test Suite requires the value to determine if UEFI runtime > > services are correctly implemented. > > > > With this patch an IOCTL call is provided to read the value of the field > > RuntimeServicesSupported, e.g. > > > > #define EFI_RUNTIME_GET_SUPPORTED_MASK \ > > _IOR('p', 0x0C, unsigned int) > > unsigned int mask; > > fd = open("/dev/efi_test", O_RDWR); > > ret = ioctl(fd, EFI_RUNTIME_GET_SUPPORTED_MASK, &mask); > > > > Signed-off-by: Heinrich Schuchardt > > --- > > drivers/firmware/efi/test/efi_test.c | 16 ++++++++++++++++ > > drivers/firmware/efi/test/efi_test.h | 3 +++ > > 2 files changed, 19 insertions(+) > > > > diff --git a/drivers/firmware/efi/test/efi_test.c b/drivers/firmware/efi/test/efi_test.c > > index ddf9eae396fe..47d67bb0a516 100644 > > --- a/drivers/firmware/efi/test/efi_test.c > > +++ b/drivers/firmware/efi/test/efi_test.c > > @@ -663,6 +663,19 @@ static long efi_runtime_query_capsulecaps(unsigned long arg) > > return rv; > > } > > > > +static long efi_runtime_get_supported_mask(unsigned long arg) > > +{ > > + unsigned int __user *supported_mask; > > + int rv = 0; > > + > > + supported_mask = (unsigned int *)arg; > > + > > + if (put_user(efi.runtime_supported_mask, supported_mask)) > > + rv = -EFAULT; > > + > > + return rv; > > +} > > + > > static long efi_test_ioctl(struct file *file, unsigned int cmd, > > unsigned long arg) > > { > > @@ -699,6 +712,9 @@ static long efi_test_ioctl(struct file *file, unsigned int cmd, > > > > case EFI_RUNTIME_RESET_SYSTEM: > > return efi_runtime_reset_system(arg); > > + > > + case EFI_RUNTIME_GET_SUPPORTED_MASK: > > + return efi_runtime_get_supported_mask(arg); > > } > > > > return -ENOTTY; > > diff --git a/drivers/firmware/efi/test/efi_test.h b/drivers/firmware/efi/test/efi_test.h > > index f2446aa1c2e3..117349e57993 100644 > > --- a/drivers/firmware/efi/test/efi_test.h > > +++ b/drivers/firmware/efi/test/efi_test.h > > @@ -118,4 +118,7 @@ struct efi_resetsystem { > > #define EFI_RUNTIME_RESET_SYSTEM \ > > _IOW('p', 0x0B, struct efi_resetsystem) > > > > +#define EFI_RUNTIME_GET_SUPPORTED_MASK \ > > + _IOR('p', 0x0C, unsigned int) > > + > > #endif /* _DRIVERS_FIRMWARE_EFI_TEST_H_ */ > > -- > > 2.29.2 > > > > Looks good to me. Thanks Heinrich. > > The EFI driver needs to be also updated in the linux kernel - has that > fix been submitted or do you require the fwts team to do that? > This /is/ the EFI driver. I'll take this as an acked-by but I'd like Ivan to chime in as well.