Re: Panic in fbt_provide_module_function() on head amd64 r347403

From: Trond Endrestøl <trond.endrestol_at_ximalas.info>
Date: Fri, 10 May 2019 08:07:46 +0200 (CEST)
On Thu, 9 May 2019 17:23-0500, Larry Rosenman wrote:

> On 05/09/2019 5:19 pm, Trond Endrestøl wrote:
> > Host is Windows 7 x64 SP1.
> > CPU is Core i7 960.
> > Hypervisor is VirtualBox 6.0.6.
> > VM is using UEFI.
> > Kernel config is
> > https://ximalas.info/~trond/create-zfs/canmount/VBOXGUEST-amd64-head
> > 
> > Crash happens early during boot, right after launching the APs.
> > 
> > fault virtual address   = 0x0
> > [...]
> > KDB backtrace:
> > db_trace_self_wrapper() at
> > vpanic() at
> > panic() at
> > trap_fatal() at
> > trap_pfault() at
> > trap() at
> > calltrap() at
> > -- trap 0xc, rip = 0xffffffff8196d63a, rsp = 0xffffffff8198d730, rbp =
> > 0xffffffff8198d790 ---
> > fbt_provide_module_function() at 0xffffffff8196d63a =
> > fbt_provide_module_function+0x7a/frame 0xffffffff8198d790
> > link_elf_each_function_nameval() at 0xffffffff80822ae5 =
> > link_elf_each_function_nameval+0x115/frame 0xffffffff8198d7e0
> > fbt_provide_module() at 0xffffffff8196c33e =
> > fbt_provide_module+0xde/frame 0xffffffff8198dc10
> > fbt_linker_file_cb() at 0xffffffff8196c242 =
> > fbt_linker_file_cb+0x12/frame 0xffffffff8198dc20
> > linker_file_foreach() at 0xffffffff807c47b7 =
> > linker_file_foreach+0x67/frame 0xffffffff8198dc60
> > mi_startup() at 0xffffffff80786de6 = mi_startup+0x216/frame
> > 0xffffffff8198dcb0
> > btext() at 0xffffffff8030da2c = btext+0x2c
> > Uptime: 1s
> > 
> > Previous BE is r346969 and works flawlessly.
> > No dumpdev is enabled to capture the details this early during boot.
> > Suggestions are welcome.
> 
> There is a patch:
> From: markj_at_FreeBSD.org (on my Crash loading dtraceall thread):
> 
> 
> I see, my theory above is not the real problem here.  The resolver for
> x86_rng_store() may return NULL, which we do not expect.  Can you show
> the CPU info and features lines from the dmesg to confirm?

CPU: Intel(R) Core(TM) i7 CPU         960  _at_ 3.20GHz (3207.36-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x196a5  Family=0x6  Model=0x1a  Stepping=5
  Features=0x1783fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,HTT>
  Features=0x180201<SSE3,SSSE3,SSE4.1,SSE4.2>
  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
  TSC: P-state invariant

I'll try the patch below when I get home.
Thanks.

> Also see if this patch helps:
> 
> diff --git a/sys/dev/random/ivy.c b/sys/dev/random/ivy.c
> index 57f3d0a1d80b..71065d788cf9 100644
> --- a/sys/dev/random/ivy.c
> +++ b/sys/dev/random/ivy.c
> _at__at_ -97,6 +97,13 _at__at_ x86_rdseed_store(u_long *buf)
>      return (retry);
>  }
> 
> +static int
> +x86_dead_store(u_long *buf __unused)
> +{
> +
> +    panic("missing hardware PRNG support");
> +}
> +
>  DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf), static)
>  {
>      has_rdrand = (cpu_feature2 & CPUID2_RDRAND);
> _at__at_ -107,7 +114,7 _at__at_ DEFINE_IFUNC(static, int, x86_rng_store, (u_long *buf),
> static)
>      else if (has_rdrand)
>          return (x86_rdrand_store);
>      else
> -        return (NULL);
> +        return (x86_dead_store);
>  }
> 
>  /* It is required that buf length is a multiple of sizeof(u_long). */

-- 
Trond.
Received on Fri May 10 2019 - 04:07:57 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:20 UTC