| /linux/arch/x86/coco/sev/ |
| H A D | core.c | 127 static struct ghcb boot_ghcb_page __bss_decrypted __aligned(PAGE_SIZE); 133 struct ghcb *boot_ghcb __section(".data"); 159 struct ghcb *ghcb; in get_jump_table_addr() local 167 ghcb = __sev_get_ghcb(&state); in get_jump_table_addr() 169 vc_ghcb_invalidate(ghcb); in get_jump_table_addr() 170 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_AP_JUMP_TABLE); in get_jump_table_addr() 171 ghcb_set_sw_exit_info_1(ghcb, SVM_VMGEXIT_GET_AP_JUMP_TABLE); in get_jump_table_addr() 172 ghcb_set_sw_exit_info_2(ghcb, 0); in get_jump_table_addr() 174 sev_es_wr_ghcb_msr(__pa(ghcb)); in get_jump_table_addr() 177 if (ghcb_sw_exit_info_1_is_valid(ghcb) && in get_jump_table_addr() [all …]
|
| H A D | svsm.c | 30 static int svsm_perform_ghcb_protocol(struct ghcb *ghcb, struct svsm_call *call) in svsm_perform_ghcb_protocol() argument 35 vc_ghcb_invalidate(ghcb); in svsm_perform_ghcb_protocol() 41 ghcb->protocol_version = ghcb_version; in svsm_perform_ghcb_protocol() 42 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in svsm_perform_ghcb_protocol() 44 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_SNP_RUN_VMPL); in svsm_perform_ghcb_protocol() 45 ghcb_set_sw_exit_info_1(ghcb, 0); in svsm_perform_ghcb_protocol() 46 ghcb_set_sw_exit_info_2(ghcb, 0); in svsm_perform_ghcb_protocol() 48 sev_es_wr_ghcb_msr(__pa(ghcb)); in svsm_perform_ghcb_protocol() 55 switch (verify_exception_info(ghcb, &ctxt)) { in svsm_perform_ghcb_protocol() 72 struct ghcb *ghcb; in svsm_perform_call_protocol() local [all …]
|
| /linux/arch/x86/kernel/cpu/ |
| H A D | vmware.c | 551 static void vmware_sev_es_hcall_prepare(struct ghcb *ghcb, in vmware_sev_es_hcall_prepare() argument 555 ghcb_set_rip(ghcb, regs->ip); in vmware_sev_es_hcall_prepare() 556 ghcb_set_rbx(ghcb, regs->bx); in vmware_sev_es_hcall_prepare() 557 ghcb_set_rcx(ghcb, regs->cx); in vmware_sev_es_hcall_prepare() 558 ghcb_set_rdx(ghcb, regs->dx); in vmware_sev_es_hcall_prepare() 559 ghcb_set_rsi(ghcb, regs->si); in vmware_sev_es_hcall_prepare() 560 ghcb_set_rdi(ghcb, regs->di); in vmware_sev_es_hcall_prepare() 561 ghcb_set_rbp(ghcb, regs->bp); in vmware_sev_es_hcall_prepare() 564 static bool vmware_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in vmware_sev_es_hcall_finish() argument 566 if (!(ghcb_rbx_is_valid(ghcb) && in vmware_sev_es_hcall_finish() [all …]
|
| H A D | mshyperv.c | 782 static void hv_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) 785 ghcb_set_rcx(ghcb, regs->cx); 786 ghcb_set_rdx(ghcb, regs->dx); 787 ghcb_set_r8(ghcb, regs->r8); 790 static bool hv_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) 797 hv_sev_es_hcall_prepare(struct ghcb * ghcb,struct pt_regs * regs) hv_sev_es_hcall_prepare() argument 805 hv_sev_es_hcall_finish(struct ghcb * ghcb,struct pt_regs * regs) hv_sev_es_hcall_finish() argument
|
| /linux/arch/x86/hyperv/ |
| H A D | ivm.c | 36 struct ghcb ghcb; member 92 hv_ghcb->ghcb.protocol_version = GHCB_PROTOCOL_MAX; in hv_ghcb_hypercall() 93 hv_ghcb->ghcb.ghcb_usage = GHCB_USAGE_HYPERV_CALL; in hv_ghcb_hypercall() 104 hv_ghcb->ghcb.ghcb_usage = 0xffffffff; in hv_ghcb_hypercall() 105 memset(hv_ghcb->ghcb.save.valid_bitmap, 0, in hv_ghcb_hypercall() 106 sizeof(hv_ghcb->ghcb.save.valid_bitmap)); in hv_ghcb_hypercall() 125 static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, in hv_ghcb_hv_call() argument 129 ghcb->protocol_version = hv_ghcb_version; in hv_ghcb_hv_call() 130 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in hv_ghcb_hv_call() 132 ghcb_set_sw_exit_code(ghcb, exit_code); in hv_ghcb_hv_call() [all …]
|
| /linux/arch/x86/boot/compressed/ |
| H A D | sev.c | 30 static struct ghcb boot_ghcb_page __aligned(PAGE_SIZE); 31 struct ghcb *boot_ghcb __section(".data"); 146 static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, in sev_es_ghcb_terminate() argument 151 vc_ghcb_invalidate(ghcb); in sev_es_ghcb_terminate() 152 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_TERM_REQUEST); in sev_es_ghcb_terminate() 153 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in sev_es_ghcb_terminate() 154 ghcb_set_sw_exit_info_2(ghcb, exit_info_2); in sev_es_ghcb_terminate() 156 sev_es_wr_ghcb_msr(__pa(ghcb)); in sev_es_ghcb_terminate()
|
| /linux/arch/x86/include/asm/ |
| H A D | sev.h | 540 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument 542 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate() 543 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate() 565 enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, 574 extern struct ghcb *boot_ghcb;
|
| /linux/arch/x86/kernel/ |
| H A D | kvm.c | 1050 static void kvm_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_prepare() argument 1053 ghcb_set_rbx(ghcb, regs->bx); in kvm_sev_es_hcall_prepare() 1054 ghcb_set_rcx(ghcb, regs->cx); in kvm_sev_es_hcall_prepare() 1055 ghcb_set_rdx(ghcb, regs->dx); in kvm_sev_es_hcall_prepare() 1056 ghcb_set_rsi(ghcb, regs->si); in kvm_sev_es_hcall_prepare() 1059 static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_finish() argument
|
| /linux/arch/x86/kvm/svm/ |
| H A D | sev.c | 3410 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() 3420 ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]); in sev_es_sync_from_ghcb() 3421 ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]); in sev_es_sync_from_ghcb() 3422 ghcb_set_rcx(ghcb, vcpu->arch.regs[VCPU_REGS_RCX]); in sev_es_sync_from_ghcb() 3423 ghcb_set_rdx(ghcb, vcpu->arch.regs[VCPU_REGS_RDX]); in sev_es_sync_from_ghcb() 3430 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_from_ghcb() 3404 struct ghcb *ghcb = svm->sev_es.ghcb; sev_es_sync_to_ghcb() local 3424 struct ghcb *ghcb = svm->sev_es.ghcb; sev_es_sync_from_ghcb() local [all...] |
| H A D | svm.h | 252 struct ghcb *ghcb; 709 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, response); in svm_vmgexit_set_return_code() 710 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, data); in svm_vmgexit_set_return_code() 1071 return READ_ONCE(svm->sev_es.ghcb->save.field); \ 251 struct ghcb *ghcb; global() member
|
| H A D | svm.c | 3024 if (!err || !is_sev_es_guest(vcpu) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_set_msr() 3588 pr_err("%-20s%016llx\n", "ghcb:", control->ghcb_gpa); in dump_vmcb()
|
| /linux/arch/x86/kvm/ |
| H A D | trace.h | 1845 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1846 TP_ARGS(vcpu_id, ghcb), 1857 __entry->exit_reason = ghcb->save.sw_exit_code; 1858 __entry->info1 = ghcb->save.sw_exit_info_1; 1859 __entry->info2 = ghcb->save.sw_exit_info_2; 1871 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1872 TP_ARGS(vcpu_id, ghcb), 1883 __entry->exit_reason = ghcb->save.sw_exit_code; 1884 __entry->info1 = ghcb->save.sw_exit_info_1; 1885 __entry->info2 = ghcb->save.sw_exit_info_2;
|