mbox series

[RFC,v2,0/4] Check if the kernel image has Ultravisor support

Message ID 20190923223024.995-1-maxiwell@linux.ibm.com
Headers show
Series Check if the kernel image has Ultravisor support | expand

Message

Maxiwell S. Garcia Sept. 23, 2019, 10:30 p.m. UTC
Hi,

This patchset enables petitboot to check if the kernel image is
an ultravisor-system compatible. Platform-specific validation is called
from boot_process() and it can be disabled from config UI screen.

I used the name 'preboot check' many times (nvram var, config UI option,
platform-specific check) but maybe better names might be suggested.

Maxiwell S. Garcia (4):
  configure: Add libelf as a requirement
  discover: Add helper functions to read ELF notes
  ui/ncurses: Add preboot check option in the config screen
  discover: Check if the kernel image has Ultravisor support

 configure.ac                  |  6 +++
 discover/Makefile.am          |  7 ++-
 discover/boot.c               | 21 +++++++++
 discover/elf.c                | 86 +++++++++++++++++++++++++++++++++++
 discover/elf.h                | 29 ++++++++++++
 discover/platform-powerpc.c   | 50 ++++++++++++++++++++
 discover/platform.c           | 15 ++++++
 discover/platform.h           |  5 ++
 lib/param_list/param_list.c   |  1 +
 lib/pb-protocol/pb-protocol.c |  9 ++++
 lib/types/types.h             |  2 +
 ui/ncurses/nc-config.c        | 43 +++++++++++++++++-
 utils/Makefile.am             |  3 +-
 13 files changed, 273 insertions(+), 4 deletions(-)
 create mode 100644 discover/elf.c
 create mode 100644 discover/elf.h

Comments

Jeremy Kerr Nov. 29, 2019, 6:04 a.m. UTC | #1
Hi Maxiwell,

> This patchset enables petitboot to check if the kernel image is
> an ultravisor-system compatible. Platform-specific validation is
> called from boot_process() and it can be disabled from config UI
> screen.

Thanks! I've applied these to the upcoming release candidate.

I've stuck with the 'pre-boot check' wording, but changed the NVRAM
setting slightly to match OF conventions (ie, preboot-check instead of
preboot_check).

I've also added a bit of wording to the config help screen.

Cheers,


Jeremy
Jeremy Kerr Nov. 29, 2019, 6:09 a.m. UTC | #2
Hi Maxiwell,

> Thanks! I've applied these to the upcoming release candidate.

.. but just as I'm doing some final checks, it looks like this breaks
one of my builds:

   In file included from ../discover/elf.c:6:
   ../discover/elf.h:4:10: fatal error: elfutils/libdw.h: No such file or directory
    #include <elfutils/libdw.h>
             ^~~~~~~~~~~~~~~~~~
   compilation terminated.

This is on x86_64 Debian. Could you take a look at this?

Thanks,


Jeremy
Maxiwell S. Garcia Dec. 2, 2019, 8:39 p.m. UTC | #3
On Fri, Nov 29, 2019 at 02:09:10PM +0800, Jeremy Kerr wrote:
> Hi Maxiwell,
> 
> > Thanks! I've applied these to the upcoming release candidate.
> 
> .. but just as I'm doing some final checks, it looks like this breaks
> one of my builds:
> 
>    In file included from ../discover/elf.c:6:
>    ../discover/elf.h:4:10: fatal error: elfutils/libdw.h: No such file or directory
>     #include <elfutils/libdw.h>
>              ^~~~~~~~~~~~~~~~~~
>    compilation terminated.
> 
> This is on x86_64 Debian. Could you take a look at this?
> 
> Thanks,

Hi Jeremy,

Thanks for review.
I forgot to add this package as a dependency.
The patch below does that.

Is it better add this dependency only in PowerPC
build?

Thanks

--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,11 @@ AM_CONDITIONAL([HAVE_LIBFDT], [test x"$have_libfdt" = xyes])
AC_CHECK_HEADERS([stdarg.h])
AC_CHECK_HEADERS([varargs.h])

+AC_CHECK_HEADERS([elfutils/libdw.h],
+                 [],
+                 [AC_MSG_FAILURE([elfutils/libdw.h not found. Try installing the package libdw-dev or elfutils-devel.])]
+)
+


> 
> 
> Jeremy
>
Maxiwell S. Garcia Jan. 14, 2020, 4:41 p.m. UTC | #4
On Mon, Dec 02, 2019 at 05:39:52PM -0300, Maxiwell S. Garcia wrote:
> On Fri, Nov 29, 2019 at 02:09:10PM +0800, Jeremy Kerr wrote:
> > Hi Maxiwell,
> > 
> > > Thanks! I've applied these to the upcoming release candidate.
> > 
> > .. but just as I'm doing some final checks, it looks like this breaks
> > one of my builds:
> > 
> >    In file included from ../discover/elf.c:6:
> >    ../discover/elf.h:4:10: fatal error: elfutils/libdw.h: No such file or directory
> >     #include <elfutils/libdw.h>
> >              ^~~~~~~~~~~~~~~~~~
> >    compilation terminated.
> > 
> > This is on x86_64 Debian. Could you take a look at this?
> > 
> > Thanks,
> 
> Hi Jeremy,
> 
> Thanks for review.
> I forgot to add this package as a dependency.
> The patch below does that.
> 
> Is it better add this dependency only in PowerPC
> build?
> 
> Thanks
> 
> --- a/configure.ac
> +++ b/configure.ac
> @@ -115,6 +115,11 @@ AM_CONDITIONAL([HAVE_LIBFDT], [test x"$have_libfdt" = xyes])
> AC_CHECK_HEADERS([stdarg.h])
> AC_CHECK_HEADERS([varargs.h])
> 
> +AC_CHECK_HEADERS([elfutils/libdw.h],
> +                 [],
> +                 [AC_MSG_FAILURE([elfutils/libdw.h not found. Try installing the package libdw-dev or elfutils-devel.])]
> +)
> +
> 
> 

Hi,

These UV patches are good to be applied in the next release?
Are they already applied in some branch?

Thanks,

> > 
> > 
> > Jeremy
> > 
> _______________________________________________
> Petitboot mailing list
> Petitboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/petitboot
Jeremy Kerr Jan. 15, 2020, 1:27 p.m. UTC | #5
Hi Maxiwell,

> These UV patches are good to be applied in the next release?

I'm a bit concerned by the introduction of a new library dependency to
build petitboot, as that will affect more than just the petitboot repo.

Klaus & Joel: any objections to including the libdw components of
elfutils (elfutils/libdw.h) into the op-build build dependencies? Or is
this already available?

Cheers,


Jeremy
Joel Stanley Jan. 16, 2020, 2:04 a.m. UTC | #6
On Wed, 15 Jan 2020 at 13:27, Jeremy Kerr <jk@ozlabs.org> wrote:
>
> Hi Maxiwell,
>
> > These UV patches are good to be applied in the next release?
>
> I'm a bit concerned by the introduction of a new library dependency to
> build petitboot, as that will affect more than just the petitboot repo.
>
> Klaus & Joel: any objections to including the libdw components of
> elfutils (elfutils/libdw.h) into the op-build build dependencies? Or is
> this already available?

We have it available due to kexec lite, so I can't see any problems
with petitboot using it.

Cheers,

Joel