1 /* SPDX-License-Identifier: GPL-2.0 */
5 * Copyright 2019, IBM Corporation
8 #include <linux/elfnote.h>
9 #include <asm/elfnote.h>
12 * Ultravisor-capable bit (PowerNV only).
14 * Bit 0 indicates that the powerpc kernel binary knows how to run in an
15 * ultravisor-enabled system.
17 * In an ultravisor-enabled system, some machine resources are now controlled
18 * by the ultravisor. If the kernel is not ultravisor-capable, but it ends up
19 * being run on a machine with ultravisor, the kernel will probably crash
20 * trying to access ultravisor resources. For instance, it may crash in early
21 * boot trying to set the partition table entry 0.
23 * In an ultravisor-enabled system, a bootloader could warn the user or prevent
24 * the kernel from being run if the PowerPC ultravisor capability doesn't exist
25 * or the Ultravisor-capable bit is not set.
27 #ifdef CONFIG_PPC_POWERNV
28 #define PPCCAP_ULTRAVISOR_BIT (1 << 0)
30 #define PPCCAP_ULTRAVISOR_BIT 0
34 * Add the PowerPC Capabilities in the binary ELF note. It is a bitmap that
35 * can be used to advertise kernel capabilities to userland.
37 #define PPC_CAPABILITIES_BITMAP (PPCCAP_ULTRAVISOR_BIT)
39 ELFNOTE(PowerPC, PPC_ELFNOTE_CAPABILITIES,
40 .long PPC_CAPABILITIES_BITMAP)