EFI stub kexec probelm

Eric W. Biederman ebiederm at xmission.com
Wed Feb 15 22:35:07 PST 2017


Paweł Lenkow <p.lenkow at camlintechnologies.com> writes:

> Hi!
>
> I am trying to run EFI stub kernel using kexec and unfortunately 2nd kernel
> crashes.

Adding the kexec list as there may be someone there who may be more
knowledgeable about our problem.

> First kernel is loaded by UEFI, starts simple init with shell and then
> I am loading the same image using kexec.
>
> It looks like a lack of correct mappings for EFI tables because it
> calls address zero (RDI register) in efi_call.
>
> Does kernel support such configuration?
>
> If yes what could be wrong?

I don't know exactly where the support is, I haven't looked recently.

There is a major challenge with efi.  The call to place efi in virtual
mode may be called exactly once.  There has been work on at least ia64
to make it possible to capture the efi virtual address bass and pass it
through to the kernel calling kexec.  I don't remember seeing the work
to do that happen on other platforms.

I personally think we should just abandon running efi in virtual mode
and always run efi in physicall mode, but the feedback when I suggested
that was that efi didn't actually work if you did that.  *Shrug*

Given that efi_enter_virtual_mode is in your call trace I am guessing
that the problem is the historical problem I have mentioned above.

Eric



> Using grub-efi all works fine, but it is not enough for me.
>
> See log below:
>
>
> / # kexec -l /mnt/INSTALL/vmlinuz -s
> / # kexec -e
> [  625.520845] kexec_core: Starting new kernel
> [    0.000000] Linux version 4.10.0-rc8 (plenkow at plenkow-PC) (gcc version 5.4.0 (GCC) ) #2 SMP Wed Feb 15 09:49:05 CET 2017
> [    0.000000] Command line:
> [    0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
> [    0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
> [    0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
> [    0.000000] x86/fpu: Supporting XSAVE feature 0x008: 'MPX bounds registers'
> [    0.000000] x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
> [    0.000000] x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256
> [    0.000000] x86/fpu: xstate_offset[3]:  832, xstate_sizes[3]:   64
> [    0.000000] x86/fpu: xstate_offset[4]:  896, xstate_sizes[4]:   64
> [    0.000000] x86/fpu: Enabled xstate features 0x1f, context size is 960 bytes, using 'compacted' format.
> [    0.000000] e820: BIOS-provided physical RAM map:
> [    0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000057fff] usable
> [    0.000000] BIOS-e820: [mem 0x0000000000058000-0x0000000000058fff] reserved
> [    0.000000] BIOS-e820: [mem 0x0000000000059000-0x0000000000085fff] usable
> [    0.000000] BIOS-e820: [mem 0x0000000000086000-0x00000000000fffff] reserved
> [    0.000000] BIOS-e820: [mem 0x0000000000100000-0x00000000a238cfff] usable
> [    0.000000] BIOS-e820: [mem 0x00000000a238d000-0x00000000a238dfff] ACPI NVS
> [    0.000000] BIOS-e820: [mem 0x00000000a238e000-0x00000000a23d7fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000a23d8000-0x00000000b867dfff] usable
> [    0.000000] BIOS-e820: [mem 0x00000000b867e000-0x00000000baf7dfff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000baf7e000-0x00000000bcf7dfff] ACPI NVS
> [    0.000000] BIOS-e820: [mem 0x00000000bcf7e000-0x00000000bcffdfff] ACPI data
> [    0.000000] BIOS-e820: [mem 0x00000000bcffe000-0x00000000bcffefff] usable
> [    0.000000] BIOS-e820: [mem 0x00000000bcfff000-0x00000000bfffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000f0000000-0x00000000f3ffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fd000000-0x00000000fe7fffff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000feb00000-0x00000000feb03fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fed10000-0x00000000fed19fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fed84000-0x00000000fed84fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
> [    0.000000] BIOS-e820: [mem 0x00000000ff900000-0x00000000ffffffff] reserved
> [    0.000000] BIOS-e820: [mem 0x0000000100000000-0x000000023dffffff] usable
> [    0.000000] NX (Execute Disable) protection: active
> [    0.000000] extended physical RAM map:
> [    0.000000] reserve setup_data: [mem 0x0000000000000000-0x00000000000502bf] usable
> [    0.000000] reserve setup_data: [mem 0x00000000000502c0-0x000000000005032f] usable
> [    0.000000] reserve setup_data: [mem 0x0000000000050330-0x0000000000057fff] usable
> [    0.000000] reserve setup_data: [mem 0x0000000000058000-0x0000000000058fff] reserved
> [    0.000000] reserve setup_data: [mem 0x0000000000059000-0x0000000000085fff] usable
> [    0.000000] reserve setup_data: [mem 0x0000000000086000-0x00000000000fffff] reserved
> [    0.000000] reserve setup_data: [mem 0x0000000000100000-0x00000000a238cfff] usable
> [    0.000000] reserve setup_data: [mem 0x00000000a238d000-0x00000000a238dfff] ACPI NVS
> [    0.000000] reserve setup_data: [mem 0x00000000a238e000-0x00000000a23d7fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000a23d8000-0x00000000b867dfff] usable
> [    0.000000] reserve setup_data: [mem 0x00000000b867e000-0x00000000baf7dfff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000baf7e000-0x00000000bcf7dfff] ACPI NVS
> [    0.000000] reserve setup_data: [mem 0x00000000bcf7e000-0x00000000bcffdfff] ACPI data
> [    0.000000] reserve setup_data: [mem 0x00000000bcffe000-0x00000000bcffefff] usable
> [    0.000000] reserve setup_data: [mem 0x00000000bcfff000-0x00000000bfffffff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000f0000000-0x00000000f3ffffff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000fd000000-0x00000000fe7fffff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000feb00000-0x00000000feb03fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000fed10000-0x00000000fed19fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000fed84000-0x00000000fed84fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000fee00000-0x00000000fee00fff] reserved
> [    0.000000] reserve setup_data: [mem 0x00000000ff900000-0x00000000ffffffff] reserved
> [    0.000000] reserve setup_data: [mem 0x0000000100000000-0x000000023dffffff] usable
> [    0.000000] efi: EFI v2.50 by INSYDE Corp.
> [    0.000000] efi:  SMBIOS=0xb88f0000  ESRT=0xb88f1998  ACPI 2.0=0xbcffd014  PROP=0xa0f59a28
> [    0.000000] SMBIOS 2.8 present.
> [    0.000000] DMI: Neousys Technology Inc. Nuvo-5000/NVS-5000, BIOS Build160809 08/09/2016
> [    0.000000] e820: last_pfn = 0x23e000 max_arch_pfn = 0x400000000
> [    0.000000] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- WT
> [    0.000000] e820: last_pfn = 0xbcfff max_arch_pfn = 0x400000000
> [    0.000000] esrt: Reserving ESRT space from 0x00000000b88f1998 to 0x00000000b88f19d0.
> [    0.000000] Scanning 1 areas for low memory corruption
> [    0.000000] Using GB pages for direct mapping
> [    0.000000] ACPI: Early table checksum verification disabled
> [    0.000000] ACPI: RSDP 0x00000000BCFFD014 000024 (v02 INSYDE)
> [    0.000000] ACPI: XSDT 0x00000000BCFC6188 0000F4 (v01 INSYDE SKL-ULT  00000000      01000013)
> [    0.000000] ACPI: FACP 0x00000000BCFE9000 0000F4 (v04 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: DSDT 0x00000000BCFC9000 01A6B5 (v02 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: FACS 0x00000000BCF7C000 000040
> [    0.000000] ACPI: UEFI 0x00000000BCFFC000 000236 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: UEFI 0x00000000BCFFB000 000042 (v01 INSYDE SKL-ULT  00000002 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFFA000 0004B7 (v02 INSYDE SKL-ULT  00001000 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFF9000 00004B (v02 INSYDE SKL-ULT  00003000 ACPI 00040000)
> [    0.000000] ACPI: TPM2 0x00000000BCFF8000 000034 (v03 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFF1000 0052EE (v02 INSYDE SKL-ULT  00003000 ACPI 00040000)
> [    0.000000] ACPI: DBGP 0x00000000BCFF0000 000034 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: DBG2 0x00000000BCFEF000 000054 (v00 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFEE000 000622 (v02 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: ASF! 0x00000000BCFED000 0000A5 (v32 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: ASPT 0x00000000BCFEC000 000034 (v07 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: BOOT 0x00000000BCFEB000 000028 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: DBGP 0x00000000BCFEA000 000034 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: HPET 0x00000000BCFE8000 000038 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: LPIT 0x00000000BCFE7000 000094 (v01 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: APIC 0x00000000BCFE6000 0000BC (v02 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: MCFG 0x00000000BCFE5000 00003C (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: WDAT 0x00000000BCFE4000 000134 (v01 INSYDE SKL-ULT  00000000 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFC8000 000E59 (v02 INSYDE SKL-ULT  00001000 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFC7000 00019A (v02 INSYDE SKL-ULT  00001000 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFC5000 000E73 (v02 INSYDE SKL-ULT  00003000 ACPI 00040000)
> [    0.000000] ACPI: DMAR 0x00000000BCFC4000 0000A8 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] ACPI: SSDT 0x00000000BCFC2000 000ABD (v01 INSYDE SKL-ULT  00001000 ACPI 00040000)
> [    0.000000] ACPI: FPDT 0x00000000BCFC1000 000044 (v01 INSYDE SKL-ULT  00000002 ACPI 00040000)
> [    0.000000] ACPI: BGRT 0x00000000BCFC3000 000038 (v01 INSYDE SKL-ULT  00000001 ACPI 00040000)
> [    0.000000] No NUMA configuration found
> [    0.000000] Faking a node at [mem 0x0000000000000000-0x000000023dffffff]
> [    0.000000] NODE_DATA(0) allocated [mem 0x23dffa000-0x23dffdfff]
> [    0.000000] Zone ranges:
> [    0.000000]   DMA      [mem 0x0000000000001000-0x0000000000ffffff]
> [    0.000000]   DMA32    [mem 0x0000000001000000-0x00000000ffffffff]
> [    0.000000]   Normal   [mem 0x0000000100000000-0x000000023dffffff]
> [    0.000000] Movable zone start for each node
> [    0.000000] Early memory node ranges
> [    0.000000]   node   0: [mem 0x0000000000001000-0x0000000000057fff]
> [    0.000000]   node   0: [mem 0x0000000000059000-0x0000000000085fff]
> [    0.000000]   node   0: [mem 0x0000000000100000-0x00000000a238cfff]
> [    0.000000]   node   0: [mem 0x00000000a23d8000-0x00000000b867dfff]
> [    0.000000]   node   0: [mem 0x00000000bcffe000-0x00000000bcffefff]
> [    0.000000]   node   0: [mem 0x0000000100000000-0x000000023dffffff]
> [    0.000000] Initmem setup node 0 [mem 0x0000000000001000-0x000000023dffffff]
> [    0.000000] Reserving Intel graphics memory at 0x00000000be000000-0x00000000bfffffff
> [    0.000000] ACPI: PM-Timer IO Port: 0x1808
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x05] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x06] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x07] high edge lint[0x1])
> [    0.000000] ACPI: LAPIC_NMI (acpi_id[0x08] high edge lint[0x1])
> [    0.000000] IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-119
> [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)
> [    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)
> [    0.000000] Using ACPI (MADT) for SMP configuration information
> [    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000
> [    0.000000] smpboot: Allowing 8 CPUs, 0 hotplug CPUs
> [    0.000000] e820: [mem 0xc0000000-0xefffffff] available for PCI devices
> [    0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
> [    0.000000] setup_percpu: NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:8 nr_node_ids:1
> [    0.000000] percpu: Embedded 34 pages/cpu @ffff88023dc00000 s101016 r8192 d30056 u262144
> [    0.000000] Built 1 zonelists in Node order, mobility grouping on.  Total pages: 2025480
> [    0.000000] Policy zone: Normal
> [    0.000000] Kernel command line: console=tty0 console=ttyS0,115200n8
> [    0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)
> [    0.000000] Memory: 8008060K/8230624K available (9406K kernel code, 1207K rwdata, 2944K rodata, 7860K init, 800K bss, 222564K reserved, 0K cma-reserved)
> [    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
> [    0.000000] Hierarchical RCU implementation.
> [    0.000000] 	Build-time adjustment of leaf fanout to 64.
> [    0.000000] 	RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=8.
> [    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=8
> [    0.000000] NR_IRQS:4352 nr_irqs:2048 16
> [    0.000000] Console: colour dummy device 80x25
> [    0.000000] console [tty0] enabled
> [    0.000000] console [ttyS0] enabled
> [    0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635855245 ns
> [    0.000000] tsc: Detected 2400.000 MHz processor
> [    0.000003] Calibrating delay loop (skipped), value calculated using timer frequency.. 4800.00 BogoMIPS (lpj=2400000)
> [    0.010601] pid_max: default: 32768 minimum: 301
> [    0.015221] ACPI: Core revision 20160930
> [    0.035202] ACPI Error: [\_SB_.PCI0.XHC_.RHUB.HS11] Namespace lookup failure, AE_NOT_FOUND (20160930/dswload-210)
> [    0.045460] ACPI Exception: AE_NOT_FOUND, During name lookup/catalog (20160930/psobject-227)
> [    0.053913] ACPI Exception: AE_NOT_FOUND, (SSDT: SKL-ULT) while loading table (20160930/tbxfload-228)
> [    0.063903] ACPI Error: 1 table load failures, 8 successful (20160930/tbxfload-246)
> [    0.071596] BUG: unable to handle kernel paging request at 000000007f000000
> [    0.078558] IP: 0x40e
> [    0.080834] PGD 235117063
> [    0.080835] PUD 0
> [    0.083539]
> [    0.087050] Oops: 0002 [#1] SMP
> [    0.090196] Modules linked in:
> [    0.093257] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.0-rc8 #2
> [    0.099522] Hardware name: Neousys Technology Inc. Nuvo-5000/NVS-5000, BIOS Build160809 08/09/2016
> [    0.108474] task: ffffffff81e0f4c0 task.stack: ffffffff81e00000
> [    0.114393] RIP: 0010:0x40e
> [    0.117194] RSP: 0000:ffffffff81e03d08 EFLAGS: 00010203
> [    0.122420] RAX: ffffffff81e03e48 RBX: ffffffff81e3a6f0 RCX: ffffffff81e3a6f0
> [    0.129553] RDX: ffffffff81e03e50 RSI: ffffffff81e3a6f0 RDI: 0000000000000000
> [    0.136685] RBP: ffffffff81e03db0 R08: 0000000000000007 R09: 0000000000000000
> [    0.143818] R10: 0000000000000001 R11: 00000000058c0000 R12: ffffffff81e03e50
> [    0.150950] R13: 0000000000000007 R14: 0000000000000000 R15: 0000000000000202
> [    0.158083] FS:  0000000000000000(0000) GS:ffff88023dc00000(0000) knlGS:0000000000000000
> [    0.166169] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [    0.171916] CR2: 000000007f000000 CR3: 0000000235115000 CR4: 00000000000406b0
> [    0.179049] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [    0.186182] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [    0.193313] Call Trace:
> [    0.195768]  ? efi_call+0x58/0x88
> [    0.199089]  virt_efi_set_variable.part.6+0x64/0x180
> [    0.204054]  virt_efi_set_variable+0x58/0x70
> [    0.208325]  efi_delete_dummy_variable+0x6d/0x80
> [    0.212946]  efi_enter_virtual_mode+0x3b8/0x469
> [    0.217478]  start_kernel+0x361/0x3ec
> [    0.221142]  x86_64_start_reservations+0x2a/0x2c
> [    0.225763]  x86_64_start_kernel+0x168/0x176
> [    0.230036]  start_cpu+0x14/0x14
> [    0.233267] Code:  Bad RIP value.
> [    0.236586] RIP: 0x40e RSP: ffffffff81e03d08
> [    0.240851] CR2: 000000007f000000
> [    0.244172] ---[ end trace 9a01cad8e91ee5e0 ]---
> [    0.248790] Kernel panic - not syncing: Attempted to kill the idle task!
> [    0.255491] ---[ end Kernel panic - not syncing: Attempted to kill the idle task!



More information about the kexec mailing list