Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237418 > unrolled thread

[PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

Started by"Kweh, Hock Leong" <hock.leong.kweh@intel.com>
First post2015-10-01 15:10 +0200
Last post2015-10-03 11:10 +0200
Articles 8 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-10-01 15:10 +0200
    Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware  updating Borislav Petkov <bp@alien8.de> - 2015-10-02 19:40 +0200
      RE: [PATCH v6 0/2] Enable capsule loader interface for efi firmware  updating "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-10-03 05:20 +0200
        Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware  updating Borislav Petkov <bp@alien8.de> - 2015-10-03 11:10 +0200
          RE: [PATCH v6 0/2] Enable capsule loader interface for efi firmware  updating "Kweh, Hock Leong" <hock.leong.kweh@intel.com> - 2015-10-05 17:40 +0200
            Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating Andy Lutomirski <luto@amacapital.net> - 2015-10-05 21:10 +0200
      Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating Andy Lutomirski <luto@amacapital.net> - 2015-10-03 06:20 +0200
        Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware  updating Borislav Petkov <bp@alien8.de> - 2015-10-03 11:10 +0200

#1237418 — [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

From"Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Date2015-10-01 15:10 +0200
Subject[PATCH v6 0/2] Enable capsule loader interface for efi firmware updating
Message-ID<qeLMu-53B-7@gated-at.bofh.it>
From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>

Dear maintainers & communities,

This patchset is created on top of Matt's patchset:
1.)https://lkml.org/lkml/2014/10/7/390
"[PATCH 1/2] efi: Move efi_status_to_err() to efi.h"
2.)https://lkml.org/lkml/2014/10/7/391
"[PATCH 2/2] efi: Capsule update support"

It expose a misc char interface for user to upload the capsule binary and
calling efi_capsule_update() API to pass the binary to EFI firmware.

The steps to update efi firmware are:
1.) cat firmware.cap > /dev/efi_capsule_loader
2.) reboot

Any failed upload error message will be returned while doing "cat" through
Write() function call.

Tested the code with Intel Quark Galileo platform.

Thanks.

---
changelog v6:
* clean up on error handling for better code flow and review
* clean up on pr_err() for critical error only
* design taking care writing block that below PAGE_SIZE
* once error has occurred, design will return -EIO until file close
* document design expectations/scenarios in the code
* change the dynamic allocation cap_info struct to statically allocated

changelog v5:
* changed to new design without leveraging firmware_class API
* use misc_char device interface instead of sysfs
* error return through file Write() function call


Kweh, Hock Leong (2):
  efi: export efi_capsule_supported() function symbol
  efi: a misc char interface for user to update efi firmware

 drivers/firmware/efi/Kconfig              |   10 ++
 drivers/firmware/efi/Makefile             |    1
 drivers/firmware/efi/capsule.c            |    1
 drivers/firmware/efi/efi-capsule-loader.c |  246 +++++++++++++++++++++++++++++
 4 files changed, 258 insertions(+)
 create mode 100644 drivers/firmware/efi/efi-capsule-loader.c

-- 
1.7.9.5

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

[toc] | [next] | [standalone]


#1238455 — Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

FromBorislav Petkov <bp@alien8.de>
Date2015-10-02 19:40 +0200
SubjectRe: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating
Message-ID<qfctl-1MB-39@gated-at.bofh.it>
In reply to#1237418
On Fri, Oct 02, 2015 at 05:05:52AM +0800, Kweh, Hock Leong wrote:
> From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
> 
> Dear maintainers & communities,
> 
> This patchset is created on top of Matt's patchset:
> 1.)https://lkml.org/lkml/2014/10/7/390
> "[PATCH 1/2] efi: Move efi_status_to_err() to efi.h"
> 2.)https://lkml.org/lkml/2014/10/7/391
> "[PATCH 2/2] efi: Capsule update support"
> 
> It expose a misc char interface for user to upload the capsule binary and
> calling efi_capsule_update() API to pass the binary to EFI firmware.
> 
> The steps to update efi firmware are:
> 1.) cat firmware.cap > /dev/efi_capsule_loader
> 2.) reboot
> 
> Any failed upload error message will be returned while doing "cat" through
> Write() function call.
> 
> Tested the code with Intel Quark Galileo platform.

What does the error case look like? A standard glibc message about
write(2) failing?

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1238726 — RE: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

From"Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Date2015-10-03 05:20 +0200
SubjectRE: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating
Message-ID<qflwB-6oh-1@gated-at.bofh.it>
In reply to#1238455
PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBCb3Jpc2xhdiBQZXRrb3YgW21h
aWx0bzpicEBhbGllbjguZGVdDQo+IFNlbnQ6IFNhdHVyZGF5LCBPY3RvYmVyIDAzLCAyMDE1IDE6
MzcgQU0NCj4gVG86IEt3ZWgsIEhvY2sgTGVvbmcNCj4gQ2M6IE1hdHQgRmxlbWluZzsgR3JlZyBL
cm9haC1IYXJ0bWFuOyBPbmcsIEJvb24gTGVvbmc7IExLTUw7IGxpbnV4LQ0KPiBlZmlAdmdlci5r
ZXJuZWwub3JnOyBTYW0gUHJvdHNlbmtvOyBQZXRlciBKb25lczsgQW5keSBMdXRvbWlyc2tpOyBS
b3kNCj4gRnJhbno7IEphbWVzIEJvdHR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+IC9kZXYvZWZpX2NhcHN1bGVfbG9hZGVyDQo+ID4gMi4pIHJlYm9vdA0K
PiA+DQo+ID4gQW55IGZhaWxlZCB1cGxvYWQgZXJyb3IgbWVzc2FnZSB3aWxsIGJlIHJldHVybmVk
IHdoaWxlIGRvaW5nICJjYXQiDQo+ID4gdGhyb3VnaA0KPiA+IFdyaXRlKCkgZnVuY3Rpb24gY2Fs
bC4NCj4gPg0KPiA+IFRlc3RlZCB0aGUgY29kZSB3aXRoIEludGVsIFF1YXJrIEdhbGlsZW8gcGxh
dGZvcm0uDQo+IA0KPiBXaGF0IGRvZXMgdGhlIGVycm9yIGNhc2UgbG9vayBsaWtlPyBBIHN0YW5k
YXJkIGdsaWJjIG1lc3NhZ2UgYWJvdXQNCj4gd3JpdGUoMikgZmFpbGluZz8NCj4gDQoNCkFueSB1
cGxvYWQgZmFpbCBlcnJvciBsaWtlIC1FTk9NRU0sIC1FSU5WQUwsIC1FSU8gYXMgd2VsbCBhcyBl
cnJvciByZXR1cm5lZA0KYnkgZWZpX2NhcHN1bGVfdXBkYXRlKCkgQVBJLg0KDQpUaGFua3MuDQoN
Cg==
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1238782 — Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

FromBorislav Petkov <bp@alien8.de>
Date2015-10-03 11:10 +0200
SubjectRe: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating
Message-ID<qfqZj-5LI-5@gated-at.bofh.it>
In reply to#1238726
On Sat, Oct 03, 2015 at 03:18:41AM +0000, Kweh, Hock Leong wrote:
> > What does the error case look like? A standard glibc message about
> > write(2) failing?
> > 
> 
> Any upload fail error like -ENOMEM, -EINVAL, -EIO as well as error returned
> by efi_capsule_update() API.

All I'm asking is, how does the user know that the upload didn't succeed?

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1239677 — RE: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

From"Kweh, Hock Leong" <hock.leong.kweh@intel.com>
Date2015-10-05 17:40 +0200
SubjectRE: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating
Message-ID<qgg1P-30J-7@gated-at.bofh.it>
In reply to#1238782
PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBCb3Jpc2xhdiBQZXRrb3YgW21h
aWx0bzpicEBhbGllbjguZGVdDQo+IFNlbnQ6IFNhdHVyZGF5LCBPY3RvYmVyIDAzLCAyMDE1IDU6
MDYgUE0NCj4gT24gU2F0LCBPY3QgMDMsIDIwMTUgYXQgMDM6MTg6NDFBTSArMDAwMCwgS3dlaCwg
SG9jayBMZW9uZyB3cm90ZToNCj4gPiA+IFdoYXQgZG9lcyB0aGUgZXJyb3IgY2FzZSBsb29rIGxp
a2U/IEEgc3RhbmRhcmQgZ2xpYmMgbWVzc2FnZSBhYm91dA0KPiA+ID4gd3JpdGUoMikgZmFpbGlu
Zz8NCj4gPiA+DQo+ID4NCj4gPiBBbnkgdXBsb2FkIGZhaWwgZXJyb3IgbGlrZSAtRU5PTUVNLCAt
RUlOVkFMLCAtRUlPIGFzIHdlbGwgYXMgZXJyb3INCj4gPiByZXR1cm5lZCBieSBlZmlfY2Fwc3Vs
ZV91cGRhdGUoKSBBUEkuDQo+IA0KPiBBbGwgSSdtIGFza2luZyBpcywgaG93IGRvZXMgdGhlIHVz
ZXIga25vdyB0aGF0IHRoZSB1cGxvYWQgZGlkbid0IHN1Y2NlZWQ/DQo+IA0KDQpJIHRoaW5rIGl0
IHNob3VsZCBkZXBlbmQgb24gdXNlciBhcHAgYWJvdXQgd2hpY2ggQVBJIHRoZXkgYXJlIHVzaW5n
Lg0KSWYgdGhleSBhcmUgdXNpbmcgc3lzY2FsbCB0aGVuIGVycm9ycyB3b3VsZCBiZSByZXR1cm5l
ZCB0aHJvdWdoIHdyaXRlKDIpLg0KSWYgdGhleSBhcmUgdXNpbmcgbGliYyBBUElzIGZ3cml0ZSwg
ZnB1dHMgYW5kIGZwcmludGYsIHRoZW4gdGhlIGVycm9ycyB3b3VsZA0KcmV0dXJuIHRocm91Z2gg
dGhvc2UgQVBJcy4gSG93ZXZlciwgdGhpcyBkZXNpZ24gaXMgdGFyZ2V0aW5nIHRoZSBzaW1wbGUN
CnVwbG9hZCBhY3Rpb24gImNhdCBjYXBzdWxlLmJpbiA+IC9kZXYvZWZpX2NhcHN1bGVfbG9hZGVy
Iiwgc28gdGhlIGVycm9ycw0Kc2hvdWxkIGJlIHJldHVybmVkIHRocm91Z2ggY2F0KCkgb3IgSS9P
IHJlZGlyZWN0aW9uIG1lY2hhbmlzbSBmcm9tDQpzaGVsbCB0ZXJtaW5hbC4gQW0gSSBhbnN3ZXJl
ZCB5b3VyIHF1ZXN0aW9uPw0KDQpCdHcsIEkgaGF2ZSBhbiBvdXQgdG9waWMgcXVlc3Rpb246IEkg
ZG8gbm90aWNlIHlvdSBndXlzIHdyb3RlIGluIHRoZSBtZXNzYWdlDQp0aGF0IGEgZnVuY3Rpb24g
bG9vayBsaWtlIHdyaXRlKDIpIG9yIGNsb3NlKDIpLiBXaGF0IGFjdHVhbGx5IHRoZSAiMiIgbWVh
biB0aGVyZT8NCg0KVGhhbmtzICYgcmVnYXJkcywNCldpbHNvbg0KDQo=
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1239847

FromAndy Lutomirski <luto@amacapital.net>
Date2015-10-05 21:10 +0200
Message-ID<qgjj4-7QJ-3@gated-at.bofh.it>
In reply to#1239677
On Mon, Oct 5, 2015 at 8:33 AM, Kweh, Hock Leong
<hock.leong.kweh@intel.com> wrote:
>> -----Original Message-----
>> From: Borislav Petkov [mailto:bp@alien8.de]
>> Sent: Saturday, October 03, 2015 5:06 PM
>> On Sat, Oct 03, 2015 at 03:18:41AM +0000, Kweh, Hock Leong wrote:
>> > > What does the error case look like? A standard glibc message about
>> > > write(2) failing?
>> > >
>> >
>> > Any upload fail error like -ENOMEM, -EINVAL, -EIO as well as error
>> > returned by efi_capsule_update() API.
>>
>> All I'm asking is, how does the user know that the upload didn't succeed?
>>
>
> I think it should depend on user app about which API they are using.
> If they are using syscall then errors would be returned through write(2).
> If they are using libc APIs fwrite, fputs and fprintf, then the errors would
> return through those APIs. However, this design is targeting the simple
> upload action "cat capsule.bin > /dev/efi_capsule_loader", so the errors
> should be returned through cat() or I/O redirection mechanism from
> shell terminal. Am I answered your question?
>
> Btw, I have an out topic question: I do notice you guys wrote in the message
> that a function look like write(2) or close(2). What actually the "2" mean there?

It's the manpage section.  Typing 'man 2 write' will give you the
manpage 'WRITE(2)'.  Section 2 is syscalls.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1238730

FromAndy Lutomirski <luto@amacapital.net>
Date2015-10-03 06:20 +0200
Message-ID<qfmsG-7HZ-3@gated-at.bofh.it>
In reply to#1238455
On Oct 2, 2015 10:37 AM, "Borislav Petkov" <bp@alien8.de> wrote:
>
> On Fri, Oct 02, 2015 at 05:05:52AM +0800, Kweh, Hock Leong wrote:
> > From: "Kweh, Hock Leong" <hock.leong.kweh@intel.com>
> >
> > Dear maintainers & communities,
> >
> > This patchset is created on top of Matt's patchset:
> > 1.)https://lkml.org/lkml/2014/10/7/390
> > "[PATCH 1/2] efi: Move efi_status_to_err() to efi.h"
> > 2.)https://lkml.org/lkml/2014/10/7/391
> > "[PATCH 2/2] efi: Capsule update support"
> >
> > It expose a misc char interface for user to upload the capsule binary and
> > calling efi_capsule_update() API to pass the binary to EFI firmware.
> >
> > The steps to update efi firmware are:
> > 1.) cat firmware.cap > /dev/efi_capsule_loader
> > 2.) reboot
> >
> > Any failed upload error message will be returned while doing "cat" through
> > Write() function call.
> >
> > Tested the code with Intel Quark Galileo platform.
>
> What does the error case look like? A standard glibc message about
> write(2) failing?
>

close(2), right?

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1238779 — Re: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating

FromBorislav Petkov <bp@alien8.de>
Date2015-10-03 11:10 +0200
SubjectRe: [PATCH v6 0/2] Enable capsule loader interface for efi firmware updating
Message-ID<qfqZj-5LI-3@gated-at.bofh.it>
In reply to#1238730
On Fri, Oct 02, 2015 at 09:18:05PM -0700, Andy Lutomirski wrote:
> > What does the error case look like? A standard glibc message about
> > write(2) failing?
> >
> 
> close(2), right?

I'm looking at those retvals of efi_capsule_write(). They are returned
to userspace during write(2), no?

/me has no idea how the whole plumbing actually works that's why me is
asking stupid questions.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web