arch/powerpc/include/asm/kvm_ppc.h
Source file repositories/reference/linux-study-clean/arch/powerpc/include/asm/kvm_ppc.h
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/include/asm/kvm_ppc.h- Extension
.h- Size
- 38535 bytes
- Lines
- 1119
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mutex.hlinux/timer.hlinux/types.hlinux/kvm_types.hlinux/kvm_host.hlinux/bug.hasm/kvm_book3s.hasm/kvm_booke.hasm/paca.hasm/xive.hasm/cpu_has_feature.hasm/inst.h
Detected Declarations
struct kvmppc_opsstruct openpicstruct kvmppc_host_rm_corestruct kvmppc_host_rm_opsenum emulation_resultenum instruction_fetch_typeenum xlate_instdataenum xlate_readwritefunction kvmppc_get_last_instfunction is_kvmppc_hv_enabledfunction kvmppc_get_fieldfunction kvmppc_set_fieldfunction kvmppc_set_xics_physfunction kvmppc_set_xive_timafunction kvmppc_get_xics_latchfunction CPUfunction kvmppc_clear_host_ipifunction kvmppc_fast_vcpu_kickfunction kvm_cma_reservefunction kvmppc_set_host_ipifunction kvm_hv_mode_activefunction kvmhv_on_pseriesfunction kvmhv_on_pseriesfunction kvmhv_is_nestedv2function kvmhv_is_nestedv1function kvmhv_nestedv2_reload_ptregsfunction kvmhv_nestedv2_mark_dirty_ptregsfunction kvmhv_nestedv2_mark_dirtyfunction kvmhv_nestedv2_cached_reloadfunction kvmppc_xics_enabledfunction kvmppc_alloc_host_rm_opsfunction kvmppc_xics_enabledfunction kvmppc_xics_free_icpfunction kvmppc_xive_xics_hcallfunction kvmppc_xive_enabledfunction kvmppc_xive_set_xivefunction kvmppc_xive_get_xivefunction kvmppc_xive_int_onfunction kvmppc_xive_int_offfunction kvmppc_xive_connect_vcpufunction kvmppc_xive_cleanup_vcpufunction kvmppc_xive_clr_mappedfunction kvmppc_xive_get_icpfunction kvmppc_xive_set_icpfunction kvmppc_xive_set_irqfunction kvmppc_xive_push_vcpufunction kvmppc_xive_enabledfunction kvmppc_xive_native_connect_vcpu
Annotated Snippet
struct kvmppc_ops {
struct module *owner;
int (*get_sregs)(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
int (*set_sregs)(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs);
int (*get_one_reg)(struct kvm_vcpu *vcpu, u64 id,
union kvmppc_one_reg *val);
int (*set_one_reg)(struct kvm_vcpu *vcpu, u64 id,
union kvmppc_one_reg *val);
void (*vcpu_load)(struct kvm_vcpu *vcpu, int cpu);
void (*vcpu_put)(struct kvm_vcpu *vcpu);
void (*inject_interrupt)(struct kvm_vcpu *vcpu, int vec, u64 srr1_flags);
void (*set_msr)(struct kvm_vcpu *vcpu, u64 msr);
int (*vcpu_run)(struct kvm_vcpu *vcpu);
int (*vcpu_create)(struct kvm_vcpu *vcpu);
void (*vcpu_free)(struct kvm_vcpu *vcpu);
int (*check_requests)(struct kvm_vcpu *vcpu);
int (*get_dirty_log)(struct kvm *kvm, struct kvm_dirty_log *log);
void (*flush_memslot)(struct kvm *kvm, struct kvm_memory_slot *memslot);
int (*prepare_memory_region)(struct kvm *kvm,
const struct kvm_memory_slot *old,
struct kvm_memory_slot *new,
enum kvm_mr_change change);
void (*commit_memory_region)(struct kvm *kvm,
struct kvm_memory_slot *old,
const struct kvm_memory_slot *new,
enum kvm_mr_change change);
bool (*unmap_gfn_range)(struct kvm *kvm, struct kvm_gfn_range *range);
bool (*age_gfn)(struct kvm *kvm, struct kvm_gfn_range *range);
bool (*test_age_gfn)(struct kvm *kvm, struct kvm_gfn_range *range);
void (*free_memslot)(struct kvm_memory_slot *slot);
int (*init_vm)(struct kvm *kvm);
void (*destroy_vm)(struct kvm *kvm);
int (*get_smmu_info)(struct kvm *kvm, struct kvm_ppc_smmu_info *info);
int (*emulate_op)(struct kvm_vcpu *vcpu,
unsigned int inst, int *advance);
int (*emulate_mtspr)(struct kvm_vcpu *vcpu, int sprn, ulong spr_val);
int (*emulate_mfspr)(struct kvm_vcpu *vcpu, int sprn, ulong *spr_val);
void (*fast_vcpu_kick)(struct kvm_vcpu *vcpu);
int (*arch_vm_ioctl)(struct file *filp, unsigned int ioctl,
unsigned long arg);
int (*hcall_implemented)(unsigned long hcall);
int (*irq_bypass_add_producer)(struct irq_bypass_consumer *,
struct irq_bypass_producer *);
void (*irq_bypass_del_producer)(struct irq_bypass_consumer *,
struct irq_bypass_producer *);
int (*configure_mmu)(struct kvm *kvm, struct kvm_ppc_mmuv3_cfg *cfg);
int (*get_rmmu_info)(struct kvm *kvm, struct kvm_ppc_rmmu_info *info);
int (*set_smt_mode)(struct kvm *kvm, unsigned long mode,
unsigned long flags);
void (*giveup_ext)(struct kvm_vcpu *vcpu, ulong msr);
int (*enable_nested)(struct kvm *kvm);
int (*load_from_eaddr)(struct kvm_vcpu *vcpu, ulong *eaddr, void *ptr,
int size);
int (*store_to_eaddr)(struct kvm_vcpu *vcpu, ulong *eaddr, void *ptr,
int size);
int (*enable_svm)(struct kvm *kvm);
int (*svm_off)(struct kvm *kvm);
int (*enable_dawr1)(struct kvm *kvm);
bool (*hash_v3_possible)(void);
int (*create_vm_debugfs)(struct kvm *kvm);
int (*create_vcpu_debugfs)(struct kvm_vcpu *vcpu, struct dentry *debugfs_dentry);
};
extern struct kvmppc_ops *kvmppc_hv_ops;
extern struct kvmppc_ops *kvmppc_pr_ops;
static inline int kvmppc_get_last_inst(struct kvm_vcpu *vcpu,
enum instruction_fetch_type type, ppc_inst_t *inst)
{
int ret = EMULATE_DONE;
u32 fetched_inst;
/* Load the instruction manually if it failed to do so in the
* exit path */
if (vcpu->arch.last_inst == KVM_INST_FETCH_FAILED)
ret = kvmppc_load_last_inst(vcpu, type, &vcpu->arch.last_inst);
/* Write fetch_failed unswapped if the fetch failed */
if (ret != EMULATE_DONE) {
*inst = ppc_inst(KVM_INST_FETCH_FAILED);
return ret;
}
#ifdef CONFIG_PPC64
/* Is this a prefixed instruction? */
if ((vcpu->arch.last_inst >> 32) != 0) {
u32 prefix = vcpu->arch.last_inst >> 32;
u32 suffix = vcpu->arch.last_inst;
if (kvmppc_need_byteswap(vcpu)) {
prefix = swab32(prefix);
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/timer.h`, `linux/types.h`, `linux/kvm_types.h`, `linux/kvm_host.h`, `linux/bug.h`, `asm/kvm_book3s.h`, `asm/kvm_booke.h`.
- Detected declarations: `struct kvmppc_ops`, `struct openpic`, `struct kvmppc_host_rm_core`, `struct kvmppc_host_rm_ops`, `enum emulation_result`, `enum instruction_fetch_type`, `enum xlate_instdata`, `enum xlate_readwrite`, `function kvmppc_get_last_inst`, `function is_kvmppc_hv_enabled`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.