Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/kvm/x86.c
void kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu) { struct kvm *kvm = vcpu->kvm; if (mutex_lock_killable(&vcpu->mutex)) return; vcpu_load(vcpu); kvm_synchronize_tsc(vcpu, 0); vcpu_put(vcpu); vcpu->arch.msr_kvm_poll_control = 1; mutex_unlock(&vcpu->mutex); if (kvmclock_periodic_sync && vcpu->v...
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
int kvm_arch_hardware_enable(void) { struct kvm *kvm; struct kvm_vcpu *vcpu; unsigned long i; int ret; u64 local_tsc; u64 max_tsc = 0; bool stable, backwards_tsc = false; kvm_user_return_msr_cpu_online(); ret = static_call(kvm_x86_hardware_enable)(); if (ret != 0) return ret; local_tsc = rdt...
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
int kvm_arch_hardware_setup(void *opaque) { struct kvm_x86_init_ops *ops = opaque; int r; rdmsrl_safe(MSR_EFER, &host_efer); if (boot_cpu_has(X86_FEATURE_XSAVES)) rdmsrl(MSR_IA32_XSS, host_xss); kvm_init_pmu_capability(); r = ops->hardware_setup(); if (r != 0) return r; kvm_ops_update(ops);...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static void kvm_unload_vcpu_mmus(struct kvm *kvm) { unsigned long i; struct kvm_vcpu *vcpu; kvm_for_each_vcpu(i, vcpu, kvm) { kvm_clear_async_pf_completion_queue(vcpu); kvm_unload_vcpu_mmu(vcpu); } }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
void kvm_arch_destroy_vm(struct kvm *kvm) { if (current->mm == kvm->mm) { mutex_lock(&kvm->slots_lock); __x86_set_memory_region(kvm, APIC_ACCESS_PAGE_PRIVATE_MEMSLOT, 0, 0); __x86_set_memory_region(kvm, IDENTITY_PAGETABLE_PRIVATE_MEMSLOT, 0, 0); __x86_set_memory_region(kvm, TSS_PRIVATE_MEMSLOT, 0, 0)...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) { int i; memslot_rmap_free(slot); for (i = 1; i < KVM_NR_PAGE_SIZES; ++i) { kvfree(slot->arch.lpage_info[i - 1]); slot->arch.lpage_info[i - 1] = NULL; } kvm_page_track_free_memslot(slot); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
int kvm_arch_prepare_memory_region(struct kvm *kvm, const struct kvm_memory_slot *old, struct kvm_memory_slot *new, enum kvm_mr_change change) { if (change == KVM_MR_CREATE || change == KVM_MR_MOVE) { if ((ne...
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
void kvm_arch_commit_memory_region(struct kvm *kvm, struct kvm_memory_slot *old, const struct kvm_memory_slot *new, enum kvm_mr_change change) { if (!kvm->arch.n_requested_mmu_pages && (change == KVM_MR_CREATE || change == KVM_MR_DELETE)) { ...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
void kvm_arch_flush_shadow_all(struct kvm *kvm) { kvm_mmu_zap_all(kvm); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
void kvm_arch_flush_shadow_memslot(struct kvm *kvm, struct kvm_memory_slot *slot) { kvm_page_track_flush_slot(kvm, slot); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu) { if (!list_empty_careful(&vcpu->async_pf.done)) return true; if (kvm_apic_has_pending_init_or_sipi(vcpu) && kvm_apic_init_sipi_allowed(vcpu)) return true; if (vcpu->arch.pv.pv_unhalted) return true; if (kvm_is_exception_pending...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
void kvm_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags) { __kvm_set_rflags(vcpu, rflags); kvm_make_request(KVM_REQ_EVENT, vcpu); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static inline u32 kvm_async_pf_hash_fn(gfn_t gfn) { BUILD_BUG_ON(!is_power_of_2(ASYNC_PF_PER_VCPU)); return hash_32(gfn & 0xffffffff, order_base_2(ASYNC_PF_PER_VCPU)); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static inline int apf_put_user_ready(struct kvm_vcpu *vcpu, u32 token) { unsigned int offset = offsetof(struct kvm_vcpu_pv_apf_data, token); return kvm_write_guest_offset_cached(vcpu->kvm, &vcpu->arch.apf.data, &token, offset, sizeof(token)); }
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static inline bool apf_pageready_slot_free(struct kvm_vcpu *vcpu) { unsigned int offset = offsetof(struct kvm_vcpu_pv_apf_data, token); u32 val; if (kvm_read_guest_offset_cached(vcpu->kvm, &vcpu->arch.apf.data, &val, offset, sizeof(val))) return false; return !val; }
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
bool noinstr kvm_arch_has_assigned_device(struct kvm *kvm) { return arch_atomic_read(&kvm->arch.assigned_device_count); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
bool kvm_arch_has_noncoherent_dma(struct kvm *kvm) { return atomic_read(&kvm->arch.noncoherent_dma_count); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
bool kvm_arch_irqfd_route_changed(struct kvm_kernel_irq_routing_entry *old, struct kvm_kernel_irq_routing_entry *new) { if (new->type != KVM_IRQ_ROUTING_MSI) return true; return !!memcmp(&old->msi, &new->msi, sizeof(new->msi)); }
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static void advance_sev_es_emulated_pio(struct kvm_vcpu *vcpu, unsigned count, int size) { vcpu->arch.sev_pio_count -= count; vcpu->arch.sev_pio_data += count * size; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.c
static int __init kvm_x86_init(void) { kvm_mmu_x86_module_init(); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline unsigned int __shrink_ple_window(unsigned int val, unsigned int base, unsigned int modifier, unsigned int min) { if (modifier < 1) return base; if (modifie...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline void kvm_queue_interrupt(struct kvm_vcpu *vcpu, u8 vector, bool soft) { vcpu->arch.interrupt.injected = true; vcpu->arch.interrupt.soft = soft; vcpu->arch.interrupt.nr = vector; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline void kvm_clear_interrupt_queue(struct kvm_vcpu *vcpu) { vcpu->arch.interrupt.injected = false; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline bool kvm_event_needs_reinjection(struct kvm_vcpu *vcpu) { return vcpu->arch.exception.injected || vcpu->arch.interrupt.injected || vcpu->arch.nmi_injected; }
[ 1, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline int is_pse(struct kvm_vcpu *vcpu) { return kvm_read_cr4_bits(vcpu, X86_CR4_PSE); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline void vcpu_cache_mmio_info(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, unsigned access) { u64 gen = kvm_memslots(vcpu->kvm)->generation; if (unlikely(gen & KVM_MEMSLOT_GEN_UPDATE_IN_PROGRESS)) return; vcpu->arch.mmio_gva = mmu_is_nested(vcpu) ? 0 : gva &...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline bool kvm_check_has_quirk(struct kvm *kvm, u64 quirk) { return !(kvm->arch.disabled_quirks & quirk); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline u64 nsec_to_cycles(struct kvm_vcpu *vcpu, u64 nsec) { return pvclock_scale_delta(nsec, vcpu->arch.virtual_tsc_mult, vcpu->arch.virtual_tsc_shift); } #define do_shl32_div32(n, base) \ ({ ...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline bool kvm_cstate_in_guest(struct kvm *kvm) { return kvm->arch.cstate_in_guest; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline void kvm_before_interrupt(struct kvm_vcpu *vcpu, enum kvm_intr_type intr) { WRITE_ONCE(vcpu->arch.handling_intr_from_guest, (u8)intr); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/x86.h
static inline void kvm_after_interrupt(struct kvm_vcpu *vcpu) { WRITE_ONCE(vcpu->arch.handling_intr_from_guest, 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
void kvm_xen_inject_timer_irqs(struct kvm_vcpu *vcpu) { if (atomic_read(&vcpu->arch.xen.timer_pending) > 0) { struct kvm_xen_evtchn e; e.vcpu_id = vcpu->vcpu_id; e.vcpu_idx = vcpu->vcpu_idx; e.port = vcpu->arch.xen.timer_virq; e.priority = KVM_IRQ_ROUTING_XEN_EVTCHN_PRIO_2LEVEL; kvm_xen_set...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
static enum hrtimer_restart xen_timer_callback(struct hrtimer *timer) { struct kvm_vcpu *vcpu = container_of(timer, struct kvm_vcpu, arch.xen.timer); if (atomic_read(&vcpu->arch.xen.timer_pending)) return HRTIMER_NORESTART; atomic_inc(&vcpu->arch.xen.timer_pending); kvm_make_request(KVM_REQ_UNBLOCK, vcpu)...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
int kvm_xen_hvm_get_attr(struct kvm *kvm, struct kvm_xen_hvm_attr *data) { int r = -ENOENT; mutex_lock(&kvm->lock); switch (data->type) { case KVM_XEN_ATTR_TYPE_LONG_MODE: data->u.long_mode = kvm->arch.xen.long_mode; r = 0; break; case KVM_XEN_ATTR_TYPE_SHARED_INFO: if (kvm->arch.xen.shinf...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
static int kvm_xen_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result) { kvm_rax_write(vcpu, result); return kvm_skip_emulated_instruction(vcpu); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
static bool wait_pending_event(struct kvm_vcpu *vcpu, int nr_ports, evtchn_port_t *ports) { struct kvm *kvm = vcpu->kvm; struct gfn_to_pfn_cache *gpc = &kvm->arch.xen.shinfo_cache; unsigned long *pending_bits; unsigned long flags; bool ret = true; int idx, i; read_lock_irq...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
static int kvm_xen_eventfd_reset(struct kvm *kvm) { struct evtchnfd *evtchnfd; int i; mutex_lock(&kvm->lock); idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) { idr_remove(&kvm->arch.xen.evtchn_ports, evtchnfd->send_port); synchronize_srcu(&kvm->srcu); if (!evtchnfd->deliver.port.port)...
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.c
void kvm_xen_init_vm(struct kvm *kvm) { idr_init(&kvm->arch.xen.evtchn_ports); kvm_gpc_init(&kvm->arch.xen.shinfo_cache); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline bool kvm_xen_hypercall_enabled(struct kvm *kvm) { return static_branch_unlikely(&kvm_xen_enabled.key) && (kvm->arch.xen_hvm_config.flags & KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL); }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline int kvm_xen_has_interrupt(struct kvm_vcpu *vcpu) { if (static_branch_unlikely(&kvm_xen_enabled.key) && vcpu->arch.xen.vcpu_info_cache.active && vcpu->kvm->arch.xen.upcall_vector) return __kvm_xen_has_interrupt(vcpu); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline bool kvm_xen_timer_enabled(struct kvm_vcpu *vcpu) { return !!vcpu->arch.xen.timer_virq; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline int kvm_xen_has_pending_timer(struct kvm_vcpu *vcpu) { if (kvm_xen_hypercall_enabled(vcpu->kvm) && kvm_xen_timer_enabled(vcpu)) return atomic_read(&vcpu->arch.xen.timer_pending); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline void kvm_xen_init_vcpu(struct kvm_vcpu *vcpu) {}
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline bool kvm_xen_msr_enabled(struct kvm *kvm) { return false; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline bool kvm_xen_hypercall_enabled(struct kvm *kvm) { return false; }
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline void kvm_xen_inject_timer_irqs(struct kvm_vcpu *vcpu) {}
[ 0, 0 ]
Linux Kernel
arch/x86/kvm/xen.h
static inline void kvm_xen_runstate_set_preempted(struct kvm_vcpu *vcpu) { if (WARN_ON_ONCE(!vcpu->preempted)) return; kvm_xen_update_runstate_guest(vcpu, RUNSTATE_runnable); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/cmdline.c
static int __cmdline_find_option_bool(const char *cmdline, int max_cmdline_size, const char *option) { char c; int pos = 0, wstart = 0; const char *opptr = NULL; enum { st_wordstart = 0, st_wordcmp, /* Comparing this word */ st_wordskip, /* Miscompare, skip */ ...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/cmdline.c
int cmdline_find_option_bool(const char *cmdline, const char *option) { return __cmdline_find_option_bool(cmdline, COMMAND_LINE_SIZE, option); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/cpu.c
unsigned int x86_family(unsigned int sig) { unsigned int x86; x86 = (sig >> 8) & 0xf; if (x86 == 0xf) x86 += (sig >> 20) & 0xff; return x86; }
[ 1, 0 ]
Linux Kernel
arch/x86/lib/cpu.c
unsigned int x86_model(unsigned int sig) { unsigned int fam, model; fam = x86_family(sig); model = (sig >> 4) & 0xf; if (fam >= 0x6) model += ((sig >> 16) & 0xf) << 4; return model; }
[ 1, 0 ]
Linux Kernel
arch/x86/lib/csum-partial_64.c
static inline unsigned short from32to16(unsigned a) { unsigned short b = a >> 16; asm("addw %w2,%w0\n\t" "adcw $0,%w0\n" : "=r"(b) : "0"(b), "r"(a)); return b; }
[ 1, 0 ]
Linux Kernel
arch/x86/lib/delay.c
static void delay_halt_tpause(u64 start, u64 cycles) { u64 until = start + cycles; u32 eax, edx; eax = lower_32_bits(until); edx = upper_32_bits(until); __tpause(TPAUSE_C02_STATE, edx, eax); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/delay.c
static void delay_halt(u64 __cycles) { u64 start, end, cycles = __cycles; if (!cycles) return; start = rdtsc_ordered(); for (;;) { delay_halt_fn(start, cycles); end = rdtsc_ordered(); if (cycles <= end - start) break; cycles -= end - start; start = end; } }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/delay.c
void __init use_tsc_delay(void) { if (delay_fn == delay_loop) delay_fn = delay_tsc; }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static bool is_string_insn(struct insn *insn) { if (insn->opcode.nbytes != 1) return false; switch (insn->opcode.bytes[0]) { case 0x6c ... 0x6f: /* INS, OUTS */ case 0xa4 ... 0xa7: /* MOVS, CMPS */ case 0xaa ... 0xaf: /* STOS, LODS, SCAS */ return true; default: return false; } }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static int resolve_default_seg(struct insn *insn, struct pt_regs *regs, int off) { if (any_64bit_mode(regs)) return INAT_SEG_REG_IGNORE; switch (off) { case offsetof(struct pt_regs, ax): case offsetof(struct pt_regs, cx): case offsetof(struct pt_regs, dx): /* Need insn ...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
int pt_regs_offset(struct pt_regs *regs, int regno) { if ((unsigned)regno < ARRAY_SIZE(pt_regoff)) return pt_regoff[regno]; return -EDOM; }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static int get_reg_offset(struct insn *insn, struct pt_regs *regs, enum reg_type type) { int regno = get_regno(insn, type); if (regno < 0) return regno; return pt_regs_offset(regs, regno); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static unsigned long get_seg_limit(struct pt_regs *regs, int seg_reg_idx) { struct desc_struct desc; unsigned long limit; short sel; sel = get_segment_selector(regs, seg_reg_idx); if (sel < 0) return 0; if (any_64bit_mode(regs) || v8086_mode(regs)) return -1L; if (!sel) return 0; if (!ge...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
int insn_get_code_seg_params(struct pt_regs *regs) { struct desc_struct desc; short sel; if (v8086_mode(regs)) return INSN_CODE_SEG_PARAMS(2, 2); sel = get_segment_selector(regs, INAT_SEG_REG_CS); if (sel < 0) return sel; if (!get_desc(&desc, sel)) return -EINVAL; /* * The most signifi...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
int insn_get_modrm_rm_off(struct insn *insn, struct pt_regs *regs) { return get_reg_offset(insn, regs, REG_TYPE_RM); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static int get_eff_addr_modrm_16(struct insn *insn, struct pt_regs *regs, int *regoff, short *eff_addr) { int addr_offset1, addr_offset2, ret; short addr1 = 0, addr2 = 0, displacement; if (insn->addr_bytes != 2) return -EINVAL; insn_get_modrm(insn); if (!insn->modrm.nby...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static int get_eff_addr_sib(struct insn *insn, struct pt_regs *regs, int *base_offset, long *eff_addr) { long base, indx; int indx_offset; int ret; if (insn->addr_bytes != 8 && insn->addr_bytes != 4) return -EINVAL; ret = insn_get_modrm(insn); if (ret) return ret; if...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/insn-eval.c
static void __user *get_addr_ref_64(struct insn *insn, struct pt_regs *regs) { return (void __user *)-1L; } #else
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn.c
void insn_init(struct insn *insn, const void *kaddr, int buf_len, int x86_64) { if (buf_len > MAX_INSN_SIZE) buf_len = MAX_INSN_SIZE; memset(insn, 0, sizeof(*insn)); insn->kaddr = kaddr; insn->end_kaddr = kaddr + buf_len; insn->next_byte = kaddr; insn->x86_64 = x86_64 ? 1 : 0; insn->opnd_bytes = 4; ...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/insn.c
int insn_get_sib(struct insn *insn) { insn_byte_t modrm; int ret; if (insn->sib.got) return 0; if (!insn->modrm.got) { ret = insn_get_modrm(insn); if (ret) return ret; } if (insn->modrm.nbytes) { modrm = insn->modrm.bytes[0]; if (insn->addr_bytes != 2 && X86_MODRM_MOD(modrm) != ...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/insn.c
int insn_get_displacement(struct insn *insn) { insn_byte_t mod, rm, base; int ret; if (insn->displacement.got) return 0; if (!insn->sib.got) { ret = insn_get_sib(insn); if (ret) return ret; } if (insn->modrm.nbytes) { mod = X86_MODRM_MOD(insn->modrm.value); rm = X86_MODRM_RM(in...
[ 1, 0 ]
Linux Kernel
arch/x86/lib/insn.c
static int __get_moffset(struct insn *insn) { switch (insn->addr_bytes) { case 2: insn_field_set(&insn->moffset1, get_next(short, insn), 2); break; case 4: insn_field_set(&insn->moffset1, get_next(int, insn), 4); break; case 8: insn_field_set(&insn->moffset1, get_next(int, insn), 4); ins...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/insn.c
static int __get_immv32(struct insn *insn) { switch (insn->opnd_bytes) { case 2: insn_field_set(&insn->immediate, get_next(short, insn), 2); break; case 4: case 8: insn_field_set(&insn->immediate, get_next(int, insn), 4); break; default: goto err_out; } return 1; err_out: return 0;...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/iomem.c
static __always_inline void rep_movs(void *to, const void *from, size_t n) { unsigned long d0, d1, d2; asm volatile("rep ; movsl\n\t" "testb $2,%b4\n\t" "je 1f\n\t" "movsw\n" "1:\ttestb $1,%b4\n\t" "je 2f\n\t" "movsb\n" ...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/iomem.c
static void unrolled_memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) { const volatile char __iomem *in = from; char *out = to; int i; for (i = 0; i < n; ++i) out[i] = readb(&in[i]); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/iomem.c
static void unrolled_memset_io(volatile void __iomem *a, int b, size_t c) { volatile char __iomem *mem = a; int i; for (i = 0; i < c; ++i) writeb(b, &mem[i]); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/iomem.c
void memcpy_fromio(void *to, const volatile void __iomem *from, size_t n) { if (cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) unrolled_memcpy_fromio(to, from, n); else string_memcpy_fromio(to, from, n); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/iomem.c
void memcpy_toio(volatile void __iomem *to, const void *from, size_t n) { if (cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) unrolled_memcpy_toio(to, from, n); else string_memcpy_toio(to, from, n); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/iomem.c
void memset_io(volatile void __iomem *a, int b, size_t c) { if (cc_platform_has(CC_ATTR_GUEST_UNROLL_STRING_IO)) { unrolled_memset_io(a, b, c); } else { /* * TODO: memset can mangle the IO patterns quite a bit. * perhaps it would be better to use a dumb one: */ memset((void *)a, b, c); ...
[ 1, 1 ]
Linux Kernel
arch/x86/lib/msr-smp.c
int rdmsrl_on_cpu(unsigned int cpu, u32 msr_no, u64 *q) { int err; struct msr_info rv; memset(&rv, 0, sizeof(rv)); rv.msr_no = msr_no; err = smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 1); *q = rv.reg.q; return err; }
[ 1, 0 ]
Linux Kernel
arch/x86/lib/msr-smp.c
static void __wrmsr_safe_on_cpu(void *info) { struct msr_info *rv = info; rv->err = wrmsr_safe(rv->msr_no, rv->reg.l, rv->reg.h); }
[ 1, 0 ]
Linux Kernel
arch/x86/lib/msr-smp.c
static void __wrmsr_safe_regs_on_cpu(void *info) { struct msr_regs_info *rv = info; rv->err = wrmsr_safe_regs(rv->regs); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/msr-smp.c
int rdmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8]) { int err; struct msr_regs_info rv; rv.regs = regs; rv.err = -EIO; err = smp_call_function_single(cpu, __rdmsr_safe_regs_on_cpu, &rv, 1); return err ? err : rv.err; }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/msr-smp.c
int wrmsr_safe_regs_on_cpu(unsigned int cpu, u32 regs[8]) { int err; struct msr_regs_info rv; rv.regs = regs; rv.err = -EIO; err = smp_call_function_single(cpu, __wrmsr_safe_regs_on_cpu, &rv, 1); return err ? err : rv.err; }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/msr.c
void do_trace_read_msr(unsigned int msr, u64 val, int failed) { trace_read_msr(msr, val, failed); }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/string_32.c
char *strcat(char *dest, const char *src) { int d0, d1, d2, d3; asm volatile("repne\n\t" "scasb\n\t" "decl %1\n" "1:\tlodsb\n\t" "stosb\n\t" "testb %%al,%%al\n\t" "jne 1b" : "=&S"(d0), "=&D"(d1), "=&a"(d2), "=&c...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/string_32.c
void *memchr(const void *cs, int c, size_t count) { int d0; void *res; if (!count) return NULL; asm volatile("repne\n\t" "scasb\n\t" "je 1f\n\t" "movl $1,%0\n" "1:\tdecl %0" : "=D"(res), "=&c"(d0) : "a"(c), "0"(cs), "1...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/string_32.c
void *memscan(void *addr, int c, size_t size) { if (!size) return addr; asm volatile("repnz; scasb\n\t" "jnz 1f\n\t" "dec %%edi\n" "1:" : "=D"(addr), "=c"(size) : "0"(addr), "1"(size), "a"(c) : "memory"); return addr; }
[ 0, 0 ]
Linux Kernel
arch/x86/lib/string_32.c
size_t strnlen(const char *s, size_t count) { int d0; int res; asm volatile("movl %2,%0\n\t" "jmp 2f\n" "1:\tcmpb $0,(%0)\n\t" "je 3f\n\t" "incl %0\n" "2:\tdecl %1\n\t" "cmpl $-1,%1\n\t" "jne 1b\n" ...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/strstr_32.c
char *strstr(const char *cs, const char *ct) { int d0, d1; register char *__res; __asm__ __volatile__("movl %6,%%edi\n\t" "repne\n\t" "scasb\n\t" "notl %%ecx\n\t" "decl %%ecx\n\t" "movl %%ecx,%%edx\n...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/usercopy_32.c
unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *from, unsigned long n) { __uaccess_begin_nospec(); #ifdef CONFIG_X86_INTEL_USERCOPY if (n > 64 && static_cpu_has(X86_FEATURE_XMM2)) n =...
[ 0, 0 ]
Linux Kernel
arch/x86/lib/usercopy_64.c
static void clean_cache_range(void *addr, size_t size) { u16 x86_clflush_size = boot_cpu_data.x86_clflush_size; unsigned long clflush_mask = x86_clflush_size - 1; void *vend = addr + size; void *p; for (p = (void *)((unsigned long)addr & ~clflush_mask); p < vend; p += x86_clflush_size) clwb(p); }
[ 1, 0 ]
Linux Kernel
arch/x86/lib/usercopy_64.c
void arch_wb_cache_pmem(void *addr, size_t size) { clean_cache_range(addr, size); }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/errors.c
int real_1op_NaN(FPU_REG *a) { int signalling, isNaN; isNaN = (exponent(a) == EXP_OVER) && (a->sigh & 0x80000000); signalling = isNaN && !(a->sigh & 0x40000000); if (!signalling) { if (!isNaN) { /* pseudo-NaN, or other unsupported? */ if (control_word & CW_Invalid) { /* Masked response */ ...
[ 1, 0 ]
Linux Kernel
arch/x86/math-emu/errors.c
int set_precision_flag(int flags) { if (control_word & CW_Precision) { partial_status &= ~(SW_C1 & flags); partial_status |= flags; return 0; } else { EXCEPTION(flags); return 1; } }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/errors.c
asmlinkage __visible int denormal_operand(void) { if (control_word & CW_Denormal) { partial_status |= SW_Denorm_Op; return TAG_Special; } else { EXCEPTION(EX_Denormal); return TAG_Special | FPU_Exception; } }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/errors.c
asmlinkage __visible int arith_underflow(FPU_REG *dest) { int tag = TAG_Valid; if (control_word & CW_Underflow) { if (exponent16(dest) <= EXP_UNDER - 63) { reg_copy(&CONST_Z, dest); partial_status &= ~SW_C1; /* Round down. */ tag = TAG_Zero; } else { stdexp(dest); } } else { ...
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/errors.c
void FPU_stack_underflow_pop(int i) { if (control_word & CW_Invalid) { FPU_copy_to_regi(&CONST_QNaN, TAG_Special, i); FPU_pop(); } EXCEPTION(EX_StackUnder); return; }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/fpu_arith.c
void fdivr_(void) { clear_C1(); FPU_div(REV, FPU_rm, control_word); }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/fpu_arith.c
void fsub_i(void) { clear_C1(); FPU_sub(REV | DEST_RM, FPU_rm, control_word); }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/fpu_arith.c
void fdivri(void) { clear_C1(); FPU_div(DEST_RM, FPU_rm, control_word); }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/fpu_arith.c
void fmulp_(void) { clear_C1(); if (FPU_mul(&st(0), FPU_gettag0(), FPU_rm, control_word) >= 0) FPU_pop(); }
[ 0, 0 ]
Linux Kernel
arch/x86/math-emu/fpu_arith.c
void fsubp_(void) { clear_C1(); if (FPU_sub(REV | DEST_RM, FPU_rm, control_word) >= 0) FPU_pop(); }
[ 0, 0 ]