arch/x86/include/asm/paravirt_types.h
Source file repositories/reference/linux-study-clean/arch/x86/include/asm/paravirt_types.h
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/include/asm/paravirt_types.h- Extension
.h- Size
- 18998 bytes
- Lines
- 529
- Domain
- Architecture Layer
- Bucket
- arch/x86
- 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/types.hasm/paravirt-base.hasm/desc_defs.hasm/pgtable_types.hasm/nospec-branch.h
Detected Declarations
struct thread_structstruct mm_structstruct task_structstruct cpumaskstruct flush_tlb_infostruct vm_area_structstruct pv_cpu_opsstruct pv_irq_opsstruct pv_mmu_opsstruct paravirt_patch_template
Annotated Snippet
struct pv_cpu_ops {
/* hooks for various privileged instructions */
#ifdef CONFIG_PARAVIRT_XXL
unsigned long (*get_debugreg)(int regno);
void (*set_debugreg)(int regno, unsigned long value);
unsigned long (*read_cr0)(void);
void (*write_cr0)(unsigned long);
void (*write_cr4)(unsigned long);
/* Segment descriptor handling */
void (*load_tr_desc)(void);
void (*load_gdt)(const struct desc_ptr *);
void (*load_idt)(const struct desc_ptr *);
void (*set_ldt)(const void *desc, unsigned entries);
unsigned long (*store_tr)(void);
void (*load_tls)(struct thread_struct *t, unsigned int cpu);
void (*load_gs_index)(unsigned int idx);
void (*write_ldt_entry)(struct desc_struct *ldt, int entrynum,
const void *desc);
void (*write_gdt_entry)(struct desc_struct *,
int entrynum, const void *desc, int size);
void (*write_idt_entry)(gate_desc *,
int entrynum, const gate_desc *gate);
void (*alloc_ldt)(struct desc_struct *ldt, unsigned entries);
void (*free_ldt)(struct desc_struct *ldt, unsigned entries);
void (*load_sp0)(unsigned long sp0);
#ifdef CONFIG_X86_IOPL_IOPERM
void (*invalidate_io_bitmap)(void);
void (*update_io_bitmap)(void);
#endif
/* cpuid emulation, mostly so that caps bits can be disabled */
void (*cpuid)(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx);
/* Unsafe MSR operations. These will warn or panic on failure. */
u64 (*read_msr)(u32 msr);
void (*write_msr)(u32 msr, u64 val);
/*
* Safe MSR operations.
* Returns 0 or -EIO.
*/
int (*read_msr_safe)(u32 msr, u64 *val);
int (*write_msr_safe)(u32 msr, u64 val);
u64 (*read_pmc)(int counter);
void (*start_context_switch)(struct task_struct *prev);
void (*end_context_switch)(struct task_struct *next);
#endif
} __no_randomize_layout;
struct pv_irq_ops {
#ifdef CONFIG_PARAVIRT_XXL
/*
* Get/set interrupt state. save_fl is expected to use X86_EFLAGS_IF;
* all other bits returned from save_fl are undefined.
*
* NOTE: These functions callers expect the callee to preserve
* more registers than the standard C calling convention.
*/
struct paravirt_callee_save save_fl;
struct paravirt_callee_save irq_disable;
struct paravirt_callee_save irq_enable;
#endif
void (*safe_halt)(void);
void (*halt)(void);
} __no_randomize_layout;
struct pv_mmu_ops {
/* TLB operations */
void (*flush_tlb_user)(void);
void (*flush_tlb_kernel)(void);
void (*flush_tlb_one_user)(unsigned long addr);
void (*flush_tlb_multi)(const struct cpumask *cpus,
const struct flush_tlb_info *info);
/* Hook for intercepting the destruction of an mm_struct. */
void (*exit_mmap)(struct mm_struct *mm);
void (*notify_page_enc_status_changed)(unsigned long pfn, int npages, bool enc);
#ifdef CONFIG_PARAVIRT_XXL
struct paravirt_callee_save read_cr2;
void (*write_cr2)(unsigned long);
Annotation
- Immediate include surface: `linux/types.h`, `asm/paravirt-base.h`, `asm/desc_defs.h`, `asm/pgtable_types.h`, `asm/nospec-branch.h`.
- Detected declarations: `struct thread_struct`, `struct mm_struct`, `struct task_struct`, `struct cpumask`, `struct flush_tlb_info`, `struct vm_area_struct`, `struct pv_cpu_ops`, `struct pv_irq_ops`, `struct pv_mmu_ops`, `struct paravirt_patch_template`.
- Atlas domain: Architecture Layer / arch/x86.
- 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.