Home
last modified time | relevance | path

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

/linux-5.19.10/arch/x86/kernel/
Dsev.c61 static struct ghcb boot_ghcb_page __bss_decrypted __aligned(PAGE_SIZE);
67 static struct ghcb *boot_ghcb __section(".data");
74 struct ghcb ghcb_page;
83 struct ghcb backup_ghcb;
110 struct ghcb *ghcb; member
202 static noinstr struct ghcb *__sev_get_ghcb(struct ghcb_state *state) in __sev_get_ghcb()
205 struct ghcb *ghcb; in __sev_get_ghcb() local
210 ghcb = &data->ghcb_page; in __sev_get_ghcb()
233 state->ghcb = &data->backup_ghcb; in __sev_get_ghcb()
236 *state->ghcb = *ghcb; in __sev_get_ghcb()
[all …]
Dsev-shared.c161 static __always_inline void vc_ghcb_invalidate(struct ghcb *ghcb) in vc_ghcb_invalidate() argument
163 ghcb->save.sw_exit_code = 0; in vc_ghcb_invalidate()
164 __builtin_memset(ghcb->save.valid_bitmap, 0, sizeof(ghcb->save.valid_bitmap)); in vc_ghcb_invalidate()
194 static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt *ctxt) in verify_exception_info() argument
198 ret = ghcb->save.sw_exit_info_1 & GENMASK_ULL(31, 0); in verify_exception_info()
203 u64 info = ghcb->save.sw_exit_info_2; in verify_exception_info()
222 static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, in sev_es_ghcb_hv_call() argument
228 ghcb->protocol_version = ghcb_version; in sev_es_ghcb_hv_call()
229 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in sev_es_ghcb_hv_call()
231 ghcb_set_sw_exit_code(ghcb, exit_code); in sev_es_ghcb_hv_call()
[all …]
Dkvm.c993 static void kvm_sev_es_hcall_prepare(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_prepare() argument
996 ghcb_set_rbx(ghcb, regs->bx); in kvm_sev_es_hcall_prepare()
997 ghcb_set_rcx(ghcb, regs->cx); in kvm_sev_es_hcall_prepare()
998 ghcb_set_rdx(ghcb, regs->dx); in kvm_sev_es_hcall_prepare()
999 ghcb_set_rsi(ghcb, regs->si); in kvm_sev_es_hcall_prepare()
1002 static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) in kvm_sev_es_hcall_finish() argument
/linux-5.19.10/arch/x86/hyperv/
Divm.c24 struct ghcb ghcb; member
78 hv_ghcb->ghcb.protocol_version = GHCB_PROTOCOL_MAX; in hv_ghcb_hypercall()
79 hv_ghcb->ghcb.ghcb_usage = GHCB_USAGE_HYPERV_CALL; in hv_ghcb_hypercall()
90 hv_ghcb->ghcb.ghcb_usage = 0xffffffff; in hv_ghcb_hypercall()
91 memset(hv_ghcb->ghcb.save.valid_bitmap, 0, in hv_ghcb_hypercall()
92 sizeof(hv_ghcb->ghcb.save.valid_bitmap)); in hv_ghcb_hypercall()
111 static enum es_result hv_ghcb_hv_call(struct ghcb *ghcb, u64 exit_code, in hv_ghcb_hv_call() argument
115 ghcb->protocol_version = hv_ghcb_version; in hv_ghcb_hv_call()
116 ghcb->ghcb_usage = GHCB_DEFAULT_USAGE; in hv_ghcb_hv_call()
118 ghcb_set_sw_exit_code(ghcb, exit_code); in hv_ghcb_hv_call()
[all …]
/linux-5.19.10/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 …]
/linux-5.19.10/arch/x86/kvm/svm/
Dsev.c2350 struct ghcb *ghcb = svm->sev_es.ghcb; in dump_ghcb() local
2359 nbits = sizeof(ghcb->save.valid_bitmap) * 8; in dump_ghcb()
2363 ghcb->save.sw_exit_code, ghcb_sw_exit_code_is_valid(ghcb)); in dump_ghcb()
2365 ghcb->save.sw_exit_info_1, ghcb_sw_exit_info_1_is_valid(ghcb)); in dump_ghcb()
2367 ghcb->save.sw_exit_info_2, ghcb_sw_exit_info_2_is_valid(ghcb)); in dump_ghcb()
2369 ghcb->save.sw_scratch, ghcb_sw_scratch_is_valid(ghcb)); in dump_ghcb()
2370 pr_err("%-20s%*pb\n", "valid_bitmap", nbits, ghcb->save.valid_bitmap); in dump_ghcb()
2376 struct ghcb *ghcb = svm->sev_es.ghcb; in sev_es_sync_to_ghcb() local
2386 ghcb_set_rax(ghcb, vcpu->arch.regs[VCPU_REGS_RAX]); in sev_es_sync_to_ghcb()
2387 ghcb_set_rbx(ghcb, vcpu->arch.regs[VCPU_REGS_RBX]); in sev_es_sync_to_ghcb()
[all …]
Dsvm.h186 struct ghcb *ghcb; member
Dsvm.c2729 if (!err || !sev_es_guest(vcpu->kvm) || WARN_ON_ONCE(!svm->sev_es.ghcb)) in svm_complete_emulated_msr()
2732 ghcb_set_sw_exit_info_1(svm->sev_es.ghcb, 1); in svm_complete_emulated_msr()
2733 ghcb_set_sw_exit_info_2(svm->sev_es.ghcb, in svm_complete_emulated_msr()
/linux-5.19.10/arch/x86/include/asm/
Dsvm.h477 struct ghcb { struct
501 BUILD_BUG_ON(sizeof(struct ghcb) != EXPECTED_GHCB_SIZE); in __unused_size_checks() argument
572 static __always_inline bool ghcb_##field##_is_valid(const struct ghcb *ghcb) \
575 (unsigned long *)&ghcb->save.valid_bitmap); \
578 static __always_inline u64 ghcb_get_##field(struct ghcb *ghcb) \
580 return ghcb->save.field; \
583 static __always_inline u64 ghcb_get_##field##_if_valid(struct ghcb *ghcb) \
585 return ghcb_##field##_is_valid(ghcb) ? ghcb->save.field : 0; \
588 static __always_inline void ghcb_set_##field(struct ghcb *ghcb, u64 value) \
591 (unsigned long *)&ghcb->save.valid_bitmap); \
[all …]
Dx86_init.h7 struct ghcb;
265 void (*sev_es_hcall_prepare)(struct ghcb *ghcb, struct pt_regs *regs);
266 bool (*sev_es_hcall_finish)(struct ghcb *ghcb, struct pt_regs *regs);
/linux-5.19.10/arch/x86/kvm/
Dtrace.h1686 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb),
1687 TP_ARGS(vcpu_id, ghcb),
1698 __entry->exit_reason = ghcb->save.sw_exit_code;
1699 __entry->info1 = ghcb->save.sw_exit_info_1;
1700 __entry->info2 = ghcb->save.sw_exit_info_2;
1712 TP_PROTO(unsigned int vcpu_id, struct ghcb *ghcb),
1713 TP_ARGS(vcpu_id, ghcb),
1724 __entry->exit_reason = ghcb->save.sw_exit_code;
1725 __entry->info1 = ghcb->save.sw_exit_info_1;
1726 __entry->info2 = ghcb->save.sw_exit_info_2;
/linux-5.19.10/arch/x86/boot/compressed/
Dsev.c28 struct ghcb boot_ghcb_page __aligned(PAGE_SIZE);
29 struct ghcb *boot_ghcb;