Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * PowerPC ELF notes.
0004  *
0005  * Copyright 2019, IBM Corporation
0006  */
0007 
0008 #include <linux/elfnote.h>
0009 #include <asm/elfnote.h>
0010 
0011 /*
0012  * Ultravisor-capable bit (PowerNV only).
0013  *
0014  * Bit 0 indicates that the powerpc kernel binary knows how to run in an
0015  * ultravisor-enabled system.
0016  *
0017  * In an ultravisor-enabled system, some machine resources are now controlled
0018  * by the ultravisor. If the kernel is not ultravisor-capable, but it ends up
0019  * being run on a machine with ultravisor, the kernel will probably crash
0020  * trying to access ultravisor resources. For instance, it may crash in early
0021  * boot trying to set the partition table entry 0.
0022  *
0023  * In an ultravisor-enabled system, a bootloader could warn the user or prevent
0024  * the kernel from being run if the PowerPC ultravisor capability doesn't exist
0025  * or the Ultravisor-capable bit is not set.
0026  */
0027 #ifdef CONFIG_PPC_POWERNV
0028 #define PPCCAP_ULTRAVISOR_BIT       (1 << 0)
0029 #else
0030 #define PPCCAP_ULTRAVISOR_BIT       0
0031 #endif
0032 
0033 /*
0034  * Add the PowerPC Capabilities in the binary ELF note. It is a bitmap that
0035  * can be used to advertise kernel capabilities to userland.
0036  */
0037 #define PPC_CAPABILITIES_BITMAP (PPCCAP_ULTRAVISOR_BIT)
0038 
0039 ELFNOTE(PowerPC, PPC_ELFNOTE_CAPABILITIES,
0040     .long PPC_CAPABILITIES_BITMAP)