Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
arch/x86/kernel/cpu/sgx/encl.c
static struct mem_cgroup *sgx_encl_get_mem_cgroup(struct sgx_encl *encl) { struct mem_cgroup *memcg = NULL; struct sgx_encl_mm *encl_mm; int idx; if (!current_is_ksgxd()) return get_mem_cgroup_from_mm(current->mm); /* * Search the enclave's mm_list to find an mm associated with * this enclave to c...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/encl.c
int sgx_encl_alloc_backing(struct sgx_encl *encl, unsigned long page_index, struct sgx_backing *backing) { struct mem_cgroup *encl_memcg = sgx_encl_get_mem_cgroup(encl); struct mem_cgroup *memcg = set_active_memcg(encl_memcg); int ret; ret = __sgx_encl_get_backing(encl, page_index, b...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/encl.c
void sgx_zap_enclave_ptes(struct sgx_encl *encl, unsigned long addr) { unsigned long mm_list_version; struct sgx_encl_mm *encl_mm; struct vm_area_struct *vma; int idx, ret; do { mm_list_version = encl->mm_list_version; smp_rmb(); idx = srcu_read_lock(&encl->srcu); list_for_each_entry_rcu(e...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/encls.h
static inline int __eadd(struct sgx_pageinfo *pginfo, void *addr) { return __encls_2(EADD, pginfo, addr); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/encls.h
static inline int __eremove(void *addr) { return __encls_ret_1(EREMOVE, addr); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/encls.h
static inline int __epa(void *addr) { unsigned long rbx = SGX_PAGE_TYPE_VA; return __encls_2(EPA, rbx, addr); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/ioctl.c
struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl, bool reclaim) { struct sgx_va_page *va_page = NULL; void *err; BUILD_BUG_ON(SGX_VA_SLOT_COUNT != (SGX_ENCL_PAGE_VA_OFFSET_MASK >> 3) + 1); if (!(encl->page_cnt % SGX_VA_SLOT_COUNT)) { va_page = kzalloc(sizeof(*va_page), GFP_KERNEL); if (!va_pag...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/ioctl.c
void sgx_encl_shrink(struct sgx_encl *encl, struct sgx_va_page *va_page) { encl->page_cnt--; if (va_page) { sgx_encl_free_epc_page(va_page->epc_page); list_del(&va_page->list); kfree(va_page); } }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/ioctl.c
static int __sgx_get_key_hash(struct crypto_shash *tfm, const void *modulus, void *hash) { SHASH_DESC_ON_STACK(shash, tfm); shash->tfm = tfm; return crypto_shash_digest(shash, modulus, SGX_MODULUS_SIZE, hash); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/ioctl.c
static long sgx_ioc_enclave_provision(struct sgx_encl *encl, void __user *arg) { struct sgx_enclave_provision params; if (copy_from_user(&params, arg, sizeof(params))) return -EFAULT; return sgx_set_attribute(&encl->attributes_mask, params.fd); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
static unsigned long __sgx_sanitize_pages(struct list_head *dirty_page_list) { unsigned long left_dirty = 0; struct sgx_epc_page *page; LIST_HEAD(dirty); int ret; while (!list_empty(dirty_page_list)) { if (kthread_should_stop()) return 0; page = list_first_entry(dirty_page_list, struct sgx_epc...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
static bool sgx_reclaimer_age(struct sgx_epc_page *epc_page) { struct sgx_encl_page *page = epc_page->owner; struct sgx_encl *encl = page->encl; struct sgx_encl_mm *encl_mm; bool ret = true; int idx; idx = srcu_read_lock(&encl->srcu); list_for_each_entry_rcu(encl_mm, &encl->mm_list, list) { if (!mm...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
void sgx_mark_page_reclaimable(struct sgx_epc_page *page) { spin_lock(&sgx_reclaimer_lock); page->flags |= SGX_EPC_PAGE_RECLAIMER_TRACKED; list_add_tail(&page->list, &sgx_active_page_list); spin_unlock(&sgx_reclaimer_lock); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
void sgx_free_epc_page(struct sgx_epc_page *page) { struct sgx_epc_section *section = &sgx_epc_sections[page->section]; struct sgx_numa_node *node = section->node; spin_lock(&node->lock); page->owner = NULL; if (page->poison) list_add(&page->list, &node->sgx_poison_page_list); else list_add_tail(&...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
bool arch_is_platform_page(u64 paddr) { return !!xa_load(&sgx_epc_address_space, paddr); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
int arch_memory_failure(unsigned long pfn, int flags) { struct sgx_epc_page *page = sgx_paddr_to_page(pfn << PAGE_SHIFT); struct sgx_epc_section *section; struct sgx_numa_node *node; if (!page) return -ENXIO; /* * If poison was consumed synchronously. Send a SIGBUS to * the task. Hardware has alre...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
static umode_t arch_node_attr_is_visible(struct kobject *kobj, struct attribute *attr, int idx) { if (nodes_empty(sgx_numa_mask)) return 0; return attr->mode; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/main.c
int sgx_set_attribute(unsigned long *allowed_attributes, unsigned int attribute_fd) { struct file *file; file = fget(attribute_fd); if (!file) return -EINVAL; if (file->f_op != &sgx_provision_fops) { fput(file); return -EINVAL; } *allowed_attributes |= SGX_ATTR_PROVISION...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/sgx.h
static inline unsigned long sgx_get_epc_phys_addr(struct sgx_epc_page *page) { struct sgx_epc_section *section = &sgx_epc_sections[page->section]; unsigned long index; index = ((unsigned long)page - (unsigned long)section->pages) / sizeof(*page); return section->phys_addr + index * PAGE_SIZE; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/sgx.h
static inline void *sgx_get_epc_virt_addr(struct sgx_epc_page *page) { struct sgx_epc_section *section = &sgx_epc_sections[page->section]; unsigned long index; index = ((unsigned long)page - (unsigned long)section->pages) / sizeof(*page); return section->virt_addr + index * PAGE_SIZE; }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/virt.c
static int sgx_vepc_remove_page(struct sgx_epc_page *epc_page) { return __eremove(sgx_get_epc_virt_addr(epc_page)); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/virt.c
static long sgx_vepc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { struct sgx_vepc *vepc = file->private_data; switch (cmd) { case SGX_IOC_VEPC_REMOVE_ALL: if (arg) return -EINVAL; return sgx_vepc_remove_all(vepc); default: return -ENOTTY; } }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/sgx/virt.c
int sgx_virt_ecreate(struct sgx_pageinfo *pageinfo, void __user *secs, int *trapnr) { int ret; if (WARN_ON_ONCE(!access_ok(secs, PAGE_SIZE))) return -EINVAL; __uaccess_begin(); ret = __ecreate(pageinfo, (void *)secs); __uaccess_end(); if (encls_faulted(ret)) { *trapnr = ENCLS...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/tsx.c
static enum tsx_ctrl_states x86_get_tsx_auto_mode(void) { if (boot_cpu_has_bug(X86_BUG_TAA)) return TSX_CTRL_DISABLE; return TSX_CTRL_ENABLE; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/tsx.c
static void tsx_dev_mode_disable(void) { u64 mcu_opt_ctrl; if (!boot_cpu_has_bug(X86_BUG_TAA) || !cpu_feature_enabled(X86_FEATURE_MSR_TSX_CTRL) || !cpu_feature_enabled(X86_FEATURE_SRBDS_CTRL)) return; rdmsrl(MSR_IA32_MCU_OPT_CTRL, mcu_opt_ctrl); if (mcu_opt_ctrl & RTM_ALLOW) { mcu_opt_ctr...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/umwait.c
static int umwait_cpu_online(unsigned int cpu) { local_irq_disable(); umwait_update_control_msr(NULL); local_irq_enable(); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/umwait.c
static int __init umwait_init(void) { struct device *dev; int ret; if (!boot_cpu_has(X86_FEATURE_WAITPKG)) return -ENODEV; rdmsrl(MSR_IA32_UMWAIT_CONTROL, orig_umwait_control_cached); ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "umwait:online", umwait_cpu_online, umwait_cpu_o...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static __init int setup_vmw_sched_clock(char *s) { vmw_sched_clock = false; return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static unsigned long long notrace vmware_sched_clock(void) { unsigned long long ns; ns = mul_u64_u32_shr(rdtsc(), vmware_cyc2ns.cyc2ns_mul, vmware_cyc2ns.cyc2ns_shift); ns -= vmware_cyc2ns.cyc2ns_offset; return ns; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static int vmware_cmd_stealclock(uint32_t arg1, uint32_t arg2) { uint32_t result, info; asm volatile(VMWARE_HYPERCALL : "=a"(result), "=c"(info) : "a"(VMWARE_HYPERVISOR_MAGIC), "b"(0), "c"(VMWARE_CMD_STEALCLOCK), "d"(0), "S"(arg1), "D"(arg2) : "memory"...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static int __stealclock_disable(void) { return vmware_cmd_stealclock(0, 1); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static uint64_t vmware_steal_clock(int cpu) { struct vmware_steal_time *steal = &per_cpu(vmw_steal_time, cpu); uint64_t clock; if (IS_ENABLED(CONFIG_64BIT)) clock = READ_ONCE(steal->clock); else { uint32_t initial_high, low, high; do { initial_high = READ_ONCE(steal->clock_high); virt...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static void vmware_register_steal_time(void) { int cpu = smp_processor_id(); struct vmware_steal_time *st = &per_cpu(vmw_steal_time, cpu); if (!has_steal_clock) return; if (!stealclock_enable(slow_virt_to_phys(st))) { has_steal_clock = false; return; } pr_info("vmware-stealtime: cpu %d, pa %...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static void vmware_disable_steal_time(void) { if (!has_steal_clock) return; stealclock_disable(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static int vmware_cpu_online(unsigned int cpu) { local_irq_disable(); vmware_guest_cpu_init(); local_irq_enable(); return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpu/vmware.c
static void __init vmware_set_capabilities(void) { setup_force_cpu_cap(X86_FEATURE_CONSTANT_TSC); setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE); if (vmware_tsc_khz) setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ); if (vmware_hypercall_mode == CPUID_VMWARE_FEATURES_ECX_VMCALL) setup_force_cpu_cap(X86_FEA...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/cpuid.c
static void cpuid_smp_cpuid(void *cmd_block) { struct cpuid_regs_done *cmd = cmd_block; cpuid_count(cmd->regs.eax, cmd->regs.ecx, &cmd->regs.eax, &cmd->regs.ebx, &cmd->regs.ecx, &cmd->regs.edx); complete(&cmd->done); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/crash.c
static void kdump_nmi_callback(int cpu, struct pt_regs *regs) { crash_save_cpu(regs, cpu); cpu_crash_vmclear_loaded_vmcss(); /* Disable VMX or SVM if needed. * * We need to disable virtualization on all CPUs. * Having VMX or SVM enabled on any CPU may break rebooting * after the kdump kernel has fin...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/crash.c
void crash_smp_send_stop(void) {} #endif
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/crash.c
static struct crash_mem *fill_up_crash_elf_data(void) { unsigned int nr_ranges = 0; struct crash_mem *cmem; walk_system_ram_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback); if (!nr_ranges) return NULL; nr_ranges += 2; cmem = vzalloc(struct_size(cmem, ranges, nr_ranges)); if (!cmem) return NUL...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/crash.c
static int add_e820_entry(struct boot_params *params, struct e820_entry *entry) { unsigned int nr_e820_entries; nr_e820_entries = params->e820_entries; if (nr_e820_entries >= E820_MAX_ENTRIES_ZEROPAGE) return 1; memcpy(&params->e820_table[nr_e820_entries], entry, sizeof...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/crash.c
static int memmap_exclude_ranges(struct kimage *image, struct crash_mem *cmem, unsigned long long mstart, unsigned long long mend) { unsigned long start, end; cmem->ranges[0].start = mstart; cmem->ranges[0].end = mend; cmem->nr_ranges = 1; st...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/crash_dump_64.c
ssize_t copy_oldmem_page_encrypted(struct iov_iter *iter, unsigned long pfn, size_t csize, unsigned long offset) { return __copy_oldmem_page(iter, pfn, csize, offset, true); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/crash_dump_64.c
ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) { struct kvec kvec = {.iov_base = buf, .iov_len = count}; struct iov_iter iter; iov_iter_kvec(&iter, ITER_DEST, &kvec, 1, count); return read_from_oldmem(&iter, count, ppos, cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/devicetree.c
static int x86_of_pci_irq_enable(struct pci_dev *dev) { u32 virq; int ret; u8 pin; ret = pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); if (ret) return ret; if (!pin) return 0; virq = of_irq_parse_and_map_pci(dev, 0, 0); if (virq == 0) return -EINVAL; dev->irq = virq; return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/devicetree.c
void x86_of_pci_init(void) { pcibios_enable_irq = x86_of_pci_irq_enable; pcibios_disable_irq = x86_of_pci_irq_disable; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/doublefault_32.c
static void set_df_gdt_entry(unsigned int cpu) { __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &get_cpu_entry_area(cpu)->doublefault_stack.tss); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack.c
static int copy_code(struct pt_regs *regs, u8 *buf, unsigned long src, unsigned int nbytes) { if (!user_mode(regs)) return copy_from_kernel_nofault(buf, (u8 *)src, nbytes); if (regs != task_pt_regs(current)) return -EPERM; /* * Even if named copy_from_user_nmi() this can be invok...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack.c
void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl) { task = task ?: current; if (!sp && task == current) sp = get_stack_pointer(current, NULL); show_trace_log_lvl(task, NULL, sp, loglvl); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack.c
unsigned long oops_begin(void) { int cpu; unsigned long flags; oops_enter(); raw_local_irq_save(flags); cpu = smp_processor_id(); if (!arch_spin_trylock(&die_lock)) { if (cpu == die_owner) /* nested oops. should stop eventually */; else arch_spin_lock(&die_lock); } die_nest_count++...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack.c
static void __die_header(const char *str, struct pt_regs *regs, long err) { const char *pr = ""; if (!die_counter) exec_summary_regs = *regs; if (IS_ENABLED(CONFIG_PREEMPTION)) pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT"; printk(KERN_DEFAULT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack.c
static int __die_body(const char *str, struct pt_regs *regs, long err) { show_regs(regs); print_modules(); if (notify_die(DIE_OOPS, str, regs, err, current->thread.trap_nr, SIGSEGV) == NOTIFY_STOP) return 1; return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack.c
void show_regs(struct pt_regs *regs) { enum show_regs_mode print_kernel_regs; show_regs_print_info(KERN_DEFAULT); print_kernel_regs = user_mode(regs) ? SHOW_REGS_USER : SHOW_REGS_ALL; __show_regs(regs, print_kernel_regs, KERN_DEFAULT); if (!user_mode(regs)) show_trace_log_lvl(current, regs, NULL, KERN_...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack_32.c
static bool in_hardirq_stack(unsigned long *stack, struct stack_info *info) { unsigned long *begin = (unsigned long *)this_cpu_read(hardirq_stack_ptr); unsigned long *end = begin + (THREAD_SIZE / sizeof(long)); if (stack < begin || stack > end) return false; info->type = STACK_TYPE_IRQ; info->begin = be...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack_32.c
static bool in_softirq_stack(unsigned long *stack, struct stack_info *info) { unsigned long *begin = (unsigned long *)this_cpu_read(softirq_stack_ptr); unsigned long *end = begin + (THREAD_SIZE / sizeof(long)); if (stack < begin || stack > end) return false; info->type = STACK_TYPE_SOFTIRQ; info->begin ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack_32.c
static bool in_doublefault_stack(unsigned long *stack, struct stack_info *info) { struct cpu_entry_area *cea = get_cpu_entry_area(raw_smp_processor_id()); struct doublefault_stack *ss = &cea->doublefault_stack; void *begin = ss->stack; void *end = begin + sizeof(ss->stack); ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack_64.c
static __always_inline bool in_irq_stack(unsigned long *stack, struct stack_info *info) { unsigned long *end = (unsigned long *)this_cpu_read(hardirq_stack_ptr); unsigned long *begin; end++; begin = end - (IRQ_STACK_SIZE / sizeof(long)); /* * Due to the switching ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/dumpstack_64.c
bool noinstr get_stack_info_noinstr(unsigned long *stack, struct task_struct *task, struct stack_info *info) { if (in_task_stack(stack, task, info)) return true; if (task != current) return false; if (in_exception_stack(stack, info...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
int e820__get_entry_type(u64 start, u64 end) { struct e820_entry *entry = __e820__mapped_all(start, end, 0); return entry ? entry->type : -EINVAL; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
static void __init __e820__range_add(struct e820_table *table, u64 start, u64 size, enum e820_type type) { int x = table->nr_entries; if (x >= ARRAY_SIZE(table->entries)) { pr_err("too many entries; ignoring [mem %#010llx-%#010llx]\n", start, start + size - 1); ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
void __init e820__range_add(u64 start, u64 size, enum e820_type type) { __e820__range_add(e820_table, start, size, type); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
static int __init cpcompare(const void *a, const void *b) { struct change_member *const *app = a, *const *bpp = b; const struct change_member *ap = *app, *bp = *bpp; if (ap->addr != bp->addr) return ap->addr > bp->addr ? 1 : -1; return (ap->addr != ap->entry->addr) - (bp->addr != bp->entry->addr); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
static int __init __append_e820_table(struct boot_e820_entry *entries, u32 nr_entries) { struct boot_e820_entry *entry = entries; while (nr_entries) { u64 start = entry->addr; u64 size = entry->size; u64 end = start + size - 1; u32 type = entry->type; if (...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
__init void e820__setup_pci_gap(void) { unsigned long gapstart, gapsize; int found; gapsize = 0x400000; found = e820_search_gap(&gapstart, &gapsize); if (!found) { #ifdef CONFIG_X86_64 gapstart = (max_pfn << PAGE_SHIFT) + 1024 * 1024; pr_err("Cannot find an available gap in the 32-bit address range\...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
__init void e820__reallocate_tables(void) { struct e820_table *n; int size; size = offsetof(struct e820_table, entries) + sizeof(struct e820_entry) * e820_table->nr_entries; n = kmemdup(e820_table, size, GFP_KERNEL); BUG_ON(!n); e820_table = n; size = offsetof(struct e820_table, entries) + ...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
static int __init e820__register_nvs_regions(void) { int i; for (i = 0; i < e820_table->nr_entries; i++) { struct e820_entry *entry = &e820_table->entries[i]; if (entry->type == E820_TYPE_NVS) acpi_nvs_register(entry->addr, entry->size); } return 0; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
static void __init early_panic(char *msg) { early_printk(msg); panic(msg); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
void __init e820__reserve_resources(void) { int i; struct resource *res; u64 end; res = memblock_alloc(sizeof(*res) * e820_table->nr_entries, SMP_CACHE_BYTES); if (!res) panic("%s: Failed to allocate %zu bytes\n", __func__, sizeof(*res) * e820_table->nr_entries); e820_res = res; for (i = 0...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/e820.c
void __init e820__memory_setup(void) { char *who; BUILD_BUG_ON(sizeof(struct boot_e820_entry) != 20); who = x86_init.resources.memory_setup(); memcpy(e820_table_kexec, e820_table, sizeof(*e820_table_kexec)); memcpy(e820_table_firmware, e820_table, sizeof(*e820_table_firmware)); pr_info("BIOS-provided ph...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static u32 __init ati_ixp4x0_rev(int num, int slot, int func) { u32 d; u8 b; b = read_pci_config_byte(num, slot, func, 0xac); b &= ~(1 << 5); write_pci_config_byte(num, slot, func, 0xac, b); d = read_pci_config(num, slot, func, 0x70); d |= 1 << 8; write_pci_config(num, slot, func, 0x70, d); d = rea...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static void __init ati_bugs(int num, int slot, int func) { u32 d; u8 b; if (acpi_use_timer_override) return; d = ati_ixp4x0_rev(num, slot, func); if (d < 0x82) acpi_skip_timer_override = 1; else { outb(0x72, 0xcd6); b = inb(0xcd7); if (!(b & 0x2)) acpi_skip_timer_override = 1; ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static resource_size_t __init i830_mem_size(void) { return read_pci_config_byte(0, 0, 0, I830_DRB3) * MB(32); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static resource_size_t __init i85x_mem_size(void) { return read_pci_config_byte(0, 0, 1, I85X_DRB3) * MB(32); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static resource_size_t __init i830_stolen_base(int num, int slot, int func, resource_size_t stolen_size) { return i830_mem_size() - i830_tseg_size() - stolen_size; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static resource_size_t __init gen8_stolen_size(int num, int slot, int func) { u16 gmch_ctrl; u16 gms; gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); gms = (gmch_ctrl >> BDW_GMCH_GMS_SHIFT) & BDW_GMCH_GMS_MASK; return gms * MB(32); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static resource_size_t __init chv_stolen_size(int num, int slot, int func) { u16 gmch_ctrl; u16 gms; gmch_ctrl = read_pci_config_16(num, slot, func, SNB_GMCH_CTRL); gms = (gmch_ctrl >> SNB_GMCH_GMS_SHIFT) & SNB_GMCH_GMS_MASK; if (gms < 0x11) return gms * MB(32); else if (gms < 0x17) return (gms - ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static void __init intel_graphics_quirks(int num, int slot, int func) { const struct intel_early_ops *early_ops; u16 device; int i; if (resource_size(&intel_graphics_stolen_res)) return; device = read_pci_config_16(num, slot, func, PCI_DEVICE_ID); for (i = 0; i < ARRAY_SIZE(intel_early_ids); i++) { ...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early-quirks.c
static void __init force_disable_hpet(int num, int slot, int func) { #ifdef CONFIG_HPET_TIMER boot_hpet_disable = true; pr_info("x86/hpet: Will disable the HPET for this platform because it's not " "reliable\n"); #endif } #define BCM4331_MMIO_SIZE 16384 #define BCM4331_PM_CAP 0x40
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early_printk.c
static void io_serial_out(unsigned long addr, int offset, int value) { outb(value, addr + offset); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/early_printk.c
static __init void early_serial_init(char *s) { unsigned divisor; unsigned long baud = DEFAULT_BAUD; char *e; if (*s == ',') ++s; if (*s) { unsigned port; if (!strncmp(s, "0x", 2)) { early_serial_base = simple_strtoul(s, &e, 16); } else { static const int __initconst bases[] = {0...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/early_printk.c
static void mem32_serial_out(unsigned long addr, int offset, int value) { u32 __iomem *vaddr = (u32 __iomem *)addr; writel(value, vaddr + offset); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/bugs.c
void __init fpu__init_check_bugs(void) { s32 fdiv_bug; if (!boot_cpu_has(X86_FEATURE_FPU)) return; kernel_fpu_begin(); /* * trap_init() enabled FXSR and company _before_ testing for FP * problems here. * * Test for the divl bug: http://en.wikipedia.org/wiki/Fdiv_bug */ __asm__("fninit\n\...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/context.h
static inline void __fpu_invalidate_fpregs_state(struct fpu *fpu) { fpu->last_cpu = -1; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/context.h
static inline int fpregs_state_valid(struct fpu *fpu, unsigned int cpu) { return fpu == this_cpu_read(fpu_fpregs_owner_ctx) && cpu == fpu->last_cpu; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
bool irq_fpu_usable(void) { if (WARN_ON_ONCE(in_nmi())) return false; if (this_cpu_read(in_kernel_fpu)) return false; /* * When not in NMI or hard interrupt context, FPU can be used in: * * - Task context except from within fpregs_lock()'ed critical * regions. * * - Soft interrupt pr...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
void fpu_free_guest_fpstate(struct fpu_guest *gfpu) { struct fpstate *fps = gfpu->fpstate; if (!fps) return; if (WARN_ON_ONCE(!fps->is_valloc || !fps->is_guest || fps->in_use)) return; gfpu->fpstate = NULL; vfree(fps); }
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
void fpu_update_guest_xfd(struct fpu_guest *guest_fpu, u64 xfd) { fpregs_lock(); guest_fpu->fpstate->xfd = xfd; if (guest_fpu->fpstate->in_use) xfd_update_state(guest_fpu->fpstate); fpregs_unlock(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
void fpu_copy_guest_fpstate_to_uabi(struct fpu_guest *gfpu, void *buf, unsigned int size, u32 pkru) { struct fpstate *kstate = gfpu->fpstate; union fpregs_state *ustate = buf; struct membuf mb = {.p = buf, .left = size}; if (cpu_feature_enabled(X86_FEATURE_XSAVE)) { __co...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
int fpu_copy_uabi_to_guest_fpstate(struct fpu_guest *gfpu, const void *buf, u64 xcr0, u32 *vpkru) { struct fpstate *kstate = gfpu->fpstate; const union fpregs_state *ustate = buf; if (!cpu_feature_enabled(X86_FEATURE_XSAVE)) { if (ustate->xsave.header.xfeatures & ~XFEATURE_...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
void kernel_fpu_begin_mask(unsigned int kfpu_mask) { preempt_disable(); WARN_ON_FPU(!irq_fpu_usable()); WARN_ON_FPU(this_cpu_read(in_kernel_fpu)); this_cpu_write(in_kernel_fpu, true); if (!(current->flags & PF_KTHREAD) && !test_thread_flag(TIF_NEED_FPU_LOAD)) { set_thread_flag(TIF_NEED_FPU_LOAD); s...
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
static void __fpstate_reset(struct fpstate *fpstate, u64 xfd) { fpstate->size = fpu_kernel_cfg.default_size; fpstate->user_size = fpu_user_cfg.default_size; fpstate->xfeatures = fpu_kernel_cfg.default_features; fpstate->user_xfeatures = fpu_user_cfg.default_features; fpstate->xfd = xfd; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
int fpu_clone(struct task_struct *dst, unsigned long clone_flags, bool minimal) { struct fpu *src_fpu = &current->thread.fpu; struct fpu *dst_fpu = &dst->thread.fpu; dst_fpu->last_cpu = -1; fpstate_reset(dst_fpu); if (!cpu_feature_enabled(X86_FEATURE_FPU)) return 0; /* * Enforce rel...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
void fpu_thread_struct_whitelist(unsigned long *offset, unsigned long *size) { *offset = offsetof(struct thread_struct, fpu.__fpstate.regs); *size = fpu_kernel_cfg.default_size; }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
void fpu__drop(struct fpu *fpu) { preempt_disable(); if (fpu == &current->thread.fpu) { asm volatile("1: fwait\n" "2:\n" _ASM_EXTABLE(1b, 2b)); fpregs_deactivate(fpu); } trace_x86_fpu_dropped(fpu); preempt_enable(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/core.c
static inline void restore_fpregs_from_init_fpstate(u64 features_mask) { if (use_xsave()) os_xrstor(&init_fpstate, features_mask); else if (use_fxsr()) fxrstor(&init_fpstate.regs.fxsave); else frstor(&init_fpstate.regs.fsave); pkru_write_default(); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/internal.h
static __always_inline __pure bool use_fxsr(void) { return cpu_feature_enabled(X86_FEATURE_FXSR); } #ifdef CONFIG_X86_DEBUG_FPU
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/legacy.h
static inline int frstor_safe(struct fregs_state *fx) { return kernel_insn_err(frstor % [fx], "=m"(*fx), [fx] "m"(*fx)); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/legacy.h
static inline void fxsave(struct fxregs_state *fx) { if (IS_ENABLED(CONFIG_X86_32)) asm volatile("fxsave %[fx]" : [fx] "=m"(*fx)); else asm volatile("fxsaveq %[fx]" : [fx] "=m"(*fx)); }
[ 0, 0 ]
Linux Kernel
arch/x86/kernel/fpu/regset.c
int xfpregs_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { struct fpu *fpu = &target->thread.fpu; struct fxregs_state newstate; int ret; if (!cpu_feature_enabled(X86_FEATURE_FXS...
[ 1, 0 ]
Linux Kernel
arch/x86/kernel/fpu/regset.c
int xstateregs_set(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, const void *kbuf, const void __user *ubuf) { struct fpu *fpu = &target->thread.fpu; struct xregs_state *tmpbuf = NULL; int ret; if (!cpu_feature_enabled(X...
[ 1, 0 ]