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

intel_huc.h (1337B)


      1/* SPDX-License-Identifier: MIT */
      2/*
      3 * Copyright © 2014-2019 Intel Corporation
      4 */
      5
      6#ifndef _INTEL_HUC_H_
      7#define _INTEL_HUC_H_
      8
      9#include "i915_reg_defs.h"
     10#include "intel_uc_fw.h"
     11#include "intel_huc_fw.h"
     12
     13struct intel_huc {
     14	/* Generic uC firmware management */
     15	struct intel_uc_fw fw;
     16
     17	/* HuC-specific additions */
     18	struct {
     19		i915_reg_t reg;
     20		u32 mask;
     21		u32 value;
     22	} status;
     23};
     24
     25void intel_huc_init_early(struct intel_huc *huc);
     26int intel_huc_init(struct intel_huc *huc);
     27void intel_huc_fini(struct intel_huc *huc);
     28int intel_huc_auth(struct intel_huc *huc);
     29int intel_huc_check_status(struct intel_huc *huc);
     30
     31static inline int intel_huc_sanitize(struct intel_huc *huc)
     32{
     33	intel_uc_fw_sanitize(&huc->fw);
     34	return 0;
     35}
     36
     37static inline bool intel_huc_is_supported(struct intel_huc *huc)
     38{
     39	return intel_uc_fw_is_supported(&huc->fw);
     40}
     41
     42static inline bool intel_huc_is_wanted(struct intel_huc *huc)
     43{
     44	return intel_uc_fw_is_enabled(&huc->fw);
     45}
     46
     47static inline bool intel_huc_is_used(struct intel_huc *huc)
     48{
     49	GEM_BUG_ON(__intel_uc_fw_status(&huc->fw) == INTEL_UC_FIRMWARE_SELECTED);
     50	return intel_uc_fw_is_available(&huc->fw);
     51}
     52
     53static inline bool intel_huc_is_authenticated(struct intel_huc *huc)
     54{
     55	return intel_uc_fw_is_running(&huc->fw);
     56}
     57
     58void intel_huc_load_status(struct intel_huc *huc, struct drm_printer *p);
     59
     60#endif