Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-26 Thread Dave Cottlehuber
On Tue, 25 Jun 2019, at 21:37, Warner Losh wrote:
> 
> 
> On Tue, Jun 25, 2019, 3:29 PM Rebecca Cran  wrote:
> > On 2019-06-25 11:23, Dave Cottlehuber wrote:
> > 
> >  > This fails to identify the partition with a bootable zpool on both a 
> > laptop (details
> >  > in the PR) and also a server (2 zpools), and instead tries to boot from 
> > the EFI
> >  > partition where the boot1.efi loader is located (i.e. disk0p1 and not 
> > disk0p2).
> >  > 
> >  > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238800
> > 
> >  This doesn't sound related to the EFI HTTP changes, but may be related
> >  to some recent changes Warner's made?
> > 
> >  Other people have reported problems booting after my changeset though,
> >  so I've disconnected the HTTP boot code in r349395.

r349404 works for me again - thanks. Please let me know when the next patches 
for this come on phabricator and I'll test.

A+
Dave
—
O for a muse of fire, that would ascend the brightest heaven of invention!
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-25 Thread Warner Losh
On Tue, Jun 25, 2019, 3:29 PM Rebecca Cran  wrote:

> On 2019-06-25 11:23, Dave Cottlehuber wrote:
>
> > This fails to identify the partition with a bootable zpool on both a
> laptop (details
> > in the PR)  and also a server (2 zpools), and instead tries to boot from
> the EFI
> > partition where the boot1.efi loader is located (i.e. disk0p1 and not
> disk0p2).
> >
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238800
>
> This doesn't sound related to the EFI HTTP changes, but may be related
> to some recent changes Warner's made?
>
> Other people have reported problems booting after my changeset though,
> so I've disconnected the HTTP boot code in r349395.
>

Please let me know if this persists.

Warner

>
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-25 Thread Rebecca Cran
On 2019-06-25 11:23, Dave Cottlehuber wrote:

> This fails to identify the partition with a bootable zpool on both a laptop 
> (details
> in the PR)  and also a server (2 zpools), and instead tries to boot from the 
> EFI
> partition where the boot1.efi loader is located (i.e. disk0p1 and not 
> disk0p2).
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238800

This doesn't sound related to the EFI HTTP changes, but may be related
to some recent changes Warner's made?

Other people have reported problems booting after my changeset though,
so I've disconnected the HTTP boot code in r349395.

-- 
Rebecca Cran



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-25 Thread Rebecca Cran
On 2019-06-25 07:03, Ed Maste wrote:

> My QEMU smoke test script (tools/boot/ci-qemu-test.sh) fails after
> this change, with an exception in the loader:
I can replicate this failure, and am working to debug it.

-- 
Rebecca Cran



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-25 Thread Dave Cottlehuber
On Mon, 24 Jun 2019, at 23:19, Rebecca Cran wrote:
> Author: bcran
> Date: Mon Jun 24 23:18:42 2019
> New Revision: 349349
> URL: https://svnweb.freebsd.org/changeset/base/349349
> 
> Log:
>   loader: add HTTP support using UEFI
>   
>   Add support for an HTTP "network filesystem" using the UEFI's HTTP
>   stack.
>   
>   This also supports HTTPS, but TianoCore EDK2 implementations currently
>   crash while fetching loader files.
>   Only IPv4 is supported at the moment. IPv6 support is planned for a
>   follow-up changeset.
>   
>   Note that we include some headers from the TianoCore EDK II project in
>   stand/efi/include/Protocol verbatim, including links to the license instead
>   of including the full text because that's their preferred way of
>   communicating it, despite not being normal FreeBSD project practice.
>   
>   Submitted by:   scottph
>   Reviewed by:imp, bcran
>   Differential Revision:  https://reviews.freebsd.org/D20643
> 
> Added:
>   head/stand/efi/include/Protocol/Http.h   (contents, props changed)
>   head/stand/efi/include/Protocol/Ip4Config2.h   (contents, props changed)
>   head/stand/efi/include/Protocol/ServiceBinding.h   (contents, props changed)
>   head/stand/efi/libefi/efihttp.c   (contents, props changed)
> Modified:
>   head/stand/efi/include/efidevp.h
>   head/stand/efi/include/efilib.h
>   head/stand/efi/libefi/Makefile
>   head/stand/efi/loader/conf.c
>   head/stand/libsa/stand.h

Many thanks for landing this Rebecca & Scott.

This fails to identify the partition with a bootable zpool on both a laptop 
(details
in the PR)  and also a server (2 zpools), and instead tries to boot from the EFI
partition where the boot1.efi loader is located (i.e. disk0p1 and not disk0p2).

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238800

A+
Dave
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-25 Thread Ed Maste
On Mon, 24 Jun 2019 at 19:18, Rebecca Cran  wrote:
>
> Author: bcran
> Date: Mon Jun 24 23:18:42 2019
> New Revision: 349349
> URL: https://svnweb.freebsd.org/changeset/base/349349
>
> Log:
>   loader: add HTTP support using UEFI

My QEMU smoke test script (tools/boot/ci-qemu-test.sh) fails after
this change, with an exception in the loader:

Consoles: EFI console
|  Reading loader env vars from /efi/freebsd/loader.env
Setting currdev to disk0p1:
/ -  X64 Exception Type - 000E CPU Apic ID -  
RIP - 0202, CS - 0028, RFLAGS - 0246
ExceptionData - 
RAX - 0FF93610, RCX - 0A500AD0, RDX - 0FF935F8
RBX - 0FF93610, RSP - 0FF93588, RBP - 0FF936C0
RSI - , RDI - 0FF9361C
R8 - , R9 - 0A500908, R10 - 0E8EFEC8
R11 - 0083, R12 - 0FF935F8, R13 - 000C
R14 - 0A500870, R15 - 0E8DC0D5
DS - 0008, ES - 0008, FS - 0008
GS - 0008, SS - 0008
CR0 - 8033, CR2 - 0202, CR3 - 0FF33000
CR4 - 0668, CR8 - 
DR0 - , DR1 - , DR2 - 
DR3 - , DR6 - 0FF0, DR7 - 0400
GDTR - 0FF1ED98 003F, LDTR - 
IDTR - 0F47F018 0FFF, TR - 
FXSAVE_STATE - 0FF931E0
qemu-system-x86_64: terminating on signal 15 from pid 54769 (timeout)
Did not boot successfully, see /tmp/ci-qemu-test-boot.log
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-24 Thread Warner Losh
Hey Rod,

On Mon, Jun 24, 2019 at 7:11 PM Rodney W. Grimes 
wrote:

> -- Start of PGP signed section.
> [ Charset UTF-8 unsupported, converting... ]
> > On 2019-06-24 18:45, Rodney W. Grimes wrote:
> >
> > > It sys accompanies, that means not a pointer to
> > > Hum oh my, what has happend to the disclaimer?
> >
> > Huh. It turns out the _latest_ version of that file just contains:
> >
> > /** @file
> >   This file defines the EFI HTTP Protocol interface. It is split into
> >   the following two main sections:
> >   HTTP Service Binding Protocol (HTTPSB)
> >   HTTP Protocol (HTTP)
> >
> >   Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> >   (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> >   SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >   @par Revision Reference:
> >   This Protocol is introduced in UEFI Specification 2.5
> >
> > **/
> >
> >
> > I think I should update the copy in the tree with this version, which
> > makes more sense. Do you agree?
>

Rebecca: I think it frankly doesn't matter. There's no need to go fetch a
stone just to keep Rod happy. The version you committed is fine: it is a
verbatim copy of the vendor source at some point in the past. I looked at
and approved that license. This newer one, I'm less sure about, so please
hold off on that.


> If that is how the vendor is distributing it now, yes, that would
> be safer as the above removes the conflict between what the file says
> and what was done.
>
> Please note that -Patent has not been addressed by core@ to my
> knowledge, and that may or may not be an issue.  I shringe when
> I see these clauses being blanket added to software though.
>
>
Again with the scolding?

Rebecca doesn't deserve this level of nit-picking. It is demotivating. She
did a great job getting this code into the tree and you wag your finger at
her for committing code verbatim from the vendor?

It's totally not cool. Please stop this sort of nonsense. The rest of the
project stopped this level of nit-picking back in the 90's when we all
agreed it was counter productive.

Warner
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-24 Thread Rodney W. Grimes
-- Start of PGP signed section.
[ Charset UTF-8 unsupported, converting... ]
> On 2019-06-24 18:45, Rodney W. Grimes wrote:
> 
> > It sys accompanies, that means not a pointer to
> > Hum oh my, what has happend to the disclaimer?
> 
> Huh. It turns out the _latest_ version of that file just contains:
> 
> /** @file
>   This file defines the EFI HTTP Protocol interface. It is split into
>   the following two main sections:
>   HTTP Service Binding Protocol (HTTPSB)
>   HTTP Protocol (HTTP)
> 
>   Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
>   (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
>   SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>   @par Revision Reference:
>   This Protocol is introduced in UEFI Specification 2.5
> 
> **/
> 
> 
> I think I should update the copy in the tree with this version, which
> makes more sense. Do you agree?

If that is how the vendor is distributing it now, yes, that would
be safer as the above removes the conflict between what the file says
and what was done.

Please note that -Patent has not been addressed by core@ to my
knowledge, and that may or may not be an issue.  I shringe when
I see these clauses being blanket added to software though.

> Rebecca Cran
-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-24 Thread Rebecca Cran
On 2019-06-24 18:45, Rodney W. Grimes wrote:

> It sys accompanies, that means not a pointer to
> Hum oh my, what has happend to the disclaimer?

Huh. It turns out the _latest_ version of that file just contains:

/** @file
  This file defines the EFI HTTP Protocol interface. It is split into
  the following two main sections:
  HTTP Service Binding Protocol (HTTPSB)
  HTTP Protocol (HTTP)

  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
  SPDX-License-Identifier: BSD-2-Clause-Patent

  @par Revision Reference:
  This Protocol is introduced in UEFI Specification 2.5

**/


I think I should update the copy in the tree with this version, which
makes more sense. Do you agree?

-- 
Rebecca Cran



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-24 Thread Rodney W. Grimes
> Author: bcran
> Date: Mon Jun 24 23:18:42 2019
> New Revision: 349349
> URL: https://svnweb.freebsd.org/changeset/base/349349
> 
> Log:
>   loader: add HTTP support using UEFI
>   
>   Add support for an HTTP "network filesystem" using the UEFI's HTTP
>   stack.
>   
>   This also supports HTTPS, but TianoCore EDK2 implementations currently
>   crash while fetching loader files.
>   Only IPv4 is supported at the moment. IPv6 support is planned for a
>   follow-up changeset.
>   
>   Note that we include some headers from the TianoCore EDK II project in
>   stand/efi/include/Protocol verbatim, including links to the license instead
>   of including the full text because that's their preferred way of
>   communicating it, despite not being normal FreeBSD project practice.

Please read the license text below and understand why I might have
a conflict with the above statement when infact the text included
says "which accompanies this distribution."

>   Submitted by:   scottph
>   Reviewed by:imp, bcran
>   Differential Revision:  https://reviews.freebsd.org/D20643
> 
> Added:
>   head/stand/efi/include/Protocol/Http.h   (contents, props changed)
>   head/stand/efi/include/Protocol/Ip4Config2.h   (contents, props changed)
>   head/stand/efi/include/Protocol/ServiceBinding.h   (contents, props changed)
>   head/stand/efi/libefi/efihttp.c   (contents, props changed)
> Modified:
>   head/stand/efi/include/efidevp.h
>   head/stand/efi/include/efilib.h
>   head/stand/efi/libefi/Makefile
>   head/stand/efi/loader/conf.c
>   head/stand/libsa/stand.h
> 
> Added: head/stand/efi/include/Protocol/Http.h
> ==
> --- /dev/null 00:00:00 1970   (empty, because file is newly added)
> +++ head/stand/efi/include/Protocol/Http.hMon Jun 24 23:18:42 2019
> (r349349)
> @@ -0,0 +1,523 @@
> +/* $FreeBSD$ */
> +/** @file
> +  This file defines the EFI HTTP Protocol interface. It is split into
> +  the following two main sections:
> +  HTTP Service Binding Protocol (HTTPSB)
> +  HTTP Protocol (HTTP)
> +
> +  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
> +  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> +  This program and the accompanying materials
> +  are licensed and made available under the terms and conditions of the BSD 
> License
> +  which accompanies this distribution. The full text of the license may be 
> found at

It sys accompanies, that means not a pointer to...

> +  http://opensource.org/licenses/bsd-license.php

Also shouldn't it say 2 clause license, as that is what is pointed at?
Is the above text exactly as it appeared in the file from Tianocore
or has it been edited in any way?

> +
> +  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.

Hum oh my, what has happend to the disclaimer?

> +
> +  @par Revision Reference:
> +  This Protocol is introduced in UEFI Specification 2.5
> +
> +**/
> +
> +#ifndef __EFI_HTTP_PROTOCOL_H__
> +#define __EFI_HTTP_PROTOCOL_H__
...

-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r349349 - in head/stand: efi/include efi/include/Protocol efi/libefi efi/loader libsa

2019-06-24 Thread Rebecca Cran
Author: bcran
Date: Mon Jun 24 23:18:42 2019
New Revision: 349349
URL: https://svnweb.freebsd.org/changeset/base/349349

Log:
  loader: add HTTP support using UEFI
  
  Add support for an HTTP "network filesystem" using the UEFI's HTTP
  stack.
  
  This also supports HTTPS, but TianoCore EDK2 implementations currently
  crash while fetching loader files.
  Only IPv4 is supported at the moment. IPv6 support is planned for a
  follow-up changeset.
  
  Note that we include some headers from the TianoCore EDK II project in
  stand/efi/include/Protocol verbatim, including links to the license instead
  of including the full text because that's their preferred way of
  communicating it, despite not being normal FreeBSD project practice.
  
  Submitted by: scottph
  Reviewed by:  imp, bcran
  Differential Revision:https://reviews.freebsd.org/D20643

Added:
  head/stand/efi/include/Protocol/Http.h   (contents, props changed)
  head/stand/efi/include/Protocol/Ip4Config2.h   (contents, props changed)
  head/stand/efi/include/Protocol/ServiceBinding.h   (contents, props changed)
  head/stand/efi/libefi/efihttp.c   (contents, props changed)
Modified:
  head/stand/efi/include/efidevp.h
  head/stand/efi/include/efilib.h
  head/stand/efi/libefi/Makefile
  head/stand/efi/loader/conf.c
  head/stand/libsa/stand.h

Added: head/stand/efi/include/Protocol/Http.h
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/stand/efi/include/Protocol/Http.h  Mon Jun 24 23:18:42 2019
(r349349)
@@ -0,0 +1,523 @@
+/* $FreeBSD$ */
+/** @file
+  This file defines the EFI HTTP Protocol interface. It is split into
+  the following two main sections:
+  HTTP Service Binding Protocol (HTTPSB)
+  HTTP Protocol (HTTP)
+
+  Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
+  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
+  This program and the accompanying materials
+  are licensed and made available under the terms and conditions of the BSD 
License
+  which accompanies this distribution. The full text of the license may be 
found at
+  http://opensource.org/licenses/bsd-license.php
+
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+  @par Revision Reference:
+  This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_HTTP_PROTOCOL_H__
+#define __EFI_HTTP_PROTOCOL_H__
+
+#define EFI_HTTP_SERVICE_BINDING_PROTOCOL_GUID \
+  { \
+0xbdc8e6af, 0xd9bc, 0x4379, {0xa7, 0x2a, 0xe0, 0xc4, 0xe7, 0x5d, 0xae, 
0x1c } \
+  }
+
+#define EFI_HTTP_PROTOCOL_GUID \
+  { \
+0x7a59b29b, 0x910b, 0x4171, {0x82, 0x42, 0xa8, 0x5a, 0x0d, 0xf2, 0x5b, 
0x5b } \
+  }
+
+typedef struct _EFI_HTTP_PROTOCOL EFI_HTTP_PROTOCOL;
+
+///
+/// EFI_HTTP_VERSION
+///
+typedef enum {
+  HttpVersion10,
+  HttpVersion11,
+  HttpVersionUnsupported
+} EFI_HTTP_VERSION;
+
+///
+/// EFI_HTTP_METHOD
+///
+typedef enum {
+  HttpMethodGet,
+  HttpMethodPost,
+  HttpMethodPatch,
+  HttpMethodOptions,
+  HttpMethodConnect,
+  HttpMethodHead,
+  HttpMethodPut,
+  HttpMethodDelete,
+  HttpMethodTrace,
+  HttpMethodMax
+} EFI_HTTP_METHOD;
+
+///
+/// EFI_HTTP_STATUS_CODE
+///
+typedef enum {
+  HTTP_STATUS_UNSUPPORTED_STATUS = 0,
+  HTTP_STATUS_100_CONTINUE,
+  HTTP_STATUS_101_SWITCHING_PROTOCOLS,
+  HTTP_STATUS_200_OK,
+  HTTP_STATUS_201_CREATED,
+  HTTP_STATUS_202_ACCEPTED,
+  HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION,
+  HTTP_STATUS_204_NO_CONTENT,
+  HTTP_STATUS_205_RESET_CONTENT,
+  HTTP_STATUS_206_PARTIAL_CONTENT,
+  HTTP_STATUS_300_MULTIPLE_CHOICES,
+  HTTP_STATUS_301_MOVED_PERMANENTLY,
+  HTTP_STATUS_302_FOUND,
+  HTTP_STATUS_303_SEE_OTHER,
+  HTTP_STATUS_304_NOT_MODIFIED,
+  HTTP_STATUS_305_USE_PROXY,
+  HTTP_STATUS_307_TEMPORARY_REDIRECT,
+  HTTP_STATUS_400_BAD_REQUEST,
+  HTTP_STATUS_401_UNAUTHORIZED,
+  HTTP_STATUS_402_PAYMENT_REQUIRED,
+  HTTP_STATUS_403_FORBIDDEN,
+  HTTP_STATUS_404_NOT_FOUND,
+  HTTP_STATUS_405_METHOD_NOT_ALLOWED,
+  HTTP_STATUS_406_NOT_ACCEPTABLE,
+  HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED,
+  HTTP_STATUS_408_REQUEST_TIME_OUT,
+  HTTP_STATUS_409_CONFLICT,
+  HTTP_STATUS_410_GONE,
+  HTTP_STATUS_411_LENGTH_REQUIRED,
+  HTTP_STATUS_412_PRECONDITION_FAILED,
+  HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE,
+  HTTP_STATUS_414_REQUEST_URI_TOO_LARGE,
+  HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE,
+  HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED,
+  HTTP_STATUS_417_EXPECTATION_FAILED,
+  HTTP_STATUS_500_INTERNAL_SERVER_ERROR,
+  HTTP_STATUS_501_NOT_IMPLEMENTED,
+  HTTP_STATUS_502_BAD_GATEWAY,
+  HTTP_STATUS_503_SERVICE_UNAVAILABLE,
+  HTTP_STATUS_504_GATEWAY_TIME_OUT,
+  HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED,
+  HTTP_STATUS_308_PERMANENT_REDIRECT
+} EFI_HTTP_STATUS_CODE;
+
+///
+/// EFI_HTTPv4_ACCESS_POINT
+///
+typedef struct {
+  ///
+  /// Set to TRUE to instruct the EFI H