cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

sev_i386.h (1607B)


      1/*
      2 * QEMU Secure Encrypted Virutualization (SEV) support
      3 *
      4 * Copyright: Advanced Micro Devices, 2016-2018
      5 *
      6 * Authors:
      7 *  Brijesh Singh <brijesh.singh@amd.com>
      8 *
      9 * This work is licensed under the terms of the GNU GPL, version 2 or later.
     10 * See the COPYING file in the top-level directory.
     11 *
     12 */
     13
     14#ifndef QEMU_SEV_I386_H
     15#define QEMU_SEV_I386_H
     16
     17#include "qom/object.h"
     18#include "qapi/error.h"
     19#include "sysemu/kvm.h"
     20#include "sysemu/sev.h"
     21#include "qemu/error-report.h"
     22#include "qapi/qapi-types-misc-target.h"
     23
     24#define SEV_POLICY_NODBG        0x1
     25#define SEV_POLICY_NOKS         0x2
     26#define SEV_POLICY_ES           0x4
     27#define SEV_POLICY_NOSEND       0x8
     28#define SEV_POLICY_DOMAIN       0x10
     29#define SEV_POLICY_SEV          0x20
     30
     31#define SEV_SNP_POLICY_SMT      0x10000
     32#define SEV_SNP_POLICY_DBG      0x80000
     33
     34typedef struct SevKernelLoaderContext {
     35    char *setup_data;
     36    size_t setup_size;
     37    char *kernel_data;
     38    size_t kernel_size;
     39    char *initrd_data;
     40    size_t initrd_size;
     41    char *cmdline_data;
     42    size_t cmdline_size;
     43} SevKernelLoaderContext;
     44
     45extern bool sev_es_enabled(void);
     46extern bool sev_snp_enabled(void);
     47extern uint64_t sev_get_me_mask(void);
     48extern SevInfo *sev_get_info(void);
     49extern uint32_t sev_get_cbit_position(void);
     50extern uint32_t sev_get_reduced_phys_bits(void);
     51extern char *sev_get_launch_measurement(void);
     52extern SevCapability *sev_get_capabilities(Error **errp);
     53extern SevAttestationReport *
     54sev_get_attestation_report(const char *mnonce, Error **errp);
     55extern bool sev_add_kernel_loader_hashes(SevKernelLoaderContext *ctx, Error **errp);
     56
     57#endif