Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Sep 2018 08:48:15 -0700
From:      Conrad Meyer <cem@freebsd.org>
To:        Konstantin Belousov <kib@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r338437 - in head/sys: amd64/amd64 amd64/include arm64/arm64 arm64/include conf dev/efidev modules/efirt sys
Message-ID:  <CAG6CVpWOUkdc4jUFZFBU53tEG=UG4Q0EEhbUcgJUgBPXwEpGRQ@mail.gmail.com>
In-Reply-To: <201809022137.w82Lb5FK046191@repo.freebsd.org>
References:  <201809022137.w82Lb5FK046191@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Konstantin,

On Sun, Sep 2, 2018 at 2:37 PM, Konstantin Belousov <kib@freebsd.org> wrote=
:
> Author: kib
> Date: Sun Sep  2 21:37:05 2018
> New Revision: 338437
> URL: https://svnweb.freebsd.org/changeset/base/338437
>
> Log:
>   Catch exceptions during EFI RT calls on amd64.
>
>   This appeared to be required to have EFI RT support and EFI RTC
>   enabled by default, because there are too many reports of faulting
>   calls on many different machines.  The knob is added to leave the
>   exceptions unhandled to allow to debug the actual bugs.
> ...
>
> Modified: head/sys/dev/efidev/efirt.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/dev/efidev/efirt.c Sun Sep  2 21:16:43 2018        (r338436)
> +++ head/sys/dev/efidev/efirt.c Sun Sep  2 21:37:05 2018        (r338437)
> ...
> @@ -346,30 +413,35 @@ efi_get_time_capabilities(struct efi_tmcap *tmcap)
>  int
>  efi_reset_system(void)
>  {
> -       int error;
> +       struct efirt_callinfo ec;
>
> -       error =3D efi_enter();
> -       if (error !=3D 0)
> -               return (error);
> -       efi_runtime->rt_reset(EFI_RESET_WARM, 0, 0, NULL);
> -       efi_leave();
> -       return (EIO);
> +       if (efi_runtime =3D=3D NULL)
> +               return (ENXIO);
> +       bzero(&ec, sizeof(ec));
> +       ec.ec_name =3D "rt_reset";
> +       ec.ec_argcnt =3D 4;
> +       ec.ec_arg1 =3D (uintptr_t)EFI_RESET_WARM;
> +       ec.ec_arg1 =3D (uintptr_t)0;
> +       ec.ec_arg1 =3D (uintptr_t)0;
> +       ec.ec_arg1 =3D (uintptr_t)NULL;

Coverity warns about ec_arg1 being overwritten before use =E2=80=94 should
these be ec_arg2, 3, 4?  CID 1395456.

> +       ec.ec_fptr =3D EFI_RT_METHOD_PA(rt_reset);
> +       return (efi_call(&ec));
>  }

Best,
Conrad



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpWOUkdc4jUFZFBU53tEG=UG4Q0EEhbUcgJUgBPXwEpGRQ>