Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp536716ybj; Tue, 5 May 2020 03:21:39 -0700 (PDT) X-Google-Smtp-Source: APiQypLLovz5Y7K+uA12lLuZRFbaxA43akzrkYapPtOjgtN005qRxQp7BxogpTdnezQfBpFfVD2g X-Received: by 2002:a05:6402:6d5:: with SMTP id n21mr1945553edy.82.1588674099836; Tue, 05 May 2020 03:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588674099; cv=none; d=google.com; s=arc-20160816; b=kAhL5SdLB59HQ4uaLVfYPEp9N54SnuK2dUznZwdFYf5DbdrnpwcJZ4MuOujVHn3XUA DTIKXZkViYb+HnJYLR8BKAeKFJef96lAvPneInNdhBUkhK1SaxFB6NoB0kuGAQKWwTQB iMGCVorRsPPwQgszfjF71jlTxCi4A81Ylt/89R5R+htp27DnOXMU7eiEjUzixKmdWxmM CN1hWDXghPVq7quy0i+8q5uCnvhI+9mSnpuK27kfGQuqkM8/ASpsqMPWwfmaY4S3p+P+ 68TREW8x4B2My3Hf1lxlHBOptrM79WsgLH9yB3mO5PnIXLlBynej+kFZZAAQvz1QCiUh weXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=ZBqSxXgUivAUuVAsclHkHDsGUwkmsuduKBzLS0rYu9k=; b=D985IZnNmIkGHZVFpyVLoQ1s7A4L38nISUSVRNIfWFdI7kG22vfC9E7OIWejorqOnf ZipqBgd0C3RkrHNq18wZBKSkrDpLHazfFOmX4wtXf76jrGqnggMcvO3+wh/lL1N07CTB EUZqNW3i7Af67acKnX9uWkP0DT+6BnxkEgwTPoWpn+Jhm7McAWJC9CFb/xMEcDhfVtEP PY57s/YNDxFhzKypWEPShn7UvpeyIoiFkSdPRhLDkwFpSkTbaXWf5INadNxscGLpEpMy RHTnA/qiNfxDy5qYBJUymSjJ+2MEB2GFD1o/n+x4U704tQ9s724FPwTsTWFim4rPcWWi m1lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@asem.it header.s=s1024 header.b="d2Ch/eJK"; 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=asem.it Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz2si802054ejb.90.2020.05.05.03.21.16; Tue, 05 May 2020 03:21:39 -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=@asem.it header.s=s1024 header.b="d2Ch/eJK"; 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=asem.it Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728751AbgEEKRi (ORCPT + 99 others); Tue, 5 May 2020 06:17:38 -0400 Received: from smtp.asem.it ([151.1.184.197]:56537 "EHLO smtp.asem.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728622AbgEEKRh (ORCPT ); Tue, 5 May 2020 06:17:37 -0400 Received: from webmail.asem.it by asem.it (smtp.asem.it) (SecurityGateway 6.5.2) with ESMTP id SG000235779.MSG for ; Tue, 05 May 2020 12:17:30 +0200S DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=s1024; d=asem.it; h=from:to:cc:subject:date:message-id:mime-version:content-type; bh=ZBqSxXgUivAUuVAsclHkHDsGUwkmsuduKBzLS0rYu9k=; b=d2Ch/eJK8f93bLolHFlz9MnrvlcW7aQarLA3anN5xYlq2Iw7xhbVE1tyY0pPmd cKwpDhnM3+b3modLyGgpvHgmcvRwyrwDsxAx3gYwqxBHXrdAiKPNuCQWubmSBP u5xrrT0hwxVK0A4qyALG1XAianu1YAKPcaQozGP7X7vwcOs= Received: from ASAS044.asem.intra (172.16.16.44) by ASAS044.asem.intra (172.16.16.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Tue, 5 May 2020 12:17:29 +0200 Received: from flavio-x.asem.intra (172.16.17.208) by ASAS044.asem.intra (172.16.16.44) with Microsoft SMTP Server id 15.1.1261.35 via Frontend Transport; Tue, 5 May 2020 12:17:29 +0200 From: Flavio Suligoi To: Jonathan Corbet , Mauro Carvalho Chehab CC: , , Flavio Suligoi Subject: [PATCH 1/2] docs: filesystems: add info about efivars content Date: Tue, 5 May 2020 12:17:15 +0200 Message-ID: <1588673836-9954-1-git-send-email-f.suligoi@asem.it> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-SGHeloLookup-Result: pass smtp.helo=webmail.asem.it (ip=172.16.16.44) X-SGSPF-Result: none (smtp.asem.it) X-SGOP-RefID: str=0001.0A09020E.5EB13D39.005C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 (_st=1 _vt=0 _iwf=0) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When an EFI variable is reading from: /sys/firmware/efi/efivars (for example using "hexdump"), the first 4 bytes of the output are not the real EFI variable data, but the variable attributes (in little-endian format). Signed-off-by: Flavio Suligoi --- Documentation/filesystems/efivarfs.rst | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/filesystems/efivarfs.rst b/Documentation/filesystems/efivarfs.rst index 90ac656..6380336 100644 --- a/Documentation/filesystems/efivarfs.rst +++ b/Documentation/filesystems/efivarfs.rst @@ -24,3 +24,20 @@ files that are not well-known standardized variables are created as immutable files. This doesn't prevent removal - "chattr -i" will work - but it does prevent this kind of failure from being accomplished accidentally. + +.. warning :: + When a content of an UEFI variable in ``/sys/firmware/efi/efivars`` is + displayed, for example using ``hexdump``, pay attention that the first + 4 bytes of the output represent the UEFI variable attributes, + in little-endian format. + + Practically the output of each ``efivar`` is composed of: + + +-----------------------------------+ + |4_bytes_of_attributes + efivar_data| + +-----------------------------------+ + +*See also:* + +- ``Documentation/admin-guide/acpi/ssdt-overlays.rst`` +- ``Documentation/ABI/stable/sysfs-firmware-efi-vars`` -- 2.7.4