#ifndef _ASM_X86_PARAVIRT_TYPES_H
#define _ASM_X86_PARAVIRT_TYPES_H
#ifdef CONFIG_PARAVIRT
#ifndef __ASSEMBLY__
#include <linux/types.h>
#include <asm/desc_defs.h>
#include <asm/pgtable_types.h>
#include <asm/nospec-branch.h>
struct page;
struct thread_struct;
struct desc_ptr;
struct tss_struct;
struct mm_struct;
struct desc_struct;
struct task_struct;
struct cpumask;
struct flush_tlb_info;
struct mmu_gather;
struct vm_area_struct;
struct paravirt_callee_save {
void *func;
};
struct pv_info {
#ifdef CONFIG_PARAVIRT_XXL
u16 extra_user_64bit_cs;
#endif
const char *name;
};
#ifdef CONFIG_PARAVIRT_XXL
struct pv_lazy_ops {
void (*enter)(void);
void (*leave)(void);
void (*flush)(void);
} __no_randomize_layout;
#endif
struct pv_cpu_ops {
void (*io_delay)(void);
#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);
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
void (*wbinvd)(void);
void (*cpuid)(unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx);
u64 (*read_msr)(unsigned int msr);
void (*write_msr)(unsigned int msr, unsigned low, unsigned high);
u64 (*read_msr_safe)(unsigned int msr, int *err);
int (*write_msr_safe)(unsigned int msr, unsigned low, unsigned high);
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
struct paravirt_callee_save save_fl;
struct paravirt_callee_save irq_disable;
struct paravirt_callee_save irq_enable;
void (*safe_halt)(void);
void (*halt)(void);
#endif
} __no_randomize_layout;
struct pv_mmu_ops {
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);
void (*tlb_remove_table)(struct mmu_gather *tlb, void *table);
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);
unsigned long (*read_cr3)(void);
void (*write_cr3)(unsigned long);
void (*enter_mmap)(struct mm_struct *mm);
int (*pgd_alloc)(struct mm_struct *mm);
void (*pgd_free)(struct mm_struct *mm, pgd_t *pgd);
void (*alloc_pte)(struct mm_struct *mm, unsigned long pfn);
void (*alloc_pmd)(struct mm_struct *mm, unsigned long pfn);
void (*alloc_pud)(struct mm_struct *mm, unsigned long pfn);
void (*alloc_p4d)(struct mm_struct *mm, unsigned long pfn);
void (*release_pte)(unsigned long pfn);
void (*release_pmd)(unsigned long pfn);
void (*release_pud)(unsigned long pfn);
void (*release_p4d)(unsigned long pfn);
void (*set_pte)(pte_t *ptep, pte_t pteval);
void (*set_pmd)(pmd_t *pmdp, pmd_t pmdval);
pte_t (*ptep_modify_prot_start)(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep);
void (*ptep_modify_prot_commit)(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep, pte_t pte);
struct paravirt_callee_save pte_val;
struct paravirt_callee_save make_pte;
struct paravirt_callee_save pgd_val;
struct paravirt_callee_save make_pgd;
void (*set_pud)(pud_t *pudp, pud_t pudval);
struct paravirt_callee_save pmd_val;
struct paravirt_callee_save make_pmd;
struct paravirt_callee_save pud_val;
struct paravirt_callee_save make_pud;
void (*set_p4d)(p4d_t *p4dp, p4d_t p4dval);
#if CONFIG_PGTABLE_LEVELS >= 5
struct paravirt_callee_save p4d_val;
struct paravirt_callee_save make_p4d;
void (*set_pgd)(pgd_t *pgdp, pgd_t pgdval);
#endif
struct pv_lazy_ops lazy_mode;
void (*set_fixmap)(unsigned idx,
phys_addr_t phys, pgprot_t flags);
#endif
} __no_randomize_layout;
struct arch_spinlock;
#ifdef CONFIG_SMP
#include <asm/spinlock_types.h>
#endif
struct qspinlock;
struct pv_lock_ops {
void (*queued_spin_lock_slowpath)(struct qspinlock *lock, u32 val);
struct paravirt_callee_save queued_spin_unlock;
void (*wait)(u8 *ptr, u8 val);
void (*kick)(int cpu);
struct paravirt_callee_save vcpu_is_preempted;
} __no_randomize_layout;
struct paravirt_patch_template {
struct pv_cpu_ops cpu;
struct pv_irq_ops irq;
struct pv_mmu_ops mmu;
struct pv_lock_ops lock;
} __no_randomize_layout;
extern struct pv_info pv_info;
extern struct paravirt_patch_template pv_ops;
#define paravirt_ptr …
int paravirt_disable_iospace(void);
#define PARAVIRT_CALL …
#ifdef CONFIG_X86_32
#define PVOP_CALL_ARGS …
#define PVOP_CALL_ARG1 …
#define PVOP_CALL_ARG2 …
#define PVOP_CALL_ARG3 …
#define PVOP_VCALL_CLOBBERS …
#define PVOP_CALL_CLOBBERS …
#define PVOP_VCALLEE_CLOBBERS …
#define PVOP_CALLEE_CLOBBERS …
#define EXTRA_CLOBBERS
#define VEXTRA_CLOBBERS
#else
#define PVOP_CALL_ARGS …
#define PVOP_CALL_ARG1 …
#define PVOP_CALL_ARG2 …
#define PVOP_CALL_ARG3 …
#define PVOP_CALL_ARG4 …
#define PVOP_VCALL_CLOBBERS …
#define PVOP_CALL_CLOBBERS …
#ifdef CONFIG_ZERO_CALL_USED_REGS
#define PVOP_VCALLEE_CLOBBERS …
#else
#define PVOP_VCALLEE_CLOBBERS …
#endif
#define PVOP_CALLEE_CLOBBERS …
#define EXTRA_CLOBBERS …
#define VEXTRA_CLOBBERS …
#endif
#ifdef CONFIG_PARAVIRT_DEBUG
#define PVOP_TEST_NULL …
#else
#define PVOP_TEST_NULL …
#endif
#define PVOP_RETVAL …
#define ____PVOP_CALL …
#define ____PVOP_ALT_CALL …
#define __PVOP_CALL …
#define __PVOP_ALT_CALL …
#define __PVOP_CALLEESAVE …
#define __PVOP_ALT_CALLEESAVE …
#define __PVOP_VCALL …
#define __PVOP_ALT_VCALL …
#define __PVOP_VCALLEESAVE …
#define __PVOP_ALT_VCALLEESAVE …
#define PVOP_CALL0 …
#define PVOP_VCALL0 …
#define PVOP_ALT_CALL0 …
#define PVOP_ALT_VCALL0 …
#define PVOP_CALLEE0 …
#define PVOP_VCALLEE0 …
#define PVOP_ALT_CALLEE0 …
#define PVOP_ALT_VCALLEE0 …
#define PVOP_CALL1 …
#define PVOP_VCALL1 …
#define PVOP_ALT_VCALL1 …
#define PVOP_CALLEE1 …
#define PVOP_VCALLEE1 …
#define PVOP_ALT_CALLEE1 …
#define PVOP_ALT_VCALLEE1 …
#define PVOP_CALL2 …
#define PVOP_VCALL2 …
#define PVOP_CALL3 …
#define PVOP_VCALL3 …
#define PVOP_CALL4 …
#define PVOP_VCALL4 …
unsigned long paravirt_ret0(void);
#ifdef CONFIG_PARAVIRT_XXL
u64 _paravirt_ident_64(u64);
unsigned long pv_native_save_fl(void);
void pv_native_irq_disable(void);
void pv_native_irq_enable(void);
unsigned long pv_native_read_cr2(void);
#endif
#define paravirt_nop …
#endif
#define ALT_NOT_XEN …
#endif
#endif