Home
last modified time | relevance | path

Searched refs:ghcb (Results 1 – 13 of 13) sorted by relevance

/openbmc/linux/arch/x86/kernel/
H A Dsev.c65 static struct ghcb boot_ghcb_page __bss_decrypted __aligned(PAGE_SIZE);
71 static struct ghcb *boot_ghcb __section(".data");
78 struct ghcb ghcb_page;
87 struct ghcb backup_ghcb;
114 struct ghcb *ghcb; member
216 static noinstr struct ghcb *__sev_get_ghcb(struct ghcb_state *state) in __sev_get_ghcb()
219 struct ghcb *ghcb; in __sev_get_ghcb() local
224 ghcb = &data->ghcb_page; in __sev_get_ghcb()
247 state->ghcb = &data->backup_ghcb; in __sev_get_ghcb()
250 *state->ghcb = *ghcb; in __sev_get_ghcb()
[all …]
H A Dsev-shared.c165 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument
167 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate()
168 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate()
198 static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in verify_exception_info() argument
202 ret = ghcb->save.sw_exit_info_1 & GENMASK_ULL(31, 0); in verify_exception_info()
207 u64 info = ghcb->save.sw_exit_info_2; in verify_exception_info()
226 static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, in sev_es_ghcb_hv_call() argument
232 ghcb->protocol_version = ghcb_version; in sev_es_ghcb_hv_call()
233 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in sev_es_ghcb_hv_call()
235 ghcb_set_sw_exit_code(ghcb, exit_code); in sev_es_ghcb_hv_call()
[all …]
H A Dkvm.c984 static void kvm_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_prepare() argument
987 ghcb_set_rbx(ghcb, regs->bx); in kvm_sev_es_hcall_prepare()
988 ghcb_set_rcx(ghcb, regs->cx); in kvm_sev_es_hcall_prepare()
989 ghcb_set_rdx(ghcb, regs->dx); in kvm_sev_es_hcall_prepare()
990 ghcb_set_rsi(ghcb, regs->si); in kvm_sev_es_hcall_prepare()
993 static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_finish() argument
/openbmc/linux/arch/x86/kernel/cpu/
H A Dvmware.c484 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 …]
H A Dmshyperv.c680 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
/openbmc/linux/arch/x86/hyperv/
H A Divm.c32 struct ghcb ghcb; member
88 hv_ghcb->ghcb.protocol_version = GHCB_PROTOCOL_MAX; in hv_ghcb_hypercall()
89 hv_ghcb->ghcb.ghcb_usage = GHCB_USAGE_HYPERV_CALL; in hv_ghcb_hypercall()
100 hv_ghcb->ghcb.ghcb_usage = 0xffffffff; in hv_ghcb_hypercall()
101 memset(hv_ghcb->ghcb.save.valid_bitmap, 0, in hv_ghcb_hypercall()
102 sizeof(hv_ghcb->ghcb.save.valid_bitmap)); in hv_ghcb_hypercall()
121 static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, in hv_ghcb_hv_call() argument
125 ghcb->protocol_version = hv_ghcb_version; in hv_ghcb_hv_call()
126 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in hv_ghcb_hv_call()
128 ghcb_set_sw_exit_code(ghcb, exit_code); in hv_ghcb_hv_call()
[all …]
/openbmc/linux/arch/x86/include/asm/
H A Dsvm.h505 struct ghcb { struct
532 BUILD_BUG_ON(sizeof(struct ghcb) != EXPECTED_GHCB_SIZE); in __unused_size_checks() argument
565 BUILD_BUG_RESERVED_OFFSET(ghcb, 0xff0); in __unused_size_checks()
636 static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \
639 (unsigned long *)&ghcb->save.valid_bitmap); \
642 static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \
644 return ghcb->save.field; \
647 static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \
649 return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \
652 static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \
[all …]
H A Dx86_init.h7 struct ghcb;
272 void (*sev_es_hcall_prepare)(struct ghcb *ghcb, struct pt_regs *regs);
273 bool (*sev_es_hcall_finish)(struct ghcb *ghcb, struct pt_regs *regs);
/openbmc/linux/arch/x86/kvm/svm/
H A Dsev.c2404 struct ghcb *ghcb = svm->sev_es.ghcb; in dump_ghcb() local
2413 nbits = sizeof(ghcb->save.valid_bitmap) * 8; in dump_ghcb()
2417 ghcb->save.sw_exit_code, ghcb_sw_exit_code_is_valid(ghcb)); in dump_ghcb()
2419 ghcb->save.sw_exit_info_1, ghcb_sw_exit_info_1_is_valid(ghcb)); in dump_ghcb()
2421 ghcb->save.sw_exit_info_2, ghcb_sw_exit_info_2_is_valid(ghcb)); in dump_ghcb()
2423 ghcb->save.sw_scratch, ghcb_sw_scratch_is_valid(ghcb)); in dump_ghcb()
2424 pr_err("%-20s%*pb\n", "valid_bitmap", nbits, ghcb->save.valid_bitmap); in dump_ghcb()
2430 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() local
2440 ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]); in sev_es_sync_to_ghcb()
2441 ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]); in sev_es_sync_to_ghcb()
[all …]
H A Dsvm.h195 struct ghcb *ghcb; member
710 …static __always_inline u64 kvm_ghcb_get_##field##_if_valid(struct vcpu_svm *svm, struct ghcb *ghcb
712 return kvm_ghcb_##field##_is_valid(svm) ? ghcb->save.field : 0; \
H A Dsvm.c2968 if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_complete_emulated_msr()
2971 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, 1); in svm_complete_emulated_msr()
2972 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, in svm_complete_emulated_msr()
/openbmc/linux/arch/x86/boot/compressed/
H A Dsev.c28 struct ghcb boot_ghcb_page __aligned(PAGE_SIZE);
29 struct ghcb *boot_ghcb;
274 static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, in sev_es_ghcb_terminate() argument
279 vc_ghcb_invalidate(ghcb); in sev_es_ghcb_terminate()
280 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_TERM_REQUEST); in sev_es_ghcb_terminate()
281 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in sev_es_ghcb_terminate()
282 ghcb_set_sw_exit_info_2(ghcb, exit_info_2); in sev_es_ghcb_terminate()
284 sev_es_wr_ghcb_msr(__pa(ghcb)); in sev_es_ghcb_terminate()
/openbmc/linux/arch/x86/kvm/
H A Dtrace.h1742 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb),
1743 TP_ARGS(vcpu_id, ghcb),
1754 __entry->exit_reason = ghcb->save.sw_exit_code;
1755 __entry->info1 = ghcb->save.sw_exit_info_1;
1756 __entry->info2 = ghcb->save.sw_exit_info_2;
1768 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb),
1769 TP_ARGS(vcpu_id, ghcb),
1780 __entry->exit_reason = ghcb->save.sw_exit_code;
1781 __entry->info1 = ghcb->save.sw_exit_info_1;
1782 __entry->info2 = ghcb->save.sw_exit_info_2;