/linux-6.12.1/arch/x86/coco/sev/ |
D | core.c | 84 static struct ghcb boot_ghcb_page __bss_decrypted __aligned(PAGE_SIZE); 90 static struct ghcb *boot_ghcb __section(".data"); 97 struct ghcb ghcb_page; 106 struct ghcb backup_ghcb; 133 struct ghcb *ghcb; member 248 static noinstr struct ghcb *__sev_get_ghcb(struct ghcb_state *state) in __sev_get_ghcb() 251 struct ghcb *ghcb; in __sev_get_ghcb() local 256 ghcb = &data->ghcb_page; in __sev_get_ghcb() 279 state->ghcb = &data->backup_ghcb; in __sev_get_ghcb() 282 *state->ghcb = *ghcb; in __sev_get_ghcb() [all …]
|
D | shared.c | 193 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument 195 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate() 196 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate() 226 static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in verify_exception_info() argument 230 ret = ghcb->save.sw_exit_info_1 & GENMASK_ULL(31, 0); in verify_exception_info() 235 u64 info = ghcb->save.sw_exit_info_2; in verify_exception_info() 336 static int svsm_perform_ghcb_protocol(struct ghcb *ghcb, struct svsm_call *call) in svsm_perform_ghcb_protocol() argument 341 vc_ghcb_invalidate(ghcb); in svsm_perform_ghcb_protocol() 347 ghcb->protocol_version = RIP_REL_REF(ghcb_version); in svsm_perform_ghcb_protocol() 348 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in svsm_perform_ghcb_protocol() [all …]
|
/linux-6.12.1/arch/x86/kernel/cpu/ |
D | vmware.c | 545 static void vmware_sev_es_hcall_prepare(struct ghcb *ghcb, in vmware_sev_es_hcall_prepare() argument 549 ghcb_set_rip(ghcb, regs->ip); in vmware_sev_es_hcall_prepare() 550 ghcb_set_rbx(ghcb, regs->bx); in vmware_sev_es_hcall_prepare() 551 ghcb_set_rcx(ghcb, regs->cx); in vmware_sev_es_hcall_prepare() 552 ghcb_set_rdx(ghcb, regs->dx); in vmware_sev_es_hcall_prepare() 553 ghcb_set_rsi(ghcb, regs->si); in vmware_sev_es_hcall_prepare() 554 ghcb_set_rdi(ghcb, regs->di); in vmware_sev_es_hcall_prepare() 555 ghcb_set_rbp(ghcb, regs->bp); in vmware_sev_es_hcall_prepare() 558 static bool vmware_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in vmware_sev_es_hcall_finish() argument 560 if (!(ghcb_rbx_is_valid(ghcb) && in vmware_sev_es_hcall_finish() [all …]
|
D | mshyperv.c | 629 static void hv_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in hv_sev_es_hcall_prepare() argument 632 ghcb_set_rcx(ghcb, regs->cx); in hv_sev_es_hcall_prepare() 633 ghcb_set_rdx(ghcb, regs->dx); in hv_sev_es_hcall_prepare() 634 ghcb_set_r8(ghcb, regs->r8); in hv_sev_es_hcall_prepare() 637 static bool hv_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in hv_sev_es_hcall_finish() argument
|
/linux-6.12.1/arch/x86/hyperv/ |
D | ivm.c | 33 struct ghcb ghcb; member 89 hv_ghcb->ghcb.protocol_version = GHCB_PROTOCOL_MAX; in hv_ghcb_hypercall() 90 hv_ghcb->ghcb.ghcb_usage = GHCB_USAGE_HYPERV_CALL; in hv_ghcb_hypercall() 101 hv_ghcb->ghcb.ghcb_usage = 0xffffffff; in hv_ghcb_hypercall() 102 memset(hv_ghcb->ghcb.save.valid_bitmap, 0, in hv_ghcb_hypercall() 103 sizeof(hv_ghcb->ghcb.save.valid_bitmap)); in hv_ghcb_hypercall() 122 static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, in hv_ghcb_hv_call() argument 126 ghcb->protocol_version = hv_ghcb_version; in hv_ghcb_hv_call() 127 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in hv_ghcb_hv_call() 129 ghcb_set_sw_exit_code(ghcb, exit_code); in hv_ghcb_hv_call() [all …]
|
/linux-6.12.1/arch/x86/boot/compressed/ |
D | sev.c | 29 static struct ghcb boot_ghcb_page __aligned(PAGE_SIZE); 30 struct ghcb *boot_ghcb; 144 struct ghcb *ghcb; in svsm_perform_call_protocol() local 148 ghcb = boot_ghcb; in svsm_perform_call_protocol() 150 ghcb = NULL; in svsm_perform_call_protocol() 153 ret = ghcb ? svsm_perform_ghcb_protocol(ghcb, call) in svsm_perform_call_protocol() 313 static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, in sev_es_ghcb_terminate() argument 318 vc_ghcb_invalidate(ghcb); in sev_es_ghcb_terminate() 319 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_TERM_REQUEST); in sev_es_ghcb_terminate() 320 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in sev_es_ghcb_terminate() [all …]
|
/linux-6.12.1/arch/x86/include/asm/ |
D | svm.h | 508 struct ghcb { struct 550 BUILD_BUG_ON(sizeof(struct ghcb) != EXPECTED_GHCB_SIZE); in __unused_size_checks() 583 BUILD_BUG_RESERVED_OFFSET(ghcb, 0xff0); in __unused_size_checks() 647 static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ 650 (unsigned long *)&ghcb->save.valid_bitmap); \ 653 static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \ 655 return ghcb->save.field; \ 658 static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ 660 return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \ 663 static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ [all …]
|
D | x86_init.h | 5 struct ghcb; 282 void (*sev_es_hcall_prepare)(struct ghcb *ghcb, struct pt_regs *regs); 283 bool (*sev_es_hcall_finish)(struct ghcb *ghcb, struct pt_regs *regs);
|
/linux-6.12.1/arch/x86/kvm/svm/ |
D | sev.c | 3201 struct ghcb *ghcb = svm->sev_es.ghcb; in dump_ghcb() local 3210 nbits = sizeof(ghcb->save.valid_bitmap) * 8; in dump_ghcb() 3214 ghcb->save.sw_exit_code, ghcb_sw_exit_code_is_valid(ghcb)); in dump_ghcb() 3216 ghcb->save.sw_exit_info_1, ghcb_sw_exit_info_1_is_valid(ghcb)); in dump_ghcb() 3218 ghcb->save.sw_exit_info_2, ghcb_sw_exit_info_2_is_valid(ghcb)); in dump_ghcb() 3220 ghcb->save.sw_scratch, ghcb_sw_scratch_is_valid(ghcb)); in dump_ghcb() 3221 pr_err("%-20s%*pb\n", "valid_bitmap", nbits, ghcb->save.valid_bitmap); in dump_ghcb() 3227 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() local 3237 ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]); in sev_es_sync_to_ghcb() 3238 ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]); in sev_es_sync_to_ghcb() [all …]
|
D | svm.h | 218 struct ghcb *ghcb; member 812 …static __always_inline u64 kvm_ghcb_get_##field##_if_valid(struct vcpu_svm *svm, struct ghcb *ghcb… 814 return kvm_ghcb_##field##_is_valid(svm) ? ghcb->save.field : 0; \
|
D | svm.c | 2975 if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_complete_emulated_msr() 2978 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, 1); in svm_complete_emulated_msr() 2979 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, in svm_complete_emulated_msr()
|
/linux-6.12.1/arch/x86/kernel/ |
D | kvm.c | 990 static void kvm_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_prepare() argument 993 ghcb_set_rbx(ghcb, regs->bx); in kvm_sev_es_hcall_prepare() 994 ghcb_set_rcx(ghcb, regs->cx); in kvm_sev_es_hcall_prepare() 995 ghcb_set_rdx(ghcb, regs->dx); in kvm_sev_es_hcall_prepare() 996 ghcb_set_rsi(ghcb, regs->si); in kvm_sev_es_hcall_prepare() 999 static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_finish() argument
|
/linux-6.12.1/arch/x86/kvm/ |
D | trace.h | 1751 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1752 TP_ARGS(vcpu_id, ghcb), 1763 __entry->exit_reason = ghcb->save.sw_exit_code; 1764 __entry->info1 = ghcb->save.sw_exit_info_1; 1765 __entry->info2 = ghcb->save.sw_exit_info_2; 1777 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1778 TP_ARGS(vcpu_id, ghcb), 1789 __entry->exit_reason = ghcb->save.sw_exit_code; 1790 __entry->info1 = ghcb->save.sw_exit_info_1; 1791 __entry->info2 = ghcb->save.sw_exit_info_2;
|