Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/powerpc/mm/fault.c | static bool access_error(bool is_write, bool is_exec,
struct vm_area_struct *vma) {
if (is_exec) {
return !(vma->vm_flags & VM_EXEC) &&
(cpu_has_feature(CPU_FTR_NOEXECUTE) ||
!(vma->vm_flags & (VM_READ | VM_WRITE)));
}
if (is_write) {
if (unlikely(!(vma->v... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/hugetlbpage.c | static inline void hugepd_free(struct mmu_gather *tlb, void *hugepte) {}
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/hugetlbpage.c | static bool range_is_outside_limits(unsigned long start, unsigned long end,
unsigned long floor, unsigned long ceiling,
unsigned long mask) {
if ((start & mask) < floor)
return true;
if (ceiling) {
ceiling &= mask;
if (!ceiling)
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/hugetlbpage.c | static void hugetlb_free_pud_range(struct mmu_gather *tlb, p4d_t *p4d,
unsigned long addr, unsigned long end,
unsigned long floor, unsigned long ceiling) {
pud_t *pud;
unsigned long next;
unsigned long start;
start = addr;
do {
pud = p... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/hugetlbpage.c | void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
unsigned long end, unsigned long floor,
unsigned long ceiling) {
pgd_t *pgd;
p4d_t *p4d;
unsigned long next;
do {
next = pgd_addr_end(addr, end);
pgd = pgd_offset(tlb->mm, add... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/init_64.c | static unsigned long vmemmap_list_free(unsigned long start) {
struct vmemmap_backing *vmem_back, *vmem_back_prev;
vmem_back_prev = vmem_back = vmemmap_list;
for (; vmem_back; vmem_back = vmem_back->list) {
if (vmem_back->virt_addr == start)
break;
vmem_back_prev = vmem_back;
}
if (unlikely(!v... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/init_64.c | void register_page_bootmem_memmap(unsigned long section_nr,
struct page *start_page, unsigned long size) {
}
#endif
#ifdef CONFIG_PPC_BOOK3S_64 | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/init_64.c | static void __init early_check_vec5(void) {
unsigned long root, chosen;
int size;
const u8 *vec5;
u8 mmu_supported;
root = of_get_flat_dt_root();
chosen = of_get_flat_dt_subnode_by_name(root, "chosen");
if (chosen == -FDT_ERR_NOTFOUND) {
cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
return;
... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/init_64.c | void __init mmu_early_init_devtree(void) {
bool hvmode = !!(mfmsr() & MSR_HV);
if (disable_radix) {
if (IS_ENABLED(CONFIG_PPC_64S_HASH_MMU))
cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
else
pr_warn("WARNING: Ignoring cmdline option disable_radix\n");
}
of_scan_flat_dt(dt_scan_mmu_pi... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/book3s_32.c |
int __init kasan_init_region(void *start, size_t size) {
unsigned long k_start = (unsigned long)kasan_mem_to_shadow(start);
unsigned long k_end = (unsigned long)kasan_mem_to_shadow(start + size);
unsigned long k_nobat = k_start;
unsigned long k_cur;
phys_addr_t phys;
int ret;
while (k_nobat < k_end) {
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_32.c |
static pgprot_t __init kasan_prot_ro(void) {
if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE))
return PAGE_READONLY;
return PAGE_KERNEL_RO;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_32.c |
static void __init kasan_populate_pte(pte_t *ptep, pgprot_t prot) {
unsigned long va = (unsigned long)kasan_early_shadow_page;
phys_addr_t pa = __pa(kasan_early_shadow_page);
int i;
for (i = 0; i < PTRS_PER_PTE; i++, ptep++)
__set_pte_at(&init_mm, va, ptep, pfn_pte(PHYS_PFN(pa), prot), 1);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_32.c |
int __init kasan_init_shadow_page_tables(unsigned long k_start,
unsigned long k_end) {
pmd_t *pmd;
unsigned long k_cur, k_next;
pmd = pmd_off_k(k_start);
for (k_cur = k_start; k_cur != k_end; k_cur = k_next, pmd++) {
pte_t *new;
k_next = pgd_addr_end(k_cur, k... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_32.c |
int __init __weak kasan_init_region(void *start, size_t size) {
unsigned long k_start = (unsigned long)kasan_mem_to_shadow(start);
unsigned long k_end = (unsigned long)kasan_mem_to_shadow(start + size);
unsigned long k_cur;
int ret;
void *block;
ret = kasan_init_shadow_page_tables(k_start, k_end);
if (r... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_32.c |
void __init kasan_mmu_init(void) {
int ret;
if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE)) {
ret = kasan_init_shadow_page_tables(KASAN_SHADOW_START, KASAN_SHADOW_END);
if (ret)
panic("kasan: kasan_init_shadow_page_tables() failed");
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_32.c |
void __init kasan_early_init(void) {
unsigned long addr = KASAN_SHADOW_START;
unsigned long end = KASAN_SHADOW_END;
unsigned long next;
pmd_t *pmd = pmd_off_k(addr);
BUILD_BUG_ON(KASAN_SHADOW_START & ~PGDIR_MASK);
kasan_populate_pte(kasan_early_shadow_pte, PAGE_KERNEL);
do {
next = pgd_addr_end(ad... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_book3e_64.c |
static inline bool kasan_pud_table(p4d_t p4d) {
return p4d_page(p4d) == virt_to_page(lm_alias(kasan_early_shadow_pud));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/kasan/init_book3e_64.c |
static inline bool kasan_pmd_table(pud_t pud) {
return pud_page(pud) == virt_to_page(lm_alias(kasan_early_shadow_pmd));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c |
pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
unsigned long size, pgprot_t vma_prot) {
if (ppc_md.phys_mem_access_prot)
return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
if (!page_is_ram(pfn))
vma_prot = pgprot_noncached(vma_prot);
return... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c | int memory_add_physaddr_to_nid(u64 start) { return hot_add_scn_to_nid(start); } | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c |
int __weak remove_section_mapping(unsigned long start, unsigned long end) {
return -ENODEV;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c | int __ref add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
struct mhp_params *params) {
int ret;
ret = __add_pages(nid, start_pfn, nr_pages, params);
if (ret)
return ret;
update_end_of_memory_vars(start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
return ret;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c |
void __ref arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) {
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
__remove_pages(start_pfn, nr_pages, altmap);
arch_remove_linear_mapping(start, size);
}
#endif
#ifndef CONFIG_NUMA | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c | static int __init mark_nonram_nosave(void) { return 0; }
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mem.c | void __init paging_init(void) {
unsigned long long total_ram = memblock_phys_mem_size();
phys_addr_t top_of_ram = memblock_end_of_DRAM();
#ifdef CONFIG_HIGHMEM
unsigned long v = __fix_to_virt(FIX_KMAP_END);
unsigned long end = __fix_to_virt(FIX_KMAP_BEGIN);
for (; v < end; v += PAGE_SIZE)
map_kernel_pag... | [
1,
1
] |
Linux Kernel | arch/powerpc/mm/mmu_context.c | static inline void switch_mm_pgdir(struct task_struct *tsk,
struct mm_struct *mm) {
get_paca()->pgd = mm->pgd;
#ifdef CONFIG_PPC_KUAP
tsk->thread.pid = mm->context.id;
#endif
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/mmu_decl.h | static inline unsigned long p_block_mapped(phys_addr_t pa) { return 0; }
#endif
#if defined(CONFIG_PPC_BOOK3S_32) || defined(CONFIG_PPC_8xx) || \
defined(CONFIG_PPC_E500) | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/40x.c | void __init MMU_init_hw(void) {
mtspr(SPRN_ZPR, 0x10000000);
flush_instruction_cache();
/*
* Set up the real-mode cache parameters for the exception vector
* handlers (which are run in real-mode).
*/
mtspr(SPRN_DCWR, 0x00000000); /* All caching is write-back */
/*
* Cache instruction and data... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/44x.c | static void __init ppc44x_update_tlb_hwater(void) {
modify_instruction_site(&patch__tlb_44x_hwater_D, 0xffff, tlb_44x_hwater);
modify_instruction_site(&patch__tlb_44x_hwater_I, 0xffff, tlb_44x_hwater);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/44x.c | static void __init ppc47x_pin_tlb(unsigned int virt, unsigned int phys) {
unsigned int rA;
int bolted;
rA = 0x88000000;
/* Look for a bolted entry slot */
bolted = ppc47x_find_free_bolted();
BUG_ON(bolted < 0);
/* Insert bolted slot number */
rA |= bolted << 24;
pr_debug("256M TLB entry for 0x%08x... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/44x.c | void __init mmu_init_secondary(int cpu) {
unsigned long addr;
unsigned long memstart = memstart_addr & ~(PPC_PIN_SIZE - 1);
for (addr = memstart + PPC_PIN_SIZE; addr < lowmem_end_addr;
addr += PPC_PIN_SIZE) {
if (mmu_has_feature(MMU_FTR_TYPE_47x))
ppc47x_pin_tlb(addr + PAGE_OFFSET, addr);
el... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/8xx.c | void __init setup_initial_memory_limit(phys_addr_t first_memblock_base,
phys_addr_t first_memblock_size) {
BUG_ON(first_memblock_base != 0);
/* 8xx can only access 32MB at the moment */
memblock_set_current_limit(min_t(u64, first_memblock_size, SZ_32M));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/book3e_pgtable.c | int __meminit vmemmap_create_mapping(unsigned long start,
unsigned long page_size,
unsigned long phys) {
unsigned long i, flags = _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_KERNEL_RW;
/* PTEs only contain page size encodings up to 32M */
BUG_... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/book3e_pgtable.c | void vmemmap_remove_mapping(unsigned long start, unsigned long page_size) {}
#endif
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/book3e_pgtable.c | void __patch_exception(int exc, unsigned long addr) {
unsigned int *ibase = &interrupt_base_book3e;
patch_branch(ibase + (exc / 4) + 1, addr, 0);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500.c | phys_addr_t v_block_mapped(unsigned long va) {
int b;
for (b = 0; b < tlbcam_index; ++b)
if (va >= tlbcam_addrs[b].start && va < tlbcam_addrs[b].limit)
return tlbcam_addrs[b].phys + (va - tlbcam_addrs[b].start);
return 0;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500.c | unsigned long p_block_mapped(phys_addr_t pa) {
int b;
for (b = 0; b < tlbcam_index; ++b)
if (pa >= tlbcam_addrs[b].phys &&
pa < (tlbcam_addrs[b].limit - tlbcam_addrs[b].start) +
tlbcam_addrs[b].phys)
return tlbcam_addrs[b].start + (pa - tlbcam_addrs[b].phys);
return 0;
}
#endif | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500.c | static unsigned long calc_cam_sz(unsigned long ram, unsigned long virt,
phys_addr_t phys) {
unsigned int camsize = __ilog2(ram);
unsigned int align = __ffs(virt | phys);
unsigned long max_cam;
if ((mfspr(SPRN_MMUCFG) & MMUCFG_MAVN) == MMUCFG_MAVN_V1) {
max_cam = ((mfspr(SP... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500.c |
unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx, bool dryrun,
bool init) {
unsigned long virt = PAGE_OFFSET;
phys_addr_t phys = memstart_addr;
return map_mem_in_cams_addr(phys, virt, ram, max_cam_idx, dryrun, init);
}
#ifdef CONFIG_PPC32
#if defined(CONFIG_LOWMEM... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500.c | void __init adjust_total_lowmem(void) {
unsigned long ram;
int i;
ram = min((phys_addr_t)__max_low_memory, (phys_addr_t)total_lowmem);
i = switch_to_as1();
__max_low_memory = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, false, true);
restore_to_as0(i, 0, NULL, 1);
pr_info("Memory CAM mapping: ");
for ... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500.c | notrace void __init relocate_init(u64 dt_ptr, phys_addr_t start) {
unsigned long base = kernstart_virt_addr;
phys_addr_t size;
kernstart_addr = start;
if (is_second_reloc) {
virt_phys_offset = PAGE_OFFSET - memstart_addr;
kaslr_late_init();
return;
}
start &= ~0x3ffffff;
base &= ~0x3ffffff;
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500_hugetlbpage.c |
static inline int tlb1_next(void) {
struct paca_struct *paca = get_paca();
struct tlb_core_data *tcd;
int this, next;
tcd = paca->tcd_ptr;
this = tcd->esel_next;
next = this + 1;
if (next >= tcd->esel_max)
next = tcd->esel_first;
tcd->esel_next = next;
return this;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500_hugetlbpage.c | static inline int tlb1_next(void) {
int index, ncams;
ncams = mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY;
index = this_cpu_read(next_tlbcam_idx);
if (unlikely(index == ncams - 1))
__this_cpu_write(next_tlbcam_idx, tlbcam_index);
else
__this_cpu_inc(next_tlbcam_idx);
return index;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/e500_hugetlbpage.c |
static inline int book3e_tlb_exists(unsigned long ea, unsigned long pid) {
int found = 0;
mtspr(SPRN_MAS6, pid << 16);
asm volatile("tlbsx 0,%1\n"
"mfspr %0,0x271\n"
"srwi %0,%0,31\n"
: "=&r"(found)
: "r"(ea));
return found;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/kaslr_booke.c |
static __init u64 get_kaslr_seed(void *fdt) {
int node, len;
fdt64_t *prop;
u64 ret;
node = fdt_path_offset(fdt, "/chosen");
if (node < 0)
return 0;
prop = fdt_getprop_w(fdt, node, "kaslr-seed", &len);
if (!prop || len != sizeof(u64))
return 0;
ret = fdt64_to_cpu(*prop);
*prop = 0;
retur... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/kaslr_booke.c |
static unsigned long __init kaslr_legal_offset(void *dt_ptr,
unsigned long index,
unsigned long offset) {
unsigned long koffset = 0;
unsigned long start;
while ((long)index >= 0) {
offset = memstart_addr + index * ... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/kaslr_booke.c | notrace void __init kaslr_early_init(void *dt_ptr, phys_addr_t size) {
unsigned long tlb_virt;
phys_addr_t tlb_phys;
unsigned long offset;
unsigned long kernel_sz;
kernel_sz = (unsigned long)_end - (unsigned long)_stext;
offset = kaslr_choose_location(dt_ptr, size, kernel_sz);
if (offset == 0)
retur... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/mmu_context.c | int init_new_context(struct task_struct *t, struct mm_struct *mm) {
mm->context.id = MMU_NO_CONTEXT;
mm->context.active = 0;
pte_frag_set(&mm->context, NULL);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/tlb.c | static inline int mmu_get_tsize(int psize) { return 0; }
#endif
#ifdef CONFIG_PPC_8xx | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/tlb.c |
void __local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
int tsize, int ind) {
unsigned int pid;
preempt_disable();
pid = mm ? mm->context.id : 0;
if (pid != MMU_NO_CONTEXT)
_tlbil_va(vmaddr, pid, tsize, ind);
preempt_enable();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/tlb.c |
static void do_flush_tlb_page_ipi(void *param) {
struct tlb_flush_param *p = param;
_tlbil_va(p->addr, p->pid, p->tsize, p->ind);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/tlb.c | void __flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr, int tsize,
int ind) {
struct cpumask *cpu_mask;
unsigned int pid;
if (WARN_ON(!mm))
return;
preempt_disable();
pid = mm->context.id;
if (unlikely(pid == MMU_NO_CONTEXT))
goto bail;
cpu_mask = mm_cpumask(mm);
... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/tlb.c | void tlb_flush(struct mmu_gather *tlb) { flush_tlb_mm(tlb->mm); }
#ifdef CONFIG_PPC64 | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/nohash/tlb.c | static void early_init_this_mmu(void) {
unsigned int mas4;
mas4 = 0x4 << MAS4_WIMGED_SHIFT;
switch (book3e_htw_mode) {
case PPC_HTW_E6500:
mas4 |= MAS4_INDD;
mas4 |= BOOK3E_PAGESZ_2M << MAS4_TSIZED_SHIFT;
mas4 |= MAS4_TLBSELD(1);
mmu_pte_psize = MMU_PAGE_2M;
break;
case PPC_HTW_IBM:
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | void unmap_cpu_from_node(unsigned long cpu) {
int node = numa_cpu_lookup_table[cpu];
if (cpumask_test_cpu(cpu, node_to_cpumask_map[node])) {
cpumask_clear_cpu(cpu, node_to_cpumask_map[node]);
pr_debug("removing cpu %lu from node %d\n", cpu, node);
} else {
pr_warn("Warning: cpu %lu not found in node ... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | int cpu_relative_distance(__be32 *cpu1_assoc, __be32 *cpu2_assoc) {
VM_WARN_ON(affinity_form == FORM0_AFFINITY);
if (affinity_form == FORM1_AFFINITY)
return __cpu_form1_relative_distance(cpu1_assoc, cpu2_assoc);
return __cpu_form2_relative_distance(cpu1_assoc, cpu2_assoc);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | static const __be32 *of_get_associativity(struct device_node *dev) {
return of_get_property(dev, "ibm,associativity", NULL);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | static int of_node_to_nid_single(struct device_node *device) {
int nid = NUMA_NO_NODE;
const __be32 *tmp;
tmp = of_get_associativity(device);
if (tmp)
nid = associativity_to_nid(tmp);
return nid;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | int of_node_to_nid(struct device_node *device) {
int nid = NUMA_NO_NODE;
of_node_get(device);
while (device) {
nid = of_node_to_nid_single(device);
if (nid != -1)
break;
device = of_get_next_parent(device);
}
of_node_put(device);
return nid;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | static void initialize_form1_numa_distance(const __be32 *associativity) {
int array_sz;
array_sz = of_read_number(associativity, 1);
__initialize_form1_numa_distance(associativity + 1, array_sz);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | static int __init get_nid_and_numa_distance(struct drmem_lmb *lmb) {
struct assoc_arrays aa = {.arrays = NULL};
int default_nid = NUMA_NO_NODE;
int nid = default_nid;
int rc, index;
if ((primary_domain_index < 0) || !numa_enabled)
return default_nid;
rc = of_get_assoc_arrays(&aa);
if (rc)
return... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c |
static int vphn_get_nid(long lcpu) {
__be32 associativity[VPHN_ASSOC_BUFSIZE] = {0};
if (!__vphn_get_associativity(lcpu, associativity))
return associativity_to_nid(associativity);
return NUMA_NO_NODE;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | static int __init numa_setup_drmem_lmb(struct drmem_lmb *lmb,
const __be32 **usm, void *data) {
unsigned int ranges, is_kexec_kdump = 0;
unsigned long base, size, sz;
int nid;
if ((lmb->flags & DRCONF_MEM_RESERVED) || !(lmb->flags & DRCONF_MEM_ASSIGNED))
return 0;
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c |
static void __init setup_nonnuma(void) {
unsigned long top_of_ram = memblock_end_of_DRAM();
unsigned long total_ram = memblock_phys_mem_size();
unsigned long start_pfn, end_pfn;
unsigned int nid = 0;
int i;
pr_debug("Top of RAM: 0x%lx, Total RAM: 0x%lx\n", top_of_ram, total_ram);
pr_debug("Memory hole s... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | static void __init find_possible_nodes(void) {
struct device_node *rtas;
const __be32 *domains = NULL;
int prop_length, max_nodes;
u32 i;
if (!numa_enabled)
return;
rtas = of_find_node_by_path("/rtas");
if (!rtas)
return;
if (!of_get_property(of_root, "ibm,migratable-partition", NULL))
do... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | void __init initmem_init(void) {
int nid;
memblock_dump_all();
for_each_online_node(nid) {
unsigned long start_pfn, end_pfn;
get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
setup_node_data(nid, start_pfn, end_pfn);
}
sparse_init();
cpuhp_setup_state_nocalls(CPUHP_POWER_NUMA_PREPARE, "powe... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c | int hot_add_scn_to_nid(unsigned long scn_addr) {
struct device_node *memory = NULL;
int nid;
if (!numa_enabled)
return first_online_node;
memory = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory");
if (memory) {
nid = hot_add_drconf_scn_to_nid(scn_addr);
of_node_put(memory);
} else {... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/numa.c |
static u64 hot_add_drconf_memory_max(void) {
struct device_node *memory = NULL;
struct device_node *dn = NULL;
const __be64 *lrdr = NULL;
dn = of_find_node_by_path("/rtas");
if (dn) {
lrdr = of_get_property(dn, "ibm,lrdr-capacity", NULL);
of_node_put(dn);
if (lrdr)
return be64_to_cpup(lrdr... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/pageattr.c | static int change_page_attr(pte_t *ptep, unsigned long addr, void *data) {
long action = (long)data;
addr &= PAGE_MASK;
switch (action) {
case SET_MEMORY_RO:
/* Don't clear DIRTY bit */
pte_update_delta(ptep, addr, _PAGE_KERNEL_RW & ~_PAGE_DIRTY,
_PAGE_KERNEL_RO);
break;
cas... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable-frag.c | void pte_frag_destroy(void *pte_frag) {
int count;
struct page *page;
page = virt_to_page(pte_frag);
count = ((unsigned long)pte_frag & ~PAGE_MASK) >> PTE_FRAG_SIZE_SHIFT;
/* We allow PTE_FRAG_NR fragments from a PTE page */
if (atomic_sub_and_test(PTE_FRAG_NR - count, &page->pt_frag_refcount)) {
pgta... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable-frag.c | static pte_t *__alloc_for_ptecache(struct mm_struct *mm, int kernel) {
void *ret = NULL;
struct page *page;
if (!kernel) {
page = alloc_page(PGALLOC_GFP | __GFP_ACCOUNT);
if (!page)
return NULL;
if (!pgtable_pte_page_ctor(page)) {
__free_page(page);
return NULL;
}
} else {
... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable-frag.c |
void pte_fragment_free(unsigned long *table, int kernel) {
struct page *page = virt_to_page(table);
if (PageReserved(page))
return free_reserved_page(page);
BUG_ON(atomic_read(&page->pt_frag_refcount) <= 0);
if (atomic_dec_and_test(&page->pt_frag_refcount)) {
if (!kernel)
pgtable_pte_page_dtor(... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c |
static inline int is_exec_fault(void) {
return current->thread.regs && TRAP(current->thread.regs) == 0x400;
} | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c | static pte_t set_pte_filter_hash(pte_t pte) {
pte = __pte(pte_val(pte) & ~_PAGE_HPTEFLAGS);
if (pte_looks_normal(pte) && !(cpu_has_feature(CPU_FTR_COHERENT_ICACHE) ||
cpu_has_feature(CPU_FTR_NOEXECUTE))) {
struct page *pg = maybe_pte_to_page(pte);
if (!pg)
return pte;
... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c | static inline pte_t set_pte_filter(pte_t pte) {
struct page *pg;
if (radix_enabled())
return pte;
if (mmu_has_feature(MMU_FTR_HPTE_TABLE))
return set_pte_filter_hash(pte);
if (!pte_exec(pte) || !pte_looks_normal(pte))
return pte;
/* If you set _PAGE_EXEC on weird pages you're on your own */
... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c | static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma,
int dirty) {
struct page *pg;
if (IS_ENABLED(CONFIG_PPC_BOOK3S_64))
return pte;
if (mmu_has_feature(MMU_FTR_HPTE_TABLE))
return pte;
/* So here, we only care about exec faults, as we use t... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c | int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address,
pte_t *ptep, pte_t entry, int dirty) {
int changed;
entry = set_access_flags_filter(entry, vma, dirty);
changed = !pte_same(*(ptep), entry);
if (changed) {
assert_pte_locked(vma->vm_mm, address);
__pte... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c | int huge_ptep_set_access_flags(struct vm_area_struct *vma, unsigned long addr,
pte_t *ptep, pte_t pte, int dirty) {
#ifdef HUGETLB_NEED_PRELOAD
ptep_set_access_flags(vma, addr, ptep, pte, dirty);
return 1;
#else
int changed, psize;
pte = set_access_flags_filter(pte, vma, dirty);... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable.c |
unsigned long vmalloc_to_phys(void *va) {
unsigned long pfn = vmalloc_to_pfn(va);
BUG_ON(!pfn);
return __pa(pfn_to_kaddr(pfn)) + offset_in_page(va);
} | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable_32.c |
notrace void __init early_ioremap_init(void) {
unsigned long addr = ALIGN_DOWN(FIXADDR_START, PGDIR_SIZE);
pte_t *ptep = (pte_t *)early_fixmap_pagetable;
pmd_t *pmdp = pmd_off_k(addr);
for (; (s32)(FIXADDR_TOP - addr) > 0;
addr += PGDIR_SIZE, ptep += PTRS_PER_PTE, pmdp++)
pmd_populate_kernel(&init_... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable_32.c |
pte_t __init *early_pte_alloc_kernel(pmd_t *pmdp, unsigned long va) {
if (pmd_none(*pmdp)) {
pte_t *ptep = early_alloc_pgtable(PTE_FRAG_SIZE);
pmd_populate_kernel(&init_mm, pmdp, ptep);
}
return pte_offset_kernel(pmdp, va);
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable_32.c | static void __init __mapin_ram_chunk(unsigned long offset, unsigned long top) {
unsigned long v, s;
phys_addr_t p;
bool ktext;
s = offset;
v = PAGE_OFFSET + s;
p = memstart_addr + s;
for (; s < top; s += PAGE_SIZE) {
ktext = core_kernel_text(v);
map_kernel_page(v, p, ktext ? PAGE_KERNEL_TEXT : PA... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable_32.c | void mark_rodata_ro(void) {
unsigned long numpages;
if (IS_ENABLED(CONFIG_STRICT_MODULE_RWX) &&
mmu_has_feature(MMU_FTR_HPTE_TABLE))
pr_warn("This platform has HASH MMU, STRICT_MODULE_RWX won't work\n");
if (v_block_mapped((unsigned long)_stext + 1)) {
mmu_mark_rodata_ro();
ptdump_check_wx();
... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/pgtable_64.c | void mark_rodata_ro(void) {
if (!mmu_has_feature(MMU_FTR_KERNEL_RO)) {
pr_warn("Warning: Unable to mark rodata read only on this CPU.\n");
return;
}
if (radix_enabled())
radix__mark_rodata_ro();
else
hash__mark_rodata_ro();
ptdump_check_wx();
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/bats.c |
static void bat_show_603(struct seq_file *m, int idx, u32 lower, u32 upper,
bool is_d) {
u32 bepi = upper & 0xfffe0000;
u32 bl = (upper >> 2) & 0x7ff;
u32 k = upper & 3;
phys_addr_t brpn = PHYS_BAT_ADDR(lower);
u32 size = (bl + 1) << 17;
seq_printf(m, "%d: ", idx);
if (k == 0) {... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/bats.c |
static int __init bats_init(void) {
debugfs_create_file("block_address_translation", 0400, arch_debugfs_dir, NULL,
&bats_fops);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/hashpagetable.c | static void decode_r(int bps, unsigned long r, unsigned long *rpn, int *aps,
unsigned long *lp_bits) {
struct mmu_psize_def entry;
unsigned long arpn, mask, lp;
int penc = -2, idx = 0, shift;
arpn = (r & HPTE_R_RPN) >> HPTE_R_RPN_SHIFT;
lp = arpn & 0xff;
entry = mmu_psize_defs[bps];
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/hashpagetable.c | static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start) {
pte_t *pte = pte_offset_kernel(pmd, 0);
unsigned long addr, pteval, psize;
int i, status;
for (i = 0; i < PTRS_PER_PTE; i++, pte++) {
addr = start + i * PAGE_SIZE;
pteval = pte_val(*pte);
if (addr < VMALLOC_END)
psi... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/hashpagetable.c | static void walk_pud(struct pg_state *st, p4d_t *p4d, unsigned long start) {
pud_t *pud = pud_offset(p4d, 0);
unsigned long addr;
unsigned int i;
for (i = 0; i < PTRS_PER_PUD; i++, pud++) {
addr = start + i * PUD_SIZE;
if (!pud_none(*pud))
walk_pmd(st, pud, addr);
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/hashpagetable.c | static void walk_pagetables(struct pg_state *st) {
pgd_t *pgd = pgd_offset_k(0UL);
unsigned int i;
unsigned long addr;
for (i = 0; i < PTRS_PER_PGD; i++, pgd++) {
addr = KERN_VIRT_START + i * PGDIR_SIZE;
if (!pgd_none(*pgd))
/* pgd exists */
walk_p4d(st, pgd, addr);
}
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/hashpagetable.c | static void walk_vmemmap(struct pg_state *st) {
struct vmemmap_backing *ptr = vmemmap_list;
if (!IS_ENABLED(CONFIG_SPARSEMEM_VMEMMAP))
return;
while (ptr->list) {
hpte_find(st, ptr->virt_addr, mmu_vmemmap_psize);
ptr = ptr->list;
}
seq_puts(st->seq, "---[ vmemmap end ]---\n");
} | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/hashpagetable.c |
static void populate_markers(void) {
address_markers[0].start_address = PAGE_OFFSET;
address_markers[1].start_address = VMALLOC_START;
address_markers[2].start_address = VMALLOC_END;
address_markers[3].start_address = ISA_IO_BASE;
address_markers[4].start_address = ISA_IO_END;
address_markers[5].start_addr... | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/ptdump.c | static void dump_flag_info(struct pg_state *st, const struct flag_info *flag,
u64 pte, int num) {
unsigned int i;
for (i = 0; i < num; i++, flag++) {
const char *s = NULL;
u64 val;
if (flag->mask == 0)
continue;
/* Some 'flags' are actually values */
if (flag->... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/ptdump.c |
static void note_page_update_state(struct pg_state *st, unsigned long addr,
int level, u64 val) {
u64 flag = level >= 0 ? val & pg_level[level].mask : 0;
u64 pa = val & PTE_RPN_MASK;
st->level = level;
st->current_flags = flag;
st->start_address = addr;
st->start_pa = pa... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/ptdump.c |
static void __init build_pgtable_complete_mask(void) {
unsigned int i, j;
for (i = 0; i < ARRAY_SIZE(pg_level); i++)
if (pg_level[i].flag)
for (j = 0; j < pg_level[i].num; j++)
pg_level[i].mask |= pg_level[i].flag[j].mask;
}
#ifdef CONFIG_DEBUG_WX | [
0,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/ptdump.c | void ptdump_check_wx(void) {
struct pg_state st = {.seq = NULL,
.marker =
(struct addr_marker[]){
{0, NULL},
{-1, NULL},
},
.level = -1,
... | [
1,
0
] |
Linux Kernel | arch/powerpc/mm/ptdump/segment_regs.c |
static void seg_show(struct seq_file *m, int i) {
u32 val = mfsr(i << 28);
seq_printf(m, "0x%01x0000000-0x%01xfffffff ", i, i);
seq_printf(m, "Kern key %d ", (val >> 30) & 1);
seq_printf(m, "User key %d ", (val >> 29) & 1);
if (val & 0x80000000) {
seq_printf(m, "Device 0x%03x", (val >> 20) & 0x1ff);
... | [
1,
0
] |
Linux Kernel | arch/powerpc/net/bpf_jit.h |
static inline void bpf_clear_seen_register(struct codegen_context *ctx, int i) {
ctx->seen &= ~(1 << (31 - i));
} | [
0,
0
] |
Linux Kernel | arch/powerpc/net/bpf_jit_comp64.c |
static int bpf_jit_stack_tailcallcnt(struct codegen_context *ctx) {
return bpf_jit_stack_local(ctx) + 16;
} | [
0,
0
] |
Linux Kernel | arch/powerpc/net/bpf_jit_comp64.c | static void bpf_jit_emit_common_epilogue(u32 *image,
struct codegen_context *ctx) {
int i;
for (i = BPF_REG_6; i <= BPF_REG_10; i++)
if (bpf_is_seen_register(ctx, bpf_to_ppc(i)))
EMIT(PPC_RAW_LD(bpf_to_ppc(i), _R1,
bpf_jit_stack_offsetof(ctx,... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.