~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/cc_platform.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/linux/cc_platform.h (Architecture alpha) and /include/linux/cc_platform.h (Architecture mips)


  1 /* SPDX-License-Identifier: GPL-2.0-only */         1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*                                                  2 /*
  3  * Confidential Computing Platform Capability       3  * Confidential Computing Platform Capability checks
  4  *                                                  4  *
  5  * Copyright (C) 2021 Advanced Micro Devices,       5  * Copyright (C) 2021 Advanced Micro Devices, Inc.
  6  *                                                  6  *
  7  * Author: Tom Lendacky <thomas.lendacky@amd.c      7  * Author: Tom Lendacky <thomas.lendacky@amd.com>
  8  */                                                 8  */
  9                                                     9 
 10 #ifndef _LINUX_CC_PLATFORM_H                       10 #ifndef _LINUX_CC_PLATFORM_H
 11 #define _LINUX_CC_PLATFORM_H                       11 #define _LINUX_CC_PLATFORM_H
 12                                                    12 
 13 #include <linux/types.h>                           13 #include <linux/types.h>
 14 #include <linux/stddef.h>                          14 #include <linux/stddef.h>
 15                                                    15 
 16 /**                                                16 /**
 17  * enum cc_attr - Confidential computing attri     17  * enum cc_attr - Confidential computing attributes
 18  *                                                 18  *
 19  * These attributes represent confidential com     19  * These attributes represent confidential computing features that are
 20  * currently active.                               20  * currently active.
 21  */                                                21  */
 22 enum cc_attr {                                     22 enum cc_attr {
 23         /**                                        23         /**
 24          * @CC_ATTR_MEM_ENCRYPT: Memory encryp     24          * @CC_ATTR_MEM_ENCRYPT: Memory encryption is active
 25          *                                         25          *
 26          * The platform/OS is running with act     26          * The platform/OS is running with active memory encryption. This
 27          * includes running either as a bare-m     27          * includes running either as a bare-metal system or a hypervisor
 28          * and actively using memory encryptio     28          * and actively using memory encryption or as a guest/virtual machine
 29          * and actively using memory encryptio     29          * and actively using memory encryption.
 30          *                                         30          *
 31          * Examples include SME, SEV and SEV-E     31          * Examples include SME, SEV and SEV-ES.
 32          */                                        32          */
 33         CC_ATTR_MEM_ENCRYPT,                       33         CC_ATTR_MEM_ENCRYPT,
 34                                                    34 
 35         /**                                        35         /**
 36          * @CC_ATTR_HOST_MEM_ENCRYPT: Host mem     36          * @CC_ATTR_HOST_MEM_ENCRYPT: Host memory encryption is active
 37          *                                         37          *
 38          * The platform/OS is running as a bar     38          * The platform/OS is running as a bare-metal system or a hypervisor
 39          * and actively using memory encryptio     39          * and actively using memory encryption.
 40          *                                         40          *
 41          * Examples include SME.                   41          * Examples include SME.
 42          */                                        42          */
 43         CC_ATTR_HOST_MEM_ENCRYPT,                  43         CC_ATTR_HOST_MEM_ENCRYPT,
 44                                                    44 
 45         /**                                        45         /**
 46          * @CC_ATTR_GUEST_MEM_ENCRYPT: Guest m     46          * @CC_ATTR_GUEST_MEM_ENCRYPT: Guest memory encryption is active
 47          *                                         47          *
 48          * The platform/OS is running as a gue     48          * The platform/OS is running as a guest/virtual machine and actively
 49          * using memory encryption.                49          * using memory encryption.
 50          *                                         50          *
 51          * Examples include SEV and SEV-ES.        51          * Examples include SEV and SEV-ES.
 52          */                                        52          */
 53         CC_ATTR_GUEST_MEM_ENCRYPT,                 53         CC_ATTR_GUEST_MEM_ENCRYPT,
 54                                                    54 
 55         /**                                        55         /**
 56          * @CC_ATTR_GUEST_STATE_ENCRYPT: Guest     56          * @CC_ATTR_GUEST_STATE_ENCRYPT: Guest state encryption is active
 57          *                                         57          *
 58          * The platform/OS is running as a gue     58          * The platform/OS is running as a guest/virtual machine and actively
 59          * using memory encryption and registe     59          * using memory encryption and register state encryption.
 60          *                                         60          *
 61          * Examples include SEV-ES.                61          * Examples include SEV-ES.
 62          */                                        62          */
 63         CC_ATTR_GUEST_STATE_ENCRYPT,               63         CC_ATTR_GUEST_STATE_ENCRYPT,
 64                                                    64 
 65         /**                                        65         /**
 66          * @CC_ATTR_GUEST_UNROLL_STRING_IO: St     66          * @CC_ATTR_GUEST_UNROLL_STRING_IO: String I/O is implemented with
 67          *                                  IN     67          *                                  IN/OUT instructions
 68          *                                         68          *
 69          * The platform/OS is running as a gue     69          * The platform/OS is running as a guest/virtual machine and uses
 70          * IN/OUT instructions in place of str     70          * IN/OUT instructions in place of string I/O.
 71          *                                         71          *
 72          * Examples include TDX guest & SEV.       72          * Examples include TDX guest & SEV.
 73          */                                        73          */
 74         CC_ATTR_GUEST_UNROLL_STRING_IO,            74         CC_ATTR_GUEST_UNROLL_STRING_IO,
 75                                                    75 
 76         /**                                        76         /**
 77          * @CC_ATTR_SEV_SNP: Guest SNP is acti     77          * @CC_ATTR_SEV_SNP: Guest SNP is active.
 78          *                                         78          *
 79          * The platform/OS is running as a gue     79          * The platform/OS is running as a guest/virtual machine and actively
 80          * using AMD SEV-SNP features.             80          * using AMD SEV-SNP features.
 81          */                                        81          */
 82         CC_ATTR_GUEST_SEV_SNP,                     82         CC_ATTR_GUEST_SEV_SNP,
 83                                                    83 
 84         /**                                        84         /**
 85          * @CC_ATTR_HOST_SEV_SNP: AMD SNP enab     85          * @CC_ATTR_HOST_SEV_SNP: AMD SNP enabled on the host.
 86          *                                         86          *
 87          * The host kernel is running with the     87          * The host kernel is running with the necessary features
 88          * enabled to run SEV-SNP guests.          88          * enabled to run SEV-SNP guests.
 89          */                                        89          */
 90         CC_ATTR_HOST_SEV_SNP,                      90         CC_ATTR_HOST_SEV_SNP,
 91 };                                                 91 };
 92                                                    92 
 93 #ifdef CONFIG_ARCH_HAS_CC_PLATFORM                 93 #ifdef CONFIG_ARCH_HAS_CC_PLATFORM
 94                                                    94 
 95 /**                                                95 /**
 96  * cc_platform_has() - Checks if the specified     96  * cc_platform_has() - Checks if the specified cc_attr attribute is active
 97  * @attr: Confidential computing attribute to      97  * @attr: Confidential computing attribute to check
 98  *                                                 98  *
 99  * The cc_platform_has() function will return      99  * The cc_platform_has() function will return an indicator as to whether the
100  * specified Confidential Computing attribute     100  * specified Confidential Computing attribute is currently active.
101  *                                                101  *
102  * Context: Any context                           102  * Context: Any context
103  * Return:                                        103  * Return:
104  * * TRUE  - Specified Confidential Computing     104  * * TRUE  - Specified Confidential Computing attribute is active
105  * * FALSE - Specified Confidential Computing     105  * * FALSE - Specified Confidential Computing attribute is not active
106  */                                               106  */
107 bool cc_platform_has(enum cc_attr attr);          107 bool cc_platform_has(enum cc_attr attr);
108 void cc_platform_set(enum cc_attr attr);          108 void cc_platform_set(enum cc_attr attr);
109 void cc_platform_clear(enum cc_attr attr);        109 void cc_platform_clear(enum cc_attr attr);
110                                                   110 
111 #else   /* !CONFIG_ARCH_HAS_CC_PLATFORM */        111 #else   /* !CONFIG_ARCH_HAS_CC_PLATFORM */
112                                                   112 
113 static inline bool cc_platform_has(enum cc_att    113 static inline bool cc_platform_has(enum cc_attr attr) { return false; }
114 static inline void cc_platform_set(enum cc_att    114 static inline void cc_platform_set(enum cc_attr attr) { }
115 static inline void cc_platform_clear(enum cc_a    115 static inline void cc_platform_clear(enum cc_attr attr) { }
116                                                   116 
117 #endif  /* CONFIG_ARCH_HAS_CC_PLATFORM */         117 #endif  /* CONFIG_ARCH_HAS_CC_PLATFORM */
118                                                   118 
119 #endif  /* _LINUX_CC_PLATFORM_H */                119 #endif  /* _LINUX_CC_PLATFORM_H */
120                                                   120 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php