| /arch/x86/coco/sev/ |
| A D | vc-handle.c | 495 ghcb_set_sw_scratch(ghcb, ghcb_pa + offsetof(struct ghcb, shared_buffer)); in vc_do_mmio() 648 static enum es_result vc_handle_dr7_write(struct ghcb *ghcb, in vc_handle_dr7_write() argument 689 static enum es_result vc_handle_dr7_read(struct ghcb *ghcb, in vc_handle_dr7_read() argument 709 static enum es_result vc_handle_wbinvd(struct ghcb *ghcb, in vc_handle_wbinvd() argument 725 if (!(ghcb_rax_is_valid(ghcb) && ghcb_rdx_is_valid(ghcb))) in vc_handle_rdpmc() 734 static enum es_result vc_handle_monitor(struct ghcb *ghcb, in vc_handle_monitor() argument 744 static enum es_result vc_handle_mwait(struct ghcb *ghcb, in vc_handle_mwait() argument 751 static enum es_result vc_handle_vmmcall(struct ghcb *ghcb, in vc_handle_vmmcall() argument 783 static enum es_result vc_handle_trap_ac(struct ghcb *ghcb, in vc_handle_trap_ac() argument 797 struct ghcb *ghcb, in vc_handle_exitcode() argument [all …]
|
| A D | vc-shared.c | 304 static enum es_result vc_handle_ioio(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in vc_handle_ioio() argument 354 sw_scratch = __pa(ghcb) + offsetof(struct ghcb, shared_buffer); in vc_handle_ioio() 396 ghcb_set_rax(ghcb, rax); in vc_handle_ioio() 412 static int vc_handle_cpuid_snp(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in vc_handle_cpuid_snp() argument 431 static enum es_result vc_handle_cpuid(struct ghcb *ghcb, in vc_handle_cpuid() argument 453 ghcb_set_xcr0(ghcb, 1); in vc_handle_cpuid() 465 regs->ax = ghcb->save.rax; in vc_handle_cpuid() 466 regs->bx = ghcb->save.rbx; in vc_handle_cpuid() 467 regs->cx = ghcb->save.rcx; in vc_handle_cpuid() 473 static enum es_result vc_handle_rdtsc(struct ghcb *ghcb, in vc_handle_rdtsc() argument [all …]
|
| A D | sev-nmi.c | 95 struct ghcb *ghcb; in __sev_es_nmi_complete() local 97 ghcb = __sev_get_ghcb(&state); in __sev_es_nmi_complete() 99 vc_ghcb_invalidate(ghcb); in __sev_es_nmi_complete() 100 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_NMI_COMPLETE); in __sev_es_nmi_complete() 101 ghcb_set_sw_exit_info_1(ghcb, 0); in __sev_es_nmi_complete() 102 ghcb_set_sw_exit_info_2(ghcb, 0); in __sev_es_nmi_complete() 104 sev_es_wr_ghcb_msr(__pa_nodebug(ghcb)); in __sev_es_nmi_complete()
|
| A D | core.c | 128 struct ghcb *ghcb; in get_jump_table_addr() local 390 static int vmgexit_psc(struct ghcb *ghcb, struct snp_psc_desc *desc) in vmgexit_psc() argument 465 struct ghcb *ghcb; in __set_pages_state() local 513 if (!ghcb || vmgexit_psc(ghcb, data)) in __set_pages_state() 578 struct ghcb *ghcb; in vmgexit_ap_control() local 716 if (addr <= ghcb && ghcb < addr + size) { in unshare_all_memory() 830 struct ghcb *ghcb; in snp_kexec_finish() local 1113 struct ghcb *ghcb; in snp_register_per_cpu_ghcb() local 1167 struct ghcb *ghcb; in sev_es_ap_hlt_loop() local 1434 struct ghcb *ghcb; in snp_issue_guest_request() local [all …]
|
| /arch/x86/boot/startup/ |
| A D | sev-startup.c | 74 struct ghcb *ghcb; in __sev_get_ghcb() local 105 *state->ghcb = *ghcb; in __sev_get_ghcb() 107 state->ghcb = NULL; in __sev_get_ghcb() 111 return ghcb; in __sev_get_ghcb() 120 struct ghcb *ghcb; in __sev_put_ghcb() local 127 if (state->ghcb) { in __sev_put_ghcb() 129 *ghcb = *state->ghcb; in __sev_put_ghcb() 146 struct ghcb *ghcb; in svsm_perform_call_protocol() local 158 ghcb = boot_ghcb; in svsm_perform_call_protocol() 160 ghcb = NULL; in svsm_perform_call_protocol() [all …]
|
| A D | sev-shared.c | 140 static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in verify_exception_info() argument 250 static int svsm_perform_ghcb_protocol(struct ghcb *ghcb, struct svsm_call *call) in svsm_perform_ghcb_protocol() argument 255 vc_ghcb_invalidate(ghcb); in svsm_perform_ghcb_protocol() 288 enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, in sev_es_ghcb_hv_call() argument 358 ghcb_set_xcr0(ghcb, 1); in __sev_cpuid_hv_ghcb() 370 leaf->eax = ghcb->save.rax; in __sev_cpuid_hv_ghcb() 371 leaf->ebx = ghcb->save.rbx; in __sev_cpuid_hv_ghcb() 372 leaf->ecx = ghcb->save.rcx; in __sev_cpuid_hv_ghcb() 380 return ghcb ? __sev_cpuid_hv_ghcb(ghcb, ctxt, leaf) in sev_cpuid_hv() 494 snp_cpuid_postprocess(struct ghcb *ghcb, struct es_em_ctxt *ctxt, in snp_cpuid_postprocess() argument [all …]
|
| /arch/x86/kernel/cpu/ |
| A D | vmware.c | 549 static void vmware_sev_es_hcall_prepare(struct ghcb *ghcb, in vmware_sev_es_hcall_prepare() argument 553 ghcb_set_rip(ghcb, regs->ip); in vmware_sev_es_hcall_prepare() 554 ghcb_set_rbx(ghcb, regs->bx); in vmware_sev_es_hcall_prepare() 555 ghcb_set_rcx(ghcb, regs->cx); in vmware_sev_es_hcall_prepare() 556 ghcb_set_rdx(ghcb, regs->dx); in vmware_sev_es_hcall_prepare() 557 ghcb_set_rsi(ghcb, regs->si); in vmware_sev_es_hcall_prepare() 558 ghcb_set_rdi(ghcb, regs->di); in vmware_sev_es_hcall_prepare() 559 ghcb_set_rbp(ghcb, regs->bp); in vmware_sev_es_hcall_prepare() 562 static bool vmware_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in vmware_sev_es_hcall_finish() argument 572 regs->bx = ghcb_get_rbx(ghcb); in vmware_sev_es_hcall_finish() [all …]
|
| A D | mshyperv.c | 680 static void hv_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in hv_sev_es_hcall_prepare() argument 683 ghcb_set_rcx(ghcb, regs->cx); in hv_sev_es_hcall_prepare() 684 ghcb_set_rdx(ghcb, regs->dx); in hv_sev_es_hcall_prepare() 685 ghcb_set_r8(ghcb, regs->r8); in hv_sev_es_hcall_prepare() 688 static bool hv_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in hv_sev_es_hcall_finish() argument
|
| /arch/x86/boot/compressed/ |
| A D | sev.c | 29 static struct ghcb boot_ghcb_page __aligned(PAGE_SIZE); 30 struct ghcb *boot_ghcb; 62 struct ghcb *ghcb; in svsm_perform_call_protocol() local 66 ghcb = boot_ghcb; in svsm_perform_call_protocol() 68 ghcb = NULL; in svsm_perform_call_protocol() 71 ret = ghcb ? svsm_perform_ghcb_protocol(ghcb, call) in svsm_perform_call_protocol() 194 static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, in sev_es_ghcb_terminate() argument 199 vc_ghcb_invalidate(ghcb); in sev_es_ghcb_terminate() 201 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in sev_es_ghcb_terminate() 202 ghcb_set_sw_exit_info_2(ghcb, exit_info_2); in sev_es_ghcb_terminate() [all …]
|
| /arch/x86/include/asm/ |
| A D | sev-internal.h | 5 extern struct ghcb boot_ghcb_page; 11 struct ghcb ghcb_page; 20 struct ghcb backup_ghcb; 47 struct ghcb *ghcb; member 52 struct ghcb *__sev_get_ghcb(struct ghcb_state *state);
|
| A 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);
|
| A D | svm.h | 518 struct ghcb { struct 593 BUILD_BUG_RESERVED_OFFSET(ghcb, 0xff0); in __unused_size_checks() 657 static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \ 660 (unsigned long *)&ghcb->save.valid_bitmap); \ 663 static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \ 665 return ghcb->save.field; \ 668 static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \ 670 return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \ 673 static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \ 676 (unsigned long *)&ghcb->save.valid_bitmap); \ [all …]
|
| A D | sev.h | 537 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument 539 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate() 540 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate() 555 int snp_cpuid(struct ghcb *ghcb, struct es_em_ctxt *ctxt, struct cpuid_leaf *leaf); 558 enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, 563 extern struct ghcb *boot_ghcb;
|
| /arch/x86/hyperv/ |
| A D | ivm.c | 35 struct ghcb ghcb; member 103 hv_ghcb->ghcb.ghcb_usage = 0xffffffff; in hv_ghcb_hypercall() 104 memset(hv_ghcb->ghcb.save.valid_bitmap, 0, in hv_ghcb_hypercall() 124 static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, in hv_ghcb_hv_call() argument 128 ghcb->protocol_version = hv_ghcb_version; in hv_ghcb_hv_call() 129 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in hv_ghcb_hv_call() 131 ghcb_set_sw_exit_code(ghcb, exit_code); in hv_ghcb_hv_call() 132 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in hv_ghcb_hv_call() 133 ghcb_set_sw_exit_info_2(ghcb, exit_info_2); in hv_ghcb_hv_call() 207 ghcb_set_rcx(&hv_ghcb->ghcb, msr); in hv_ghcb_msr_write() [all …]
|
| /arch/x86/kernel/ |
| A 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
|
| /arch/x86/kvm/svm/ |
| A D | sev.c | 3239 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() local 3259 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_from_ghcb() local 3277 memcpy(&svm->sev_es.valid_bitmap, &ghcb->save.valid_bitmap, sizeof(ghcb->save.valid_bitmap)); in sev_es_sync_from_ghcb() 3288 vcpu->arch.xcr0 = ghcb_get_xcr0(ghcb); in sev_es_sync_from_ghcb() 3293 exit_code = ghcb_get_sw_exit_code(ghcb); in sev_es_sync_from_ghcb() 3301 memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in sev_es_sync_from_ghcb() 3318 if (svm->sev_es.ghcb->ghcb_usage) { in sev_es_validate_vmgexit() 3433 svm->sev_es.ghcb->ghcb_usage); in sev_es_validate_vmgexit() 3454 if (!svm->sev_es.ghcb) in sev_es_unmap_ghcb() 3481 svm->sev_es.ghcb = NULL; in sev_es_unmap_ghcb() [all …]
|
| A D | svm.h | 224 struct ghcb *ghcb; member 593 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, response); in svm_vmgexit_set_return_code() 594 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, data); in svm_vmgexit_set_return_code() 923 …static __always_inline u64 kvm_ghcb_get_##field##_if_valid(struct vcpu_svm *svm, struct ghcb *ghcb… 925 return kvm_ghcb_##field##_is_valid(svm) ? ghcb->save.field : 0; \
|
| A D | svm.c | 2857 if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_complete_emulated_msr()
|
| /arch/x86/kvm/ |
| A D | trace.h | 1844 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1845 TP_ARGS(vcpu_id, ghcb), 1856 __entry->exit_reason = ghcb->save.sw_exit_code; 1857 __entry->info1 = ghcb->save.sw_exit_info_1; 1858 __entry->info2 = ghcb->save.sw_exit_info_2; 1870 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb), 1871 TP_ARGS(vcpu_id, ghcb), 1882 __entry->exit_reason = ghcb->save.sw_exit_code; 1883 __entry->info1 = ghcb->save.sw_exit_info_1; 1884 __entry->info2 = ghcb->save.sw_exit_info_2;
|