Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
b292256
pKVM: x86: Share the mce banks info between host and pKVM in npVMs
Qiangcy Jan 9, 2026
37dc101
pKVM: x86: Add two helpers to manage pkvm_vcpu instances
cxdong Oct 12, 2025
bfecc3b
pKVM: x86: Add IBPB symbols for loading vcpu
cxdong Oct 12, 2025
78dee66
pKVM: VMX: Implement vcpu_load operation
cxdong Nov 10, 2025
32781b5
pKVM: x86: Add vcpu_load PV interface
cxdong Oct 12, 2025
3472fbd
pKVM: VMX: Implement vcpu_put operation
cxdong Nov 10, 2025
7eef996
pKVM: x86: Add vcpu_put PV interface
cxdong Oct 12, 2025
77f91ad
KVM: pVMX: Implement vcpu_load operation
cxdong Nov 9, 2025
28f93a2
KVM: pVMX: Implement vcpu_put operation
cxdong Nov 9, 2025
b86f004
pKVM: x86: Extend pkvm_fixup_exception to support EX_TYPE_DEFAULT
cxdong Dec 23, 2025
c2b7607
KVM: VMX: Add helper vmcs_store()
cxdong Oct 27, 2025
6784ecd
pKVM: VMX: Ensure the host VMCS is loaded when handling NMI
cxdong Oct 27, 2025
22784b3
pKVM: x86: Redefine KVM print macros for the pKVM hypervisor
cxdong Oct 12, 2025
3b0c312
pKVM: x86: Add helper to handle the PV interfaces for a loaded vCPU
cxdong Dec 2, 2025
0d96fca
pKVM: x86: Audit PV interfaces for protected VMs
cxdong Dec 23, 2025
127c23d
pKVM: VMX: Implement update_exception_bitmap operation
cxdong Nov 10, 2025
c836239
pKVM: x86: Add update_exception_bitmap PV interface
cxdong Dec 23, 2025
1b0994e
KVM: pVMX: Implement update_exception_bitmap operation
cxdong Nov 9, 2025
b933b88
pKVM: VMX: Implement set_efer operation
cxdong Nov 10, 2025
bcbb17f
pKVM: x86: Add set_efer PV interface
cxdong Dec 22, 2025
ae2976c
KVM: pVMX: Implement set_efer operation
cxdong Nov 9, 2025
8ade101
pKVM: x86: Import fpu_update_guest_xfd() from kernel x86 fpu
cxdong Dec 18, 2025
0a12a0f
pKVM: x86: Setup feature MSRs stuff
cxdong Oct 24, 2025
f1c13ea
pKVM: x86: Import kvm_set_msr_common() from KVM
cxdong Oct 12, 2025
0efdfd1
pKVM: x86: Import kvm_get_msr_common() from KVM
cxdong Oct 12, 2025
d7595b3
pKVM: x86: Add helper to check pKVM host emulated MSR
cxdong Dec 30, 2025
121641f
KVM: pVMX: Implement has_emulated_msr operation
Qiangcy Jan 9, 2026
c9bf33e
pKVM: VMX: Implement set_msr operation
cxdong Nov 10, 2025
417dd6e
pKVM: x86: Add set_msr PV interface
cxdong Dec 24, 2025
22e6112
KVM: pVMX: Implement set_msr operation
cxdong Dec 30, 2025
951f7f4
pKVM: VMX: Implement get_msr operation
cxdong Nov 10, 2025
d0d5717
pKVM: x86: Add get_msr PV interface
cxdong Dec 24, 2025
44eacd2
KVM: pVMX: Implement get_msr operation
cxdong Oct 13, 2025
53828fe
KVM: pVMX: Implement get_feature_msr operation
cxdong Oct 27, 2025
b46801b
pKVM: x86: Enforce initial values of most MSRs
Dec 5, 2025
dd793d3
pKVM: VMX: Implement cache_reg operation
cxdong Nov 10, 2025
2928f69
pKVM: x86: Add cache_reg PV interface
cxdong Dec 22, 2025
d0a504c
KVM: pVMX: Implement cache_reg operation
cxdong Nov 9, 2025
cd751d7
pKVM: VMX: Implement set_cr4/is_valid_cr4 operations
cxdong Nov 10, 2025
cb04020
pKVM: x86: Add set_cr4 PV interface
cxdong Dec 24, 2025
e7ba61c
KVM: pVMX: Implement CR4 related operations
cxdong Oct 13, 2025
e2562b2
pKVM: VMX: Implement set_cr0/is_valid_cr0 operations
cxdong Dec 22, 2025
d07cfd1
pKVM: x86: Add set_cr0 PV interface
cxdong Dec 24, 2025
1215cff
KVM: pVMX: Implement CR0 related operations
cxdong Dec 22, 2025
70b04f1
pKVM: VMX: Implement rflags related operations
cxdong Nov 10, 2025
869a2af
pKVM: x86: Add set/get_rflags PV interfaces
cxdong Dec 24, 2025
8b0a2c3
KVM: pVMX: Implement rflags related operations
cxdong Nov 9, 2025
ea216e6
pKVM: VMX: Implement debug registers related operations
cxdong Nov 10, 2025
f21390c
pKVM: x86: Add set_dr7 PV interfaces
cxdong Dec 22, 2025
ec5722b
KVM: pVMX: Implement set_dr7 operation
cxdong Oct 14, 2025
ff71b91
pKVM: VMX: Import the vmenter.S
cxdong Nov 10, 2025
ab6baf6
pKVM: VMX: Implement vcpu_reset operation
cxdong Nov 10, 2025
53d2ca8
pKVM: x86: Setup xstate cache
cxdong Oct 23, 2025
0d1dfc9
pKVM: x86: Import fpstate_clear_xstate_component
cxdong Oct 23, 2025
d5a304d
pKVM: x86: Import fpu_swap_kvm_fpstate
cxdong Oct 23, 2025
14a59fa
pKVM: x86: Import kvm_vcpu_reset
cxdong Oct 18, 2025
4d5a499
pKVM: x86: Reset vCPU when creating it
Jan 9, 2026
e19a0d0
pKVM: x86: Add vcpu_reset PV interface
cxdong Dec 24, 2025
a7d453c
KVM: pVMX: Implement vcpu_reset operation
cxdong Oct 14, 2025
897512a
KVM: pVMX: Handle CR4 access from host userspace
Qiangcy Jan 11, 2026
8eab416
pKVM: VMX: Implement segment related ops
cxdong Nov 10, 2025
90b8dd4
pKVM: x86: Define pkvm_hypercall_in macro
cxdong Dec 5, 2025
33fea2e
pKVM: x86: Get hypercall inputs from the host
cxdong Dec 3, 2025
6e7aeaf
pKVM: x86: Add segment PV interfaces
cxdong Dec 24, 2025
a45436b
KVM: pVMX: Implement segment related operations
cxdong Oct 14, 2025
f13643a
pKVM: VMX: Implement idt/gdt related operations
cxdong Nov 10, 2025
b5c7dc4
pKVM: x86: Add idt/gdt PV interfaces
cxdong Dec 24, 2025
62e9247
KVM: pVMX: Implement idt/gdt related operations
cxdong Oct 14, 2025
46fec25
pKVM: VMX: Implement TLB flushing related operations
cxdong Nov 10, 2025
7d89e1e
pKVM: x86: Add TLB flushing PV interfaces
cxdong Dec 24, 2025
f651912
KVM: pVMX: Implement TLB flushing operations
cxdong Nov 9, 2025
b655aed
pKVM: VMX: Implement interrupt shadow operations
cxdong Nov 10, 2025
aec611f
pKVM: x86: Add interrupt shadow PV interfaces
cxdong Dec 22, 2025
3fed737
KVM: pVMX: Implement interrupt shadow operations
cxdong Nov 9, 2025
9b8b4ee
pKVM: VMX: Implement enable irq/nmi window operations
cxdong Nov 10, 2025
1841c3c
pKVM: x86: Add enabling irq/nmi window PV interfaces
cxdong Dec 23, 2025
9de9513
KVM: pVMX: Implement enabling irq/nmi window operations
cxdong Nov 9, 2025
891c91d
pKVM: VMX: Implement irq/nmi mask related operations
cxdong Nov 10, 2025
e007472
pKVM: x86: Add irq/nmi mask PV interfaces
cxdong Dec 24, 2025
a8d31e6
KVM: pVMX: Implement irq/nmi mask related operations
cxdong Oct 14, 2025
be2d96c
pKVM: VMX: Implement event injection operations
cxdong Nov 10, 2025
45b9a20
pKVM: x86: Add event injection PV interfaces
cxdong Dec 24, 2025
83c2be2
KVM: pVMX: Implement event injection operations
cxdong Oct 20, 2025
a72f611
pKVM: VMX: Implement cancel injection operation
cxdong Nov 10, 2025
fb6d867
pKVM: x86 Add cancel injection PV interface
cxdong Dec 24, 2025
4cc1ffe
KVM: pVMX: Implement cancel injection operation
cxdong Oct 14, 2025
98b97cb
pKVM: VMX: Implement update_cr8_intercept operations
cxdong Nov 10, 2025
56a8a53
pKVM: x86: Add update_cr8_intercept PV interface
cxdong Dec 24, 2025
38832f1
KVM: pVMX: Implement update_cr8_intercept operation
cxdong Nov 9, 2025
d0031dd
KVM: pVMX: Implement x2apic_icr_is_split knob
cxdong Oct 27, 2025
2af3393
pKVM: VMX: Implement set_virtual_apic_mode operation
cxdong Nov 10, 2025
ead4b58
pKVM: x86: Add set_virtual_apic_mode PV interface
cxdong Dec 24, 2025
fc8554a
KVM: pVMX: Implement set_virtual_apic_mode operation
cxdong Nov 9, 2025
2be0ab7
pKVM: VMX: Implement refresh_apicv_exec_ctrl operation
cxdong Nov 10, 2025
71ea859
pKVM: x86: Add refresh_apicv_exec_ctrl PV interface
cxdong Dec 24, 2025
f0f1808
KVM: pVMX: Implement refresh_apicv_exec_ctrl operation
cxdong Nov 9, 2025
65c481c
pKVM: VMX: Implement load_eoi_exitmap operation
cxdong Nov 10, 2025
9526051
pKVM: x86: Add load_eoi_exitmap PV interface
cxdong Dec 24, 2025
2eb9f93
KVM: pVMX: Implement load_eoi_exitmap operation
cxdong Nov 9, 2025
90a3823
KVM: pVMX: Implement apicv_pre_state_restore operation
cxdong Oct 27, 2025
3a34989
KVM: pVMX: Implement required_apicv_inhibits knob
cxdong Nov 9, 2025
4fb733f
pKVM: VMX: Implement hwapic_isr_update operation
cxdong Nov 10, 2025
13f7e35
pKVM: x86: Add hwapic_isr_update PV interface
cxdong Dec 24, 2025
c020b5f
KVM: pVMX: Implement hwapic_isr_update operation
cxdong Nov 9, 2025
8931a49
pKVM: VMX: Implement sync_pir_to_irr operation
cxdong Nov 10, 2025
b4afee4
pKVM: x86: Add sync_pir_to_irr PV interface
cxdong Dec 24, 2025
e40778e
KVM: pVMX: Implement sync_pir_to_irr operation
cxdong Nov 9, 2025
a273a5e
KVM: pVMX: Implement interrupt delivery/pending operations
cxdong Jan 8, 2026
3abf8d2
KVM: pVMX: Implement posted interrupt related operations
cxdong Oct 28, 2025
6baa12f
KVM: pVMX: Implement apic_init_signal_blocked operation
cxdong Jan 8, 2026
4de54ca
KVM: pVMX: Implement vcpu_deliver_sipi_vector operation
cxdong Nov 9, 2025
10ea38d
pKVM: VMX: Implement vcpu_after_set_cpuid operation
cxdong Nov 10, 2025
0e6bf81
pKVM: x86: Initialize KVM cpuid_xstate_sizes
cxdong Oct 14, 2025
f70afca
pKVM: x86: Import fpu_enable_guest_xfd_features
cxdong Oct 23, 2025
cc6365c
pKVM: x86: Import kvm_set_cpuid
cxdong Oct 14, 2025
b1297ce
pKVM: x86: Remove KVM PV feature bits for pVM
cxdong Oct 21, 2025
694ddce
pKVM: x86: Add vcpu_after_set_cpuid PV interface
cxdong Dec 24, 2025
4c171e8
KVM: pVMX: Implement vcpu_after_set_cpuid operation
cxdong Jan 8, 2026
aad45bb
pKVM: x86: Acquire the default cpuid leaves into the per-cpu buffer
ktian1 Dec 5, 2025
99b3b66
pKVM: x86: Enforce cpuid for pVM
cxdong Jan 9, 2026
9f0fe53
pKVM: x86: Add vcpu_add_fpstate PV interface
cxdong Dec 24, 2025
8068fc3
KVM: pVMX: Add new fpstate memory for xfd
cxdong Jan 8, 2026
337751c
pKVM: VMX: Implement write_tsc_offset/multiplier operations
cxdong Nov 10, 2025
89b0fc7
pKVM: x86: Add write_tsc_offset/multiplier PV interfaces
cxdong Dec 24, 2025
ef7cdca
KVM: pVMX: Implement write_tsc_offset/multiplier operations
cxdong Oct 28, 2025
395d3b2
pKVM: VMX: Implement load_mmu_pgd operation
cxdong Nov 10, 2025
a162945
pKVM: x86: Add load_mmu_pgd PV interface
cxdong Dec 29, 2025
a3a1830
KVM: pVMX: Implement load_mmu_pgd operation
cxdong Oct 28, 2025
8c5f579
KVM: pVMX: Provide stub implementation for nested related operations
cxdong Oct 28, 2025
e8d1800
pKVM: VMX: Implement setup_mce operation
cxdong Nov 10, 2025
784b805
pKVM: x86: Add setup_mce PV interface
cxdong Dec 24, 2025
27c4656
KVM: pVMX: Implement setup_mce operation
cxdong Oct 28, 2025
4d6a20f
KVM: pVMX: Provide stub implementation for SMM mode operations
cxdong Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/x86/include/asm/fpu/xstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,8 @@ static __always_inline __pure bool fpu_state_size_dynamic(void)
}
#endif

#ifdef __PKVM_HYP__
void pkvm_setup_xstate_cache(void);
#endif

#endif
2 changes: 2 additions & 0 deletions arch/x86/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -2317,6 +2317,7 @@ int kvm_emulate_xsetbv(struct kvm_vcpu *vcpu);

int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr);
int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr);
bool pkvm_host_has_emulated_msr(struct kvm *kvm, u32 msr);

unsigned long kvm_get_rflags(struct kvm_vcpu *vcpu);
void kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags);
Expand Down Expand Up @@ -2516,6 +2517,7 @@ void __user *__x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa,
u32 size);
bool kvm_vcpu_is_reset_bsp(struct kvm_vcpu *vcpu);
bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu);
int kvm_vcpu_x86_setup_mce(struct kvm_vcpu *vcpu, u64 mcg_cap);

static inline bool kvm_irq_is_postable(struct kvm_lapic_irq *irq)
{
Expand Down
148 changes: 147 additions & 1 deletion arch/x86/include/asm/kvm_pkvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,54 @@ union pkvm_hc_data {
struct {
struct pkvm_memcache memcache;
} vcpu_free;
struct {
u64 data;
} get_msr;
union {
unsigned long rsp;
unsigned long rip;
unsigned long cr0;
unsigned long cr3;
unsigned long cr4;
u64 pdptrs[4];
} cache_reg;
struct {
unsigned long data;
} get_rflags;
struct {
struct kvm_segment seg_val;
int seg;
} set_segment;
struct {
struct kvm_segment seg_val;
} get_segment;
struct {
u64 data;
} get_segment_base;
struct {
struct desc_ptr desc;
} set_idt;
struct {
struct desc_ptr desc;
} get_idt;
struct {
struct desc_ptr desc;
} set_gdt;
struct {
struct desc_ptr desc;
} get_gdt;
struct {
u32 data;
} get_interrupt_shadow;
struct {
bool data;
} get_nmi_mask;
struct {
struct pkvm_memcache memcache;
} vcpu_after_set_cpuid;
struct {
struct pkvm_memcache memcache;
} vcpu_add_fpstate;
struct {
u64 data[PKVM_HC_DATA_MAX_NUM];
} raw;
Expand All @@ -86,11 +134,16 @@ static_assert(sizeof(union pkvm_hc_data) == PKVM_HC_DATA_MAX_NUM * sizeof(u64));
(ALIGN(sizeof(((union pkvm_hc_data *)0)->f), sizeof(u64)) / sizeof(u64))

#define PKVM_HC_OUTPUT_NUM(f) f##_output_num
#define PKVM_HC_INPUT_NUM(f) f##_input_num

enum {
#define PKVM_HC(f) PKVM_HC_OUTPUT_NUM(f) = 0,
#define PKVM_HC_OUT(f) PKVM_HC_OUTPUT_NUM(f) = PKVM_HC_DATA_NUM(f),
#include <asm/pkvm_hypercalls.h>

#define PKVM_HC(f) PKVM_HC_INPUT_NUM(f) = 0,
#define PKVM_HC_IN(f) PKVM_HC_INPUT_NUM(f) = PKVM_HC_DATA_NUM(f),
#include <asm/pkvm_hypercalls.h>
};

static inline int pkvm_hc_output_num(enum pkvm_hc hc)
Expand All @@ -103,6 +156,16 @@ static inline int pkvm_hc_output_num(enum pkvm_hc hc)
}
}

static inline int pkvm_hc_input_num(enum pkvm_hc hc)
{
switch (hc) {
#define PKVM_HC(f) case TO_PKVM_HC(f): return PKVM_HC_INPUT_NUM(f);
#include <asm/pkvm_hypercalls.h>
default:
return 0;
}
}

#define PKVM_HC_IN_0()
#define PKVM_HC_IN_1(a1) , "b"(a1)
#define PKVM_HC_IN_2(a1, a2) PKVM_HC_IN_1(a1), "c"(a2)
Expand Down Expand Up @@ -151,6 +214,23 @@ static inline int pkvm_hc_output_num(enum pkvm_hc hc)
__pkvm_hypercall(f, o, 4, ##__VA_ARGS__), \
PKVM_HC_UNREACHABLE(f))))))

#define pkvm_hypercall_in(f, i) \
__builtin_choose_expr(PKVM_HC_INPUT_NUM(f) == 1, \
__pkvm_hypercall(f, NULL, 0, (i)->raw.data[0]), \
__builtin_choose_expr(PKVM_HC_INPUT_NUM(f) == 2, \
__pkvm_hypercall(f, NULL, 0, (i)->raw.data[0], \
(i)->raw.data[1]), \
__builtin_choose_expr(PKVM_HC_INPUT_NUM(f) == 3, \
__pkvm_hypercall(f, NULL, 0, (i)->raw.data[0], \
(i)->raw.data[1], \
(i)->raw.data[2]), \
__builtin_choose_expr(PKVM_HC_INPUT_NUM(f) == 4, \
__pkvm_hypercall(f, NULL, 0, (i)->raw.data[0], \
(i)->raw.data[1], \
(i)->raw.data[2], \
(i)->raw.data[3]), \
PKVM_HC_UNREACHABLE(f)))))

static inline unsigned long pkvm_hc(struct kvm_vcpu *vcpu)
{
return vcpu->arch.regs[VCPU_REGS_RAX];
Expand All @@ -160,13 +240,41 @@ static inline unsigned long pkvm_hc(struct kvm_vcpu *vcpu)
static inline unsigned long pkvm_hc_input##n(struct kvm_vcpu *vcpu) \
{ \
return vcpu->arch.regs[VCPU_REGS_##reg]; \
} \
static inline void pkvm_hc_get_input##n(struct kvm_vcpu *vcpu, union pkvm_hc_data *p) \
{ \
BUILD_BUG_ON(n == 0 || n > PKVM_HC_DATA_MAX_NUM); \
p->raw.data[n - 1] = vcpu->arch.regs[VCPU_REGS_##reg]; \
}

DEFINE_PKVM_HC_INPUT(1, RBX)
DEFINE_PKVM_HC_INPUT(2, RCX)
DEFINE_PKVM_HC_INPUT(3, RDX)
DEFINE_PKVM_HC_INPUT(4, RSI)

static inline void pkvm_hc_get_input(struct kvm_vcpu *vcpu, enum pkvm_hc hc,
union pkvm_hc_data *in)
{
switch (pkvm_hc_input_num(hc)) {
case 4:
pkvm_hc_get_input4(vcpu, in);
fallthrough;
case 3:
pkvm_hc_get_input3(vcpu, in);
fallthrough;
case 2:
pkvm_hc_get_input2(vcpu, in);
fallthrough;
case 1:
pkvm_hc_get_input1(vcpu, in);
fallthrough;
case 0:
break;
default:
BUG();
}
}

static inline void pkvm_hc_set_ret(struct kvm_vcpu *vcpu, int ret)
{
vcpu->arch.regs[VCPU_REGS_RAX] = ret;
Expand Down Expand Up @@ -224,8 +332,12 @@ extern struct pkvm_init_ops *pkvm_sym(init_ops);
extern struct cpumask pkvm_sym(__cpu_possible_mask);
extern unsigned int pkvm_sym(nr_cpu_ids);
DECLARE_STATIC_KEY_FALSE(pkvm_sym(switch_vcpu_ibpb));
extern u64 pkvm_sym(x86_pred_cmd);
extern struct fpu_state_config pkvm_sym(fpu_kernel_cfg);
extern struct fpu_state_config pkvm_sym(fpu_user_cfg);
#ifdef CONFIG_X86_64
DECLARE_STATIC_KEY_FALSE(pkvm_sym(__fpu_state_size_dynamic));
#endif

u64 pkvm_total_reserve_pages(void);
PKVM_DECLARE(void *, pkvm_early_alloc_page, (void));
Expand Down Expand Up @@ -376,7 +488,32 @@ static inline size_t pkvm_guest_initial_fpstate_size(struct kvm *kvm)

#ifdef __PKVM_HYP__

#ifndef CONFIG_PKVM_X86_DEBUG
#undef kvm_err
#undef kvm_info
#undef kvm_debug
#undef kvm_debug_ratelimited
#undef kvm_pr_unimpl

#ifdef CONFIG_PKVM_X86_DEBUG

#define kvm_err(fmt, ...) \
pr_err("pkvm: " fmt, ## __VA_ARGS__)
#define kvm_info(fmt, ...) \
pr_info("pkvm: " fmt, ## __VA_ARGS__)
#define kvm_debug(fmt, ...) \
pr_debug("pkvm: " fmt, ## __VA_ARGS__)
#define kvm_debug_ratelimited(fmt, ...) \
pr_debug_ratelimited("pkvm: " fmt, ## __VA_ARGS__)
#define kvm_pr_unimpl(fmt, ...) \
pr_err_ratelimited("pkvm: " fmt, ## __VA_ARGS__)

#else /* CONFIG_PKVM_X86_DEBUG */

#define kvm_err(fmt, ...) do {} while(0)
#define kvm_info(fmt, ...) do {} while(0)
#define kvm_debug(fmt, ...) do {} while(0)
#define kvm_debug_ratelimited(fmt, ...) do {} while(0)
#define kvm_pr_unimpl(fmt, ...) do {} while(0)

#undef WARN_ON
#undef WARN
Expand All @@ -402,6 +539,15 @@ static inline size_t pkvm_guest_initial_fpstate_size(struct kvm *kvm)

#endif /* CONFIG_PKVM_X86_DEBUG */

#undef KVM_BUG_ON
#define KVM_BUG_ON(cond, kvm) \
({ \
bool __ret = !!(cond); \
\
BUG_ON(__ret); \
unlikely(__ret); \
})

#endif /* __PKVM_HYP__ */

#else /* !CONFIG_PKVM_X86 */
Expand Down
53 changes: 53 additions & 0 deletions arch/x86/include/asm/pkvm_hypercalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ BUILD_BUG_ON(1)
#define PKVM_HC_OUT PKVM_HC
#endif

#ifndef PKVM_HC_IN
#define PKVM_HC_IN PKVM_HC
#endif

/* Hypercalls used only during pKVM initialization */
PKVM_HC(init)
PKVM_HC(init_finalize)
Expand All @@ -23,6 +27,55 @@ PKVM_HC(vm_init)
PKVM_HC_OUT(vm_destroy)
PKVM_HC(vcpu_create)
PKVM_HC_OUT(vcpu_free)
PKVM_HC(vcpu_load)
PKVM_HC(vcpu_put)
PKVM_HC(vcpu_reset)
PKVM_HC(update_exception_bitmap)
PKVM_HC(set_efer)
PKVM_HC(set_msr)
PKVM_HC_OUT(get_msr)
PKVM_HC_OUT(cache_reg)
PKVM_HC(set_cr4)
PKVM_HC(set_cr0)
PKVM_HC_OUT(get_rflags)
PKVM_HC(set_rflags)
PKVM_HC(set_dr7)
PKVM_HC_IN(set_segment)
PKVM_HC_OUT(get_segment)
PKVM_HC_OUT(get_segment_base)
PKVM_HC_IN(set_idt)
PKVM_HC_OUT(get_idt)
PKVM_HC_IN(set_gdt)
PKVM_HC_OUT(get_gdt)
PKVM_HC(flush_tlb_all)
PKVM_HC(flush_tlb_current)
PKVM_HC(flush_tlb_gva)
PKVM_HC(flush_tlb_guest)
PKVM_HC(set_interrupt_shadow)
PKVM_HC_OUT(get_interrupt_shadow)
PKVM_HC(enable_nmi_window)
PKVM_HC(enable_irq_window)
PKVM_HC(interrupt_allowed)
PKVM_HC(nmi_allowed)
PKVM_HC_OUT(get_nmi_mask)
PKVM_HC(set_nmi_mask)
PKVM_HC(inject_irq)
PKVM_HC(inject_nmi)
PKVM_HC(inject_exception)
PKVM_HC(cancel_injection)
PKVM_HC(update_cr8_intercept)
PKVM_HC(set_virtual_apic_mode)
PKVM_HC(refresh_apicv_exec_ctrl)
PKVM_HC(load_eoi_exitmap)
PKVM_HC(hwapic_isr_update)
PKVM_HC(sync_pir_to_irr)
PKVM_HC_OUT(vcpu_after_set_cpuid)
PKVM_HC_OUT(vcpu_add_fpstate)
PKVM_HC(write_tsc_offset)
PKVM_HC(write_tsc_multiplier)
PKVM_HC(load_mmu_pgd)
PKVM_HC(setup_mce)

#undef PKVM_HC
#undef PKVM_HC_OUT
#undef PKVM_HC_IN
1 change: 1 addition & 0 deletions arch/x86/include/asm/pkvm_image_vars.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PKVM_ALIAS(__trace_bprintk);
PKVM_ALIAS(__dynamic_pr_debug);
PKVM_ALIAS(mem_dump_obj);
PKVM_ALIAS(vmalloc_base);
PKVM_ALIAS(get_cpu_entry_area);
#endif

#endif /* _ASM_x86_PKVM_IMAGE_VARS_H */
Loading