1 // SPDX-License-Identifier: GPL-2.0-only 2 /* 3 * Confidential Computing Platform Capability checks 4 * 5 * Copyright (C) 2021 Advanced Micro Devices, Inc. 6 * 7 * Author: Tom Lendacky <thomas.lendacky@amd.com> 8 */ 9 10 #include <linux/export.h> 11 #include <linux/cc_platform.h> 12 13 #include <asm/machdep.h> 14 #include <asm/svm.h> 15 cc_platform_has(enum cc_attr attr)16bool cc_platform_has(enum cc_attr attr) 17 { 18 switch (attr) { 19 case CC_ATTR_MEM_ENCRYPT: 20 return is_secure_guest(); 21 22 default: 23 return false; 24 } 25 } 26 EXPORT_SYMBOL_GPL(cc_platform_has); 27