Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/s390/mm/page-states.c
static void mark_kernel_pud(p4d_t *p4d, unsigned long addr, unsigned long end) { unsigned long next; struct page *page; pud_t *pud; int i; pud = pud_offset(p4d, addr); do { next = pud_addr_end(addr, end); if (pud_none(*pud) || pud_large(*pud)) continue; if (!pud_folded(*pud)) { pag...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/page-states.c
static void mark_kernel_pgd(void) { unsigned long addr, next; struct page *page; pgd_t *pgd; int i; addr = 0; pgd = pgd_offset_k(addr); do { next = pgd_addr_end(addr, MODULES_END); if (pgd_none(*pgd)) continue; if (!pgd_folded(*pgd)) { page = phys_to_page(pgd_val(*pgd)); fo...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/page-states.c
void arch_set_page_dat(struct page *page, int order) { if (!cmma_flag) return; set_page_stable_dat(page, order); }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pageattr.c
static void pgt_set(unsigned long *old, unsigned long new, unsigned long addr, unsigned long dtt) { unsigned long *table, mask; mask = 0; if (MACHINE_HAS_EDAT2) { switch (dtt) { case CRDTE_DTT_REGION3: mask = ~(PTRS_PER_PUD * sizeof(pud_t) - 1); break; case CRDTE_DTT_...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pageattr.c
static void modify_pmd_page(pmd_t *pmdp, unsigned long addr, unsigned long flags) { pmd_t new = *pmdp; if (flags & SET_MEMORY_RO) new = pmd_wrprotect(new); else if (flags & SET_MEMORY_RW) new = pmd_mkwrite(pmd_mkdirty(new)); if (flags & SET_MEMORY_NX) new = set_pmd_bit(...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pageattr.c
static int walk_pmd_level(pud_t *pudp, unsigned long addr, unsigned long end, unsigned long flags) { unsigned long next; int need_split; pmd_t *pmdp; int rc = 0; pmdp = pmd_offset(pudp, addr); do { if (pmd_none(*pmdp)) return -EINVAL; next = pmd_addr_end(addr, end);...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pageattr.c
static int walk_pud_level(p4d_t *p4d, unsigned long addr, unsigned long end, unsigned long flags) { unsigned long next; int need_split; pud_t *pudp; int rc = 0; pudp = pud_offset(p4d, addr); do { if (pud_none(*pudp)) return -EINVAL; next = pud_addr_end(addr, end); ...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static inline unsigned int atomic_xor_bits(atomic_t *v, unsigned int bits) { unsigned int old, new; do { old = atomic_read(v); new = old ^ bits; } while (atomic_cmpxchg(v, old, new) != old); return new; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
struct page *page_table_alloc_pgste(struct mm_struct *mm) { struct page *page; u64 *table; page = alloc_page(GFP_KERNEL); if (page) { table = (u64 *)page_to_virt(page); memset64(table, _PAGE_INVALID, PTRS_PER_PTE); memset64(table + PTRS_PER_PTE, 0, PTRS_PER_PTE); } return page; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
void page_table_free(struct mm_struct *mm, unsigned long *table) { unsigned int mask, bit, half; struct page *page; page = virt_to_page(table); if (!mm_alloc_pgste(mm)) { bit = ((unsigned long)table & ~PAGE_MASK) / (PTRS_PER_PTE * sizeof(pte_t)); spin_lock_bh(&mm->context.lock); /* * Mark the...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
void page_table_free_rcu(struct mmu_gather *tlb, unsigned long *table, unsigned long vmaddr) { struct mm_struct *mm; struct page *page; unsigned int bit, mask; mm = tlb->mm; page = virt_to_page(table); if (mm_alloc_pgste(mm)) { gmap_unlink(mm, table, vmaddr); table = (unsig...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static unsigned long *base_pgt_alloc(void) { unsigned long *table; table = kmem_cache_alloc(base_pgt_cache, GFP_KERNEL); if (table) memset64((u64 *)table, _PAGE_INVALID, PTRS_PER_PTE); return table; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static unsigned long *base_crst_alloc(unsigned long val) { unsigned long *table; table = (unsigned long *)__get_free_pages(GFP_KERNEL, CRST_ALLOC_ORDER); if (table) crst_table_init(table, val); return table; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static inline unsigned long base_lra(unsigned long address) { unsigned long real; asm volatile(" lra %0,0(%1)\n" : "=d"(real) : "a"(address) : "cc"); return real; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static int base_page_walk(unsigned long *origin, unsigned long addr, unsigned long end, int alloc) { unsigned long *pte, next; if (!alloc) return 0; pte = origin; pte += (addr & _PAGE_INDEX) >> _PAGE_SHIFT; do { next = base_page_addr_end(addr, end); *pte = base_lra(addr...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static int base_segment_walk(unsigned long *origin, unsigned long addr, unsigned long end, int alloc) { unsigned long *ste, next, *table; int rc; ste = origin; ste += (addr & _SEGMENT_INDEX) >> _SEGMENT_SHIFT; do { next = base_segment_addr_end(addr, end); if (*ste & _SEG...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgalloc.c
static int base_region1_walk(unsigned long *origin, unsigned long addr, unsigned long end, int alloc) { unsigned long *rfte, next, *table; int rc; rfte = origin; rfte += (addr & _REGION1_INDEX) >> _REGION1_SHIFT; do { next = base_region1_addr_end(addr, end); if (*rfte & ...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
pgprot_t pgprot_writethrough(pgprot_t prot) { return __pgprot(pgprot_val(prot) & ~mio_wb_bit_mask); }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int nodat) { unsigned long opt, asce; if (MACHINE_HAS_TLB_GUEST) { opt = 0; asce = READ_ONCE(mm->context.gmap_asce); if (asce == 0UL || nodat) opt |= IPTE_NODAT; if ...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline pte_t ptep_flush_direct(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int nodat) { pte_t old; old = *ptep; if (unlikely(pte_val(old) & _PAGE_INVALID)) return old; atomic_inc(&mm->context.flush_count); if (MACHINE_HAS_TLB_LC && cpumask_eq...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline pgste_t pgste_get_lock(pte_t *ptep) { unsigned long new = 0; #ifdef CONFIG_PGSTE unsigned long old; asm(" lg %0,%2\n" "0: lgr %1,%0\n" " nihh %0,0xff7f\n" " oihh %1,0x0080\n" /* set PCL bit in new */ " csg %0,%1,%2\n" " jl 0b\n" : "=&d"(old), "=&d"(new), "=Q"(pte...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline void pgste_set_unlock(pte_t *ptep, pgste_t pgste) { #ifdef CONFIG_PGSTE asm(" nihh %1,0xff7f\n" " stg %1,%0\n" : "=Q"(ptep[PTRS_PER_PTE]) : "d"(pgste_val(pgste)), "Q"(ptep[PTRS_PER_PTE]) : "cc", "memory"); #endif }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline pgste_t pgste_pte_notify(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pgste_t pgste) { #ifdef CONFIG_PGSTE unsigned long bits; bits = pgste_val(pgste) & (PGSTE_IN_BIT | PGSTE_VSIE_BIT); if (bits) { pgste_val(pgste) ^= bits; ptep_notify(mm, a...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline pte_t ptep_xchg_commit(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pgste_t pgste, pte_t old, pte_t new) { if (mm_has_pgste(mm)) { if (pte_val(old) & _PAGE_INVALID) pgste_set_key(ptep, pgste, new, mm); if ...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
pte_t ptep_xchg_lazy(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t new) { pgste_t pgste; pte_t old; int nodat; preempt_disable(); pgste = ptep_xchg_start(mm, addr, ptep); nodat = !!(pgste_val(pgste) & _PGSTE_GPS_NODAT); old = ptep_flush_lazy(mm, addr, ptep, nodat); ...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline void pmdp_idte_local(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp) { if (MACHINE_HAS_TLB_GUEST) __pmdp_idte(addr, pmdp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_LOCAL); else __pmdp_idte(addr, pmdp, 0, 0, IDTE_LOCAL); if...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline void pmdp_idte_global(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp) { if (MACHINE_HAS_TLB_GUEST) { __pmdp_idte(addr, pmdp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_GLOBAL); if (mm_has_pgste(mm) && mm->context.allow_gmap_hp...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline void pudp_idte_local(struct mm_struct *mm, unsigned long addr, pud_t *pudp) { if (MACHINE_HAS_TLB_GUEST) __pudp_idte(addr, pudp, IDTE_NODAT | IDTE_GUEST_ASCE, mm->context.asce, IDTE_LOCAL); else __pudp_idte(addr, pudp, 0, 0, IDTE_LOCAL); }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
static inline pud_t pudp_flush_direct(struct mm_struct *mm, unsigned long addr, pud_t *pudp) { pud_t old; old = *pudp; if (pud_val(old) & _REGION_ENTRY_INVALID) return old; atomic_inc(&mm->context.flush_count); if (MACHINE_HAS_TLB_LC && cpumask_equal(mm_cpumas...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
pud_t pudp_xchg_direct(struct mm_struct *mm, unsigned long addr, pud_t *pudp, pud_t new) { pud_t old; preempt_disable(); old = pudp_flush_direct(mm, addr, pudp); set_pud(pudp, new); preempt_enable(); return old; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
void ptep_set_notify(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { pgste_t pgste; preempt_disable(); pgste = pgste_get_lock(ptep); pgste_val(pgste) |= PGSTE_IN_BIT; pgste_set_unlock(ptep, pgste); preempt_enable(); }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
void ptep_zap_unused(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int reset) { unsigned long pgstev; pgste_t pgste; pte_t pte; preempt_disable(); pgste = pgste_get_lock(ptep); pgstev = pgste_val(pgste); pte = *ptep; if (!reset && pte_swap(pte) && ((pgstev & _PGSTE_G...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
bool ptep_test_and_clear_uc(struct mm_struct *mm, unsigned long addr, pte_t *ptep) { pgste_t pgste; pte_t pte; bool dirty; int nodat; pgste = pgste_get_lock(ptep); dirty = !!(pgste_val(pgste) & PGSTE_UC_BIT); pgste_val(pgste) &= ~PGSTE_UC_BIT; pte = *ptep; if (dirty && (pt...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/pgtable.c
int get_pgste(struct mm_struct *mm, unsigned long hva, unsigned long *pgstep) { struct vm_area_struct *vma; spinlock_t *ptl; pte_t *ptep; vma = vma_lookup(mm, hva); if (!vma || is_vm_hugetlb_page(vma)) return -EFAULT; ptep = get_locked_pte(mm, hva, &ptl); if (unlikely(!ptep)) return -EFAULT; *p...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
pte_t __ref *vmem_pte_alloc(void) { unsigned long size = PTRS_PER_PTE * sizeof(pte_t); pte_t *pte; if (slab_is_available()) pte = (pte_t *)page_table_alloc(&init_mm); else pte = (pte_t *)memblock_alloc(size, size); if (!pte) return NULL; memset64((u64 *)pte, _PAGE_INVALID, PTRS_PER_PTE); ret...
[ 1, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
static void vmemmap_mark_sub_pmd_used(unsigned long start, unsigned long end) { memset((void *)start, 0, sizeof(struct page)); }
[ 1, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
static void vmemmap_use_sub_pmd(unsigned long start, unsigned long end) { if (unused_sub_pmd_start == start) { unused_sub_pmd_start = end; if (likely(IS_ALIGNED(unused_sub_pmd_start, PMD_SIZE))) unused_sub_pmd_start = 0; return; } vmemmap_flush_unused_sub_pmd(); vmemmap_mark_sub_pmd_used(star...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
static int modify_p4d_table(pgd_t *pgd, unsigned long addr, unsigned long end, bool add, bool direct) { unsigned long next; int ret = -ENOMEM; p4d_t *p4d; pud_t *pud; p4d = p4d_offset(pgd, addr); for (; addr < end; addr = next, p4d++) { next = p4d_addr_end(addr, end); i...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
static int remove_pagetable(unsigned long start, unsigned long end, bool direct) { return modify_pagetable(start, end, false, direct); }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node, struct vmem_altmap *altmap) { int ret; mutex_lock(&vmem_mutex); ret = add_pagetable(start, end, false); if (ret) remove_pagetable(start, end, false); mutex_unlock(&vmem_mutex); return ret; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
void vmem_remove_mapping(unsigned long start, unsigned long size) { mutex_lock(&vmem_mutex); vmem_remove_range(start, size); mutex_unlock(&vmem_mutex); }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
struct range arch_get_mappable_range(void) { struct range mhp_range; mhp_range.start = 0; mhp_range.end = VMEM_MAX_PHYS - 1; return mhp_range; }
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
pte_t *vmem_get_alloc_pte(unsigned long addr, bool alloc) { pte_t *ptep = NULL; pgd_t *pgd; p4d_t *p4d; pud_t *pud; pmd_t *pmd; pte_t *pte; pgd = pgd_offset_k(addr); if (pgd_none(*pgd)) { if (!alloc) goto out; p4d = vmem_crst_alloc(_REGION2_ENTRY_EMPTY); if (!p4d) goto out; ...
[ 0, 0 ]
Linux Kernel
arch/s390/mm/vmem.c
int vmem_map_4k_page(unsigned long addr, unsigned long phys, pgprot_t prot) { int rc; mutex_lock(&vmem_mutex); rc = __vmem_map_4k_page(addr, phys, prot, true); mutex_unlock(&vmem_mutex); return rc; }
[ 0, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static inline u32 reg_high(u32 reg) { return reg2hex[reg] << 4; }
[ 0, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static bool is_first_pass(struct bpf_jit *jit) { return jit->size == 0; }
[ 0, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static void jit_fill_hole(void *area, unsigned int size) { memset(area, 0, size); }
[ 1, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static void save_regs(struct bpf_jit *jit, u32 rs, u32 re) { u32 off = STK_OFF_R6 + (rs - 6) * 8; if (rs == re) _EMIT6(0xe300f000 | rs << 20 | off, 0x0024); else /* stmg %rs,%re,off(%r15) */ _EMIT6_DISP(0xeb00f000 | rs << 20 | re << 16, 0x0024, off); }
[ 1, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static void restore_regs(struct bpf_jit *jit, u32 rs, u32 re, u32 stack_depth) { u32 off = STK_OFF_R6 + (rs - 6) * 8; if (jit->seen & SEEN_STACK) off += STK_OFF + stack_depth; if (rs == re) _EMIT6(0xe300f000 | rs << 20 | off, 0x0004); else /* lmg %rs,%re,off(%r15) */ _EMIT6_DISP(0xeb00f000 | ...
[ 1, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static int get_end(struct bpf_jit *jit, int start) { int i; for (i = start; i < 15; i++) { if (!jit->seen_reg[i] && !jit->seen_reg[i + 1]) return i - 1; } return jit->seen_reg[15] ? 15 : 14; } #define REGS_SAVE 1
[ 0, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static void bpf_jit_epilogue(struct bpf_jit *jit, u32 stack_depth) { jit->exit_ip = jit->prg; EMIT4(0xb9040000, REG_2, BPF_REG_0); /* Restore registers */ save_restore_regs(jit, REGS_RESTORE, stack_depth); if (nospec_uses_trampoline()) { jit->r14_thunk_ip = jit->prg; /* Generate __s390_indirect_jump_...
[ 1, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static int get_probe_mem_regno(const u8 *insn) { if (insn[0] != 0xe3) /* common llgc, llgh, llgf and lg prefix */ return -1; if (insn[5] != 0x90 && /* llgc */ insn[5] != 0x91 && /* llgh */ insn[5] != 0x16 && /* llgf */ insn[5] != 0x04) /* lg */ return -1; return insn[1] >> 4; }
[ 1, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
bool ex_handler_bpf(const struct exception_table_entry *x, struct pt_regs *regs) { regs->psw.addr = extable_fixup(x); regs->gprs[x->data] = 0; return true; }
[ 0, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
static bool bpf_is_new_addr_sane(struct bpf_jit *jit, int i) { if (is_first_pass(jit)) return true; /* The codegen pass must not change anything */ if (is_codegen_pass(jit)) return jit->addrs[i] == jit->prg; /* Passes in between must not increase code size */ return jit->addrs[i] >= jit->prg; }
[ 0, 0 ]
Linux Kernel
arch/s390/net/bpf_jit_comp.c
bool bpf_jit_needs_zext(void) { return true; }
[ 0, 0 ]
Linux Kernel
arch/s390/net/pnet.c
int pnet_id_by_dev_port(struct device *dev, unsigned short port, u8 *pnetid) { u8 pnetids[MAX_PNETID_PORTS][MAX_PNETID_LEN]; static const u8 zero[MAX_PNETID_LEN] = {0}; int rc = 0; if (!dev || port >= MAX_PNETID_PORTS) return -ENOENT; if (!pnet_ids_by_device(dev, (u8 *)pnetids) && memcmp(pnetids[p...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci.c
int pci_domain_nr(struct pci_bus *bus) { return ((struct zpci_bus *)bus->sysdata)->domain_nr; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
resource_size_t pcibios_align_resource(void *data, const struct resource *res, resource_size_t size, resource_size_t align) { return 0; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
void __iowrite64_copy(void __iomem *to, const void *from, size_t count) { zpci_memcpy_toio(to, from, count); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
static void pci_iounmap_fh(struct pci_dev *pdev, void __iomem *addr) { unsigned int idx = ZPCI_IDX(addr); spin_lock(&zpci_iomap_lock); WARN_ON(!zpci_iomap_start[idx].count); if (!--zpci_iomap_start[idx].count) { zpci_iomap_start[idx].fh = 0; zpci_iomap_start[idx].bar = 0; } spin_unlock(&zpci_iomap...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci.c
static int zpci_alloc_iomap(struct zpci_dev *zdev) { unsigned long entry; spin_lock(&zpci_iomap_lock); entry = find_first_zero_bit(zpci_iomap_bitmap, ZPCI_IOMAP_ENTRIES); if (entry == ZPCI_IOMAP_ENTRIES) { spin_unlock(&zpci_iomap_lock); return -ENOSPC; } set_bit(entry, zpci_iomap_bitmap); spin_u...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
static void zpci_do_update_iomap_fh(struct zpci_dev *zdev, u32 fh) { int bar, idx; spin_lock(&zpci_iomap_lock); for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { if (!zdev->bars[bar].size) continue; idx = zdev->bars[bar].map_idx; if (!zpci_iomap_start[idx].count) continue; WRITE_ONCE(zp...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
void zpci_update_fh(struct zpci_dev *zdev, u32 fh) { if (!fh || zdev->fh == fh) return; zdev->fh = fh; if (zpci_use_mio(zdev)) return; if (zdev->has_resources && zdev_enabled(zdev)) zpci_do_update_iomap_fh(zdev, fh); }
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci.c
static void zpci_cleanup_bus_resources(struct zpci_dev *zdev) { int i; for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (!zdev->bars[i].size || !zdev->bars[i].res) continue; zpci_free_iomap(zdev, zdev->bars[i].map_idx); release_resource(zdev->bars[i].res); kfree(zdev->bars[i].res); } zdev->h...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
int pcibios_enable_device(struct pci_dev *pdev, int mask) { struct zpci_dev *zdev = to_zpci(pdev); zpci_debug_init_device(zdev, dev_name(&pdev->dev)); zpci_fmb_enable_device(zdev); return pci_enable_resources(pdev, mask); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
void pcibios_disable_device(struct pci_dev *pdev) { struct zpci_dev *zdev = to_zpci(pdev); zpci_fmb_disable_device(zdev); zpci_debug_exit_device(zdev); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
void zpci_free_domain(int domain) { spin_lock(&zpci_domain_lock); clear_bit(domain, zpci_domain); spin_unlock(&zpci_domain_lock); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci.c
bool zpci_is_device_configured(struct zpci_dev *zdev) { enum zpci_state state = zdev->state; return state != ZPCI_FN_STATE_RESERVED && state != ZPCI_FN_STATE_STANDBY; }
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci.c
bool zpci_is_enabled(void) { return s390_pci_initialized; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_bus.c
int zpci_bus_scan_bus(struct zpci_bus *zbus) { struct zpci_dev *zdev; int devfn, rc, ret = 0; for (devfn = 0; devfn < ZPCI_FUNCTIONS_PER_BUS; devfn++) { zdev = zbus->function[devfn]; if (zdev && zdev->state == ZPCI_FN_STATE_CONFIGURED) { rc = zpci_bus_prepare_device(zdev); if (rc) ret...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_bus.c
static struct zpci_bus *zpci_bus_alloc(int pchid) { struct zpci_bus *zbus; zbus = kzalloc(sizeof(*zbus), GFP_KERNEL); if (!zbus) return NULL; zbus->pchid = pchid; INIT_LIST_HEAD(&zbus->bus_next); mutex_lock(&zbus_list_lock); list_add_tail(&zbus->bus_next, &zbus_list); mutex_unlock(&zbus_list_lock...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_bus.c
static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev) { int rc = -EINVAL; if (zbus->function[zdev->devfn]) { pr_err("devfn %04x is already assigned\n", zdev->devfn); return rc; } zdev->zbus = zbus; zbus->function[zdev->devfn] = zdev; zpci_nb_devices++; if (zbus->multifun...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_bus.h
static inline struct zpci_dev *zdev_from_bus(struct pci_bus *bus, unsigned int devfn) { struct zpci_bus *zbus = bus->sysdata; return (devfn >= ZPCI_FUNCTIONS_PER_BUS) ? NULL : zbus->function[devfn]; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
void update_uid_checking(bool new) { if (zpci_unique_uid != new) zpci_dbg(3, "uid checking:%d\n", new); zpci_unique_uid = new; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
static void *clp_alloc_block(gfp_t gfp_mask) { return (void *)__get_free_pages(gfp_mask, get_order(CLP_BLK_SIZE)); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
static void clp_free_block(void *ptr) { free_pages((unsigned long)ptr, get_order(CLP_BLK_SIZE)); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
int clp_enable_fh(struct zpci_dev *zdev, u32 *fh, u8 nr_dma_as) { int rc; rc = clp_set_pci_fn(zdev, fh, nr_dma_as, CLP_SET_ENABLE_PCI_FN); zpci_dbg(3, "ena fid:%x, fh:%x, rc:%d\n", zdev->fid, *fh, rc); if (!rc && zpci_use_mio(zdev)) { rc = clp_set_pci_fn(zdev, fh, nr_dma_as, CLP_SET_ENABLE_MIO); zpci_...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
int clp_disable_fh(struct zpci_dev *zdev, u32 *fh) { int rc; if (!zdev_enabled(zdev)) return 0; rc = clp_set_pci_fn(zdev, fh, 0, CLP_SET_DISABLE_PCI_FN); zpci_dbg(3, "dis fid:%x, fh:%x, rc:%d\n", zdev->fid, *fh, rc); return rc; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
static int clp_list_pci_req(struct clp_req_rsp_list_pci *rrb, u64 *resume_token, int *nentries) { int rc; memset(rrb, 0, sizeof(*rrb)); rrb->request.hdr.len = sizeof(rrb->request); rrb->request.hdr.cmd = CLP_LIST_PCI; rrb->response.hdr.len = CLP_BLK_SIZE - LIST_PCI_HDR_LEN; rrb...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
int clp_scan_pci_devices(void) { struct clp_req_rsp_list_pci *rrb; int rc; rrb = clp_alloc_block(GFP_KERNEL); if (!rrb) return -ENOMEM; rc = clp_list_pci(rrb, NULL, __clp_add); clp_free_block(rrb); return rc; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
static int clp_pci_query(struct clp_req *req, struct clp_req_rsp_query_pci *lpcb) { unsigned long limit = PAGE_SIZE - sizeof(lpcb->request); if (lpcb->request.hdr.len != sizeof(lpcb->request) || lpcb->response.hdr.len > limit) return -EINVAL; if (lpcb->request.reserved2 != 0 |...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_clp.c
static int __init clp_misc_init(void) { return misc_register(&clp_misc_device); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_debug.c
static int pci_perf_show(struct seq_file *m, void *v) { struct zpci_dev *zdev = m->private; if (!zdev) return 0; mutex_lock(&zdev->lock); if (!zdev->fmb) { mutex_unlock(&zdev->lock); seq_puts(m, "FMB statistics disabled\n"); return 0; } seq_printf(m, "Update interval: %u ms\n", zdev->fmb_...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_debug.c
static int pci_perf_seq_open(struct inode *inode, struct file *filp) { return single_open(filp, pci_perf_show, file_inode(filp)->i_private); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_debug.c
void zpci_debug_exit_device(struct zpci_dev *zdev) { debugfs_remove_recursive(zdev->debugfs_dev); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static unsigned long *dma_alloc_page_table(void) { unsigned long *table, *entry; table = kmem_cache_alloc(dma_page_table_cache, GFP_ATOMIC); if (!table) return NULL; for (entry = table; entry < table + ZPCI_PT_ENTRIES; entry++) *entry = ZPCI_PTE_INVALID; return table; }
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
unsigned long *dma_walk_cpu_trans(unsigned long *rto, dma_addr_t dma_addr) { unsigned long *sto, *pto; unsigned int rtx, sx, px; rtx = calc_rtx(dma_addr); sto = dma_get_seg_table_origin(&rto[rtx]); if (!sto) return NULL; sx = calc_sx(dma_addr); pto = dma_get_page_table_origin(&sto[sx]); if (!pto)...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static unsigned long __dma_alloc_iommu(struct device *dev, unsigned long start, int size) { struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); return iommu_area_alloc(zdev->iommu_bitmap, zdev->iommu_pages, start, size, zdev->start_dma >> PAGE_SHIFT, ...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static dma_addr_t dma_alloc_address(struct device *dev, int size) { struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); unsigned long offset, flags; spin_lock_irqsave(&zdev->iommu_bitmap_lock, flags); offset = __dma_alloc_iommu(dev, zdev->next_bit, size); if (offset == -1) { if (!s390_iommu_strict) { ...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static void dma_free_address(struct device *dev, dma_addr_t dma_addr, int size) { struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); unsigned long flags, offset; offset = (dma_addr - zdev->start_dma) >> PAGE_SHIFT; spin_lock_irqsave(&zdev->iommu_bitmap_lock, flags); if (!zdev->i...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static void s390_dma_unmap_pages(struct device *dev, dma_addr_t dma_addr, size_t size, enum dma_data_direction direction, unsigned long attrs) { struct zpci_dev *zdev = to_zpci(to_pci_dev(dev)); int npages, ret; npages = iommu_num_pages(dma_addr,...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static int s390_dma_map_sg(struct device *dev, struct scatterlist *sg, int nr_elements, enum dma_data_direction dir, unsigned long attrs) { struct scatterlist *s = sg, *start = sg, *dma = sg; unsigned int max = dma_get_max_seg_size(dev); unsigned int size = s...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
int zpci_dma_exit_device(struct zpci_dev *zdev) { int cc = 0; WARN_ON(zdev->s390_domain); if (zdev_enabled(zdev)) cc = zpci_unregister_ioat(zdev, 0); /* * cc == 3 indicates the function is gone already. This can happen * if the function was deconfigured/disabled suddenly and we have not * received...
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static int __init s390_iommu_setup(char *str) { if (!strcmp(str, "strict")) s390_iommu_strict = 1; return 1; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_dma.c
static int __init s390_iommu_aperture_setup(char *str) { if (kstrtou32(str, 10, &s390_iommu_aperture_factor)) s390_iommu_aperture_factor = 1; return 1; }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_event.c
static inline bool ers_result_indicates_abort(pci_ers_result_t ers_res) { switch (ers_res) { case PCI_ERS_RESULT_CAN_RECOVER: case PCI_ERS_RESULT_RECOVERED: case PCI_ERS_RESULT_NEED_RESET: return false; default: return true; } }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_event.c
static bool is_driver_supported(struct pci_driver *driver) { if (!driver || !driver->err_handler) return false; if (!driver->err_handler->error_detected) return false; if (!driver->err_handler->slot_reset) return false; if (!driver->err_handler->resume) return false; return true; }
[ 1, 0 ]
Linux Kernel
arch/s390/pci/pci_event.c
static void zpci_event_hard_deconfigured(struct zpci_dev *zdev, u32 fh) { zpci_update_fh(zdev, fh); zpci_bus_remove_device(zdev, true); /* Even though the device is already gone we still * need to free zPCI resources as part of the disable. */ if (zdev->dma_table) zpci_dma_exit_device(zdev); if (zd...
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_event.c
void zpci_event_availability(void *data) { if (zpci_is_enabled()) __zpci_event_availability(data); }
[ 0, 0 ]
Linux Kernel
arch/s390/pci/pci_insn.c
static inline void zpci_err_insn_req(int lvl, u8 insn, u8 cc, u8 status, u64 req, u64 offset) { struct zpci_err_insn_data data = { .insn = insn, .cc = cc, .status = status, .req = req, .offset = offset}; zpci_err_hex_level(lvl, &data, sizeof(data)); }
[ 1, 0 ]