Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/xen/enlighten.c
void __init xen_banner(void) { unsigned version = HYPERVISOR_xen_version(XENVER_version, NULL); struct xen_extraversion extra; HYPERVISOR_xen_version(XENVER_extraversion, &extra); pr_info("Booting kernel on %s\n", pv_info.name); pr_info("Xen version: %u.%u%s%s\n", version >> 16, version & 0xffff, ...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten.c
void __init xen_add_preferred_consoles(void) { add_preferred_console("xenboot", 0, NULL); if (!boot_params.screen_info.orig_video_isVGA) add_preferred_console("tty", 0, NULL); add_preferred_console("hvc", 0, NULL); if (boot_params.screen_info.orig_video_isVGA) add_preferred_console("tty", 0, NULL); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten.c
void xen_reboot(int reason) { struct sched_shutdown r = {.reason = reason}; int cpu; for_each_online_cpu(cpu) xen_pmu_finish(cpu); if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) BUG(); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten.c
void xen_emergency_restart(void) { xen_reboot(reboot_reason); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten.c
static int xen_panic_event(struct notifier_block *this, unsigned long event, void *ptr) { if (!kexec_crash_loaded()) { if (xen_legacy_crash) xen_reboot(SHUTDOWN_crash); reboot_reason = SHUTDOWN_crash; if (panic_timeout == 0) panic_timeout = -1; } return NOTIFY_...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_hvm.c
void xen_hvm_init_shared_info(void) { struct xen_add_to_physmap xatp; xatp.domid = DOMID_SELF; xatp.idx = 0; xatp.space = XENMAPSPACE_shared_info; xatp.gpfn = shared_info_pfn; if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp)) BUG(); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_hvm.c
static bool __init msi_ext_dest_id(void) { return cpuid_eax(xen_cpuid_base() + 4) & XEN_HVM_CPUID_EXT_DEST_ID; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_hvm.c
static __init void xen_hvm_guest_late_init(void) { #ifdef CONFIG_XEN_PVH if (!xen_pvh && (x86_platform.legacy.rtc || !x86_platform.legacy.no_vga)) return; /* PVH detected. */ xen_pvh = true; if (nopv) panic("\"nopv\" and \"xen_nopv\" parameters are unsupported in PVH guest."); /* Make sure we don'...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static bool __init xen_check_xsave(void) { unsigned int cx, xsave_mask; cx = cpuid_ecx(1); xsave_mask = (1 << (X86_FEATURE_XSAVE % 32)) | (1 << (X86_FEATURE_OSXSAVE % 32)); return (cx & xsave_mask) == xsave_mask; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_end_context_switch(struct task_struct *next) { xen_mc_flush(); paravirt_end_context_switch(next); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_free_ldt(struct desc_struct *ldt, unsigned entries) { const unsigned entries_per_page = PAGE_SIZE / LDT_ENTRY_SIZE; int i; for (i = 0; i < entries; i += entries_per_page) set_aliased_prot(ldt + i, PAGE_KERNEL); }
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_set_ldt(const void *addr, unsigned entries) { struct mmuext_op *op; struct multicall_space mcs = xen_mc_entry(sizeof(*op)); trace_xen_cpu_set_ldt(addr, entries); op = mcs.args; op->cmd = MMUEXT_SET_LDT; op->arg1.linear_addr = (unsigned long)addr; op->arg2.nr_ents = entries; MULTI_mmu...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_load_gdt(const struct desc_ptr *dtr) { unsigned long va = dtr->address; unsigned int size = dtr->size + 1; unsigned long pfn, mfn; int level; pte_t *ptep; void *virt; BUG_ON(size > PAGE_SIZE); BUG_ON(va & ~PAGE_MASK); /* * The GDT is per-cpu and is in the percpu data area. * Th...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static inline bool desc_equal(const struct desc_struct *d1, const struct desc_struct *d2) { return !memcmp(d1, d2, sizeof(*d1)); }
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum, const void *ptr) { xmaddr_t mach_lp = arbitrary_virt_to_machine(&dt[entrynum]); u64 entry = *(u64 *)ptr; trace_xen_cpu_write_ldt_entry(dt, entrynum, entry); preempt_disable(); xen_mc_flush(); if (HYPERV...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static bool __ref get_trap_addr(void **addr, unsigned int ist) { unsigned int nr; bool ist_okay = false; bool found = false; for (nr = 0; nr < ARRAY_SIZE(trap_array); nr++) { struct trap_array_entry *entry = trap_array + nr; if (*addr == entry->orig) { *addr = entry->xen; ist_okay = entry-...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_load_idt(const struct desc_ptr *desc) { static DEFINE_SPINLOCK(lock); static struct trap_info traps[257]; static const struct trap_info zero = {}; unsigned out; trace_xen_cpu_load_idt(desc); spin_lock(&lock); memcpy(this_cpu_ptr(&idt_desc), desc, sizeof(idt_desc)); out = xen_convert_...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void __init xen_write_gdt_entry_boot(struct desc_struct *dt, int entry, const void *desc, int type) { trace_xen_cpu_write_gdt_entry(dt, entry, desc, type); switch (type) { case DESC_LDT: case DESC_TSS: break; default: { xmaddr_t maddr = virt_to_mac...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_load_sp0(unsigned long sp0) { struct multicall_space mcs; mcs = xen_mc_entry(0); MULTI_stack_switch(mcs.mc, __KERNEL_DS, sp0); xen_mc_issue(PARAVIRT_LAZY_CPU); this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0); } #ifdef CONFIG_X86_IOPL_IOPERM
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_invalidate_io_bitmap(void) { struct physdev_set_iobitmap iobitmap = { .bitmap = NULL, .nr_ports = 0, }; native_tss_invalidate_io_bitmap(); HYPERVISOR_physdev_op(PHYSDEVOP_set_iobitmap, &iobitmap); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_update_io_bitmap(void) { struct physdev_set_iobitmap iobitmap; struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw); native_tss_update_io_bitmap(); iobitmap.bitmap = (uint8_t *)(&tss->x86_tss) + tss->x86_tss.io_bitmap_base; if (tss->x86_tss.io_bitmap_base == IO_BITMAP_OFFSET_INVALID) iobi...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static u64 xen_do_read_msr(unsigned int msr, int *err) { u64 val = 0; if (pmu_msr_read(msr, &val, err)) return val; if (err) val = native_read_msr_safe(msr, err); else val = native_read_msr(msr); switch (msr) { case MSR_IA32_APICBASE: val &= ~X2APIC_ENABLE; break; } return val; }
[ 1, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static u64 xen_read_msr_safe(unsigned int msr, int *err) { return xen_do_read_msr(msr, err); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static int xen_write_msr_safe(unsigned int msr, unsigned int low, unsigned int high) { int err = 0; xen_do_write_msr(msr, low, high, &err); return err; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
void __init xen_setup_vcpu_info_placement(void) { int cpu; for_each_possible_cpu(cpu) { per_cpu(xen_vcpu_id, cpu) = cpu; xen_vcpu_setup(cpu); } pv_ops.irq.save_fl = __PV_IS_CALLEE_SAVE(xen_save_fl_direct); pv_ops.irq.irq_disable = __PV_IS_CALLEE_SAVE(xen_irq_disable_direct); pv_ops.irq.irq_enable...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_restart(char *msg) { xen_reboot(SHUTDOWN_reboot); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static void xen_crash_shutdown(struct pt_regs *regs) { xen_reboot(SHUTDOWN_crash); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pv.c
static int xen_cpu_dead_pv(unsigned int cpu) { xen_smp_intr_free(cpu); xen_smp_intr_free_pv(cpu); xen_teardown_timer(cpu); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/enlighten_pvh.c
void __init mem_map_via_hcall(struct boot_params *boot_params_p) { struct xen_memory_map memmap; int rc; memmap.nr_entries = ARRAY_SIZE(boot_params_p->e820_table); set_xen_guest_handle(memmap.buffer, boot_params_p->e820_table); rc = HYPERVISOR_memory_op(XENMEM_memory_map, &memmap); if (rc) { xen_raw_p...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/grant-table.c
int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, unsigned long max_nr_gframes, void **__shared) { void *shared = *__shared; unsigned long addr; unsigned long i; if (shared == NULL) *__shared = shared = gnttab_shared_vm_area.area->addr; addr = (unsig...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/grant-table.c
static void arch_gnttab_vfree(struct gnttab_vm_area *area) { free_vm_area(area->area); kfree(area->ptes); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/grant-table.c
int arch_gnttab_init(unsigned long nr_shared, unsigned long nr_status) { int ret; if (!xen_pv_domain()) return 0; ret = arch_gnttab_valloc(&gnttab_shared_vm_area, nr_shared); if (ret < 0) return ret; ret = arch_gnttab_valloc(&gnttab_status_vm_area, nr_status); if (ret < 0) goto err; return...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/grant-table.c
static int __init xen_pvh_gnttab_setup(void) { if (!xen_pvh_domain()) return -ENODEV; xen_auto_xlat_grant_frames.count = gnttab_max_grant_frames(); return xen_xlate_map_ballooned_pages(&xen_auto_xlat_grant_frames.pfn, &xen_auto_xlat_grant_frames.vaddr, ...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/irq.c
noinstr void xen_force_evtchn_callback(void) { (void)HYPERVISOR_xen_version(0, NULL); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_hvm.c
static int is_pagetable_dying_supported(void) { struct xen_hvm_pagetable_dying a; int rc = 0; a.domid = DOMID_SELF; a.gpa = 0x00; rc = HYPERVISOR_hvm_op(HVMOP_pagetable_dying, &a); if (rc < 0) { printk(KERN_DEBUG "HVMOP_pagetable_dying not supported\n"); return 0; } return 1; }
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static bool xen_page_pinned(void *ptr) { if (static_branch_likely(&xen_struct_pages_ready)) { struct page *page = virt_to_page(ptr); return PagePinned(page); } return true; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_set_pmd(pmd_t *ptr, pmd_t val) { trace_xen_mmu_set_pmd(ptr, val); if (!xen_page_pinned(ptr)) { *ptr = val; return; } xen_set_pmd_hyper(ptr, val); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static pteval_t pte_mfn_to_pfn(pteval_t val) { if (val & _PAGE_PRESENT) { unsigned long mfn = (val & XEN_PTE_MFN_MASK) >> PAGE_SHIFT; unsigned long pfn = mfn_to_pfn(mfn); pteval_t flags = val & PTE_FLAGS_MASK; if (unlikely(pfn == ~0)) val = flags & ~_PAGE_PRESENT; else val = ((pteval_...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static pteval_t pte_pfn_to_mfn(pteval_t val) { if (val & _PAGE_PRESENT) { unsigned long pfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; pteval_t flags = val & PTE_FLAGS_MASK; unsigned long mfn; mfn = __pfn_to_mfn(pfn); if (unlikely(mfn == INVALID_P2M_ENTRY)) { mfn = 0; flags = 0; } els...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
__visible pgdval_t xen_pgd_val(pgd_t pgd) { return pte_mfn_to_pfn(pgd.pgd); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
__visible pmdval_t xen_pmd_val(pmd_t pmd) { return pte_mfn_to_pfn(pmd.pmd); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_set_pud(pud_t *ptr, pud_t val) { trace_xen_mmu_set_pud(ptr, val); if (!xen_page_pinned(ptr)) { *ptr = val; return; } xen_set_pud_hyper(ptr, val); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static pgd_t *xen_get_user_pgd(pgd_t *pgd) { pgd_t *pgd_page = (pgd_t *)(((unsigned long)pgd) & PAGE_MASK); unsigned offset = pgd - pgd_page; pgd_t *user_ptr = NULL; if (offset < pgd_index(USER_LIMIT)) { struct page *page = virt_to_page(pgd_page); user_ptr = (pgd_t *)page->private; if (user_ptr) ...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init xen_set_p4d_hyper(p4d_t *ptr, p4d_t val) { preempt_disable(); xen_mc_batch(); __xen_set_p4d_hyper(ptr, val); xen_mc_issue(PARAVIRT_LAZY_MMU); preempt_enable(); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_pmd_walk(struct mm_struct *mm, pmd_t *pmd, void (*func)(struct mm_struct *mm, struct page *, enum pt_level), bool last, unsigned long limit) { int i, nr; nr = last ? pmd_index(limit) + 1 : PTRS_PER_PMD; for (...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_p4d_walk(struct mm_struct *mm, p4d_t *p4d, void (*func)(struct mm_struct *mm, struct page *, enum pt_level), bool last, unsigned long limit) { pud_t *pud; if (p4d_none(*p4d)) return; pud = pud_offset(p4d...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __xen_pgd_walk(struct mm_struct *mm, pgd_t *pgd, void (*func)(struct mm_struct *mm, struct page *, enum pt_level), unsigned long limit) { int i, nr; unsigned hole_low = 0, hole_high = 0; limit--; BUG_ON(li...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_pgd_walk(struct mm_struct *mm, void (*func)(struct mm_struct *mm, struct page *, enum pt_level), unsigned long limit) { __xen_pgd_walk(mm, mm->pgd, func, limit); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static spinlock_t *xen_pte_lock(struct page *page, struct mm_struct *mm) { spinlock_t *ptl = NULL; #if USE_SPLIT_PTE_PTLOCKS ptl = ptlock_ptr(page); spin_lock_nest_lock(ptl, &mm->page_table_lock); #endif return ptl; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init xen_after_bootmem(void) { static_branch_enable(&xen_struct_pages_ready); #ifdef CONFIG_X86_VSYSCALL_EMULATION SetPagePinned(virt_to_page(level3_user_vsyscall)); #endif xen_pgd_walk(&init_mm, xen_mark_pinned, FIXADDR_TOP); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_drop_mm_ref(struct mm_struct *mm) { drop_mm_ref_this_cpu(mm); } #endif
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init pin_pagetable_pfn(unsigned cmd, unsigned long pfn) { struct mmuext_op op; op.cmd = cmd; op.arg1.mfn = pfn_to_mfn(pfn); if (HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF)) BUG(); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init xen_cleanmfnmap_pmd(pmd_t *pmd, bool unpin) { unsigned long pa; pte_t *pte_tbl; int i; if (pmd_large(*pmd)) { pa = pmd_val(*pmd) & PHYSICAL_PAGE_MASK; xen_free_ro_pages(pa, PMD_SIZE); return; } pte_tbl = pte_offset_kernel(pmd, 0); for (i = 0; i < PTRS_PER_PTE; i++) { ...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static noinstr void xen_write_cr2(unsigned long cr2) { this_cpu_read(xen_vcpu)->arch.cr2 = cr2; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_flush_tlb_one_user(unsigned long addr) { struct mmuext_op *op; struct multicall_space mcs; trace_xen_mmu_flush_tlb_one_user(addr); preempt_disable(); mcs = xen_mc_entry(sizeof(*op)); op = mcs.args; op->cmd = MMUEXT_INVLPG_LOCAL; op->arg1.linear_addr = addr & PAGE_MASK; MULTI_mmuext...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_flush_tlb_multi(const struct cpumask *cpus, const struct flush_tlb_info *info) { struct { struct mmuext_op op; DECLARE_BITMAP(mask, NR_CPUS); } *args; struct multicall_space mcs; const size_t mc_entry_size = sizeof(args->op) + sizeof(args->mask...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_write_cr3(unsigned long cr3) { pgd_t *user_pgd = xen_get_user_pgd(__va(cr3)); BUG_ON(preemptible()); xen_mc_batch(); /* Update while interrupts are disabled, so its atomic with respect to ipis */ this_cpu_write(xen_cr3, cr3); __xen_write_cr3(true, cr3); if (user_pgd) __xen_wr...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
__visible pte_t xen_make_pte_init(pteval_t pte) { unsigned long pfn; pfn = (pte & PTE_PFN_MASK) >> PAGE_SHIFT; if (xen_start_info->mfn_list < __START_KERNEL_map && pfn >= xen_start_info->first_p2m_pfn && pfn < xen_start_info->first_p2m_pfn + xen_start_info->nr_p2m_frames) pte &= ~_PAGE_RW; pte...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init xen_alloc_pte_init(struct mm_struct *mm, unsigned long pfn) { #ifdef CONFIG_FLATMEM BUG_ON(mem_map); #endif make_lowmem_page_readonly(__va(PFN_PHYS(pfn))); pin_pagetable_pfn(MMUEXT_PIN_L1_TABLE, pfn); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init xen_release_pte_init(unsigned long pfn) { pin_pagetable_pfn(MMUEXT_UNPIN_TABLE, pfn); make_lowmem_page_readwrite(__va(PFN_PHYS(pfn))); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init xen_release_pmd_init(unsigned long pfn) { make_lowmem_page_readwrite(__va(PFN_PHYS(pfn))); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_alloc_pmd(struct mm_struct *mm, unsigned long pfn) { xen_alloc_ptpage(mm, pfn, PT_PMD); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_release_pmd(unsigned long pfn) { xen_release_ptpage(pfn, PT_PMD); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init set_page_prot_flags(void *addr, pgprot_t prot, unsigned long flags) { unsigned long pfn = __pa(addr) >> PAGE_SHIFT; pte_t pte = pfn_pte(pfn, prot); if (HYPERVISOR_update_va_mapping((unsigned long)addr, pte, flags)) BUG(); }
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init set_page_prot(void *addr, pgprot_t prot) { return set_page_prot_flags(addr, prot, UVMF_NONE); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void __init check_pt_base(unsigned long *pt_base, unsigned long *pt_end, unsigned long addr) { if (*pt_base == PFN_DOWN(__pa(addr))) { set_page_prot_flags((void *)addr, PAGE_KERNEL, UVMF_INVLPG); clear_page((void *)addr); (*pt_base)++; } if (*pt_end == PFN_DOWN(...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static phys_addr_t __init xen_early_virt_to_phys(unsigned long vaddr) { phys_addr_t pa; pgd_t pgd; pud_t pud; pmd_t pmd; pte_t pte; pa = read_cr3_pa(); pgd = native_make_pgd(xen_read_phys_ulong(pa + pgd_index(vaddr) * sizeof(pgd))); if (!pgd_present(pgd)) return 0; pa = pgd_val(pgd) & PTE_...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
void __init xen_reserve_special_pages(void) { phys_addr_t paddr; memblock_reserve(__pa(xen_start_info), PAGE_SIZE); if (xen_start_info->store_mfn) { paddr = PFN_PHYS(mfn_to_pfn(xen_start_info->store_mfn)); memblock_reserve(paddr, PAGE_SIZE); } if (!xen_initial_domain()) { paddr = PFN_PHYS(mfn_to...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) { pte_t pte; unsigned long vaddr; phys >>= PAGE_SHIFT; switch (idx) { case FIX_BTMAP_END ... FIX_BTMAP_BEGIN: #ifdef CONFIG_X86_VSYSCALL_EMULATION case VSYSCALL_PAGE: #endif pte = pfn_pte(phys, prot); break; #ifdef CONFIG_...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_leave_lazy_mmu(void) { preempt_disable(); xen_mc_flush(); paravirt_leave_lazy_mmu(); preempt_enable(); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
static void xen_zap_pfn_range(unsigned long vaddr, unsigned int order, unsigned long *in_frames, unsigned long *out_frames) { int i; struct multicall_space mcs; xen_mc_batch(); for (i = 0; i < (1UL << order); i++, vaddr += PAGE_SIZE) { mcs = __xen...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
int xen_create_contiguous_region(phys_addr_t pstart, unsigned int order, unsigned int address_bits, dma_addr_t *dma_handle) { unsigned long *in_frames = discontig_frames, out_frame; unsigned long flags; int success; unsigned long vstart = (unsign...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/mmu_pv.c
void xen_destroy_contiguous_region(phys_addr_t pstart, unsigned int order) { unsigned long *out_frames = discontig_frames, in_frame; unsigned long flags; int success; unsigned long vstart; if (unlikely(order > MAX_CONTIG_ORDER)) return; vstart = (unsigned long)phys_to_virt(pstart); memset((void *)vs...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/multicalls.c
struct multicall_space __xen_mc_entry(size_t args) { struct mc_buffer *b = this_cpu_ptr(&mc_buffer); struct multicall_space ret; unsigned argidx = roundup(b->argidx, sizeof(u64)); trace_xen_mc_entry_alloc(args); BUG_ON(preemptible()); BUG_ON(b->argidx >= MC_ARGS); if (unlikely(b->mcidx == MC_BATCH || ...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/multicalls.c
struct multicall_space xen_mc_extend_args(unsigned long op, size_t size) { struct mc_buffer *b = this_cpu_ptr(&mc_buffer); struct multicall_space ret = {NULL, NULL}; BUG_ON(preemptible()); BUG_ON(b->argidx >= MC_ARGS); if (unlikely(b->mcidx == 0 || b->entries[b->mcidx - 1].op != op)) { trace_xen_mc_ext...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/multicalls.h
static inline void xen_mc_batch(void) { unsigned long flags; local_irq_save(flags); trace_xen_mc_batch(paravirt_get_lazy_mode()); __this_cpu_write(xen_mc_irq_flags, flags); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/multicalls.h
static inline void xen_mc_issue(unsigned mode) { trace_xen_mc_issue(mode); if ((paravirt_get_lazy_mode() & mode) == 0) xen_mc_flush(); local_irq_restore(this_cpu_read(xen_mc_irq_flags)); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/p2m.c
static inline unsigned p2m_index(unsigned long pfn) { return pfn % P2M_PER_PAGE; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/p2m.c
static void __ref free_p2m_page(void *p) { if (unlikely(!slab_is_available())) { memblock_free(p, PAGE_SIZE); return; } free_page((unsigned long)p); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/p2m.c
static int xen_p2m_elem_type(unsigned long pfn) { unsigned long mfn; if (pfn >= xen_p2m_size) return P2M_TYPE_IDENTITY; mfn = xen_p2m_addr[pfn]; if (mfn == INVALID_P2M_ENTRY) return P2M_TYPE_MISSING; if (mfn & IDENTITY_FRAME_BIT) return P2M_TYPE_IDENTITY; return P2M_TYPE_PFN; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/p2m.c
void __init xen_vmalloc_p2m_tree(void) { static struct vm_struct vm; unsigned long p2m_limit; xen_p2m_last_pfn = xen_max_p2m_pfn; p2m_limit = (phys_addr_t)P2M_LIMIT * 1024 * 1024 * 1024 / PAGE_SIZE; vm.flags = VM_ALLOC; vm.size = ALIGN(sizeof(unsigned long) * max(xen_max_p2m_pfn, p2m_limit), ...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/p2m.c
unsigned long get_phys_to_machine(unsigned long pfn) { pte_t *ptep; unsigned int level; if (unlikely(pfn >= xen_p2m_size)) { if (pfn < xen_max_p2m_pfn) return xen_chk_extra_mem(pfn); return IDENTITY_FRAME(pfn); } ptep = lookup_address((unsigned long)(xen_p2m_addr + pfn), &level); BUG_ON(!pt...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/p2m.c
unsigned long __init set_phys_range_identity(unsigned long pfn_s, unsigned long pfn_e) { unsigned long pfn; if (unlikely(pfn_s >= xen_p2m_size)) return 0; if (pfn_s > pfn_e) return 0; if (pfn_e > xen_p2m_size) pfn_e = xen_p2m_size; for (pfn = pfn_s...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/platform-pci-unplug.c
bool xen_has_pv_nic_devices(void) { return __xen_has_pv_device(XEN_UNPLUG_ALL_NICS | XEN_UNPLUG_ALL); }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/platform-pci-unplug.c
void xen_unplug_emulated_devices(void) { int r; if (xen_pvh_domain()) return; /* user explicitly requested no unplug */ if (xen_emul_unplug & XEN_UNPLUG_NEVER) return; /* check the version of the xen platform PCI device */ r = check_platform_magic(); /* If the version matches enable the Xen plat...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/pmu.c
static void xen_pmu_arch_init(void) { if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { switch (boot_cpu_data.x86) { case 0x15: amd_num_counters = F15H_NUM_COUNTERS; amd_counters_base = MSR_F15H_PERF_CTR; amd_ctrls_base = MSR_F15H_PERF_CTL; amd_msr_step = 2; k7_counters_mirror...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/pmu.c
static bool xen_intel_pmu_emulate(unsigned int msr, u64 *val, int type, int index, bool is_read) { uint64_t *reg = NULL; struct xen_pmu_intel_ctxt *ctxt; uint64_t *fix_counters; struct xen_pmu_cntr_pair *arch_cntr_pair; struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); ...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/pmu.c
static unsigned long long xen_intel_read_pmc(int counter) { struct xen_pmu_intel_ctxt *ctxt; uint64_t *fixed_counters; struct xen_pmu_cntr_pair *arch_cntr_pair; struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); uint8_t xenpmu_flags = get_xenpmu_flags(); if (!xenpmu_data || !(xenpmu_flags & XENPMU_IRQ_...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/pmu.c
static unsigned int xen_guest_state(void) { const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); unsigned int state = 0; if (!xenpmu_data) { pr_warn_once("%s: pmudata not initialized\n", __func__); return state; } if (!xen_initial_domain() || (xenpmu_data->domain_id >= DOMID_SELF)) return...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/pmu.c
static unsigned long xen_get_guest_ip(void) { const struct xen_pmu_data *xenpmu_data = get_xenpmu_data(); if (!xenpmu_data) { pr_warn_once("%s: pmudata not initialized\n", __func__); return 0; } return xenpmu_data->pmu.r.regs.ip; }
[ 0, 0 ]
Linux Kernel
arch/x86/xen/pmu.c
void xen_pmu_finish(int cpu) { struct xen_pmu_params xp; if (xen_hvm_domain()) return; xp.vcpu = cpu; xp.version.maj = XENPMU_VER_MAJ; xp.version.min = XENPMU_VER_MIN; (void)HYPERVISOR_xenpmu_op(XENPMU_finish, &xp); free_pages((unsigned long)per_cpu(xenpmu_shared, cpu).xenpmu_data, 0); per_cpu(...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/pmu.h
static inline void xen_pmu_init(int cpu) {}
[ 0, 0 ]
Linux Kernel
arch/x86/xen/setup.c
static void __init xen_do_set_identity_and_remap_chunk( unsigned long start_pfn, unsigned long size, unsigned long remap_pfn) { unsigned long buf = (unsigned long)&xen_remap_buf; unsigned long mfn_save, mfn; unsigned long ident_pfn_iter, remap_pfn_iter; unsigned long ident_end_pfn = start_pfn + size; unsi...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/setup.c
static unsigned long __init xen_set_identity_and_remap_chunk( unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages, unsigned long remap_pfn) { unsigned long pfn; unsigned long i = 0; unsigned long n = end_pfn - start_pfn; if (remap_pfn == 0) remap_pfn = nr_pages; while (i < n) ...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/setup.c
bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size) { struct e820_entry *entry; unsigned mapcnt; phys_addr_t end; if (!size) return false; end = start + size; entry = xen_e820_table.entries; for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) { if (entry->type == E...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/setup.c
static void __init xen_phys_memcpy(phys_addr_t dest, phys_addr_t src, phys_addr_t n) { phys_addr_t dest_off, src_off, dest_len, src_len, len; void *from, *to; while (n) { dest_off = dest & ~PAGE_MASK; src_off = src & ~PAGE_MASK; dest_len = n; if (dest_len > (NR_...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/setup.c
static void __init xen_reserve_xen_mfnlist(void) { phys_addr_t start, size; if (xen_start_info->mfn_list >= __START_KERNEL_map) { start = __pa(xen_start_info->mfn_list); size = PFN_ALIGN(xen_start_info->nr_pages * sizeof(unsigned long)); } else { start = PFN_PHYS(xen_start_info->first_p2m_pfn); s...
[ 1, 0 ]
Linux Kernel
arch/x86/xen/setup.c
static void __init xen_pvmmu_arch_setup(void) { HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_4gb_segments); HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_writable_pagetables); HYPERVISOR_vm_assist(VMASST_CMD_enable, VMASST_TYPE_pae_extended_cr3); if (register_callback(CALLBACKTYPE_event, ...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/smp.c
int xen_smp_intr_init(unsigned int cpu) { int rc; char *resched_name, *callfunc_name, *debug_name; resched_name = kasprintf(GFP_KERNEL, "resched%d", cpu); per_cpu(xen_resched_irq, cpu).name = resched_name; rc = bind_ipi_to_irqhandler( XEN_RESCHEDULE_VECTOR, cpu, xen_reschedule_interrupt, IRQF_PE...
[ 0, 0 ]
Linux Kernel
arch/x86/xen/smp.c
void __init xen_smp_cpus_done(unsigned int max_cpus) { if (xen_hvm_domain()) native_smp_cpus_done(max_cpus); else calculate_max_logical_packages(); }
[ 0, 0 ]