Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp330672pxa; Wed, 19 Aug 2020 02:30:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz01A8FWV45kJJlP/CT5FBhUKwgrMF9B+7pDQ42m3kCiTKwiMsSvkhmAyzntNdQ7PjS/O6A X-Received: by 2002:a17:906:a3d5:: with SMTP id ca21mr23694909ejb.453.1597829456451; Wed, 19 Aug 2020 02:30:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597829456; cv=none; d=google.com; s=arc-20160816; b=Fsuz1fTHjU7qdmRDeqsQZznpZ4C1+7O9O6mmcMnnci6MM7b5BQkVmGKZnZtF5M1bV0 Ewl7+cNUvZAl0zAhuUX+/ZG5DR6m3TM507kSjBzKZg2Ooswf2wi8S9SzwAwr2RJpEmeL hz/0P2jTYEq98XM0ukiqrX7IU3AE/zPOKtxDPdjA5G1Bg/zVy6F3HFov3NzciPwt0739 gTC+xICNXThzWnuicOy9gygvtmntm8hcLk+26mhbLyyDHVxrUSjTgLpNY/Nuv9EyGC4B Y5cnjZ5ECchWuTXmgIO052f1uoWqz5HzG6AMCBnWIHqqZzTWX3ymTEyVtXKrLIdetLoE wL+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=sfALJ3tnvI7h4k/zG4r6toxyODZkz1A4RL+TTCxV1MQ=; b=cNjjgxsTp6sI9MkqjNpdsPyaquxNi6/hp8cTP/maD6JUV+9AirrQClgODJKkP3vXHu i6HEpP/x7DwvyK/goqYKXnM20skz4RC3dF0cx+j/E8RxqSEVYleTRQrM5QqaSZpFc4LV bpyG96j8TGmFdI2r/wLgELNi/FpQP1FUNDQsm7VBEJmkHxFudjS0Rcty8g5ih6wboEXb 4amMlmYmzmEqdphwqrP6XwAmgC0bBo2bSgEU9Llu7VZNIhNcC6ZyjB6ncBaL8RZYyjFB K60cBybWHpmsHSASGtT4r3EYQ8T2LZXYWLUPb0dieNngzOW6bLt5crK1NugAI7XJZSY/ v6cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UJg96UPN; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si15551698ejy.697.2020.08.19.02.30.32; Wed, 19 Aug 2020 02:30:56 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=UJg96UPN; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727113AbgHSJ2p (ORCPT + 99 others); Wed, 19 Aug 2020 05:28:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbgHSJ2n (ORCPT ); Wed, 19 Aug 2020 05:28:43 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E0CCC061757; Wed, 19 Aug 2020 02:28:43 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 128so11112244pgd.5; Wed, 19 Aug 2020 02:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=sfALJ3tnvI7h4k/zG4r6toxyODZkz1A4RL+TTCxV1MQ=; b=UJg96UPNkqjdaV4Z8G1IDr8c6TPIWfXOxPYd3O0SO5WoJKuI7jCmUbACjWzBZHo9U7 0c7nnXAgDABQEBuR0un7P4giAqlg814vs3v74WUKa4O3jHlp5d9Peg+8lpFHu6SmfEBX T8OsGUc+M40aP4W28v0M6kqxwGgTcZDzMTgzPm2JLXfUdp+3cII65MNQJdmQl8cWud4Z k3F0lqNF8NUMnE5OQdYexzBoLJ2mSWn/W7hs6/zxeYfNl58kw70iZIseA4f0limFxE47 Smr+gNjgXUG+xFLsiOrrxvcHlpMjISJ9qMWHeHAqYXd6oxHVdWktrACBujKwqcrj972f mkgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=sfALJ3tnvI7h4k/zG4r6toxyODZkz1A4RL+TTCxV1MQ=; b=IPyyRhnzb1UVApTLyYKUQ/t+YopR3LVLXnLpwE6tvtmfhSFyGhfYHnEaDP3aNRMruE Xt2JedL9FxVsuvGcANAGVPzfyvfh1x86gvAICQybO1XsoVyt5n5p+4+geyFNsGxHzvsb IijhAQ9MA0XY+CbEtPIuIe+FeX49zwK/usOXJqBCPhHD4MpKqzKvrwH5vZyF+O9KStgD 3YFZzMjGbk9dZTcav9ZqQ03IjR6vKUqp+voe4+3oRLcdOJMvPSMAgEQ4hFXCGAgUBXGN ys0Au3Gu3LmN96xApNpKALxOQr/94GByOKEcBsQ16jbCpqOwo/7R5WXV6AP/tbh35v18 POdQ== X-Gm-Message-State: AOAM531B6gldqAib0bJLeryEO5g4WPumqQFmnMAU0Fyh9t0vFqCojbZ2 TjNI1njgRbNukjjVT+yaZWo= X-Received: by 2002:a63:ff18:: with SMTP id k24mr16640114pgi.109.1597829323025; Wed, 19 Aug 2020 02:28:43 -0700 (PDT) Received: from linux-691t.suse.de ([124.11.22.254]) by smtp.gmail.com with ESMTPSA id y1sm27060156pfl.136.2020.08.19.02.28.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2020 02:28:42 -0700 (PDT) From: "Lee, Chun-Yi" X-Google-Original-From: "Lee, Chun-Yi" To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" , Ilias Apalodimas , Ard Biesheuvel Subject: [PATCH] efi/efivars: create efivars mount point when get variable services are available Date: Wed, 19 Aug 2020 17:28:38 +0800 Message-Id: <20200819092838.11290-1-jlee@suse.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The efivars filesystem depends on GetVariable or GetNextVariable EFI runtime services. So the /sys/firmware/efi/efivars does not need to be created when GetVariable and GetNextVariable are not available. It is useful for userland to determine the availability of efivars filesystem. Cc: Ilias Apalodimas Cc: Ard Biesheuvel Signed-off-by: "Lee, Chun-Yi" --- drivers/firmware/efi/efi.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index fdd1db025dbf..929fbf4dfd5d 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -404,11 +404,14 @@ static int __init efisubsys_init(void) if (error) goto err_remove_group; - /* and the standard mountpoint for efivarfs */ - error = sysfs_create_mount_point(efi_kobj, "efivars"); - if (error) { - pr_err("efivars: Subsystem registration failed.\n"); - goto err_remove_group; + if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE | + EFI_RT_SUPPORTED_GET_NEXT_VARIABLE_NAME)) { + /* and the standard mountpoint for efivarfs */ + error = sysfs_create_mount_point(efi_kobj, "efivars"); + if (error) { + pr_err("efivars: Subsystem registration failed.\n"); + goto err_remove_group; + } } if (efi_enabled(EFI_DBG) && efi_enabled(EFI_PRESERVE_BS_REGIONS)) -- 2.16.4