The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Khalid Aziz <khalid.aziz@hp.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Mike Waychison <mikew@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Tony Luck <tony.luck@intel.com>, Matthew Garrett <mjg@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	"gong.chen@linux.intel.com" <gong.chen@linux.intel.com>,
	khalid@gonehiking.org
Subject: Re: [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs
Date: Mon, 10 Sep 2012 12:13:09 -0600	[thread overview]
Message-ID: <1347300789.4393.27.camel@lyra> (raw)
In-Reply-To: <20120910180335.GA26021@kroah.com>

On Mon, 2012-09-10 at 11:03 -0700, Greg KH wrote:
> On Mon, Sep 10, 2012 at 01:59:18PM -0400, Mike Waychison wrote:
> > On Mon, Sep 10, 2012 at 1:55 PM, Mike Waychison <mikew@google.com> wrote:
> > > Greg,
> > >
> > > Can you please pick this patch up in one of your trees?
> > 
> > Resend using a good email addy for gregkh :)
> 
> Can someone resend it in a format that I can apply it in?  I can't find
> the original anymore, sorry.
> 
> greg k-h

Some of the EFI variable attributes are missing from print out from
/sys/firmware/efi/vars/*/attributes. This patch adds those in. It also
updates code to use pre-defined constants for masking current value
of attributes.

Signed-off-by: Khalid Aziz <khalid.aziz@hp.com>
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 47408e8..d10c987 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -435,12 +435,23 @@ efivar_attr_read(struct efivar_entry *entry, char *buf)
 	if (status != EFI_SUCCESS)
 		return -EIO;
 
-	if (var->Attributes & 0x1)
+	if (var->Attributes & EFI_VARIABLE_NON_VOLATILE)
 		str += sprintf(str, "EFI_VARIABLE_NON_VOLATILE\n");
-	if (var->Attributes & 0x2)
+	if (var->Attributes & EFI_VARIABLE_BOOTSERVICE_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_BOOTSERVICE_ACCESS\n");
-	if (var->Attributes & 0x4)
+	if (var->Attributes & EFI_VARIABLE_RUNTIME_ACCESS)
 		str += sprintf(str, "EFI_VARIABLE_RUNTIME_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_HARDWARE_ERROR_RECORD)
+		str += sprintf(str, "EFI_VARIABLE_HARDWARE_ERROR_RECORD\n");
+	if (var->Attributes & EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes &
+			EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS)
+		str += sprintf(str,
+			"EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS\n");
+	if (var->Attributes & EFI_VARIABLE_APPEND_WRITE)
+		str += sprintf(str, "EFI_VARIABLE_APPEND_WRITE\n");
 	return str - buf;
 }
 
--
1.7.9.5

-- 
Khalid Aziz <khalid.aziz@hp.com>


  reply	other threads:[~2012-09-10 18:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 17:42 [PATCH v2] Add missing attributes to EFI variable attribute print out from sysfs Khalid Aziz
2012-07-13 17:50 ` Matthew Garrett
2012-09-06 17:14   ` Khalid Aziz
2012-09-10 17:55 ` Mike Waychison
2012-09-10 17:59   ` Mike Waychison
2012-09-10 18:03     ` Greg KH
2012-09-10 18:13       ` Khalid Aziz [this message]
2012-09-10 18:18         ` Greg KH
2012-09-10 18:29           ` Khalid Aziz
2012-09-10 18:35             ` Greg KH
2012-09-10 18:52               ` [PATCH v2 RESEND] " Khalid Aziz
2012-09-10 18:58               ` [PATCH v2] " Khalid Aziz

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=1347300789.4393.27.camel@lyra \
    --to=khalid.aziz@hp.com \
    --cc=gong.chen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=khalid@gonehiking.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikew@google.com \
    --cc=mjg@redhat.com \
    --cc=tony.luck@intel.com \
    /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