Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4734768pxu; Thu, 10 Dec 2020 04:19:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVTpgz434NJM3sYSmQBmcvIW23umfvaU86maUJlcYIp/SQsQe6vKpe0jxCWtzXs0WKWw6K X-Received: by 2002:aa7:cccf:: with SMTP id y15mr6561869edt.112.1607602759621; Thu, 10 Dec 2020 04:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607602759; cv=none; d=google.com; s=arc-20160816; b=VZL6soHHt70C41k3u0OlK+ktwPkSFXew2giSyTYznLEODf5kF51+JEjlrUrFIs8UlV JwGK+tSjj7VWBLymR0FRPpYuBliiDXdsmEbZLRkujupbMj5ZGBFkruaYLlVMjVC+Jk4e xccHmObHLYllPyjAnk8i4zCS00QcW6w9aprFuk+Sbp9pj8qqwqC43kA9Nj1+7awA+pUo d+MGmp54W2pDxEv4JmO/cN86mQvFsIh5dH0pj/zfniIZl6qqQoj7JDWcDUqAJxOzfrmR E3ygK5j7vlmuretnB6crkwpz/AzrGoRWFZXRj6Genqqvoax4lemOYtmdrbCrROcy+Tud Z58Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=BA7KlfOg2DsYkIP2mLYhQatYBgcHVmtHGkOv9xzCu8k=; b=EzbYcJ0A64cs6OL8Xg2VOA1YeEsaRQfWDiI4CajONiR6akrWGIkKHDfhQpt/5Ryj2V eROj8XeNdLE3DzfNlLu8wyfnIJZaKdcPTC7J9Ky5RTRDgpSQJXn+T2PyHVuqnkSbC4eY 6pMr5/HKYvDO/DytDrFhG5FkE7T98d5gQ8lk3OcT10G0vCslRlSmpUZHIwdE9lb8j96/ c50B7cQ4uzTIY+CK0LLD2XMSVvOLBWCPIyf+YKihAxseXqm7VK5MSQlU3+Jg43AxKcy2 +YgDtVhiE+3L7C7GOCz8Tnmck0Hx4kksIvtWh076hWvFKY7XTG3jHqoNDwl30N7H9Bzi xqlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="Sp/amVry"; dkim=neutral (no key) header.i=@linutronix.de header.b=2KdojQ+F; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si2675766ejd.397.2020.12.10.04.18.56; Thu, 10 Dec 2020 04:19:19 -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=@linutronix.de header.s=2020 header.b="Sp/amVry"; dkim=neutral (no key) header.i=@linutronix.de header.b=2KdojQ+F; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729526AbgLJLu4 (ORCPT + 99 others); Thu, 10 Dec 2020 06:50:56 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:53406 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbgLJLuh (ORCPT ); Thu, 10 Dec 2020 06:50:37 -0500 Date: Thu, 10 Dec 2020 11:49:49 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607600990; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BA7KlfOg2DsYkIP2mLYhQatYBgcHVmtHGkOv9xzCu8k=; b=Sp/amVryuol5fatGyrXiVm8h9XCgTKJh2Rq55U4xHIg8+49pbPOrfHPc+NlmZKw7eZsjA1 V+I7j0kMD8Sgz8z3JjyqGTDk2nvXO2XeNTy5I+LSUFa1sMFTmvn1/acoQJDavI7DklLVDb aYRWiByhk47HgjjriOtMr6bg9jvYrOwtM7fVAaPrdjLoNA1Qa7+Se6Dn2mCjBj1zyiP6kD 1SAiiBNvcAbzTTT+A4VArL8bBs5n3e5jWmHD7ptxHy+vkDBa8N6g8QgxFPvN9r63eJN/CK 4JYzdeY8gej7va45N1kdUpB2Uv6fnd6XBuPUay6ujKlYYOg5HqeoeKVSbnCWAQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607600990; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BA7KlfOg2DsYkIP2mLYhQatYBgcHVmtHGkOv9xzCu8k=; b=2KdojQ+FHCEptHZtts83btYa6zstN/8+U+Dm7wWkLh4cD3RE1XJjwE9g9uAUQFjMEtg2WD 0rEXJzn+/MODeeBA== From: "tip-bot2 for Heinrich Schuchardt" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: efi/core] efi/efi_test: read RuntimeServicesSupported Cc: Heinrich Schuchardt , Colin Ian King , Ivan Hu , Ard Biesheuvel , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20201127192051.1430-1-xypron.glpk@gmx.de> References: <20201127192051.1430-1-xypron.glpk@gmx.de> MIME-Version: 1.0 Message-ID: <160760098968.3364.7658260181933543462.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 AuthorDate: Fri, 27 Nov 2020 20:20:51 +01:00 Committer: Ard Biesheuvel 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 Link: https://lore.kernel.org/r/20201127192051.1430-1-xypron.glpk@gmx.de Acked-by: Colin Ian King Acked-by: Ivan Hu Signed-off-by: Ard Biesheuvel --- 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_ */