[PATCH 1/3 v3] selftests: Add tests for efivarfs

2013-02-06 Thread Jeremy Kerr
This change adds a few initial efivarfs tests to the tools/testing/selftests directory. The open-unlink test is based on code from Lingzhu Xiang . Signed-off-by: Jeremy Kerr --- tools/testing/selftests/Makefile |2 tools/testing/selftests/efivarfs/Makefile | 12

[PATCH 2/3 v3] selftests/efivarfs: Add empty file creation test

2013-02-06 Thread Jeremy Kerr
Signed-off-by: Jeremy Kerr --- tools/testing/selftests/efivarfs/efivarfs.sh | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index e8c0d27..3af4b37 100755 --- a/tools/testing

[PATCH 2/3 v3] selftests/efivarfs: Add empty file creation test

2013-02-06 Thread Jeremy Kerr
Signed-off-by: Jeremy Kerr j...@ozlabs.org --- tools/testing/selftests/efivarfs/efivarfs.sh | 13 + 1 file changed, 13 insertions(+) diff --git a/tools/testing/selftests/efivarfs/efivarfs.sh b/tools/testing/selftests/efivarfs/efivarfs.sh index e8c0d27..3af4b37 100755 --- a/tools

[PATCH 1/3 v3] selftests: Add tests for efivarfs

2013-02-06 Thread Jeremy Kerr
This change adds a few initial efivarfs tests to the tools/testing/selftests directory. The open-unlink test is based on code from Lingzhu Xiang lxi...@redhat.com. Signed-off-by: Jeremy Kerr j...@ozlabs.org --- tools/testing/selftests/Makefile |2 tools/testing/selftests

[PATCH 0/3 v3] selftests: Add efivarfs tests

2013-02-06 Thread Jeremy Kerr
covered by these. Cheers, Jeremy -- v2: Remove qemu check, add a couple of tests v3: Change expected empty read() behaviour to return EOF --- Jeremy Kerr (3): selftests: Add tests for efivarfs selftests/efivarfs: Add empty file creation test selftests/efivarfs: Add create-read

[PATCH 3/3 v3] selftests/efivarfs: Add create-read test

2013-02-06 Thread Jeremy Kerr
Test that reads from a newly-created efivarfs file (with no data written) will return EOF. Signed-off-by: Jeremy Kerr j...@ozlabs.org --- tools/testing/selftests/efivarfs/Makefile |2 tools/testing/selftests/efivarfs/create-read.c | 38 + tools/testing/selftests

Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-16 Thread Jeremy Kerr
ock *sb) { kill_litter_super(sb); efivarfs_sb = NULL; } Which I believe will clean them up. Awesome, thanks for that. Looks good to me. Acked-by: Jeremy Kerr Cheers, Jeremy Kerr -- To unsubscribe from this list: send the line "unsubscribe linux-efi&

Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-16 Thread Jeremy Kerr
) { kill_litter_super(sb); efivarfs_sb = NULL; } Which I believe will clean them up. Awesome, thanks for that. Looks good to me. Acked-by: Jeremy Kerr jeremy.k...@canonical.com Cheers, Jeremy Kerr -- To unsubscribe from this list: send the line unsubscribe linux

Re: [PATCH] efivarfs: Implement exclusive access for {get,set}_variable

2012-10-11 Thread Jeremy Kerr
Hi Greg, Should this be backported to the stable kernels? No, the efivarfs code that this touches was only recently committed; it won't be in any of the stable series. Cheers, Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, Looks good. Thanks for taking the time to review the efivarfs changes. Acked-by: Jeremy Kerr Cheers, Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo inf

Re: [PATCH 3/5] efivarfs: efivarfs_fill_super() fix inode reference counts

2012-10-11 Thread Jeremy Kerr
Hi Andy, When d_make_root() fails it will automatically drop the reference on the root inode. We should not be doing so as well. Looks good: Acked-by: Jeremy Kerr Cheers, Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of

Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, @@ -969,16 +970,18 @@ return -ENOMEM; list_for_each_entry_safe(entry, n, >list, list) { - struct inode *inode; struct dentry *dentry, *root = efivarfs_sb->s_root; - char *name; unsigned long size = 0;

Re: [PATCH 4/5] efivarfs: efivarfs_fill_super() ensure we free our temporary name

2012-10-11 Thread Jeremy Kerr
Hi Andy, d_alloc_name() copies the passed name to new storage, once complete we no longer need our name. Acked-by: Jeremy Kerr Cheers, Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 1/5] efivarfs: efivarfs_file_read ensure we free data in error paths

2012-10-11 Thread Jeremy Kerr
Hi Andy, > Signed-off-by: Andy Whitcroft > --- > drivers/firmware/efivars.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > Looks good to me. Acked-by: Jeremy Kerr Cheers, Jeremy -- To unsubscribe from this list: send the line "unsubscribe linux

[PATCH] efivarfs: Implement exclusive access for {get,set}_variable

2012-10-11 Thread Jeremy Kerr
rfs paths. Signed-off-by: Jeremy Kerr --- drivers/firmware/efivars.c | 68 +++-- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 5765664..a86eb55 100644 --- a/drivers/firmware/efivar

[PATCH] efivarfs: Implement exclusive access for {get,set}_variable

2012-10-11 Thread Jeremy Kerr
paths. Signed-off-by: Jeremy Kerr jeremy.k...@canonical.com --- drivers/firmware/efivars.c | 68 +++-- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c index 5765664..a86eb55 100644

Re: [PATCH 1/5] efivarfs: efivarfs_file_read ensure we free data in error paths

2012-10-11 Thread Jeremy Kerr
Hi Andy, Signed-off-by: Andy Whitcroft a...@canonical.com --- drivers/firmware/efivars.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Looks good to me. Acked-by: Jeremy Kerr jeremy.k...@canonical.com Cheers, Jeremy -- To unsubscribe from this list: send the line

Re: [PATCH 4/5] efivarfs: efivarfs_fill_super() ensure we free our temporary name

2012-10-11 Thread Jeremy Kerr
Hi Andy, d_alloc_name() copies the passed name to new storage, once complete we no longer need our name. Acked-by: Jeremy Kerr jeremy.k...@canonical.com Cheers, Jeremy -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord

Re: [PATCH 5/5] efivarfs: efivarfs_fill_super() ensure we clean up correctly on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, @@ -969,16 +970,18 @@ return -ENOMEM; list_for_each_entry_safe(entry, n, efivars-list, list) { - struct inode *inode; struct dentry *dentry, *root = efivarfs_sb-s_root; - char *name; unsigned long size

Re: [PATCH 3/5] efivarfs: efivarfs_fill_super() fix inode reference counts

2012-10-11 Thread Jeremy Kerr
Hi Andy, When d_make_root() fails it will automatically drop the reference on the root inode. We should not be doing so as well. Looks good: Acked-by: Jeremy Kerr jeremy.k...@canonical.com Cheers, Jeremy -- To unsubscribe from this list: send the line unsubscribe linux-kernel

Re: [PATCH 2/5] efivarfs: efivarfs_create() ensure we drop our reference on inode on error

2012-10-11 Thread Jeremy Kerr
Hi Andy, Looks good. Thanks for taking the time to review the efivarfs changes. Acked-by: Jeremy Kerr jeremy.k...@canonical.com Cheers, Jeremy -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] efivarfs: Implement exclusive access for {get,set}_variable

2012-10-11 Thread Jeremy Kerr
Hi Greg, Should this be backported to the stable kernels? No, the efivarfs code that this touches was only recently committed; it won't be in any of the stable series. Cheers, Jeremy -- To unsubscribe from this list: send the line unsubscribe linux-efi in the body of a message to

Re: [PATCH 2/3] efi: add efivars kobject to efi sysfs folder

2012-10-05 Thread Jeremy Kerr
Hi Joey, Since more people prefer to use "efivarfs", so, I modified the patch for replace "efivars" to "efivarfs" like following: I'd intentionally left this patch as-is. I think that the filesystem should be called "efivarfs", while the directory should be called "efivars". Same style as

[PATCH 3/3] efi: Handle deletions and size changes in efivarfs_write_file

2012-10-05 Thread Jeremy Kerr
datasize). This change re-reads the updated variable from firmware, to check for size changes and deletions. In the latter case, we need to drop the dentry. Signed-off-by: Jeremy Kerr --- drivers/firmware/efivars.c | 49 + 1 file changed, 39 insertions(+), 10

[PATCH 1/3] efi: Add support for a UEFI variable filesystem

2012-10-05 Thread Jeremy Kerr
for this. So, instead, let's add a filesystem. Variables can be read, written and created, with the first 4 bytes of each variable representing its UEFI attributes. The create() method doesn't actually commit to flash since zero-length variables can't exist per-spec. Updates from Jeremy Kerr . Signed

[PATCH 2/3] efi: add efivars kobject to efi sysfs folder

2012-10-05 Thread Jeremy Kerr
From: Lee, Chun-Yi UEFI variable filesystem need a new mount point, so this patch add efivars kobject to efi_kobj for create a /sys/firmware/efi/efivars folder. Cc: Matt Fleming Cc: Jeremy Kerr Cc: Matthew Garrett Cc: H. Peter Anvin Signed-off-by: Lee, Chun-Yi Signed-off-by: Jeremy Kerr

[PATCH 2/3] efi: add efivars kobject to efi sysfs folder

2012-10-05 Thread Jeremy Kerr
From: Lee, Chun-Yi joeyli.ker...@gmail.com UEFI variable filesystem need a new mount point, so this patch add efivars kobject to efi_kobj for create a /sys/firmware/efi/efivars folder. Cc: Matt Fleming matt.flem...@intel.com Cc: Jeremy Kerr jeremy.k...@canonical.com Cc: Matthew Garrett m

[PATCH 1/3] efi: Add support for a UEFI variable filesystem

2012-10-05 Thread Jeremy Kerr
Kerr jeremy.k...@canonical.com. Signed-off-by: Matthew Garrett m...@redhat.com Signed-off-by: Jeremy Kerr jeremy.k...@canonical.com --- drivers/firmware/efivars.c | 384 - include/linux/efi.h|5 2 files changed, 383 insertions(+), 6 deletions

[PATCH 3/3] efi: Handle deletions and size changes in efivarfs_write_file

2012-10-05 Thread Jeremy Kerr
datasize). This change re-reads the updated variable from firmware, to check for size changes and deletions. In the latter case, we need to drop the dentry. Signed-off-by: Jeremy Kerr jeremy.k...@canonical.com --- drivers/firmware/efivars.c | 49 + 1 file

Re: [PATCH 2/3] efi: add efivars kobject to efi sysfs folder

2012-10-05 Thread Jeremy Kerr
Hi Joey, Since more people prefer to use efivarfs, so, I modified the patch for replace efivars to efivarfs like following: I'd intentionally left this patch as-is. I think that the filesystem should be called efivarfs, while the directory should be called efivars. Same style as sysfs -

Re: [PATCH] efi: add efivars kobject to efi sysfs folder

2012-10-04 Thread Jeremy Kerr
Hi Matt, Jeremy, did you want to pick this up as part of your series? I have this in my series, yes. I'm just working on the authenticated delete code, then will send out the next revision. Speaking of which - Peter: I've realised that doing a GetVariable() after the SetVariable is a much

Re: [PATCH] efi: add efivars kobject to efi sysfs folder

2012-10-04 Thread Jeremy Kerr
Hi Matt, Jeremy, did you want to pick this up as part of your series? I have this in my series, yes. I'm just working on the authenticated delete code, then will send out the next revision. Speaking of which - Peter: I've realised that doing a GetVariable() after the SetVariable is a much

Re: [RFC,PATCH v2] efi: Add support for a UEFI variable filesystem

2012-09-06 Thread Jeremy Kerr
Hi Matt, I think this is the problematic chunk of code, static int efivars_unlink(struct inode *dir, struct dentry *dentry) { struct efivar_entry *var = dentry->d_inode->i_private; struct efivars *efivars = var->efivars; efi_status_t status;

Re: [RFC,PATCH v2] efi: Add support for a UEFI variable filesystem

2012-09-06 Thread Jeremy Kerr
Hi Matt, Am I correct in thinking that this filesystem doesn't handle deletion of authenticated variables? Unless I'm missing something, this should work fine; we just pass the EFI_VARIABLE_AUTHENTICATION_2 descriptor (with the usual attribute header), but no data following the descriptor.

[RFC,PATCH v2] efi: Add support for a UEFI variable filesystem

2012-09-06 Thread Jeremy Kerr
for this. So, instead, let's add a filesystem. Variables can be read, written and created, with the first 4 bytes of each variable representing its UEFI attributes. The create() method doesn't actually commit to flash since zero-length variables can't exist per-spec. Updates from Jeremy Kerr . Signed

[RFC,PATCH v2] efi: Add support for a UEFI variable filesystem

2012-09-06 Thread Jeremy Kerr
Kerr jeremy.k...@canonical.com. Signed-off-by: Matthew Garrett m...@redhat.com Signed-off-by: Jeremy Kerr jeremy.k...@canonical.com --- v2: Add check for 4-byte writes --- drivers/firmware/efivars.c | 384 - include/linux/efi.h|5 2 files

Re: [RFC,PATCH v2] efi: Add support for a UEFI variable filesystem

2012-09-06 Thread Jeremy Kerr
Hi Matt, Am I correct in thinking that this filesystem doesn't handle deletion of authenticated variables? Unless I'm missing something, this should work fine; we just pass the EFI_VARIABLE_AUTHENTICATION_2 descriptor (with the usual attribute header), but no data following the descriptor.

Re: [RFC,PATCH v2] efi: Add support for a UEFI variable filesystem

2012-09-06 Thread Jeremy Kerr
Hi Matt, I think this is the problematic chunk of code, static int efivars_unlink(struct inode *dir, struct dentry *dentry) { struct efivar_entry *var = dentry-d_inode-i_private; struct efivars *efivars = var-efivars; efi_status_t status;

Re: [RFC,PATCH] efi: Add support for a UEFI variable filesystem

2012-09-02 Thread Jeremy Kerr
Hi hpa, > Well, appending is an action, not really a property of the variable > that sticks around, no? True, but they're still all defined as the same thing in the UEFI spec. If you're looking to define which attributes to pass, you now need to know the extra information that you pass most of

Re: [RFC,PATCH] efi: Add support for a UEFI variable filesystem

2012-09-02 Thread Jeremy Kerr
hi hpa, > Wouldn't that be better handled by O_APPEND? Possibly, but this then means that there are now two "interfaces" that specify the variable attributes. [Also, in that case we should support the same mechanism through open(); llseek(0, SEEK_END) then, right?] In general, I think the

Re: [RFC,PATCH] efi: Add support for a UEFI variable filesystem

2012-09-02 Thread Jeremy Kerr
hi hpa, Wouldn't that be better handled by O_APPEND? Possibly, but this then means that there are now two interfaces that specify the variable attributes. [Also, in that case we should support the same mechanism through open(); llseek(0, SEEK_END) then, right?] In general, I think the

Re: [RFC,PATCH] efi: Add support for a UEFI variable filesystem

2012-09-02 Thread Jeremy Kerr
Hi hpa, Well, appending is an action, not really a property of the variable that sticks around, no? True, but they're still all defined as the same thing in the UEFI spec. If you're looking to define which attributes to pass, you now need to know the extra information that you pass most of the

Re: [RFC,PATCH] efi: Add support for a UEFI variable filesystem

2012-08-30 Thread Jeremy Kerr
Hi hpa, Thanks for the review! However, I have a question... rather than putting the attributes as the first data bytes, would it be better to make it either part of the filename (assuming there is at least one character other than / which can be reasonably relied upon to not be part of the

Re: [RFC,PATCH] efi: Add support for a UEFI variable filesystem

2012-08-30 Thread Jeremy Kerr
Hi hpa, Thanks for the review! However, I have a question... rather than putting the attributes as the first data bytes, would it be better to make it either part of the filename (assuming there is at least one character other than / which can be reasonably relied upon to not be part of the

Re: [RFC/PATCH] Export force_sig_info

2007-11-25 Thread Jeremy Kerr
Hi Andrew, > Perhaps export it from within a powerpc-specific C file (along with > suitable comment) to prevent people from generally relying upon the > export? Even better, I'll export it from a Cell-specific C file. I'll follow this up in my own spufs series for .25. Cheers, Jeremy -

Re: [RFC/PATCH] Export force_sig_info

2007-11-25 Thread Jeremy Kerr
Hi Andrew, Perhaps export it from within a powerpc-specific C file (along with suitable comment) to prevent people from generally relying upon the export? Even better, I'll export it from a Cell-specific C file. I'll follow this up in my own spufs series for .25. Cheers, Jeremy - To

[RFC/PATCH] Export force_sig_info

2007-11-11 Thread Jeremy Kerr
This change allows force_sig_info to be called from modules. Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> -- Any objections to exporting this symbol? I'm planning to move some SPU fault-handling code from the kernel to the spufs.ko object. --- kernel/signal.c |1 + 1 file chan

[RFC/PATCH] Export force_sig_info

2007-11-11 Thread Jeremy Kerr
This change allows force_sig_info to be called from modules. Signed-off-by: Jeremy Kerr [EMAIL PROTECTED] -- Any objections to exporting this symbol? I'm planning to move some SPU fault-handling code from the kernel to the spufs.ko object. --- kernel/signal.c |1 + 1 file changed, 1

Re: [PATCH 01/15] Extract the file descriptor search logic in SPU coredump code

2007-09-12 Thread Jeremy Kerr
Hi Michael, This series looks good to me, thanks for the fixes. I'll do some testing tomorrow but it looks like it'll be fine as-is. Andrew - almost all of these are for spufs, the notable exception being: [PATCH 12/15] Cleanup ELF coredump extra notes logic which touches the generic

Re: [PATCH 01/15] Extract the file descriptor search logic in SPU coredump code

2007-09-12 Thread Jeremy Kerr
Hi Michael, This series looks good to me, thanks for the fixes. I'll do some testing tomorrow but it looks like it'll be fine as-is. Andrew - almost all of these are for spufs, the notable exception being: [PATCH 12/15] Cleanup ELF coredump extra notes logic which touches the generic

Re: [PATCH] ppc64 mismerge

2007-07-22 Thread Jeremy Kerr
> Mismerge in > commit 8b6f50ef1d5cc86b278eb42bc91630fad455fb10 > Author: Jeremy Kerr <[EMAIL PROTECTED]> > Date: Sat Jul 21 04:37:51 2007 -0700 > spufs: make signal-notification files readonly for NOSCHED > contexts > > structs got duplicated. >

Re: [PATCH] ppc64 mismerge

2007-07-22 Thread Jeremy Kerr
Mismerge in commit 8b6f50ef1d5cc86b278eb42bc91630fad455fb10 Author: Jeremy Kerr [EMAIL PROTECTED] Date: Sat Jul 21 04:37:51 2007 -0700 spufs: make signal-notification files readonly for NOSCHED contexts structs got duplicated. Signed-off-by: Al Viro [EMAIL PROTECTED] Yep

<    1   2