Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/powerpc/kvm/mpic.c
void kvmppc_mpic_disconnect_vcpu(struct openpic *opp, struct kvm_vcpu *vcpu) { BUG_ON(!opp->dst[vcpu->arch.irq_cpu_id].vcpu); opp->dst[vcpu->arch.irq_cpu_id].vcpu = NULL; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/mpic.c
int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e, struct kvm *kvm, int irq_source_id, int level, bool line_status) { struct openpic *opp = kvm->arch.mpic; unsigned long flags; spin_lock_irqsave(&opp->lock, flags); /* * XXX We ignore the target address for now, as we only support * ...
[ 0, 1 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu) { return false; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu) { return 1; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
static void kvmppc_swab_shared(struct kvm_vcpu *vcpu) { struct kvm_vcpu_arch_shared *shared = vcpu->arch.shared; int i; shared->sprg0 = swab64(shared->sprg0); shared->sprg1 = swab64(shared->sprg1); shared->sprg2 = swab64(shared->sprg2); shared->sprg3 = swab64(shared->sprg3); shared->srr0 = swab64(shared-...
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvmppc_st(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr, bool data) { ulong mp_pa = vcpu->arch.magic_page_pa & KVM_PAM & PAGE_MASK; struct kvmppc_pte pte; int r = -EINVAL; vcpu->stat.st++; if (vcpu->kvm->arch.kvm_ops && vcpu->kvm->arch.kvm_ops->store_to_eaddr) r = vcpu->kvm-...
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvmppc_ld(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr, bool data) { ulong mp_pa = vcpu->arch.magic_page_pa & KVM_PAM & PAGE_MASK; struct kvmppc_pte pte; int rc = -EINVAL; vcpu->stat.ld++; if (vcpu->kvm->arch.kvm_ops && vcpu->kvm->arch.kvm_ops->load_from_eaddr) rc = vcpu->k...
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
long kvm_arch_dev_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { return -EINVAL; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) { kvmppc_core_vcpu_put(vcpu); #ifdef CONFIG_BOOKE vcpu->arch.vrsave = mfspr(SPRN_VRSAVE); #endif }
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *cons, struct irq_bypass_producer *prod) { struct kvm_kernel_irqfd *irqfd = container_of(cons, struct kvm_kernel_irqfd, consumer); struct kvm *kvm = irqfd->kvm; if (kvm->arch.kvm_ops->irq_bypass_add_produc...
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
static inline void kvmppc_set_vsr_word_dump(struct kvm_vcpu *vcpu, u32 gpr) { union kvmppc_one_reg val; int index = vcpu->arch.io_gpr & KVM_MMIO_REG_MASK; if (index >= 32) { val.vsx32val[0] = gpr; val.vsx32val[1] = gpr; val.vsx32val[2] = gpr; val.vsx32val[3] = gpr; VCPU_VSX_VR(vcpu, index - ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvmppc_handle_vsx_load(struct kvm_vcpu *vcpu, unsigned int rt, unsigned int bytes, int is_default_endian, int mmio_sign_extend) { enum emulation_result emulated = EMULATE_DONE; if (vcpu->arch.mmio_vsx_copy_nums > 4) return EMULATE_FAIL; while (vcpu->...
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvmppc_handle_vsx_store(struct kvm_vcpu *vcpu, int rs, unsigned int bytes, int is_default_endian) { u64 val; enum emulation_result emulated = EMULATE_DONE; vcpu->arch.io_gpr = rs; if (vcpu->arch.mmio_vsx_copy_nums > 4) return EMULATE_FAIL; while (vcpu->arch.mmio_vsx_copy...
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
int kvmppc_handle_vmx_load(struct kvm_vcpu *vcpu, unsigned int rt, unsigned int bytes, int is_default_endian) { enum emulation_result emulated = EMULATE_DONE; if (vcpu->arch.mmio_vmx_copy_nums > 2) return EMULATE_FAIL; while (vcpu->arch.mmio_vmx_copy_nums) { emulated = __kvmpp...
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
static int kvmppc_get_vmx_hword(struct kvm_vcpu *vcpu, int index, u64 *val) { union kvmppc_one_reg reg; int vmx_offset = 0; int result = 0; vmx_offset = kvmppc_get_vmx_hword_offset(vcpu, vcpu->arch.mmio_vmx_offset); if (vmx_offset == -1) return -1; reg.vval = VCPU_VSX_VR(vcpu, index); *val = reg.v...
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
static int kvmppc_emulate_mmio_vmx_loadstore(struct kvm_vcpu *vcpu) { struct kvm_run *run = vcpu->run; enum emulation_result emulated = EMULATE_FAIL; int r; vcpu->arch.paddr_accessed += run->mmio.len; if (!vcpu->mmio_is_write) { emulated = kvmppc_handle_vmx_load(vcpu, vcpu->arch.io_gpr, run->mm...
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/powerpc.c
long kvm_arch_vcpu_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { struct kvm_vcpu *vcpu = filp->private_data; void __user *argp = (void __user *)arg; long r; switch (ioctl) { case KVM_ENABLE_CAP: { struct kvm_enable_cap cap; r = -EFAULT; if (copy_from_...
[ 1, 0 ]
Linux Kernel
arch/powerpc/kvm/timing.c
static int kvmppc_exit_timing_show(struct seq_file *m, void *private) { struct kvm_vcpu *vcpu = m->private; int i; u64 min, max, sum, sum_quad; seq_puts(m, "type count min max sum sum_squared\n"); for (i = 0; i < __NUMBER_OF_KVM_EXIT_TYPES; i++) { min = vcpu->arch.timing_min_duration[i]; do_div(mi...
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/timing.h
static inline int kvmppc_create_vcpu_debugfs_e500(struct kvm_vcpu *vcpu, struct dentry *debugfs_dentry) { return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/timing.h
static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {} #endif
[ 0, 0 ]
Linux Kernel
arch/powerpc/kvm/timing.h
static inline void kvmppc_account_exit(struct kvm_vcpu *vcpu, int type) { kvmppc_set_exit_type(vcpu, type); kvmppc_account_exit_stat(vcpu, type); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/checksum_wrappers.c
__wsum csum_and_copy_to_user(const void *src, void __user *dst, int len) { __wsum csum; if (unlikely(!user_write_access_begin(dst, len))) return 0; csum = csum_partial_copy_generic(src, (void __force *)dst, len); user_write_access_end(); return csum; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
static int text_area_cpu_up(unsigned int cpu) { struct vm_struct *area; unsigned long addr; int err; area = get_vm_area(PAGE_SIZE, VM_ALLOC); if (!area) { WARN_ONCE(1, "Failed to create text area for cpu %d\n", cpu); return -1; } addr = (unsigned long)area->addr; err = map_patch_area(empty_zer...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
static int map_patch_area(void *addr, unsigned long text_poke_addr) { unsigned long pfn = get_patch_pfn(addr); return map_kernel_page(text_poke_addr, (pfn << PAGE_SHIFT), PAGE_KERNEL); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
static int do_patch_instruction(u32 *addr, ppc_inst_t instr) { int err; unsigned long flags; if (!static_branch_likely(&poking_init_done)) return raw_patch_instruction(addr, instr); local_irq_save(flags); err = __do_patch_instruction(addr, instr); local_irq_restore(flags); return err; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
bool is_conditional_branch(ppc_inst_t instr) { unsigned int opcode = ppc_inst_primary_opcode(instr); if (opcode == 16) return true; if (opcode == 19) { switch ((ppc_inst_val(instr) >> 1) & 0x3ff) { case 16: /* bclr, bclrl */ case 528: /* bcctr, bcctrl */ case 560: /* bctar, bctarl */ r...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
int instr_is_relative_link_branch(ppc_inst_t instr) { return instr_is_relative_branch(instr) && (ppc_inst_val(instr) & BRANCH_SET_LINK); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
static unsigned long branch_iform_target(const u32 *instr) { signed long imm; imm = ppc_inst_val(ppc_inst_read(instr)) & 0x3FFFFFC; if (imm & 0x2000000) imm -= 0x4000000; if ((ppc_inst_val(ppc_inst_read(instr)) & BRANCH_ABSOLUTE) == 0) imm += (unsigned long)instr; return (unsigned long)imm; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/code-patching.c
unsigned long branch_target(const u32 *instr) { if (instr_is_branch_iform(ppc_inst_read(instr))) return branch_iform_target(instr); else if (instr_is_branch_bform(ppc_inst_read(instr))) return branch_bform_target(instr); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
static int patch_feature_section(unsigned long value, struct fixup_entry *fcur) { u32 *start, *end, *alt_start, *alt_end, *src, *dest; start = calc_addr(fcur, fcur->start_off); end = calc_addr(fcur, fcur->end_off); alt_start = calc_addr(fcur, fcur->alt_start_off); alt_end = ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
static int __do_rfi_flush_fixups(void *data) { enum l1d_flush_type types = *(enum l1d_flush_type *)data; unsigned int instrs[3], *dest; long *start, *end; int i; start = PTRRELOC(&__start___rfi_flush_fixup); end = PTRRELOC(&__stop___rfi_flush_fixup); instrs[0] = PPC_RAW_NOP(); instrs[1] = PPC_RAW_NOP(...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
void do_barrier_nospec_fixups(bool enable) { void *start, *end; start = PTRRELOC(&__start___barrier_nospec_fixup); end = PTRRELOC(&__stop___barrier_nospec_fixup); do_barrier_nospec_fixups_range(enable, start, end); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
void __init setup_feature_keys(void) { jump_label_init(); cpu_feature_keys_init(); mmu_feature_keys_init(); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
static void test_alternative_case_with_branch(void) { extern unsigned int ftr_fixup_test5[]; extern unsigned int end_ftr_fixup_test5[]; extern unsigned int ftr_fixup_test5_expected[]; int size = 4 * (end_ftr_fixup_test5 - ftr_fixup_test5); check(memcmp(ftr_fixup_test5, ftr_fixup_test5_expected, size) == 0);...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
static void __init test_alternative_case_with_external_branch(void) { extern unsigned int ftr_fixup_test6[]; extern unsigned int end_ftr_fixup_test6[]; extern unsigned int ftr_fixup_test6_expected[]; int size = 4 * (end_ftr_fixup_test6 - ftr_fixup_test6); check(memcmp(ftr_fixup_test6, ftr_fixup_test6_expect...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/feature-fixups.c
static void __init test_prefix_word_alt_patching(void) { extern unsigned int ftr_fixup_prefix3[]; extern unsigned int end_ftr_fixup_prefix3[]; extern unsigned int ftr_fixup_prefix3_orig[]; extern unsigned int ftr_fixup_prefix3_expected[]; extern unsigned int ftr_fixup_prefix3_alt[]; int size = sizeof(unsign...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/locks.c
void splpar_spin_yield(arch_spinlock_t *lock) { unsigned int lock_value, holder_cpu, yield_count; lock_value = lock->slock; if (lock_value == 0) return; holder_cpu = lock_value & 0xffff; BUG_ON(holder_cpu >= NR_CPUS); yield_count = yield_count_of(holder_cpu); if ((yield_count & 1) == 0) return; ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/pmem.c
static inline void __clean_pmem_range(unsigned long start, unsigned long stop) { unsigned long shift = l1_dcache_shift(); unsigned long bytes = l1_dcache_bytes(); void *addr = (void *)(start & ~(bytes - 1)); unsigned long size = stop - (unsigned long)addr + (bytes - 1); unsigned long i; for (i = 0; i < si...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/pmem.c
static inline void flush_pmem_range(unsigned long start, unsigned long stop) { if (cpu_has_feature(CPU_FTR_ARCH_207S)) return __flush_pmem_range(start, stop); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/pmem.c
void memcpy_page_flushcache(char *to, struct page *page, size_t offset, size_t len) { memcpy_flushcache(to, page_to_virt(page) + offset, len); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/restart_table.c
bool search_kernel_soft_mask_table(unsigned long addr) { struct soft_mask_table_entry *smte = __start___soft_mask_table; while (smte < __stop___soft_mask_table) { unsigned long start = smte->start; unsigned long end = smte->end; if (addr >= start && addr < end) return true; smte++; } re...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/rheap.c
static inline void release_slot(rh_info_t *info, rh_block_t *blk) { list_add(&blk->list, &info->empty_list); info->empty_slots++; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/rheap.c
void rh_destroy(rh_info_t *info) { if ((info->flags & RHIF_STATIC_BLOCK) == 0) kfree(info->block); if ((info->flags & RHIF_STATIC_INFO) == 0) kfree(info); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/rheap.c
int rh_attach_region(rh_info_t *info, unsigned long start, int size) { rh_block_t *blk; unsigned long s, e, m; int r; s = start; e = s + size; m = info->alignment - 1; /* Round start up */ s = (s + m) & ~m; /* Round end down */ e = e & ~m; if (IS_ERR_VALUE(e) || (e < s)) return -ERANGE; ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/rheap.c
int rh_free(rh_info_t *info, unsigned long start) { rh_block_t *blk, *blk2; struct list_head *l; int size; blk = NULL; list_for_each(l, &info->taken_list) { blk2 = list_entry(l, rh_block_t, list); if (start < blk2->start) break; blk = blk2; } if (blk == NULL || start > (blk->start + bl...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline unsigned long truncate_if_32bit(unsigned long msr, unsigned long val) { if ((msr & MSR_64BIT) == 0) val &= 0xffffffffUL; return val; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline int branch_taken(unsigned int instr, const struct pt_regs *regs, struct instruction_op *op) { unsigned int bo = (instr >> 21) & 0x1f; unsigned int bi; if ((bo & 4) == 0) { op->type |= DECCTR; if (((bo ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline unsigned long dsform_ea(unsigned int instr, const struct pt_regs *regs) { int ra; unsigned long ea; ra = (instr >> 16) & 0x1f; ea = (signed short)(instr & ~3); if (ra) ea += regs->gpr[ra]; return ea; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline unsigned long max_align(unsigned long x) { x |= sizeof(unsigned long); return x & -x; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline int __copy_mem_out(u8 *dest, unsigned long ea, int nb, struct pt_regs *regs) { int c; for (; nb > 0; nb -= c) { c = max_align(ea); if (c > nb) c = max_align(nb); switch (c) { case 1: unsafe_put_user(*dest, (u8 __user *)ea,...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline int write_mem_unaligned(unsigned long val, unsigned long ea, int nb, struct pt_regs *regs) { union { unsigned long ul; u8 b[sizeof(unsigned long)]; } u; int i; u.ul = val; i = IS_BE ?...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static int do_fp_store(struct instruction_op *op, unsigned long ea, struct pt_regs *regs, bool cross_endian) { int rn, nb; union { unsigned int u; float f; double d[2]; unsigned long l[2]; u8 b[2 * sizeof(double)]; } u; nb = GETSIZE(op->type); if (!address_ok(regs,...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline int do_vec_store(int rn, unsigned long ea, int size, struct pt_regs *regs, bool cross_endian) { union { __vector128 v; u8 b[sizeof(__vector128)]; } u; if (!address_ok(regs, ea & ~0xfUL, 16)) return ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline int emulate_lq(struct pt_regs *regs, unsigned long ea, int reg, bool cross_endian) { int err; if (!address_ok(regs, ea, 16)) return -EFAULT; if ((ea & 0xf) == 0) { err = do_lq(ea, &regs->gpr[reg]); } else { err = read_mem(&regs->gpr[reg ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
int emulate_dcbz(unsigned long ea, struct pt_regs *regs) { int err; unsigned long size = l1_dcache_bytes(); ea = truncate_if_32bit(regs->msr, ea); ea &= ~(size - 1); if (!address_ok(regs, ea, size)) return -EFAULT; if (is_kernel_addr(ea)) { err = __emulate_dcbz(ea); } else if (user_write_access...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline void add_with_carry(const struct pt_regs *regs, struct instruction_op *op, int rd, unsigned long val1, unsigned long val2, unsigned long carry_in) { unsigned long val = val1 + val2; if (carry_in) ++val; op->type = COMPUTE | SETREG | SETXER; op->reg = rd; op->val = v...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline void do_bpermd(const struct pt_regs *regs, struct instruction_op *op, unsigned long v1, unsigned long v2) { unsigned char perm, idx; unsigned int i; perm = 0; for (i = 0; i < 8; i++) { idx = (v1 >> (i * 8)) &...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/sstep.c
static nokprobe_inline int handle_stack_update(unsigned long ea, struct pt_regs *regs) { WARN_ON(test_thread_flag(TIF_EMULATE_STACK_STORE)); set_thread_flag(TIF_EMULATE_STACK_STORE); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/test-code-patching.c
static void __init test_create_function_call(void) { u32 *iptr; unsigned long dest; ppc_inst_t instr; iptr = (u32 *)ppc_function_entry(test_trampoline); dest = ppc_function_entry(test_create_function_call); create_branch(&instr, iptr, dest, BRANCH_SET_LINK); patch_instruction(iptr, instr); check(instr_...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init init_pt_regs(struct pt_regs *regs) { static unsigned long msr; static bool msr_cached; memset(regs, 0, sizeof(struct pt_regs)); if (likely(msr_cached)) { regs->msr = msr; return; } asm volatile("mfmsr %0" : "=r"(regs->msr)); regs->msr |= MSR_FP; regs->msr |= MSR_VEC; re...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init show_result_with_descr(char *mnemonic, char *descr, char *result) { pr_info("%-14s : %-50s %s\n", mnemonic, descr, result); }
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_ld(void) { struct pt_regs regs; unsigned long a = 0x23; int stepped = -1; init_pt_regs(&regs); regs.gpr[3] = (unsigned long)&a; stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LD(5, 3, 0))); if (stepped == 1 && regs.gpr[5] == a) show_result("ld", "PASS"); else show_resu...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_pld(void) { struct pt_regs regs; unsigned long a = 0x23; int stepped = -1; if (!cpu_has_feature(CPU_FTR_ARCH_31)) { show_result("pld", "SKIP (!CPU_FTR_ARCH_31)"); return; } init_pt_regs(&regs); regs.gpr[3] = (unsigned long)&a; stepped = emulate_step(&regs, TEST_PLD(5, ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_plwz(void) { struct pt_regs regs; unsigned int a = 0x4545; int stepped = -1; if (!cpu_has_feature(CPU_FTR_ARCH_31)) { show_result("plwz", "SKIP (!CPU_FTR_ARCH_31)"); return; } init_pt_regs(&regs); regs.gpr[3] = (unsigned long)&a; stepped = emulate_step(&regs, TEST_PLWZ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_lwzx(void) { struct pt_regs regs; unsigned int a[3] = {0x0, 0x0, 0x1234}; int stepped = -1; init_pt_regs(&regs); regs.gpr[3] = (unsigned long)a; regs.gpr[4] = 8; regs.gpr[5] = 0x8765; stepped = emulate_step(&regs, ppc_inst(PPC_RAW_LWZX(5, 3, 4))); if (stepped == 1 && regs.gpr...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_pstd(void) { struct pt_regs regs; unsigned long a = 0x1234; int stepped = -1; if (!cpu_has_feature(CPU_FTR_ARCH_31)) { show_result("pstd", "SKIP (!CPU_FTR_ARCH_31)"); return; } init_pt_regs(&regs); regs.gpr[3] = (unsigned long)&a; regs.gpr[5] = 0x5678; stepped = emul...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_ldarx_stdcx(void) { struct pt_regs regs; unsigned long a = 0x1234; int stepped = -1; unsigned long cr0_eq = 0x1 << 29; init_pt_regs(&regs); asm volatile("mfcr %0" : "=r"(regs.ccr)); /*** ldarx ***/ regs.gpr[3] = (unsigned long)&a; regs.gpr[4] = 0; regs.gpr[5] = 0x5678; ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init test_lxvp_stxvp(void) { show_result("lxvp", "SKIP (CONFIG_VSX is not set)"); show_result("stxvp", "SKIP (CONFIG_VSX is not set)"); } #endif
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static void __init run_tests_load_store(void) { test_ld(); test_pld(); test_lwz(); test_plwz(); test_lwzx(); test_std(); test_pstd(); test_ldarx_stdcx(); test_lfsx_stfsx(); test_plfs_pstfs(); test_lfdx_stfdx(); test_plfd_pstfd(); test_lvx_stvx(); test_lxvd2x_stxvd2x(); test_lxvp_stxvp(); ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static int __init emulate_compute_instr(struct pt_regs *regs, ppc_inst_t instr, bool negative) { int analysed; struct instruction_op op; if (!regs || !ppc_inst_val(instr)) return -EINVAL; regs->nip = patch_site_addr(&patch__exec_instr); analysed = analyse_instr(&...
[ 1, 0 ]
Linux Kernel
arch/powerpc/lib/test_emulate_step.c
static int __init test_emulate_step(void) { printk(KERN_INFO "Running instruction emulation self-tests ...\n"); run_tests_load_store(); run_tests_compute(); return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/vmx-helper.c
int enter_vmx_ops(void) { if (in_interrupt()) return 0; preempt_disable(); enable_kernel_altivec(); return 1; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/vmx-helper.c
void *exit_vmx_ops(void *dest) { disable_kernel_altivec(); preempt_enable(); return dest; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/lib/xor_vmx.c
void __xor_altivec_3(unsigned long bytes, unsigned long *__restrict v1_in, const unsigned long *__restrict v2_in, const unsigned long *__restrict v3_in) { DEFINE(v1); DEFINE(v2); DEFINE(v3); unsigned long lines = bytes / (sizeof(unative_t)) / 4; do { LOAD(v1); ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/math-emu/fadd.c
int fadd(void *frD, void *frA, void *frB) { FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(R); FP_DECL_EX; #ifdef DEBUG printk("%s: %p %p %p\n", __func__, frD, frA, frB); #endif FP_UNPACK_DP(A, frA); FP_UNPACK_DP(B, frB); #ifdef DEBUG printk("A: %ld %lu %lu %ld (%ld)\n", A_s, A_f1, A_f0, A_e, A_c); printk(...
[ 0, 0 ]
Linux Kernel
arch/powerpc/math-emu/fcmpu.c
int fcmpu(u32 *ccr, int crfD, void *frA, void *frB) { FP_DECL_D(A); FP_DECL_D(B); FP_DECL_EX; int code[4] = {(1 << 3), (1 << 1), (1 << 2), (1 << 0)}; long cmp; #ifdef DEBUG printk("%s: %p (%08x) %d %p %p\n", __func__, ccr, *ccr, crfD, frA, frB); #endif FP_UNPACK_DP(A, frA); FP_UNPACK_DP(B, frB); #if...
[ 0, 0 ]
Linux Kernel
arch/powerpc/math-emu/fmsub.c
int fmsub(void *frD, void *frA, void *frB, void *frC) { FP_DECL_D(R); FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(C); FP_DECL_D(T); FP_DECL_EX; #ifdef DEBUG printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC); #endif FP_UNPACK_DP(A, frA); FP_UNPACK_DP(B, frB); FP_UNPACK_DP(C, frC); #ifdef DEBUG ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/math-emu/fnmadd.c
int fnmadd(void *frD, void *frA, void *frB, void *frC) { FP_DECL_D(R); FP_DECL_D(A); FP_DECL_D(B); FP_DECL_D(C); FP_DECL_D(T); FP_DECL_EX; #ifdef DEBUG printk("%s: %p %p %p %p\n", __func__, frD, frA, frB, frC); #endif FP_UNPACK_DP(A, frA); FP_UNPACK_DP(B, frB); FP_UNPACK_DP(C, frC); #ifdef DEBUG...
[ 1, 0 ]
Linux Kernel
arch/powerpc/math-emu/frsqrte.c
int frsqrte(void *frD, void *frB) { #ifdef DEBUG printk("%s: %p %p\n", __func__, frD, frB); #endif return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/math-emu/mcrfs.c
int mcrfs(u32 *ccr, u32 crfD, u32 crfS) { u32 value, clear; #ifdef DEBUG printk("%s: %p (%08x) %d %d\n", __func__, ccr, *ccr, crfD, crfS); #endif clear = 15 << ((7 - crfS) << 2); if (!crfS) clear = 0x90000000; value = (__FPU_FPSCR >> ((7 - crfS) << 2)) & 15; __FPU_FPSCR &= ~(clear); *ccr &= ~(15 ...
[ 1, 0 ]
Linux Kernel
arch/powerpc/math-emu/mtfsb0.c
int mtfsb0(int crbD) { if ((crbD != 1) && (crbD != 2)) __FPU_FPSCR &= ~(1 << (31 - crbD)); #ifdef DEBUG printk("%s: %d %08lx\n", __func__, crbD, __FPU_FPSCR); #endif return 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/math-emu/mtfsfi.c
int mtfsfi(unsigned int crfD, unsigned int IMM) { u32 mask = 0xf; if (!crfD) mask = 9; __FPU_FPSCR &= ~(mask << ((7 - crfD) << 2)); __FPU_FPSCR |= (IMM & 0xf) << ((7 - crfD) << 2); #ifdef DEBUG printk("%s: %d %x: %08lx\n", __func__, crfD, IMM, __FPU_FPSCR); #endif return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/kuap.c
void setup_kuap(bool disabled) { if (!disabled) { kuap_lock_all_ool(); init_mm.context.sr0 |= SR_KS; current->thread.sr0 |= SR_KS; } if (smp_processor_id() != boot_cpuid) return; if (disabled) static_branch_enable(&disable_kuap_key); else pr_info("Activating Kernel Userspace Access ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/mmu.c
phys_addr_t v_block_mapped(unsigned long va) { int b; for (b = 0; b < ARRAY_SIZE(bat_addrs); ++b) if (va >= bat_addrs[b].start && va < bat_addrs[b].limit) return bat_addrs[b].phys + (va - bat_addrs[b].start); return 0; }
[ 1, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/mmu.c
static void clearibat(int index) { struct ppc_bat *bat = BATS[index]; bat[0].batu = 0; bat[0].batl = 0; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/mmu.c
static bool is_module_segment(unsigned long addr) { if (!IS_ENABLED(CONFIG_MODULES)) return false; if (addr < ALIGN_DOWN(MODULES_VADDR, SZ_256M)) return false; if (addr > ALIGN(MODULES_END, SZ_256M) - 1) return false; return true; }
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/mmu.c
void __init setbat(int index, unsigned long virt, phys_addr_t phys, unsigned int size, pgprot_t prot) { unsigned int bl; int wimgxpp; struct ppc_bat *bat; unsigned long flags = pgprot_val(prot); if (index == -1) index = find_free_bat(); if (index == -1) { pr_err("%s: no BAT avail...
[ 1, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/mmu.c
void __init MMU_init_hw(void) { unsigned int n_hpteg, lg_n_hpteg; if (!mmu_has_feature(MMU_FTR_HPTE_TABLE)) return; if (ppc_md.progress) ppc_md.progress("hash:enter", 0x105); #define LG_HPTEG_SIZE 6 #define SDR1_LOW_BITS ((n_hpteg - 1) >> 10) #define MIN_N_HPTEG 1024 /* min 64kB hash table */ /* ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/mmu_context.c
void __destroy_context(unsigned long ctx) { clear_bit(ctx, context_map); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s32/tlb.c
void hash__flush_tlb_mm(struct mm_struct *mm) { struct vm_area_struct *mp; VMA_ITERATOR(vmi, mm, 0); for_each_vma(vmi, mp) hash__flush_range(mp->vm_mm, mp->vm_start, mp->vm_end); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_native.c
static inline void native_lock_hpte(struct hash_pte *hptep) { unsigned long *word = (unsigned long *)&hptep->v; acquire_hpte_lock(); while (1) { if (!test_and_set_bit_lock(HPTE_LOCK_BIT, word)) break; spin_begin(); while (test_bit(HPTE_LOCK_BIT, word)) spin_cpu_relax(); spin_end(); ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_native.c
static inline void native_unlock_hpte(struct hash_pte *hptep) { unsigned long *word = (unsigned long *)&hptep->v; release_hpte_lock(); clear_bit_unlock(HPTE_LOCK_BIT, word); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_native.c
static long native_hpte_updatepp(unsigned long slot, unsigned long newpp, unsigned long vpn, int bpsize, int apsize, int ssize, unsigned long flags) { struct hash_pte *hptep = htab_address + slot; unsigned long hpte_v, want_v; int ret = 0, local = ...
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_native.c
static void native_hugepage_invalidate(unsigned long vsid, unsigned long addr, unsigned char *hpte_slot_array, int psize, int ssize, int local) { WARN(1, "%s called without THP support\n", __func__); }
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_native.c
static notrace void native_hpte_clear(void) { unsigned long vpn = 0; unsigned long slot, slots; struct hash_pte *hptep = htab_address; unsigned long hpte_v; unsigned long pteg_count; int psize, apsize, ssize; pteg_count = htab_hash_mask + 1; slots = pteg_count * HPTES_PER_GROUP; for (slot = 0; slot...
[ 1, 1 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_pgtable.c
pmd_t hash__pmdp_huge_get_and_clear(struct mm_struct *mm, unsigned long addr, pmd_t *pmdp) { pmd_t old_pmd; pgtable_t pgtable; unsigned long old; pgtable_t *pgtable_slot; old = pmd_hugepage_update(mm, addr, pmdp, ~0UL, 0); old_pmd = __pmd(old); pgtable_slot = (pgtable...
[ 1, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_pgtable.c
static void change_memory_range(unsigned long start, unsigned long end, unsigned int step, unsigned long newpp) { unsigned long idx; pr_debug( "Changing page protection on range 0x%lx-0x%lx, to 0x%lx, step 0x%x\n", start, end, newpp, step); for (idx = start; idx < end...
[ 1, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_pgtable.c
static bool hash__change_memory_range(unsigned long start, unsigned long end, unsigned long newpp) { unsigned int step, shift; shift = mmu_psize_defs[mmu_linear_psize].shift; step = 1 << shift; start = ALIGN_DOWN(start, step); end = ALIGN(end, step); if (start >= end...
[ 0, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_utils.c
static __always_inline void tlbiel_hash_set_isa300(unsigned int set, unsigned int is, unsigned int pid, unsigned int ric, unsigned int prs) { unsigned long rb; unsigned long rs; unsigned int r = 0; rb = (set << PPC_BITLSHIFT(51)) | (is << PPC_BITLSHIFT(53)); rs = ((unsigned long)pid <<...
[ 1, 0 ]
Linux Kernel
arch/powerpc/mm/book3s64/hash_utils.c
static void tlbiel_all_isa206(unsigned int num_sets, unsigned int is) { unsigned int set; asm volatile("ptesync" : : : "memory"); for (set = 0; set < num_sets; set++) tlbiel_hash_set_isa206(set, is); ppc_after_tlbiel_barrier(); }
[ 0, 0 ]