Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/kernel/quirks.c
static void hpet_print_force_info(void) { printk(KERN_INFO "HPET not enabled in BIOS. " "You might try hpet=force boot option\n"); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/quirks.c
static void vt8237_force_enable_hpet(struct pci_dev *dev) { u32 val; if (hpet_address || force_hpet_address) return; if (!hpet_force_user) { hpet_print_force_info(); return; } pci_read_config_dword(dev, 0x68, &val); if (val & 0x80) { force_hpet_address = (val & ~0x3ff); dev_printk(KE...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/quirks.c
static void ati_force_hpet_resume(void) { pci_write_config_dword(cached_dev, 0x14, 0xfed00000); printk(KERN_DEBUG "Force enabled HPET at resume\n"); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/quirks.c
static void ati_force_enable_hpet(struct pci_dev *dev) { u32 d, val; u8 b; if (hpet_address || force_hpet_address) return; if (!hpet_force_user) { hpet_print_force_info(); return; } d = ati_ixp4x0_rev(dev); if (d < 0x82) return; pci_write_config_dword(dev, 0x14, 0xfed00000); pci_re...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/quirks.c
static void e6xx_force_enable_hpet(struct pci_dev *dev) { if (hpet_address || force_hpet_address) return; force_hpet_address = 0xFED00000; force_hpet_resume_type = NONE_FORCE_HPET_RESUME; dev_printk(KERN_DEBUG, &dev->dev, "Force enabled HPET at " "0x%lx\n", force_hpet...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/quirks.c
static void quirk_intel_brickland_xeon_ras_cap(struct pci_dev *pdev) { u32 capid0; pci_read_config_dword(pdev, 0x84, &capid0); if (capid0 & 0x10) enable_copy_mc_fragile(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/reboot.c
void machine_shutdown(void) { machine_ops.shutdown(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/reboot.c
static int crash_nmi_callback(unsigned int val, struct pt_regs *regs) { int cpu; cpu = raw_smp_processor_id(); if (cpu == crashing_cpu) return NMI_HANDLED; local_irq_disable(); shootdown_callback(cpu, regs); atomic_dec(&waiting_for_crash_ipi); /* Assume hlt works */ halt(); for (;;) cpu_re...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/reboot.c
void run_crash_ipi_callback(struct pt_regs *regs) { if (crash_ipi_issued) crash_nmi_callback(0, regs); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/reboot.c
void nmi_panic_self_stop(struct pt_regs *regs) { while (1) { run_crash_ipi_callback(regs); cpu_relax(); } }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/reboot_fixups_32.c
static void rdc321x_reset(struct pci_dev *dev) { unsigned i; outl(0x80003840, 0xCF8); /* Generate a CPU reset on next tick */ i = inl(0xCFC); /* Use the minimum timer resolution */ i |= 0x1600; outl(i, 0xCFC); outb(1, 0x92); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/reboot_fixups_32.c
void mach_reboot_fixups(void) { const struct device_fixup *cur; struct pci_dev *dev; int i; if (in_interrupt()) return; for (i = 0; i < ARRAY_SIZE(fixups_table); i++) { cur = &(fixups_table[i]); dev = pci_get_device(cur->vendor, cur->device, NULL); if (!dev) continue; cur->reboot_...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/rethook.c
void arch_rethook_fixup_return(struct pt_regs *regs, unsigned long correct_ret_addr) { unsigned long *frame_pointer = (void *)(regs + 1); *frame_pointer = correct_ret_addr; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/rtc.c
unsigned char rtc_cmos_read(unsigned char addr) { unsigned char val; lock_cmos_prefix(addr); outb(addr, RTC_PORT(0)); val = inb(RTC_PORT(1)); lock_cmos_suffix(addr); return val; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/setup.c
static void __init relocate_initrd(void) { u64 ramdisk_image = get_ramdisk_image(); u64 ramdisk_size = get_ramdisk_size(); u64 area_size = PAGE_ALIGN(ramdisk_size); /* We need to move the initrd down into directly mapped mem */ relocated_ramdisk = memblock_phys_alloc_range(area_size, PAGE_SIZE, 0, ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/setup.c
static void __init add_early_ima_buffer(u64 phys_addr) { #ifdef CONFIG_IMA struct ima_setup_data *data; data = early_memremap(phys_addr + sizeof(struct setup_data), sizeof(*data)); if (!data) { pr_warn("setup: failed to memremap ima_setup_data entry\n"); return; } if (data->size) { memblock_res...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/setup.c
static void __init parse_setup_data(void) { struct setup_data *data; u64 pa_data, pa_next; pa_data = boot_params.hdr.setup_data; while (pa_data) { u32 data_len, data_type; data = early_memremap(pa_data, sizeof(*data)); data_len = data->len + sizeof(struct setup_data); data_type = data->type; ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/setup.c
static void __init trim_snb_memory(void) { static const __initconst unsigned long bad_pages[] = { 0x20050000, 0x20110000, 0x20130000, 0x20138000, 0x40004000, }; int i; if (!snb_gfx_workaround_needed()) return; printk(KERN_DEBUG "reserving inaccessible SNB gfx pages\n"); for (i = 0; i < ARRAY_SI...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/setup.c
static void __init e820_add_kernel_range(void) { u64 start = __pa_symbol(_text); u64 size = __pa_symbol(_end) - start; if (e820__mapped_all(start, start + size, E820_TYPE_RAM)) return; pr_warn(".text .data .bss are not marked as E820_TYPE_RAM!\n"); e820__range_remove(start, size, E820_TYPE_RAM, 0); e8...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/setup_percpu.c
static int __init pcpu_cpu_to_node(int cpu) { return early_cpu_to_node(cpu); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/setup_percpu.c
static inline void setup_percpu_segment(int cpu) { #ifdef CONFIG_X86_32 struct desc_struct d = GDT_ENTRY_INIT(0x8092, per_cpu_offset(cpu), 0xFFFFF); write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_PERCPU, &d, DESCTYPE_S); #endif }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sev-shared.c
static void snp_register_ghcb_early(unsigned long paddr) { unsigned long pfn = paddr >> PAGE_SHIFT; u64 val; sev_es_wr_ghcb_msr(GHCB_MSR_REG_GPA_REQ_VAL(pfn)); VMGEXIT(); val = sev_es_rd_ghcb_msr(); if ((GHCB_RESP_CODE(val) != GHCB_MSR_REG_GPA_RESP) || (GHCB_MSR_REG_GPA_RESP_VAL(val) != pfn)) s...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/sev-shared.c
static int snp_cpuid(struct cpuid_leaf *leaf) { const struct snp_cpuid_table *cpuid_table = snp_cpuid_get_table(); if (!cpuid_table->count) return -EOPNOTSUPP; if (!snp_cpuid_get_validated_func(leaf)) { leaf->eax = leaf->ebx = leaf->ecx = leaf->edx = 0; /* Skip post-processing for out-of-range zer...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/sev-shared.c
static void __init setup_cpuid_table(const struct cc_blob_sev_info *cc_info) { const struct snp_cpuid_table *cpuid_table_fw, *cpuid_table; int i; if (!cc_info || !cc_info->cpuid_phys || cc_info->cpuid_len < PAGE_SIZE) sev_es_terminate(SEV_TERM_SET_LINUX, GHCB_TERM_CPUID); cpuid_table_fw = (const struct sn...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
void noinstr __sev_es_ist_exit(void) { unsigned long ist; ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]); if (WARN_ON(ist == __this_cpu_ist_top_va(VC))) return; /* Read back old IST entry and write it to the TSS */ this_cpu_write(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC], *(unsigned long *)ist)...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
static u64 __init get_snp_jump_table_addr(void) { struct snp_secrets_page_layout *layout; void __iomem *mem; u64 pa, addr; pa = get_secrets_page(); if (!pa) return 0; mem = ioremap_encrypted(pa, PAGE_SIZE); if (!mem) { pr_err("Unable to locate AP jump table address: failed to map the SNP " ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
static int snp_set_vmsa(void *va, bool vmsa) { u64 attrs; attrs = 1; if (vmsa) attrs |= RMPADJUST_VMSA_PAGE_BIT; return rmpadjust((unsigned long)va, RMP_PG_SIZE_4K, attrs); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
int __init sev_es_efi_map_ghcbs(pgd_t *pgd) { struct sev_es_runtime_data *data; unsigned long address, pflags; int cpu; u64 pfn; if (!cc_platform_has(CC_ATTR_GUEST_STATE_ENCRYPT)) return 0; pflags = _PAGE_NX | _PAGE_RW; for_each_possible_cpu(cpu) { data = per_cpu(runtime_data, cpu); addres...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
static void __init init_ghcb(int cpu) { struct sev_es_runtime_data *data; int err; data = per_cpu(runtime_data, cpu); err = early_set_memory_decrypted((unsigned long)&data->ghcb_page, sizeof(data->ghcb_page)); if (err) panic("Can't map GHCBs unencrypted"); memset(&...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
static enum es_result vc_handle_mmio_movs(struct es_em_ctxt *ctxt, unsigned int bytes) { unsigned long ds_base, es_base; unsigned char *src, *dst; unsigned char buffer[8]; enum es_result ret; bool rep; int off; ds_base = insn_get_seg_base(ctxt->regs, INAT_SEG_REG...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
static enum es_result vc_handle_mwait(struct ghcb *ghcb, struct es_em_ctxt *ctxt) { return ES_OK; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
static bool vc_raw_handle_exception(struct pt_regs *regs, unsigned long error_code) { struct ghcb_state state; struct es_em_ctxt ctxt; enum es_result result; struct ghcb *ghcb; bool ret = true; ghcb = __sev_get_ghcb(&state); vc_ghcb_invalidate(ghcb); result = vc_ini...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/sev.c
__init snp_init(struct boot_params *bp) { struct cc_blob_sev_info *cc_info; if (!bp) return false; cc_info = find_cc_blob(bp); if (!cc_info) return false; setup_cpuid_table(cc_info); bp->cc_blob_address = (u32)(unsigned long)cc_info; return true; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/signal.c
static inline int is_x32_frame(struct ksignal *ksig) { return IS_ENABLED(CONFIG_X86_X32_ABI) && ksig->ka.sa.sa_flags & SA_X32_ABI; } /* x86 ABI requires 16-byte alignment */
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/signal.c
static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) { #ifdef CONFIG_IA32_EMULATION if (current->restart_block.arch_data & TS_COMPAT) return __NR_ia32_restart_syscall; #endif #ifdef CONFIG_X86_X32_ABI return __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); #else return __...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/signal.c
static int __init strict_sas_size(char *arg) { return kstrtobool(arg, &strict_sigaltstack_size); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/signal_32.c
static inline void reload_segments(struct sigcontext_32 *sc) { unsigned int cur; savesegment(gs, cur); if ((sc->gs | 0x03) != cur) load_gs_index(sc->gs | 0x03); savesegment(fs, cur); if ((sc->fs | 0x03) != cur) loadsegment(fs, sc->fs | 0x03); savesegment(ds, cur); if ((sc->ds | 0x03) != cur) ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/signal_64.c
static void force_valid_ss(struct pt_regs *regs) { u32 ar; asm volatile("lar %[old_ss], %[ar]\n\t" "jz 1f\n\t" "xorl %[ar], %[ar]\n\t" /* set ar = 0 */ "1:" : [ar] "=r"(ar) : [old_ss] "rm"((u16)regs->ss)); /* * For a valid 64-bit user ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/signal_64.c
static unsigned long frame_uc_flags(struct pt_regs *regs) { unsigned long flags; if (boot_cpu_has(X86_FEATURE_XSAVE)) flags = UC_FP_XSTATE | UC_SIGCONTEXT_SS; else flags = UC_SIGCONTEXT_SS; if (likely(user_64bit_mode(regs))) flags |= UC_STRICT_RESTORE_SS; return flags; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/signal_compat.c
void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact) { signal_compat_build_tests(); if (!act) return; if (in_ia32_syscall()) act->sa.sa_flags |= SA_IA32_ABI; if (in_x32_syscall()) act->sa.sa_flags |= SA_X32_ABI; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
int arch_update_cpu_topology(void) { int retval = x86_topology_update; x86_topology_update = false; return retval; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
static inline void smpboot_setup_warm_reset_vector(unsigned long start_eip) { unsigned long flags; spin_lock_irqsave(&rtc_lock, flags); CMOS_WRITE(0xa, 0xf); spin_unlock_irqrestore(&rtc_lock, flags); *((volatile unsigned short *)phys_to_virt(TRAMPOLINE_PHYS_HIGH)) = start_eip >> 4; *((volatile unsig...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
static void notrace start_secondary(void *unused) { cr4_init(); #ifdef CONFIG_X86_32 /* switch away from the initial page table */ load_cr3(swapper_pg_dir); __flush_tlb_all(); #endif cpu_init_secondary(); rcu_cpu_starting(raw_smp_processor_id()); x86_cpuinit.early_percpu_clock_init(); smp_callin(); ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
static int x86_smt_flags(void) { return cpu_smt_flags() | x86_sched_itmt_flags(); } #endif #ifdef CONFIG_SCHED_CLUSTER
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void __inquire_remote_apic(int apicid) { unsigned i, regs[] = {APIC_ID >> 4, APIC_LVR >> 4, APIC_SPIV >> 4}; const char *const names[] = {"ID", "VERSION", "SPIV"}; int timeout; u32 status; pr_info("Inquiring remote APIC 0x%x...\n", apicid); for (i = 0; i < ARRAY_SIZE(regs); i++) { pr_info("... APIC 0x...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void arch_disable_smp_support(void) { disable_ioapic_support(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
static __init void disable_smp(void) { pr_info("SMP disabled\n"); disable_ioapic_support(); init_cpu_present(cpumask_of(0)); init_cpu_possible(cpumask_of(0)); if (smp_found_config) physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); else physid_set_mask_of_physid(0, &phys_...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void arch_thaw_secondary_cpus_end(void) { cache_aps_init(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void __init calculate_max_logical_packages(void) { int ncpus; ncpus = cpu_data(0).booted_cores * topology_max_smt_threads(); __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus); pr_info("Max logical packages: %u\n", __max_logical_packages); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
__init void prefill_possible_map(void) { int i, possible; if (!num_processors) { if (boot_cpu_has(X86_FEATURE_APIC)) { int apicid = boot_cpu_physical_apicid; int cpu = hard_smp_processor_id(); pr_warn("Boot CPU (id %d) not listed by BIOS\n", cpu); /* Make sure boot cpu is enumerated *...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
static void remove_cpu_from_maps(int cpu) { set_cpu_online(cpu, false); cpumask_clear_cpu(cpu, cpu_callout_mask); cpumask_clear_cpu(cpu, cpu_callin_mask); cpumask_clear_cpu(cpu, cpu_initialized_mask); numa_remove_cpu(cpu); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void native_cpu_die(unsigned int cpu) { common_cpu_die(cpu); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void play_dead_common(void) { idle_task_exit(); (void)cpu_report_death(); /* * With physical CPU hotplug, we should halt the cpu */ local_irq_disable(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void cond_wakeup_cpu0(void) { if (smp_processor_id() == 0 && enable_start_cpu0) start_cpu0(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void native_play_dead(void) { play_dead_common(); tboot_shutdown(TB_SHUTDOWN_WFS); mwait_play_dead(); if (cpuidle_play_dead()) hlt_play_dead(); } #else /* ... !CONFIG_HOTPLUG_CPU */
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/smpboot.c
void native_cpu_die(unsigned int cpu) { BUG(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/stacktrace.c
void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, struct task_struct *task, struct pt_regs *regs) { struct unwind_state state; unsigned long addr; if (regs && !consume_entry(cookie, regs->ip)) return; for (unwind_start(&state, task, regs, NULL); !unwind_done(&s...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/step.c
void user_enable_single_step(struct task_struct *child) { enable_step(child, 0); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/sys_x86_64.c
static void find_start_end(unsigned long addr, unsigned long flags, unsigned long *begin, unsigned long *end) { if (!in_32bit_syscall() && (flags & MAP_32BIT)) { *begin = 0x40000000; *end = 0x80000000; if (current->flags & PF_RANDOMIZE) { *begin = randomize_page(*begin, 0...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/tboot.c
bool tboot_enabled(void) { return tboot != NULL; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tboot.c
void __init tboot_probe(void) { if (!boot_params.tboot_addr) return; /* * also verify that it is mapped as we expect it before calling * set_fixmap(), to reduce chance of garbage value causing crash */ if (!e820__mapped_any(boot_params.tboot_addr, boot_params.tboot_addr, E820...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tboot.c
void tboot_shutdown(u32 shutdown_type) { void (*shutdown)(void); if (!tboot_enabled()) return; if (!tboot_pg_dir) return; /* if this is S3 then set regions to MAC */ if (shutdown_type == TB_SHUTDOWN_S3) if (tboot_setup_sleep()) return; tboot->shutdown_type = shutdown_type; switch_to...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tboot.c
static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b) { if (!tboot_enabled()) return 0; pr_warn("tboot is not able to suspend on platforms with reduced hardware " "sleep (ACPIv5)"); return -ENODEV; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/time.c
static void __init setup_default_timer_irq(void) { unsigned long flags = IRQF_NOBALANCING | IRQF_IRQPOLL | IRQF_TIMER; if (request_irq(0, timer_interrupt, flags, "timer", NULL)) pr_info("Failed to register legacy timer interrupt\n"); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/time.c
void clocksource_arch_init(struct clocksource *cs) { if (cs->vdso_clock_mode == VDSO_CLOCKMODE_NONE) return; if (cs->mask != CLOCKSOURCE_MASK(64)) { pr_warn("clocksource %s registered with invalid mask %016llx for VDSO. " "Disabling VDSO support.\n", cs->name, cs->mask); cs->vds...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tls.c
static bool tls_desc_okay(const struct user_desc *info) { /* * For historical reasons (i.e. no one ever documented how any * of the segmentation APIs work), user programs can and do * assume that a struct user_desc that's all zeros except for * entry_number means "no segment at all". This never actually ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tls.c
int regset_tls_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES]; const struct user_desc *info; int i; if (pos >= GDT_ENTRY_T...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/topology.c
static int __init debug_hotplug_cpu(void) { _debug_hotplug_cpu(0, 0); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/traps.c
static void show_signal(struct task_struct *tsk, int signr, const char *type, const char *desc, struct pt_regs *regs, long error_code) { if (show_unhandled_signals && unhandled_signal(tsk, signr) && printk_ratelimit()) { pr_info("%s[%d] %s%s ip:%lx sp:%lx err...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/traps.c
static __always_inline void __user *error_get_trap_addr(struct pt_regs *regs) { return (void __user *)uprobe_get_trap_addr(regs); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/traps.c
static enum kernel_gp_hint get_kernel_gp_address(struct pt_regs *regs, unsigned long *addr) { u8 insn_buf[MAX_INSN_SIZE]; struct insn insn; int ret; if (copy_from_kernel_nofault(insn_buf, (void *)regs->ip, MAX_INSN_SIZE)) return GP_NO_HINT; ret = insn_dec...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/traps.c
static void gp_user_force_sig_segv(struct pt_regs *regs, int trapnr, unsigned long error_code, const char *str) { current->thread.error_code = error_code; current->thread.trap_nr = trapnr; show_signal(current, SIGSEGV, "", str, regs, error_code); force_sig(SIGSEGV); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
__always_inline void cyc2ns_read_begin(struct cyc2ns_data *data) { int seq, idx; preempt_disable_notrace(); do { seq = this_cpu_read(cyc2ns.seq.seqcount.sequence); idx = seq & 1; data->cyc2ns_offset = this_cpu_read(cyc2ns.data[idx].cyc2ns_offset); data->cyc2ns_mul = this_cpu_read(cyc2ns.data[i...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
__always_inline void cyc2ns_read_end(void) { preempt_enable_notrace(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static void __init cyc2ns_init_boot_cpu(void) { struct cyc2ns *c2n = this_cpu_ptr(&cyc2ns); seqcount_latch_init(&c2n->seq); __set_cyc2ns_scale(tsc_khz, smp_processor_id(), rdtsc()); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
bool using_native_sched_clock(void) { return true; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static u64 tsc_read_refs(u64 *p, int hpet) { u64 t1, t2; u64 thresh = tsc_khz ? tsc_khz >> 5 : TSC_DEFAULT_THRESHOLD; int i; for (i = 0; i < MAX_RETRIES; i++) { t1 = get_cycles(); if (hpet) *p = hpet_readl(HPET_COUNTER) & 0xFFFFFFFF; else *p = acpi_pm_read_early(); t2 = get_cycles()...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static unsigned long calc_pmtimer_ref(u64 deltatsc, u64 pm1, u64 pm2) { u64 tmp; if (!pm1 && !pm2) return ULONG_MAX; if (pm2 < pm1) pm2 += (u64)ACPI_PM_OVRRUN; pm2 -= pm1; tmp = pm2 * 1000000000LL; do_div(tmp, PMTMR_TICKS_PER_SEC); do_div(deltatsc, tmp); return (unsigned long)deltatsc; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static unsigned long native_calibrate_cpu(void) { unsigned long tsc_freq = native_calibrate_cpu_early(); if (!tsc_freq) tsc_freq = pit_hpet_ptimer_calibrate_cpu(); return tsc_freq; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static void __init detect_art(void) { unsigned int unused[2]; if (boot_cpu_data.cpuid_level < ART_CPUID_LEAF) return; if (boot_cpu_has(X86_FEATURE_HYPERVISOR) || !boot_cpu_has(X86_FEATURE_NONSTOP_TSC) || !boot_cpu_has(X86_FEATURE_TSC_ADJUST) || tsc_async_resets) return; cpuid(ART_CPUID_LE...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static void tsc_cs_tick_stable(struct clocksource *cs) { if (tsc_unstable) return; if (using_native_sched_clock()) sched_clock_tick_stable(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static int __init init_tsc_clocksource(void) { if (!boot_cpu_has(X86_FEATURE_TSC) || !tsc_khz) return 0; if (tsc_unstable) goto unreg; if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC_S3)) clocksource_tsc.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP; if (boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ)) { if (boot_...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
static bool __init determine_cpu_tsc_frequencies(bool early) { WARN_ON(cpu_khz || tsc_khz); if (early) { cpu_khz = x86_platform.calibrate_cpu(); if (tsc_early_khz) tsc_khz = tsc_early_khz; else tsc_khz = x86_platform.calibrate_tsc(); } else { /* We should not be here with non-native ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc.c
unsigned long calibrate_delay_is_known(void) { int sibling, cpu = smp_processor_id(); int constant_tsc = cpu_has(&cpu_data(cpu), X86_FEATURE_CONSTANT_TSC); const struct cpumask *mask = topology_core_cpumask(cpu); if (!constant_tsc || !mask) return 0; sibling = cpumask_any_but(mask, cpu); if (sibling <...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/tsc_sync.c
bool tsc_store_and_check_tsc_adjust(bool bootcpu) { struct tsc_adjust *ref, *cur = this_cpu_ptr(&tsc_adjust); unsigned int refcpu, cpu = smp_processor_id(); struct cpumask *mask; s64 bootval; if (!boot_cpu_has(X86_FEATURE_TSC_ADJUST)) return false; rdmsrl(MSR_IA32_TSC_ADJUST, bootval); cur->bootval ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/tsc_sync.c
static inline unsigned int loop_timeout(int cpu) { return (cpumask_weight(topology_core_cpumask(cpu)) > 1) ? 2 : 20; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_frame.c
static void unwind_dump(struct unwind_state *state) { static bool dumped_before = false; bool prev_zero, zero = false; unsigned long word, *sp; struct stack_info stack_info = {0}; unsigned long visit_mask = 0; if (dumped_before) return; dumped_before = true; printk_deferred("unwind stack type:%d...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_frame.c
static bool in_entry_code(unsigned long ip) { char *addr = (char *)ip; return addr >= __entry_text_start && addr < __entry_text_end; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_frame.c
static bool is_last_frame(struct unwind_state *state) { return state->bp == last_frame(state); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_frame.c
static bool is_last_task_frame(struct unwind_state *state) { return is_last_frame(state) || is_last_aligned_frame(state) || is_last_ftrace_frame(state); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_frame.c
__no_kmsan_checks static bool update_stack_state(struct unwind_state *state, unsigned long *next_bp) { struct stack_info *info = &state->stack_info; enum stack_type prev_type = info->type; struct pt_regs *regs; unsigned long *frame, *prev_frame_end, *addr_p, addr...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_frame.c
void __unwind_start(struct unwind_state *state, struct task_struct *task, struct pt_regs *regs, unsigned long *first_frame) { unsigned long *bp; memset(state, 0, sizeof(*state)); state->task = task; state->got_irq = (regs); if (regs && user_mode(regs)) { state->stack_info.type = STAC...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_guess.c
bool unwind_next_frame(struct unwind_state *state) { struct stack_info *info = &state->stack_info; if (unwind_done(state)) return false; do { for (state->sp++; state->sp < info->end; state->sp++) { unsigned long addr = READ_ONCE_NOCHECK(*state->sp); if (__kernel_text_address(addr)) ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
static inline unsigned long orc_ip(const int *ip) { return (unsigned long)ip + *ip; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
static struct orc_entry *orc_module_find(unsigned long ip) { struct module *mod; mod = __module_address(ip); if (!mod || !mod->arch.orc_unwind || !mod->arch.orc_unwind_ip) return NULL; return __orc_find(mod->arch.orc_unwind_ip, mod->arch.orc_unwind, mod->arch.num_orcs, ip); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
static struct orc_entry *orc_module_find(unsigned long ip) { return NULL; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
static struct orc_entry *orc_find(unsigned long ip) { static struct orc_entry *orc; if (ip == 0) return &null_orc_entry; if (ip >= LOOKUP_START_IP && ip < LOOKUP_STOP_IP) { unsigned int idx, start, stop; idx = (ip - LOOKUP_START_IP) / LOOKUP_BLOCK_SIZE; if (unlikely((idx >= lookup_num_blocks -...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
unsigned long unwind_get_return_address(struct unwind_state *state) { if (unwind_done(state)) return 0; return __kernel_text_address(state->ip) ? state->ip : 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
static bool deref_stack_reg(struct unwind_state *state, unsigned long addr, unsigned long *val) { if (!stack_access_ok(state, addr, sizeof(long))) return false; *val = READ_ONCE_NOCHECK(*(unsigned long *)addr); return true; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/unwind_orc.c
static bool deref_stack_regs(struct unwind_state *state, unsigned long addr, unsigned long *ip, unsigned long *sp) { struct pt_regs *regs = (struct pt_regs *)addr; /* x86-32 support will be more complicated due to the &regs->sp hack */ BUILD_BUG_ON(IS_ENABLED(CONFIG_X86_32)); if (...
[ 1, 1 ]