cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

cc_platform.c (496B)


      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
     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}
     26EXPORT_SYMBOL_GPL(cc_platform_has);