mirror of
https://github.com/torvalds/linux.git
synced 2026-09-26 10:02:02 +02:00
KVM: x86: Move MSR helper declarations from kvm_host.h => msrs.h
Relocate declarations of MSR helpers (and kvm_nr_uret_msrs) from x86's kvm_host.h to msrs, to continue trimming down kvm_host.h. Deliberately leave the funky read_msr() where it is, as it will hopefully be removed entirely as part of a broader kernel-API cleanup. No functional change intended. Reviewed-by: Kai Huang <kai.huang@intel.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com> Message-ID: <20260613000329.732085-18-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
dd164f5ce8
commit
159a51a038
|
|
@ -2093,7 +2093,6 @@ struct kvm_arch_async_pf {
|
|||
u64 error_code;
|
||||
};
|
||||
|
||||
extern u32 __read_mostly kvm_nr_uret_msrs;
|
||||
extern bool __read_mostly allow_smaller_maxphyaddr;
|
||||
extern bool __read_mostly enable_apicv;
|
||||
extern bool __read_mostly enable_ipiv;
|
||||
|
|
@ -2277,18 +2276,6 @@ void kvm_prepare_emulation_failure_exit(struct kvm_vcpu *vcpu);
|
|||
void kvm_prepare_event_vectoring_exit(struct kvm_vcpu *vcpu, gpa_t gpa);
|
||||
void kvm_prepare_unexpected_reason_exit(struct kvm_vcpu *vcpu, u64 exit_reason);
|
||||
|
||||
void kvm_enable_efer_bits(u64);
|
||||
bool kvm_valid_efer(struct kvm_vcpu *vcpu, u64 efer);
|
||||
int kvm_emulate_msr_read(struct kvm_vcpu *vcpu, u32 index, u64 *data);
|
||||
int kvm_emulate_msr_write(struct kvm_vcpu *vcpu, u32 index, u64 data);
|
||||
int __kvm_emulate_msr_read(struct kvm_vcpu *vcpu, u32 index, u64 *data);
|
||||
int __kvm_emulate_msr_write(struct kvm_vcpu *vcpu, u32 index, u64 data);
|
||||
int kvm_msr_read(struct kvm_vcpu *vcpu, u32 index, u64 *data);
|
||||
int kvm_msr_write(struct kvm_vcpu *vcpu, u32 index, u64 data);
|
||||
int kvm_emulate_rdmsr(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_rdmsr_imm(struct kvm_vcpu *vcpu, u32 msr, int reg);
|
||||
int kvm_emulate_wrmsr(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_wrmsr_imm(struct kvm_vcpu *vcpu, u32 msr, int reg);
|
||||
int kvm_emulate_as_nop(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_invd(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_mwait(struct kvm_vcpu *vcpu);
|
||||
|
|
@ -2310,9 +2297,6 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int idt_index,
|
|||
int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr);
|
||||
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);
|
||||
|
||||
int kvm_emulate_rdpmc(struct kvm_vcpu *vcpu);
|
||||
|
||||
void kvm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr);
|
||||
|
|
@ -2487,16 +2471,6 @@ int kvm_pv_send_ipi(struct kvm *kvm, unsigned long ipi_bitmap_low,
|
|||
unsigned long ipi_bitmap_high, u32 min,
|
||||
unsigned long icr, int op_64_bit);
|
||||
|
||||
int kvm_add_user_return_msr(u32 msr);
|
||||
int kvm_find_user_return_msr(u32 msr);
|
||||
int kvm_set_user_return_msr(unsigned index, u64 val, u64 mask);
|
||||
u64 kvm_get_user_return_msr(unsigned int slot);
|
||||
|
||||
static inline bool kvm_is_supported_user_return_msr(u32 msr)
|
||||
{
|
||||
return kvm_find_user_return_msr(msr) >= 0;
|
||||
}
|
||||
|
||||
u64 kvm_scale_tsc(u64 tsc, u64 ratio);
|
||||
u64 kvm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc);
|
||||
u64 kvm_calc_nested_tsc_offset(u64 l1_offset, u64 l2_offset, u64 l2_multiplier);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
extern bool report_ignored_msrs;
|
||||
extern bool ignore_msrs;
|
||||
|
||||
extern u32 __read_mostly kvm_nr_uret_msrs;
|
||||
|
||||
static inline void kvm_pr_unimpl_wrmsr(struct kvm_vcpu *vcpu, u32 msr, u64 data)
|
||||
{
|
||||
if (report_ignored_msrs)
|
||||
|
|
@ -56,13 +58,39 @@ int kvm_get_set_one_reg(struct kvm_vcpu *vcpu, unsigned int ioctl,
|
|||
int kvm_get_reg_list(struct kvm_vcpu *vcpu,
|
||||
struct kvm_reg_list __user *user_list);
|
||||
|
||||
void kvm_user_return_msr_cpu_online(void);
|
||||
void drop_user_return_notifiers(void);
|
||||
void kvm_destroy_user_return_msrs(void);
|
||||
void kvm_enable_efer_bits(u64);
|
||||
bool kvm_valid_efer(struct kvm_vcpu *vcpu, u64 efer);
|
||||
int kvm_emulate_msr_read(struct kvm_vcpu *vcpu, u32 index, u64 *data);
|
||||
int kvm_emulate_msr_write(struct kvm_vcpu *vcpu, u32 index, u64 data);
|
||||
int __kvm_emulate_msr_read(struct kvm_vcpu *vcpu, u32 index, u64 *data);
|
||||
int __kvm_emulate_msr_write(struct kvm_vcpu *vcpu, u32 index, u64 data);
|
||||
int kvm_msr_read(struct kvm_vcpu *vcpu, u32 index, u64 *data);
|
||||
int kvm_msr_write(struct kvm_vcpu *vcpu, u32 index, u64 data);
|
||||
int kvm_emulate_rdmsr(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_rdmsr_imm(struct kvm_vcpu *vcpu, u32 msr, int reg);
|
||||
int kvm_emulate_wrmsr(struct kvm_vcpu *vcpu);
|
||||
int kvm_emulate_wrmsr_imm(struct kvm_vcpu *vcpu, u32 msr, int reg);
|
||||
|
||||
fastpath_t handle_fastpath_wrmsr(struct kvm_vcpu *vcpu);
|
||||
fastpath_t handle_fastpath_wrmsr_imm(struct kvm_vcpu *vcpu, u32 msr, int reg);
|
||||
|
||||
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);
|
||||
|
||||
int kvm_add_user_return_msr(u32 msr);
|
||||
int kvm_find_user_return_msr(u32 msr);
|
||||
int kvm_set_user_return_msr(unsigned index, u64 val, u64 mask);
|
||||
u64 kvm_get_user_return_msr(unsigned int slot);
|
||||
|
||||
static inline bool kvm_is_supported_user_return_msr(u32 msr)
|
||||
{
|
||||
return kvm_find_user_return_msr(msr) >= 0;
|
||||
}
|
||||
|
||||
void kvm_user_return_msr_cpu_online(void);
|
||||
void drop_user_return_notifiers(void);
|
||||
void kvm_destroy_user_return_msrs(void);
|
||||
|
||||
int kvm_emulator_get_msr_with_filter(struct kvm_vcpu *vcpu, u32 msr_index,
|
||||
u64 *pdata);
|
||||
int kvm_emulator_set_msr_with_filter(struct kvm_vcpu *vcpu, u32 msr_index,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user