/linux-6.1.9/arch/x86/kernel/ |
D | sev.c | 61 static struct ghcb boot_ghcb_page __bss_decrypted __aligned(PAGE_SIZE); 67 static struct ghcb *boot_ghcb __section(".data"); 74 struct ghcb ghcb_page; 83 struct ghcb backup_ghcb; 110 struct ghcb *ghcb; member 202 static noinstr struct ghcb *__sev_get_ghcb(struct ghcb_state *state) in __sev_get_ghcb() 205 struct ghcb *ghcb; in __sev_get_ghcb() local 210 ghcb = &data->ghcb_page; in __sev_get_ghcb() 233 state->ghcb = &data->backup_ghcb; in __sev_get_ghcb() 236 *state->ghcb = *ghcb; in __sev_get_ghcb() [all …]
|
D | sev-shared.c | 161 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument 163 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate() 164 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate() 194 static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in verify_exception_info() argument 198 ret = ghcb->save.sw_exit_info_1 & GENMASK_ULL(31, 0); in verify_exception_info() 203 u64 info = ghcb->save.sw_exit_info_2; in verify_exception_info() 222 static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, in sev_es_ghcb_hv_call() argument 228 ghcb->protocol_version = ghcb_version; in sev_es_ghcb_hv_call() 229 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in sev_es_ghcb_hv_call() 231 ghcb_set_sw_exit_code(ghcb, exit_code); in sev_es_ghcb_hv_call() [all …]
|
D | kvm.c | 992 static void kvm_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_prepare() argument 995 ghcb_set_rbx(ghcb, regs->bx); in kvm_sev_es_hcall_prepare() 996 ghcb_set_rcx(ghcb, regs->cx); in kvm_sev_es_hcall_prepare() 997 ghcb_set_rdx(ghcb, regs->dx); in kvm_sev_es_hcall_prepare() 998 ghcb_set_rsi(ghcb, regs->si); in kvm_sev_es_hcall_prepare() 1001 static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_finish() argument
|
/linux-6.1.9/arch/x86/hyperv/ |
D | ivm.c | 24 struct ghcb ghcb; member 78 hv_ghcb->ghcb.protocol_version = GHCB_PROTOCOL_MAX; in hv_ghcb_hypercall() 79 hv_ghcb->ghcb.ghcb_usage = GHCB_USAGE_HYPERV_CALL; in hv_ghcb_hypercall() 90 hv_ghcb->ghcb.ghcb_usage = 0xffffffff; in hv_ghcb_hypercall() 91 memset(hv_ghcb->ghcb.save.valid_bitmap, 0, in hv_ghcb_hypercall() 92 sizeof(hv_ghcb->ghcb.save.valid_bitmap)); in hv_ghcb_hypercall() 111 static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, in hv_ghcb_hv_call() argument 115 ghcb->protocol_version = hv_ghcb_version; in hv_ghcb_hv_call() 116 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in hv_ghcb_hv_call() 118 ghcb_set_sw_exit_code(ghcb, exit_code); in hv_ghcb_hv_call() [all …]
|
/linux-6.1.9/arch/x86/kernel/cpu/ |
D | vmware.c | 484 static void vmware_sev_es_hcall_prepare(struct ghcb *ghcb, in vmware_sev_es_hcall_prepare() argument 488 ghcb_set_rip(ghcb, regs->ip); in vmware_sev_es_hcall_prepare() 489 ghcb_set_rbx(ghcb, regs->bx); in vmware_sev_es_hcall_prepare() 490 ghcb_set_rcx(ghcb, regs->cx); in vmware_sev_es_hcall_prepare() 491 ghcb_set_rdx(ghcb, regs->dx); in vmware_sev_es_hcall_prepare() 492 ghcb_set_rsi(ghcb, regs->si); in vmware_sev_es_hcall_prepare() 493 ghcb_set_rdi(ghcb, regs->di); in vmware_sev_es_hcall_prepare() 494 ghcb_set_rbp(ghcb, regs->bp); in vmware_sev_es_hcall_prepare() 497 static bool vmware_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in vmware_sev_es_hcall_finish() argument 499 if (!(ghcb_rbx_is_valid(ghcb) && in vmware_sev_es_hcall_finish() [all …]
|
/linux-6.1.9/arch/x86/kvm/svm/ |
D | sev.c | 2350 struct ghcb *ghcb = svm->sev_es.ghcb; in dump_ghcb() local 2359 nbits = sizeof(ghcb->save.valid_bitmap) * 8; in dump_ghcb() 2363 ghcb->save.sw_exit_code, ghcb_sw_exit_code_is_valid(ghcb)); in dump_ghcb() 2365 ghcb->save.sw_exit_info_1, ghcb_sw_exit_info_1_is_valid(ghcb)); in dump_ghcb() 2367 ghcb->save.sw_exit_info_2, ghcb_sw_exit_info_2_is_valid(ghcb)); in dump_ghcb() 2369 ghcb->save.sw_scratch, ghcb_sw_scratch_is_valid(ghcb)); in dump_ghcb() 2370 pr_err("%-20s%*pb\n", "valid_bitmap", nbits, ghcb->save.valid_bitmap); in dump_ghcb() 2376 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() local 2386 ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]); in sev_es_sync_to_ghcb() 2387 ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]); in sev_es_sync_to_ghcb() [all …]
|
D | svm.h | 195 struct ghcb *ghcb; member
|
D | svm.c | 2822 if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_complete_emulated_msr() 2825 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, 1); in svm_complete_emulated_msr() 2826 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, in svm_complete_emulated_msr()
|
/linux-6.1.9/arch/x86/include/asm/ |
D | svm.h | 487 struct ghcb { struct 511 BUILD_BUG_ON(sizeof(struct ghcb) != EXPECTED_GHCB_SIZE); in __unused_size_checks() argument 582 static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ 585 (unsigned long *)&ghcb->save.valid_bitmap); \ 588 static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \ 590 return ghcb->save.field; \ 593 static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ 595 return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \ 598 static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ 601 (unsigned long *)&ghcb->save.valid_bitmap); \ [all …]
|
D | x86_init.h | 7 struct ghcb; 265 void (*sev_es_hcall_prepare)(struct ghcb *ghcb, struct pt_regs *regs); 266 bool (*sev_es_hcall_finish)(struct ghcb *ghcb, struct pt_regs *regs);
|
/linux-6.1.9/arch/x86/boot/compressed/ |
D | sev.c | 28 struct ghcb boot_ghcb_page __aligned(PAGE_SIZE); 29 struct ghcb *boot_ghcb; 211 static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, in sev_es_ghcb_terminate() argument 216 vc_ghcb_invalidate(ghcb); in sev_es_ghcb_terminate() 217 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_TERM_REQUEST); in sev_es_ghcb_terminate() 218 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in sev_es_ghcb_terminate() 219 ghcb_set_sw_exit_info_2(ghcb, exit_info_2); in sev_es_ghcb_terminate() 221 sev_es_wr_ghcb_msr(__pa(ghcb)); in sev_es_ghcb_terminate()
|
/linux-6.1.9/arch/x86/kvm/ |
D | trace.h | 1734 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1735 TP_ARGS(vcpu_id, ghcb), 1746 __entry->exit_reason = ghcb->save.sw_exit_code; 1747 __entry->info1 = ghcb->save.sw_exit_info_1; 1748 __entry->info2 = ghcb->save.sw_exit_info_2; 1760 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1761 TP_ARGS(vcpu_id, ghcb), 1772 __entry->exit_reason = ghcb->save.sw_exit_code; 1773 __entry->info1 = ghcb->save.sw_exit_info_1; 1774 __entry->info2 = ghcb->save.sw_exit_info_2;
|