Re: [PATCH 38/54] efivars: remove new_var and del_var files from sysfs

2007-11-26 Thread Greg KH
On Fri, Nov 16, 2007 at 09:01:16AM -0600, Matt Domsch wrote:
> On Fri, Nov 02, 2007 at 04:59:16PM -0700, Greg Kroah-Hartman wrote:
> > WTF?  Passing binary structures into a sysfs file, expecting it to be in
> > the correct format/endianness?  That's just wrong on so many levels.
> > 
> > So, these files are deleted.  If you want to add them back, please do so
> > in configfs, or in debugfs.  Or use text strings, which is what sysfs is
> > only for.
> 
> 
> I have tested gregkh's patches tree, which includes this patch, the
> patch to put these back as binary blob interfaces, as well as other
> cleanups, on an Itanium2 system.  The efibootmgr userspace application
> continues to work as it did before this patch series, which I claim is
> success.  For the patches that touch drivers/firmware/efivars.c I can
> say:
> 
> Tested-by: Matt Domsch <[EMAIL PROTECTED]>

Great, thanks for doing this, I appreciate it.

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 38/54] efivars: remove new_var and del_var files from sysfs

2007-11-26 Thread Greg KH
On Fri, Nov 16, 2007 at 09:01:16AM -0600, Matt Domsch wrote:
 On Fri, Nov 02, 2007 at 04:59:16PM -0700, Greg Kroah-Hartman wrote:
  WTF?  Passing binary structures into a sysfs file, expecting it to be in
  the correct format/endianness?  That's just wrong on so many levels.
  
  So, these files are deleted.  If you want to add them back, please do so
  in configfs, or in debugfs.  Or use text strings, which is what sysfs is
  only for.
 
 
 I have tested gregkh's patches tree, which includes this patch, the
 patch to put these back as binary blob interfaces, as well as other
 cleanups, on an Itanium2 system.  The efibootmgr userspace application
 continues to work as it did before this patch series, which I claim is
 success.  For the patches that touch drivers/firmware/efivars.c I can
 say:
 
 Tested-by: Matt Domsch [EMAIL PROTECTED]

Great, thanks for doing this, I appreciate it.

greg k-h
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 38/54] efivars: remove new_var and del_var files from sysfs

2007-11-16 Thread Matt Domsch
On Fri, Nov 02, 2007 at 04:59:16PM -0700, Greg Kroah-Hartman wrote:
> WTF?  Passing binary structures into a sysfs file, expecting it to be in
> the correct format/endianness?  That's just wrong on so many levels.
> 
> So, these files are deleted.  If you want to add them back, please do so
> in configfs, or in debugfs.  Or use text strings, which is what sysfs is
> only for.


I have tested gregkh's patches tree, which includes this patch, the
patch to put these back as binary blob interfaces, as well as other
cleanups, on an Itanium2 system.  The efibootmgr userspace application
continues to work as it did before this patch series, which I claim is
success.  For the patches that touch drivers/firmware/efivars.c I can
say:

Tested-by: Matt Domsch <[EMAIL PROTECTED]>

Thanks,
Matt

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 38/54] efivars: remove new_var and del_var files from sysfs

2007-11-16 Thread Matt Domsch
On Fri, Nov 02, 2007 at 04:59:16PM -0700, Greg Kroah-Hartman wrote:
 WTF?  Passing binary structures into a sysfs file, expecting it to be in
 the correct format/endianness?  That's just wrong on so many levels.
 
 So, these files are deleted.  If you want to add them back, please do so
 in configfs, or in debugfs.  Or use text strings, which is what sysfs is
 only for.


I have tested gregkh's patches tree, which includes this patch, the
patch to put these back as binary blob interfaces, as well as other
cleanups, on an Itanium2 system.  The efibootmgr userspace application
continues to work as it did before this patch series, which I claim is
success.  For the patches that touch drivers/firmware/efivars.c I can
say:

Tested-by: Matt Domsch [EMAIL PROTECTED]

Thanks,
Matt

-- 
Matt Domsch
Linux Technology Strategist, Dell Office of the CTO
linux.dell.com  www.dell.com/linux
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 38/54] efivars: remove new_var and del_var files from sysfs

2007-11-02 Thread Greg Kroah-Hartman
WTF?  Passing binary structures into a sysfs file, expecting it to be in
the correct format/endianness?  That's just wrong on so many levels.

So, these files are deleted.  If you want to add them back, please do so
in configfs, or in debugfs.  Or use text strings, which is what sysfs is
only for.

Cc: Kay Sievers <[EMAIL PROTECTED]>
Cc: Matt Domsch <[EMAIL PROTECTED]>
Cc: Matt Tolentino <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/firmware/efivars.c |  149 
 1 files changed, 0 insertions(+), 149 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 06ecdb9..65cddb7 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -143,13 +143,6 @@ struct efivar_attribute efivar_attr_##_name = { \
.store = _store, \
 };
 
-#define VAR_SUBSYS_ATTR(_name, _mode, _show, _store) \
-struct subsys_attribute var_subsys_attr_##_name = { \
-   .attr = {.name = __stringify(_name), .mode = _mode}, \
-   .show = _show, \
-   .store = _store, \
-};
-
 #define to_efivar_attr(_attr) container_of(_attr, struct efivar_attribute, 
attr)
 #define to_efivar_entry(obj)  container_of(obj, struct efivar_entry, kobj)
 
@@ -408,144 +401,12 @@ static struct kobj_type efivar_ktype = {
.default_attrs = def_attrs,
 };
 
-static ssize_t
-dummy(struct kset *kset, char *buf)
-{
-   return -ENODEV;
-}
-
 static inline void
 efivar_unregister(struct efivar_entry *var)
 {
kobject_unregister(>kobj);
 }
 
-
-static ssize_t
-efivar_create(struct kset *kset, const char *buf, size_t count)
-{
-   struct efi_variable *new_var = (struct efi_variable *)buf;
-   struct efivar_entry *search_efivar, *n;
-   unsigned long strsize1, strsize2;
-   efi_status_t status = EFI_NOT_FOUND;
-   int found = 0;
-
-   if (!capable(CAP_SYS_ADMIN))
-   return -EACCES;
-
-   spin_lock(_lock);
-
-   /*
-* Does this variable already exist?
-*/
-   list_for_each_entry_safe(search_efivar, n, _list, list) {
-   strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024);
-   strsize2 = utf8_strsize(new_var->VariableName, 1024);
-   if (strsize1 == strsize2 &&
-   !memcmp(&(search_efivar->var.VariableName),
-   new_var->VariableName, strsize1) &&
-   !efi_guidcmp(search_efivar->var.VendorGuid,
-   new_var->VendorGuid)) {
-   found = 1;
-   break;
-   }
-   }
-   if (found) {
-   spin_unlock(_lock);
-   return -EINVAL;
-   }
-
-   /* now *really* create the variable via EFI */
-   status = efi.set_variable(new_var->VariableName,
-   _var->VendorGuid,
-   new_var->Attributes,
-   new_var->DataSize,
-   new_var->Data);
-
-   if (status != EFI_SUCCESS) {
-   printk(KERN_WARNING "efivars: set_variable() failed: 
status=%lx\n",
-   status);
-   spin_unlock(_lock);
-   return -EIO;
-   }
-   spin_unlock(_lock);
-
-   /* Create the entry in sysfs.  Locking is not required here */
-   status = efivar_create_sysfs_entry(utf8_strsize(new_var->VariableName,
-   1024), new_var->VariableName, _var->VendorGuid);
-   if (status) {
-   printk(KERN_WARNING "efivars: variable created, but sysfs entry 
wasn't.\n");
-   }
-   return count;
-}
-
-static ssize_t
-efivar_delete(struct kset *kset, const char *buf, size_t count)
-{
-   struct efi_variable *del_var = (struct efi_variable *)buf;
-   struct efivar_entry *search_efivar, *n;
-   unsigned long strsize1, strsize2;
-   efi_status_t status = EFI_NOT_FOUND;
-   int found = 0;
-
-   if (!capable(CAP_SYS_ADMIN))
-   return -EACCES;
-
-   spin_lock(_lock);
-
-   /*
-* Does this variable already exist?
-*/
-   list_for_each_entry_safe(search_efivar, n, _list, list) {
-   strsize1 = utf8_strsize(search_efivar->var.VariableName, 1024);
-   strsize2 = utf8_strsize(del_var->VariableName, 1024);
-   if (strsize1 == strsize2 &&
-   !memcmp(&(search_efivar->var.VariableName),
-   del_var->VariableName, strsize1) &&
-   !efi_guidcmp(search_efivar->var.VendorGuid,
-   del_var->VendorGuid)) {
-   found = 1;
-   break;
-   }
-   }
-   if (!found) {
-   spin_unlock(_lock);
-   return -EINVAL;
-   }
-   /* force the Attributes/DataSize to 0 to ensure deletion */
-   del_var->Attributes = 0;
-   del_var->DataSize = 

[PATCH 38/54] efivars: remove new_var and del_var files from sysfs

2007-11-02 Thread Greg Kroah-Hartman
WTF?  Passing binary structures into a sysfs file, expecting it to be in
the correct format/endianness?  That's just wrong on so many levels.

So, these files are deleted.  If you want to add them back, please do so
in configfs, or in debugfs.  Or use text strings, which is what sysfs is
only for.

Cc: Kay Sievers [EMAIL PROTECTED]
Cc: Matt Domsch [EMAIL PROTECTED]
Cc: Matt Tolentino [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/firmware/efivars.c |  149 
 1 files changed, 0 insertions(+), 149 deletions(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 06ecdb9..65cddb7 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -143,13 +143,6 @@ struct efivar_attribute efivar_attr_##_name = { \
.store = _store, \
 };
 
-#define VAR_SUBSYS_ATTR(_name, _mode, _show, _store) \
-struct subsys_attribute var_subsys_attr_##_name = { \
-   .attr = {.name = __stringify(_name), .mode = _mode}, \
-   .show = _show, \
-   .store = _store, \
-};
-
 #define to_efivar_attr(_attr) container_of(_attr, struct efivar_attribute, 
attr)
 #define to_efivar_entry(obj)  container_of(obj, struct efivar_entry, kobj)
 
@@ -408,144 +401,12 @@ static struct kobj_type efivar_ktype = {
.default_attrs = def_attrs,
 };
 
-static ssize_t
-dummy(struct kset *kset, char *buf)
-{
-   return -ENODEV;
-}
-
 static inline void
 efivar_unregister(struct efivar_entry *var)
 {
kobject_unregister(var-kobj);
 }
 
-
-static ssize_t
-efivar_create(struct kset *kset, const char *buf, size_t count)
-{
-   struct efi_variable *new_var = (struct efi_variable *)buf;
-   struct efivar_entry *search_efivar, *n;
-   unsigned long strsize1, strsize2;
-   efi_status_t status = EFI_NOT_FOUND;
-   int found = 0;
-
-   if (!capable(CAP_SYS_ADMIN))
-   return -EACCES;
-
-   spin_lock(efivars_lock);
-
-   /*
-* Does this variable already exist?
-*/
-   list_for_each_entry_safe(search_efivar, n, efivar_list, list) {
-   strsize1 = utf8_strsize(search_efivar-var.VariableName, 1024);
-   strsize2 = utf8_strsize(new_var-VariableName, 1024);
-   if (strsize1 == strsize2 
-   !memcmp((search_efivar-var.VariableName),
-   new_var-VariableName, strsize1) 
-   !efi_guidcmp(search_efivar-var.VendorGuid,
-   new_var-VendorGuid)) {
-   found = 1;
-   break;
-   }
-   }
-   if (found) {
-   spin_unlock(efivars_lock);
-   return -EINVAL;
-   }
-
-   /* now *really* create the variable via EFI */
-   status = efi.set_variable(new_var-VariableName,
-   new_var-VendorGuid,
-   new_var-Attributes,
-   new_var-DataSize,
-   new_var-Data);
-
-   if (status != EFI_SUCCESS) {
-   printk(KERN_WARNING efivars: set_variable() failed: 
status=%lx\n,
-   status);
-   spin_unlock(efivars_lock);
-   return -EIO;
-   }
-   spin_unlock(efivars_lock);
-
-   /* Create the entry in sysfs.  Locking is not required here */
-   status = efivar_create_sysfs_entry(utf8_strsize(new_var-VariableName,
-   1024), new_var-VariableName, new_var-VendorGuid);
-   if (status) {
-   printk(KERN_WARNING efivars: variable created, but sysfs entry 
wasn't.\n);
-   }
-   return count;
-}
-
-static ssize_t
-efivar_delete(struct kset *kset, const char *buf, size_t count)
-{
-   struct efi_variable *del_var = (struct efi_variable *)buf;
-   struct efivar_entry *search_efivar, *n;
-   unsigned long strsize1, strsize2;
-   efi_status_t status = EFI_NOT_FOUND;
-   int found = 0;
-
-   if (!capable(CAP_SYS_ADMIN))
-   return -EACCES;
-
-   spin_lock(efivars_lock);
-
-   /*
-* Does this variable already exist?
-*/
-   list_for_each_entry_safe(search_efivar, n, efivar_list, list) {
-   strsize1 = utf8_strsize(search_efivar-var.VariableName, 1024);
-   strsize2 = utf8_strsize(del_var-VariableName, 1024);
-   if (strsize1 == strsize2 
-   !memcmp((search_efivar-var.VariableName),
-   del_var-VariableName, strsize1) 
-   !efi_guidcmp(search_efivar-var.VendorGuid,
-   del_var-VendorGuid)) {
-   found = 1;
-   break;
-   }
-   }
-   if (!found) {
-   spin_unlock(efivars_lock);
-   return -EINVAL;
-   }
-   /* force the Attributes/DataSize to 0 to ensure deletion */
-   del_var-Attributes = 0;
-