Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3296824pxa; Tue, 25 Aug 2020 17:49:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGjr84ADcKUtqR8pGODJwTt2lTlRslBpiYRsL6omGX0qf7xlNGJ+GqysMhnEJghKUyQVrc X-Received: by 2002:a17:906:6415:: with SMTP id d21mr551700ejm.550.1598402993372; Tue, 25 Aug 2020 17:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598402993; cv=none; d=google.com; s=arc-20160816; b=vW0ecRuoTZX0vKpZVOER6vRg136wg/MB7YYpMx/Z1awOCvee7IPChNRx3GP+VXoCmZ yCf0ctDb3mtQgYSK3+8TyuWQr1hS3wq0vSzXTcgYQdS6kS4afNPvwR9bvExbRSodY50V N2FVexONiGPbzMl4av3dq4j9AyeBL4LzhGgupO5vzfSzoW38OBbCVUltA2rQBCmbfDfN sfjuwQ6uIeG+yhSLpkygroza+XT4413y1mVLvLZHYhNwJAokFhsBHO7+/rgjWtV6RzTt UhVTRcUVK3ROQRLhPRRsd+D1R3GtZdaNu/6wBYiQpZescBqX7LklyZvo0ESsfZ2+GS+D OIKg== 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=tYkmP2T+taGzQPsdNtmk2OPLPT6ITCwubwhEvkJJlCk=; b=uWExWJRUq2ESyLP47FwnwLBwIdCIOS2zQVM2j5+RGouzHN+mamiy6+fD43RBOMKogz 8rr1up3s5xXuQMFySVpJDc+qCEOLZXyTXeLmqOwMknvOsreDQ3hQjj0yPW9w7WfVKLkP czqbzHtCFHic+MuSAoZkT/YsZzE/hmhr4PEgSMfDIc2h+4ISytMJLroJTiMk/yyCpTnF F7sPQj1xaaszn7hheFLhMXVymmpZKjqLl6QwrZcZbLzxLBj9MZUvcE3d8Wx+RzzkJ0f8 3Mms7jsDCkMA2K7i1K5+S+/gMEv9lK+dxua9LRHLSi9JobKML61BoXOBk+IPDLZy6R6U 6mFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GGCI67e+; 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 os27si398480ejb.139.2020.08.25.17.49.29; Tue, 25 Aug 2020 17:49:53 -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=GGCI67e+; 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 S1726757AbgHZAqN (ORCPT + 99 others); Tue, 25 Aug 2020 20:46:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726570AbgHZAqM (ORCPT ); Tue, 25 Aug 2020 20:46:12 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDDB1C061574; Tue, 25 Aug 2020 17:46:12 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id w186so173858pgb.8; Tue, 25 Aug 2020 17:46:12 -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=tYkmP2T+taGzQPsdNtmk2OPLPT6ITCwubwhEvkJJlCk=; b=GGCI67e+oEId6snat38qMmRD/cojMw+wU62EvwvFdd0q3is7kDXAaVI72o2D2BgLcg WrFBmzhN+Xs57YQPxevp7oGA6ZvYp5MsCxsnsOzC/DS9LaaYCj9Gag50gOggeQeF1BvU LvjCgOzTTFsdPIy6a3fSWpjzW5K1mqQauP/+P+93ZeIwRUt9wnr0nIEvnSp5NvldFFXI gSyL5jlwp4Pi1YoCFt1xc/1A9VRfNVUXL6E97gifx9rFCjHRvv6jwA34q/2gLCj7XRF0 5+AlZPMWPOka9YqAjK4ersPfW+rlKqLTycYryUzFAbwCGB04MUuG471+7RqdNe/rOLKJ rTOw== 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=tYkmP2T+taGzQPsdNtmk2OPLPT6ITCwubwhEvkJJlCk=; b=JTLRHycZ6fR4524ilioNhdHTMMLhqYGQjAnsVUMWe9I25aH9XNX1lc2YKc1hobMK9P W+tOWk7NQrRywcqWWYigYZdsSxTFHGgBUxbcrp+568VCGrShZ6FA9H9/zYA0r/TYV71Y /9RTNU6cNlDH2KYTt8gx3Ztw4UroCGQ8vZbUjzIi+4346cVIyQRTvMlsbMQqWQT4cPU1 kSlb7QT27bnpjg5ENPQ4+tcfGLUsjODfmbd4rcPEmz+k5ZTZKxpcUParTnh20Pf8yCiI 5kx41q11RgOJQRobaMh0buqnL7xVR4RHVV7Nfeskx7GAW3aIk6l/eMq/8jw5vsRM0Vyd DIyQ== X-Gm-Message-State: AOAM530xHJtXbD53LM0JBHBo4ubyvYqdPT0sMZl0u68VYkM1sSAK4tNv xn4f/evbXdW3CVr3X1jRDzFeEajF/mQ= X-Received: by 2002:a63:511a:: with SMTP id f26mr8721575pgb.15.1598402772496; Tue, 25 Aug 2020 17:46:12 -0700 (PDT) Received: from linux-691t.suse.de ([124.11.22.254]) by smtp.gmail.com with ESMTPSA id x4sm454044pff.112.2020.08.25.17.46.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Aug 2020 17:46:11 -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" , Matthias Brugger , Fabian Vogt , Ilias Apalodimas , Ard Biesheuvel Subject: [PATCH v2] efi/efivars: Create efivars mount point via efivars abstraction Date: Wed, 26 Aug 2020 08:46:07 +0800 Message-Id: <20200826004607.7483-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 This patch creates efivars mount point when active efivars abstraction be set. It is useful for userland to determine the availability of efivars filesystem. Cc: Matthias Brugger Cc: Fabian Vogt Cc: Ilias Apalodimas Cc: Ard Biesheuvel Signed-off-by: "Lee, Chun-Yi" --- v2: Using efivars_kobject() helper instead of checking GetVariable or GetNextVariable EFI runtime services. Because the efivarfs code could be instantiated using a different efivars abstraction. drivers/firmware/efi/efi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 3aa07c3b5136..db483fc68501 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -405,11 +405,13 @@ 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 (efivars_kobject()) { + /* 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