Home
last modified time | relevance | path

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

/Linux-v6.6/arch/x86/kernel/
Dsev.c63 static struct ghcb boot_ghcb_page __bss_decrypted __aligned(PAGE_SIZE);
69 static struct ghcb *boot_ghcb __section(".data");
76 struct ghcb ghcb_page;
85 struct ghcb backup_ghcb;
112 struct ghcb *ghcb; member
214 static noinstr struct ghcb *__sev_get_ghcb(struct ghcb_state *state) in __sev_get_ghcb()
217 struct ghcb *ghcb; in __sev_get_ghcb() local
222 ghcb = &data->ghcb_page; in __sev_get_ghcb()
245 state->ghcb = &data->backup_ghcb; in __sev_get_ghcb()
248 *state->ghcb = *ghcb; in __sev_get_ghcb()
[all …]
Dsev-shared.c164 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument
166 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate()
167 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate()
197 static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in verify_exception_info() argument
201 ret = ghcb->save.sw_exit_info_1 & GENMASK_ULL(31, 0); in verify_exception_info()
206 u64 info = ghcb->save.sw_exit_info_2; in verify_exception_info()
225 static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, in sev_es_ghcb_hv_call() argument
231 ghcb->protocol_version = ghcb_version; in sev_es_ghcb_hv_call()
232 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in sev_es_ghcb_hv_call()
234 ghcb_set_sw_exit_code(ghcb, exit_code); in sev_es_ghcb_hv_call()
[all …]
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
/Linux-v6.6/arch/x86/kernel/cpu/
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 …]
Dmshyperv.c621 static void hv_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in hv_sev_es_hcall_prepare() argument
624 ghcb_set_rcx(ghcb, regs->cx); in hv_sev_es_hcall_prepare()
625 ghcb_set_rdx(ghcb, regs->dx); in hv_sev_es_hcall_prepare()
626 ghcb_set_r8(ghcb, regs->r8); in hv_sev_es_hcall_prepare()
629 static bool hv_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in hv_sev_es_hcall_finish() argument
/Linux-v6.6/arch/x86/hyperv/
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 …]
/Linux-v6.6/arch/x86/include/asm/
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 …]
Dx86_init.h7 struct ghcb;
271 void (*sev_es_hcall_prepare)(struct ghcb *ghcb, struct pt_regs *regs);
272 bool (*sev_es_hcall_finish)(struct ghcb *ghcb, struct pt_regs *regs);
/Linux-v6.6/arch/x86/kvm/svm/
Dsev.c2374 struct ghcb *ghcb = svm->sev_es.ghcb; in dump_ghcb() local
2383 nbits = sizeof(ghcb->save.valid_bitmap) * 8; in dump_ghcb()
2387 ghcb->save.sw_exit_code, ghcb_sw_exit_code_is_valid(ghcb)); in dump_ghcb()
2389 ghcb->save.sw_exit_info_1, ghcb_sw_exit_info_1_is_valid(ghcb)); in dump_ghcb()
2391 ghcb->save.sw_exit_info_2, ghcb_sw_exit_info_2_is_valid(ghcb)); in dump_ghcb()
2393 ghcb->save.sw_scratch, ghcb_sw_scratch_is_valid(ghcb)); in dump_ghcb()
2394 pr_err("%-20s%*pb\n", "valid_bitmap", nbits, ghcb->save.valid_bitmap); in dump_ghcb()
2400 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() local
2410 ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]); in sev_es_sync_to_ghcb()
2411 ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]); in sev_es_sync_to_ghcb()
[all …]
Dsvm.h194 struct ghcb *ghcb; member
708 …static __always_inline u64 kvm_ghcb_get_##field##_if_valid(struct vcpu_svm *svm, struct ghcb *ghcb
710 return kvm_ghcb_##field##_is_valid(svm) ? ghcb->save.field : 0; \
Dsvm.c2953 if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_complete_emulated_msr()
2956 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, 1); in svm_complete_emulated_msr()
2957 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, in svm_complete_emulated_msr()
/Linux-v6.6/arch/x86/boot/compressed/
Dsev.c28 struct ghcb boot_ghcb_page __aligned(PAGE_SIZE);
29 struct ghcb *boot_ghcb;
271 static void __noreturn sev_es_ghcb_terminate(struct ghcb *ghcb, unsigned int set, in sev_es_ghcb_terminate() argument
276 vc_ghcb_invalidate(ghcb); in sev_es_ghcb_terminate()
277 ghcb_set_sw_exit_code(ghcb, SVM_VMGEXIT_TERM_REQUEST); in sev_es_ghcb_terminate()
278 ghcb_set_sw_exit_info_1(ghcb, exit_info_1); in sev_es_ghcb_terminate()
279 ghcb_set_sw_exit_info_2(ghcb, exit_info_2); in sev_es_ghcb_terminate()
281 sev_es_wr_ghcb_msr(__pa(ghcb)); in sev_es_ghcb_terminate()
/Linux-v6.6/arch/x86/kvm/
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;