Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/kernel/apic/x2apic_uv_x.c
static void get_mn(struct mn *mnp) { memset(mnp, 0, sizeof(*mnp)); mnp->n_val = uv_cpuid.n_skt; if (is_uv(UV4 | UVY)) { mnp->m_val = 0; mnp->n_lshift = 0; } else if (is_uv3_hub()) { union uvyh_gr0_gam_gr_config_u m_gr_config; mnp->m_val = uv_cpuid.m_skt; m_gr_config.v = uv_read_local_mmr(UV...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/apic/x2apic_uv_x.c
static __init void boot_init_possible_blades(struct uv_hub_info_s *hub_info) { unsigned long np; int i, uv_pb = 0; if (UVH_NODE_PRESENT_TABLE) { pr_info("UV: NODE_PRESENT_DEPTH = %d\n", UVH_NODE_PRESENT_TABLE_DEPTH); for (i = 0; i < UVH_NODE_PRESENT_TABLE_DEPTH; i++) { np = uv_read_local_mmr(UVH_NO...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static inline unsigned long __apm_irq_save(void) { unsigned long flags; local_save_flags(flags); if (apm_info.allow_ints) { if (irqs_disabled_flags(flags)) local_irq_enable(); } else local_irq_disable(); return flags; } #define apm_irq_save(flags) ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static int apm_driver_version(u_short *val) { u32 eax; int err; if (apm_bios_call_simple(APM_FUNC_VERSION, 0, *val, &eax, &err)) return err; *val = eax; return APM_SUCCESS; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static int apm_get_event(apm_event_t *event, apm_eventinfo_t *info) { struct apm_bios_call call; call.func = APM_FUNC_GET_EVENT; call.ebx = call.ecx = 0; if (apm_bios_call(&call)) return call.err; *event = call.ebx; if (apm_info.connection_version < 0x0102) *info = ~0; else *info = call.ecx...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static void queue_event(apm_event_t event, struct apm_user *sender) { struct apm_user *as; spin_lock(&user_list_lock); if (user_list == NULL) goto out; for (as = user_list; as != NULL; as = as->next) { if ((as == sender) || (!as->reader)) continue; if (++as->event_head >= APM_MAX_EVENTS) ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static void standby(void) { int err; dpm_suspend_end(PMSG_SUSPEND); local_irq_disable(); syscore_suspend(); local_irq_enable(); err = set_system_power_state(APM_STATE_STANDBY); if ((err != APM_SUCCESS) && (err != APM_NO_ERROR)) apm_error("standby", err); local_irq_disable(); syscore_resume();...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static void apm_event_handler(void) { static int pending_count = 4; int err; if ((standbys_pending > 0) || (suspends_pending > 0)) { if ((apm_info.connection_version > 0x100) && (pending_count-- <= 0)) { pending_count = 4; if (debug) printk(KERN_DEBUG "apm: setting state busy\n"); ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static int check_apm_user(struct apm_user *as, const char *func) { if (as == NULL || as->magic != APM_BIOS_MAGIC) { pr_err("%s passed bad filp\n", func); return 1; } return 0; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos) { struct apm_user *as; int i; apm_event_t event; as = fp->private_data; if (check_apm_user(as, "read")) return -EIO; if ((int)count < sizeof(apm_event_t)) return -EINVAL; if ((queue_empty...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static int do_open(struct inode *inode, struct file *filp) { struct apm_user *as; as = kmalloc(sizeof(*as), GFP_KERNEL); if (as == NULL) return -ENOMEM; as->magic = APM_BIOS_MAGIC; as->event_tail = as->event_head = 0; as->suspends_pending = as->standbys_pending = 0; as->suspends_read = as->standbys_...
[ 1, 1 ]
Linux Kernel
arch/x86/kernel/apm_32.c
static int __init apm_likes_to_melt(const struct dmi_system_id *d) { if (apm_info.forbid_idle == 0) { apm_info.forbid_idle = 1; printk(KERN_INFO "%s machine detected. " "Disabling APM idle calls.\n", d->ident); } return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/asm-offsets_64.c
int main(void) { #ifdef CONFIG_PARAVIRT #ifdef CONFIG_PARAVIRT_XXL #ifdef CONFIG_DEBUG_ENTRY OFFSET(PV_IRQ_save_fl, paravirt_patch_template, irq.save_fl); #endif #endif BLANK(); #endif #if defined(CONFIG_KVM_GUEST) OFFSET(KVM_STEAL_TIME_preempted, kvm_steal_time, preempted); BLANK(); #endif #define ENTRY(ent...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/audit_64.c
static int __init audit_classes_init(void) { #ifdef CONFIG_IA32_EMULATION extern __u32 ia32_dir_class[]; extern __u32 ia32_write_class[]; extern __u32 ia32_read_class[]; extern __u32 ia32_chattr_class[]; extern __u32 ia32_signal_class[]; audit_register_class(AUDIT_CLASS_WRITE_32, ia32_write_class); audit...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/bootflag.c
static void __init sbf_write(u8 v) { unsigned long flags; if (sbf_port != -1) { v &= ~SBF_PARITY; if (!parity(v)) v |= SBF_PARITY; printk(KERN_INFO "Simple Boot Flag at 0x%x set to 0x%x\n", sbf_port, v); spin_lock_irqsave(&rtc_lock, flags); CMOS_WRITE(v, sbf_port); spin_unlock_irqr...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cfi.c
static bool decode_cfi_insn(struct pt_regs *regs, unsigned long *target, u32 *type) { char buffer[MAX_INSN_SIZE]; struct insn insn; int offset = 0; *target = *type = 0; if (copy_from_kernel_nofault(buffer, (void *)regs->ip - 12, MAX_INSN_SIZE)) return false; if (insn_decode...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cfi.c
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs) { unsigned long target; u32 type; if (!is_cfi_trap(regs->ip)) return BUG_TRAP_TYPE_NONE; if (!decode_cfi_insn(regs, &target, &type)) return report_cfi_failure_noaddr(regs, regs->ip); return report_cfi_failure(regs, regs->ip, &target, type)...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/check.c
void __init setup_bios_corruption_check(void) { phys_addr_t start, end; u64 i; if (memory_corruption_check == -1) { memory_corruption_check = #ifdef CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK 1 #else 0 #endif ; } if (corruption_check_size == 0) memory_corruption_check = 0; ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/acrn.c
static u32 __init acrn_detect(void) { return acrn_cpuid_base(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/acrn.c
static bool acrn_x2apic_available(void) { return boot_cpu_has(X86_FEATURE_X2APIC); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/amd.c
static inline int wrmsrl_amd_safe(unsigned msr, unsigned long long val) { u32 gprs[8] = {0}; WARN_ONCE((boot_cpu_data.x86 != 0xf), "%s should only be used on K8!\n", __func__); gprs[0] = (u32)val; gprs[1] = msr; gprs[2] = val >> 32; gprs[7] = 0x9c5a203a; return wrmsr_safe_regs(gprs); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/amd.c
static void init_amd_k5(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_32 #define CBAR (0xfffc) /* Configuration Base Address (32-bit) */ #define CBAR_ENB (0x80000000) #define CBAR_KEY (0X000000CB) if (c->x86_model == 9 || c->x86_model == 10) { if (inl(CBAR) & CBAR_ENB) outl(0 | CBAR_KEY, CBAR); } #endif }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/amd.c
u32 amd_get_nodes_per_socket(void) { return nodes_per_socket; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/amd.c
static void srat_detect_node(struct cpuinfo_x86 *c) { #ifdef CONFIG_NUMA int cpu = smp_processor_id(); int node; unsigned apicid = c->apicid; node = numa_cpu_node(cpu); if (node == NUMA_NO_NODE) node = get_llc_id(cpu); if (x86_cpuinit.fixup_cpu_id) x86_cpuinit.fixup_cpu_id(c, node); if (!node_o...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/amd.c
static void early_init_amd_mc(struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP unsigned bits, ecx; if (c->extended_cpuid_level < 0x80000008) return; ecx = cpuid_ecx(0x80000008); c->x86_max_cores = (ecx & 0xff) + 1; /* CPU telling us the core id bits shift? */ bits = (ecx >> 12) & 0xF; /* Otherwise reco...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/amd.c
static void init_amd_zn(struct cpuinfo_x86 *c) { set_cpu_cap(c, X86_FEATURE_ZEN); #ifdef CONFIG_NUMA node_reclaim_distance = 32; #endif if (!cpu_has(c, X86_FEATURE_HYPERVISOR)) { /* Erratum 1076: CPB feature bit not being set in CPUID. */ if (!cpu_has(c, X86_FEATURE_CPB)) set_cpu_cap(c, X86_FEATU...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/aperfmperf.c
static bool __init core_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq) { u64 msr; int err; err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq); if (err) return false; err = rdmsrl_safe(MSR_TURBO_RATIO_LIMIT, &msr); if (err) return false; *base_freq = (*base_freq >> 8) & 0xFF; *turbo_freq = (...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/aperfmperf.c
static void disable_freq_invariance_workfn(struct work_struct *work) { static_branch_disable(&arch_scale_freq_key); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/aperfmperf.c
static inline void bp_init_freq_invariance(void) {}
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/aperfmperf.c
unsigned int arch_freq_get_on_cpu(int cpu) { struct aperfmperf *s = per_cpu_ptr(&cpu_samples, cpu); unsigned int seq, freq; unsigned long last; u64 acnt, mcnt; if (!cpu_feature_enabled(X86_FEATURE_APERFMPERF)) goto fallback; do { seq = raw_read_seqcount_begin(&s->seq); last = s->last_update; ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
void update_spec_ctrl_cond(u64 val) { if (this_cpu_read(x86_spec_ctrl_current) == val) return; this_cpu_write(x86_spec_ctrl_current, val); if (!cpu_feature_enabled(X86_FEATURE_KERNEL_IBRS)) wrmsrl(MSR_IA32_SPEC_CTRL, val); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
void update_srbds_msr(void) { u64 mcu_ctrl; if (!boot_cpu_has_bug(X86_BUG_SRBDS)) return; if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) return; if (srbds_mitigation == SRBDS_MITIGATION_UCODE_NEEDED) return; if (!boot_cpu_has(X86_FEATURE_SRBDS_CTRL)) return; rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void __init srbds_select_mitigation(void) { u64 ia32_cap; if (!boot_cpu_has_bug(X86_BUG_SRBDS)) return; ia32_cap = x86_read_arch_cap_msr(); if ((ia32_cap & ARCH_CAP_MDS_NO) && !boot_cpu_has(X86_FEATURE_RTM) && !boot_cpu_has_bug(X86_BUG_MMIO_STALE_DATA)) srbds_mitigation = SRBDS_MITIGATION...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static inline const char *spectre_v2_module_string(void) { return ""; } #endif #define SPECTRE_V2_LFENCE_MSG \ "WARNING: LFENCE mitigation is not recommended for this CPU, data leaks " \ "possible!\n" #define SPECTRE_V2_EIBRS_EBPF_MSG ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
void unpriv_ebpf_notify(int new_state) { if (new_state) return; switch (spectre_v2_enabled) { case SPECTRE_V2_EIBRS: pr_err(SPECTRE_V2_EIBRS_EBPF_MSG); break; case SPECTRE_V2_EIBRS_LFENCE: if (sched_smt_active()) pr_err(SPECTRE_V2_EIBRS_LFENCE_EBPF_SMT_MSG); break; default: brea...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static enum spectre_v2_user_cmd __init spectre_v2_parse_user_cmdline(void) { char arg[20]; int ret, i; switch (spectre_v2_cmd) { case SPECTRE_V2_CMD_NONE: return SPECTRE_V2_USER_CMD_NONE; case SPECTRE_V2_CMD_FORCE: return SPECTRE_V2_USER_CMD_FORCE; default: break; } ret = cmdline_find_opt...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void) { if (!IS_ENABLED(CONFIG_RETPOLINE)) { pr_err("Kernel not compiled with retpoline; no mitigation available!"); return SPECTRE_V2_NONE; } return SPECTRE_V2_RETPOLINE; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void __init spectre_v2_determine_rsb_fill_type_at_vmexit(enum spectre_v2_mitigation mode) { switch (mode) { case SPECTRE_V2_NONE: return; case SPECTRE_V2_EIBRS_LFENCE: case SPECTRE_V2_EIBRS: if (boot_cpu_has_bug(X86_BUG_EIBRS_PBRSB)) { setup_force_cpu_cap(X86_FEATURE_RSB_VMEXIT_LITE); ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void update_stibp_msr(void *__unused) { u64 val = spec_ctrl_current() | (x86_spec_ctrl_base & SPEC_CTRL_STIBP); update_spec_ctrl(val); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void update_stibp_strict(void) { u64 mask = x86_spec_ctrl_base & ~SPEC_CTRL_STIBP; if (sched_smt_active()) mask |= SPEC_CTRL_STIBP; if (mask == x86_spec_ctrl_base) return; pr_info("Update user space SMT mitigation: STIBP %s\n", mask & SPEC_CTRL_STIBP ? "always-on" : "off"); x86_spe...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void update_indir_branch_cond(void) { if (sched_smt_active()) static_branch_enable(&switch_to_cond_stibp); else static_branch_disable(&switch_to_cond_stibp); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static enum ssb_mitigation_cmd __init ssb_parse_cmdline(void) { enum ssb_mitigation_cmd cmd = SPEC_STORE_BYPASS_CMD_AUTO; char arg[20]; int ret, i; if (cmdline_find_option_bool(boot_command_line, "nospec_store_bypass_disable") || cpu_mitigations_off()) { return SPEC_ST...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
int arch_prctl_spec_ctrl_set(struct task_struct *task, unsigned long which, unsigned long ctrl) { switch (which) { case PR_SPEC_STORE_BYPASS: return ssb_prctl_set(task, ctrl); case PR_SPEC_INDIRECT_BRANCH: return ib_prctl_set(task, ctrl); case PR_SPEC_L1D_FLUSH: return ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static int ib_prctl_get(struct task_struct *task) { if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V2)) return PR_SPEC_NOT_AFFECTED; if (spectre_v2_user_ibpb == SPECTRE_V2_USER_NONE && spectre_v2_user_stibp == SPECTRE_V2_USER_NONE) return PR_SPEC_ENABLE; else if (is_spec_ib_user_controlled()) { if (tas...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void override_cache_bits(struct cpuinfo_x86 *c) { if (c->x86 != 6) return; switch (c->x86_model) { case INTEL_FAM6_NEHALEM: case INTEL_FAM6_WESTMERE: case INTEL_FAM6_SANDYBRIDGE: case INTEL_FAM6_IVYBRIDGE: case INTEL_FAM6_HASWELL: case INTEL_FAM6_HASWELL_L: case INTEL_FAM6_HASWELL_G: cas...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static void __init l1tf_select_mitigation(void) { u64 half_pa; if (!boot_cpu_has_bug(X86_BUG_L1TF)) return; if (cpu_mitigations_off()) l1tf_mitigation = L1TF_MITIGATION_OFF; else if (cpu_mitigations_auto_nosmt()) l1tf_mitigation = L1TF_MITIGATION_FLUSH_NOSMT; override_cache_bits(&boot_cpu_data...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static ssize_t l1tf_show_state(char *buf) { return sysfs_emit(buf, "%s\n", L1TF_DEFAULT_MSG); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static char *pbrsb_eibrs_state(void) { if (boot_cpu_has_bug(X86_BUG_EIBRS_PBRSB)) { if (boot_cpu_has(X86_FEATURE_RSB_VMEXIT_LITE) || boot_cpu_has(X86_FEATURE_RSB_VMEXIT)) return ", PBRSB-eIBRS: SW sequence"; else return ", PBRSB-eIBRS: Vulnerable"; } else { return ", PBRSB-eIBRS: No...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
static ssize_t spectre_v2_show_state(char *buf) { if (spectre_v2_enabled == SPECTRE_V2_LFENCE) return sysfs_emit(buf, "Vulnerable: LFENCE\n"); if (spectre_v2_enabled == SPECTRE_V2_EIBRS && unprivileged_ebpf_enabled()) return sysfs_emit(buf, "Vulnerable: eIBRS with unprivileged eBPF\n"); if (sched_smt_a...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
ssize_t cpu_show_spec_store_bypass(struct device *dev, struct device_attribute *attr, char *buf) { return cpu_show_common(dev, attr, buf, X86_BUG_SPEC_STORE_BYPASS); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
ssize_t cpu_show_l1tf(struct device *dev, struct device_attribute *attr, char *buf) { return cpu_show_common(dev, attr, buf, X86_BUG_L1TF); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
ssize_t cpu_show_mds(struct device *dev, struct device_attribute *attr, char *buf) { return cpu_show_common(dev, attr, buf, X86_BUG_MDS); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
ssize_t cpu_show_itlb_multihit(struct device *dev, struct device_attribute *attr, char *buf) { return cpu_show_common(dev, attr, buf, X86_BUG_ITLB_MULTIHIT); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
ssize_t cpu_show_srbds(struct device *dev, struct device_attribute *attr, char *buf) { return cpu_show_common(dev, attr, buf, X86_BUG_SRBDS); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/bugs.c
ssize_t cpu_show_mmio_stale_data(struct device *dev, struct device_attribute *attr, char *buf) { if (boot_cpu_has_bug(X86_BUG_MMIO_UNKNOWN)) return cpu_show_common(dev, attr, buf, X86_BUG_MMIO_UNKNOWN); else return cpu_show_common(dev, attr, buf, X86_BUG_MMIO_STALE_DATA); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
static void amd_calc_l3_indices(struct amd_northbridge *nb) { struct amd_l3_cache *l3 = &nb->l3_cache; unsigned int sc0, sc1, sc2, sc3; u32 val = 0; pci_read_config_dword(nb->misc, 0x1C4, &val); l3->subcaches[0] = sc0 = !(val & BIT(0)); l3->subcaches[1] = sc1 = !(val & BIT(4)); if (boot_cpu_data.x86 ==...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
static ssize_t subcaches_show(struct device *dev, struct device_attribute *attr, char *buf) { struct cacheinfo *this_leaf = dev_get_drvdata(dev); int cpu = cpumask_first(&this_leaf->shared_cpu_map); return sprintf(buf, "%x\n", amd_get_subcaches(cpu)); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
static umode_t cache_private_attrs_is_visible(struct kobject *kobj, struct attribute *attr, int unused) { struct device *dev = kobj_to_dev(kobj); struct cacheinfo *this_leaf = dev_get_drvdata(dev); umode_t mode = attr->mo...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
static void amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index) { int node; if (index < 3) return; node = topology_die_id(smp_processor_id()); this_leaf->nb = node_to_amd_nb(node); if (this_leaf->nb && !this_leaf->nb->l3_cache.indices) amd_calc_l3_indices(this_leaf->nb); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
static int cpuid4_cache_lookup_regs(int index, struct _cpuid4_info_regs *this_leaf) { union _cpuid4_leaf_eax eax; union _cpuid4_leaf_ebx ebx; union _cpuid4_leaf_ecx ecx; unsigned edx; if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { if (boot_cpu_has(X86_FEATURE_TOPOEX...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
void init_amd_cacheinfo(struct cpuinfo_x86 *c) { if (boot_cpu_has(X86_FEATURE_TOPOEXT)) { num_cache_leaves = find_num_cache_leaves(c); } else if (c->extended_cpuid_level >= 0x80000006) { if (cpuid_edx(0x80000006) & 0xf000) num_cache_leaves = 4; else num_cache_leaves = 3; } }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
static void cache_cpu_init(void) { unsigned long flags; local_irq_save(flags); cache_disable(); if (memory_caching_control & CACHE_MTRR) mtrr_generic_set_state(); if (memory_caching_control & CACHE_PAT) pat_cpu_init(); cache_enable(); local_irq_restore(flags); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
void set_cache_aps_delayed_init(bool val) { cache_aps_delayed_init = val; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cacheinfo.c
void cache_bp_restore(void) { if (memory_caching_control) cache_cpu_init(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/centaur.c
static void early_init_centaur(struct cpuinfo_x86 *c) { #ifdef CONFIG_X86_32 if (c->x86 == 5) set_cpu_cap(c, X86_FEATURE_CENTAUR_MCR); #endif if ((c->x86 == 6 && c->x86_model >= 0xf) || (c->x86 >= 7)) set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC); #ifdef CONFIG_X86_64 set_cpu_cap(c, X86_FEATURE_SYSENTER32); ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static int __init x86_nopcid_setup(char *s) { if (s) return -EINVAL; /* do not emit a message if the feature is not present */ if (!boot_cpu_has(X86_FEATURE_PCID)) return 0; setup_clear_cpu_cap(X86_FEATURE_PCID); pr_info("nopcid: PCID feature disabled\n"); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static inline int flag_is_changeable_p(u32 flag) { u32 f1, f2; asm volatile("pushfl \n\t" "pushfl \n\t" "popl %0 \n\t" "movl %0, %1 \n\t" "xorl %2, %0 \n\t" "pushl %0 \n\t" "popfl \n\t" "pushfl \n\t" ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static int __init x86_serial_nr_setup(char *s) { disable_x86_serial_nr = 0; return 1; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static __always_inline void setup_smep(struct cpuinfo_x86 *c) { if (cpu_has(c, X86_FEATURE_SMEP)) cr4_set_bits(X86_CR4_SMEP); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static void filter_cpuid_features(struct cpuinfo_x86 *c, bool warn) { const struct cpuid_dependent_feature *df; for (df = cpuid_dependent_features; df->feature; df++) { if (!cpu_has(c, df->feature)) continue; if (!((s32) df->level<0 ? (u32)df->level > (u32)c->extended_cpuid_level ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
void cpu_detect_cache_sizes(struct cpuinfo_x86 *c) { unsigned int n, dummy, ebx, ecx, edx, l2size; n = c->extended_cpuid_level; if (n >= 0x80000005) { cpuid(0x80000005, &dummy, &ebx, &ecx, &edx); c->x86_cache_size = (ecx >> 24) + (edx >> 24); #ifdef CONFIG_X86_64 c->x86_tlbsize = 0; #endif } i...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
void detect_ht(struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP int index_msb, core_bits; if (detect_ht_early(c) < 0) return; index_msb = get_count_order(smp_num_siblings); c->phys_proc_id = apic->phys_pkg_id(c->initial_apicid, index_msb); smp_num_siblings = smp_num_siblings / c->x86_max_cores; index_msb...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static void init_speculation_control(struct cpuinfo_x86 *c) { if (cpu_has(c, X86_FEATURE_SPEC_CTRL)) { set_cpu_cap(c, X86_FEATURE_IBRS); set_cpu_cap(c, X86_FEATURE_IBPB); set_cpu_cap(c, X86_FEATURE_MSR_SPEC_CTRL); } if (cpu_has(c, X86_FEATURE_INTEL_STIBP)) set_cpu_cap(c, X86_FEATURE_STIBP); i...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
u64 x86_read_arch_cap_msr(void) { u64 ia32_cap = 0; if (boot_cpu_has(X86_FEATURE_ARCH_CAPABILITIES)) rdmsrl(MSR_IA32_ARCH_CAPABILITIES, ia32_cap); return ia32_cap; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
void enable_sep_cpu(void) { struct tss_struct *tss; int cpu; if (!boot_cpu_has(X86_FEATURE_SEP)) return; cpu = get_cpu(); tss = &per_cpu(cpu_tss_rw, cpu); tss->x86_tss.ss1 = __KERNEL_CS; wrmsr(MSR_IA32_SYSENTER_CS, tss->x86_tss.ss1, 0); wrmsr(MSR_IA32_SYSENTER_ESP, (unsigned long)(cpu_entry_stack...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static inline void setup_getcpu(int cpu) { unsigned long cpudata = vdso_encode_cpunode(cpu, early_cpu_to_node(cpu)); struct desc_struct d = {}; if (boot_cpu_has(X86_FEATURE_RDTSCP) || boot_cpu_has(X86_FEATURE_RDPID)) wrmsr(MSR_TSC_AUX, cpudata, 0); d.limit0 = cpudata; d.limit1 = cpudata >> 16; d.type...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static inline void tss_setup_ist(struct tss_struct *tss) { tss->x86_tss.ist[IST_INDEX_DF] = __this_cpu_ist_top_va(DF); tss->x86_tss.ist[IST_INDEX_NMI] = __this_cpu_ist_top_va(NMI); tss->x86_tss.ist[IST_INDEX_DB] = __this_cpu_ist_top_va(DB); tss->x86_tss.ist[IST_INDEX_MCE] = __this_cpu_ist_top_va(MCE); /* Onl...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
static inline void tss_setup_io_bitmap(struct tss_struct *tss) { tss->x86_tss.io_bitmap_base = IO_BITMAP_OFFSET_INVALID; #ifdef CONFIG_X86_IOPL_IOPERM tss->io_bitmap.prev_max = 0; tss->io_bitmap.prev_sequence = 0; memset(tss->io_bitmap.bitmap, 0xff, sizeof(tss->io_bitmap.bitmap)); tss->io_bitmap.mapall[IO_B...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/common.c
void cpu_init_exception_handling(void) { struct tss_struct *tss = this_cpu_ptr(&cpu_tss_rw); int cpu = raw_smp_processor_id(); setup_getcpu(cpu); /* IST vectors need TSS to be set up. */ tss_setup_ist(tss); tss_setup_io_bitmap(tss); set_tss_desc(cpu, &get_cpu_entry_area(cpu)->tss.x86_tss); load_TR_de...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cpuid-deps.c
static inline void clear_feature(struct cpuinfo_x86 *c, unsigned int feature) { if (!c) { clear_cpu_cap(&boot_cpu_data, feature); set_bit(feature, (unsigned long *)cpu_caps_cleared); } else { clear_bit(feature, (unsigned long *)c->x86_capability); } } /* Take the capabilities and the BUG bits into a...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cyrix.c
static void check_cx686_slop(struct cpuinfo_x86 *c) { unsigned long flags; if (Cx86_dir0_msb == 3) { unsigned char ccr3, ccr5; local_irq_save(flags); ccr3 = getCx86(CX86_CCR3); setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); ccr5 = getCx86(CX86_CCR5); if (ccr5 & 2) setCx86(CX86_CCR5, ccr5 ...
[ 0, 1 ]
Linux Kernel
arch/x86/kernel/cpu/cyrix.c
static void geode_configure(void) { unsigned long flags; u8 ccr3; local_irq_save(flags); setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); ccr3 = getCx86(CX86_CCR3); setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ /* FPU fast, DTE cache, Mem bypass */ setCx86(CX86_CCR4, getCx86(CX86_CCR4) |...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cyrix.c
static void early_init_cyrix(struct cpuinfo_x86 *c) { unsigned char dir0, dir0_msn, dir1 = 0; __do_cyrix_devid(&dir0, &dir1); dir0_msn = dir0 >> 4; switch (dir0_msn) { case 3: /* 6x86/6x86L */ /* Emulate MTRRs using Cyrix's ARRs. */ set_cpu_cap(c, X86_FEATURE_CYRIX_ARR); break; case 5: /* 6x86...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/cyrix.c
static void init_nsc(struct cpuinfo_x86 *c) { /* Handle the GX (Formally known as the GX2) */ if (c->x86 == 5 && c->x86_model == 5) cpu_detect_cache_sizes(c); else init_cyrix(c); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/feat_ctl.c
static int __init nosgx(char *str) { setup_clear_cpu_cap(X86_FEATURE_SGX); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/hygon.c
static void hygon_get_topology_early(struct cpuinfo_x86 *c) { if (cpu_has(c, X86_FEATURE_TOPOEXT)) smp_num_siblings = ((cpuid_ebx(0x8000001e) >> 8) & 0xff) + 1; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/hygon.c
static void early_init_hygon_mc(struct cpuinfo_x86 *c) { #ifdef CONFIG_SMP unsigned int bits, ecx; if (c->extended_cpuid_level < 0x80000008) return; ecx = cpuid_ecx(0x80000008); c->x86_max_cores = (ecx & 0xff) + 1; /* CPU telling us the core id bits shift? */ bits = (ecx >> 12) & 0xF; /* Otherwis...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/hypervisor.c
static inline const struct hypervisor_x86 *__init detect_hypervisor_vendor(void) { const struct hypervisor_x86 *h = NULL, *const * p; uint32_t pri, max_pri = 0; for (p = hypervisors; p < hypervisors + ARRAY_SIZE(hypervisors); p++) { if (unlikely(nopv) && !(*p)->ignore_nopv) continue; pri = (*p)->...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
static void intel_detect_tlb(struct cpuinfo_x86 *c) { int i, j, n; unsigned int regs[4]; unsigned char *desc = (unsigned char *)regs; if (c->cpuid_level < 2) return; n = cpuid_eax(2) & 0xFF; for (i = 0; i < n; i++) { cpuid(2, &regs[0], &regs[1], &regs[2], &regs[3]); /* If bit 31 is set, this...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
static void split_lock_init(void) { if (sld_state == sld_ratelimit) { split_lock_verify_msr(false); return; } if (cpu_model_supports_sld) split_lock_verify_msr(sld_state != sld_off); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
static void __split_lock_reenable_unlock(struct work_struct *work) { sld_update_msr(true); up(&buslock_sem); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
static int splitlock_cpu_offline(unsigned int cpu) { sld_update_msr(true); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
void handle_bus_lock(struct pt_regs *regs) { switch (sld_state) { case sld_off: break; case sld_ratelimit: while (!__ratelimit(&bld_ratelimit)) msleep(20); /* Warn on the bus lock. */ fallthrough; case sld_warn: pr_warn_ratelimited("#DB: %s/%d took a bus_lock trap at address: 0x%lx\n"...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
static void __init split_lock_setup(struct cpuinfo_x86 *c) { const struct x86_cpu_id *m; u64 ia32_core_caps; if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) return; m = x86_match_cpu(split_lock_cpu_ids); if (!m) return; switch (m->driver_data) { case 0: break; case 1: if (!cpu_has(c, X86_F...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
static void sld_state_show(void) { if (!boot_cpu_has(X86_FEATURE_BUS_LOCK_DETECT) && !boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT)) return; switch (sld_state) { case sld_off: pr_info("disabled\n"); break; case sld_warn: if (boot_cpu_has(X86_FEATURE_SPLIT_LOCK_DETECT)) { pr_info("#AC...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel.c
u8 get_this_hybrid_cpu_type(void) { if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)) return 0; return cpuid_eax(0x0000001a) >> X86_HYBRID_CPU_TYPE_ID_SHIFT; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel_pconfig.c
int pconfig_target_supported(enum pconfig_target target) { BUILD_BUG_ON(PCONFIG_TARGET_NR >= 64); if (WARN_ON_ONCE(target >= 64)) return 0; return targets_supported & (1ULL << target); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/intel_pconfig.c
static int __init intel_pconfig_init(void) { int subleaf; if (!boot_cpu_has(X86_FEATURE_PCONFIG)) return 0; for (subleaf = 0; subleaf < INT_MAX; subleaf++) { struct cpuid_regs regs; cpuid_count(PCONFIG_CPUID, subleaf, &regs.eax, &regs.ebx, &regs.ecx, &regs.edx); switch (regs.ea...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/match.c
bool x86_cpu_has_min_microcode_rev(const struct x86_cpu_desc *table) { const struct x86_cpu_desc *res = x86_match_cpu_with_stepping(table); if (!res || res->x86_microcode_rev > boot_cpu_data.microcode) return false; return true; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/mce/amd.c
static const char *smca_get_name(enum smca_bank_types t) { if (t >= N_SMCA_BANK_TYPES) return NULL; return smca_names[t].name; }
[ 0, 0 ]