// SPDX-License-Identifier: GPL-2.0-only/* * AMD Memory Encryption Support * * Copyright (C) 2019 SUSE * * Author: Joerg Roedel <jroedel@suse.de> */#define pr_fmt(fmt) "SEV-ES: " fmt#include<linux/sched/debug.h> /* For show_regs() */#include<linux/percpu-defs.h>#include<linux/mem_encrypt.h>#include<linux/lockdep.h>#include<linux/printk.h>#include<linux/mm_types.h>#include<linux/set_memory.h>#include<linux/memblock.h>#include<linux/kernel.h>#include<linux/mm.h>#include<asm/cpu_entry_area.h>#include<asm/stacktrace.h>#include<asm/sev.h>#include<asm/insn-eval.h>#include<asm/fpu/internal.h>#include<asm/processor.h>#include<asm/realmode.h>#include<asm/traps.h>#include<asm/svm.h>#include<asm/smp.h>#include<asm/cpu.h>#define DR7_RESET_VALUE 0x400/* For early boot hypervisor communication in SEV-ES enabled guests */staticstructghcbboot_ghcb_page__bss_decrypted__aligned(PAGE_SIZE);/* * Needs to be in the .data section because we need it NULL before bss is * cleared */staticstructghcb__initdata*boot_ghcb;/* #VC handler runtime per-CPU data */structsev_es_runtime_data{structghcbghcb_page;/*