From: "tip-bot2 for Heinrich Schuchardt" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
Colin Ian King <colin.king@canonical.com>,
Ivan Hu <ivan.hu@canonical.com>, Ard Biesheuvel <ardb@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: efi/core] efi/efi_test: read RuntimeServicesSupported
Date: Thu, 10 Dec 2020 11:49:49 -0000 [thread overview]
Message-ID: <160760098968.3364.7658260181933543462.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20201127192051.1430-1-xypron.glpk@gmx.de>
The following commit has been merged into the efi/core branch of tip:
Commit-ID: ff20661bb54cd57a18207b33cc57eb8d5c758a86
Gitweb: https://git.kernel.org/tip/ff20661bb54cd57a18207b33cc57eb8d5c758a86
Author: Heinrich Schuchardt <xypron.glpk@gmx.de>
AuthorDate: Fri, 27 Nov 2020 20:20:51 +01:00
Committer: Ard Biesheuvel <ardb@kernel.org>
CommitterDate: Wed, 09 Dec 2020 08:37:27 +01:00
efi/efi_test: read RuntimeServicesSupported
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 <xypron.glpk@gmx.de>
Link: https://lore.kernel.org/r/20201127192051.1430-1-xypron.glpk@gmx.de
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ivan Hu <ivan.hu@canonical.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
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 ddf9eae..47d67bb 100644
--- a/drivers/firmware/efi/test/efi_test.c
+++ b/drivers/firmware/efi/test/efi_test.c
@@ -663,6 +663,19 @@ out:
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 f2446aa..117349e 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_ */
next prev parent reply other threads:[~2020-12-10 11:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-27 19:20 [PATCH 1/1] " Heinrich Schuchardt
2020-11-27 19:28 ` ACK: " Colin Ian King
2020-11-27 19:29 ` Ard Biesheuvel
2020-11-27 19:38 ` Colin Ian King
2020-11-27 19:39 ` Heinrich Schuchardt
2020-11-30 8:16 ` ivanhu
2020-11-30 9:17 ` Heinrich Schuchardt
2020-11-30 10:38 ` ivanhu
2020-12-02 11:38 ` Heinrich Schuchardt
2020-12-03 1:20 ` ivanhu
2020-12-03 6:48 ` Heinrich Schuchardt
2020-12-10 11:49 ` tip-bot2 for Heinrich Schuchardt [this message]
2020-12-26 10:16 ` Heinrich Schuchardt
2020-12-29 13:01 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=160760098968.3364.7658260181933543462.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=ardb@kernel.org \
--cc=colin.king@canonical.com \
--cc=ivan.hu@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=x86@kernel.org \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®