Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/x86/kernel/ksysfs.c |
static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) {
return sprintf(buf, "0x%04x\n", boot_params.hdr.version);
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ksysfs.c |
static ssize_t boot_params_data_read(struct file *fp, struct kobject *kobj,
struct bin_attribute *bin_attr, char *buf,
loff_t off, size_t count) {
memcpy(buf, (void *)&boot_params + off, count);
return count;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ksysfs.c |
static ssize_t type_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) {
struct setup_indirect *indirect;
struct setup_data *data;
int nr, ret;
u64 paddr;
u32 len;
ret = kobj_to_setup_data_nr(kobj, &nr);
if (ret)
return ret;
ret = get_setup_data_paddr(nr, ... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ksysfs.c | static int __init create_setup_data_node(struct kobject *parent,
struct kobject **kobjp, int nr) {
int ret = 0;
size_t size;
struct kobject *kobj;
char name[16];
snprintf(name, 16, "%d", nr);
kobj = kobject_create_and_add(name, parent);
if (!kobj)
return -ENOM... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ksysfs.c |
static int __init get_setup_data_total_num(u64 pa_data, int *nr) {
int ret = 0;
struct setup_data *data;
*nr = 0;
while (pa_data) {
*nr += 1;
data = memremap(pa_data, sizeof(*data), MEMREMAP_WB);
if (!data) {
ret = -ENOMEM;
goto out;
}
pa_data = data->next;
memunmap(data);
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ksysfs.c |
static int __init create_setup_data_nodes(struct kobject *parent) {
struct kobject *setup_data_kobj, **kobjp;
u64 pa_data;
int i, j, nr, ret = 0;
pa_data = boot_params.hdr.setup_data;
if (!pa_data)
return 0;
setup_data_kobj = kobject_create_and_add("setup_data", parent);
if (!setup_data_kobj) {
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static int __init parse_no_kvmapf(char *arg) {
kvmapf = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static bool kvm_async_pf_queue_task(u32 token, struct kvm_task_sleep_node *n) {
u32 key = hash_32(token, KVM_TASK_SLEEP_HASHBITS);
struct kvm_task_sleep_head *b = &async_pf_sleepers[key];
struct kvm_task_sleep_node *e;
raw_spin_lock(&b->lock);
e = _find_apf_task(b, token);
if (e) {
hlist_del(&e->link)... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static void apf_task_wake_all(void) {
int i;
for (i = 0; i < KVM_TASK_SLEEP_HASHSIZE; i++) {
struct kvm_task_sleep_head *b = &async_pf_sleepers[i];
struct kvm_task_sleep_node *n;
struct hlist_node *p, *next;
raw_spin_lock(&b->lock);
hlist_for_each_safe(p, next, &b->list) {
n = hlist_ent... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static void __init paravirt_ops_setup(void) {
pv_info.name = "KVM";
if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
pv_ops.cpu.io_delay = kvm_io_delay;
#ifdef CONFIG_X86_IO_APIC
no_timer_check = 1;
#endif
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static void __init sev_map_percpu_data(void) {
int cpu;
if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
return;
for_each_possible_cpu(cpu) {
__set_percpu_decrypted(&per_cpu(apf_reason, cpu), sizeof(apf_reason));
__set_percpu_decrypted(&per_cpu(steal_time, cpu), sizeof(steal_time));
__set_percpu... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static bool pv_tlb_flush_supported(void) {
return (kvm_para_has_feature(KVM_FEATURE_PV_TLB_FLUSH) &&
!kvm_para_has_hint(KVM_HINTS_REALTIME) &&
kvm_para_has_feature(KVM_FEATURE_STEAL_TIME) &&
!boot_cpu_has(X86_FEATURE_MWAIT) && (num_possible_cpus() != 1));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static void kvm_setup_pv_ipi(void) {
apic->send_IPI_mask = kvm_send_ipi_mask;
apic->send_IPI_mask_allbutself = kvm_send_ipi_mask_allbutself;
pr_info("setup PV IPIs\n");
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static void __init kvm_smp_prepare_boot_cpu(void) {
sev_map_percpu_data();
kvm_guest_cpu_init();
native_smp_prepare_boot_cpu();
kvm_spinlock_init();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static int kvm_cpu_down_prepare(unsigned int cpu) {
unsigned long flags;
local_irq_save(flags);
kvm_guest_cpu_offline(false);
local_irq_restore(flags);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static int kvm_pv_reboot_notify(struct notifier_block *nb, unsigned long code,
void *unused) {
if (code == SYS_RESTART)
on_each_cpu(kvm_pv_guest_cpu_reboot, NULL, 1);
return NOTIFY_DONE;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static void kvm_crash_shutdown(struct pt_regs *regs) {
kvm_guest_cpu_offline(true);
native_machine_crash_shutdown(regs);
}
#endif
#if defined(CONFIG_X86_32) || !defined(CONFIG_SMP) | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
__visible bool __kvm_vcpu_is_preempted(long cpu) {
struct kvm_steal_time *src = &per_cpu(steal_time, cpu);
return !!(src->preempted & KVM_VCPU_PREEMPTED);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c |
static void kvm_sev_hc_page_enc_status(unsigned long pfn, int npages,
bool enc) {
kvm_sev_hypercall3(KVM_HC_MAP_GPA_RANGE, pfn << PAGE_SHIFT, npages,
KVM_MAP_GPA_RANGE_ENC_STAT(enc) |
KVM_MAP_GPA_RANGE_PAGE_SZ_4K);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static bool kvm_sev_es_hcall_finish(struct ghcb *ghcb, struct pt_regs *regs) {
return true;
}
#endif | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvm.c | static void kvm_wait(u8 *ptr, u8 val) {
if (in_nmi())
return;
if (irqs_disabled()) {
if (READ_ONCE(*ptr) == val)
halt();
} else {
local_irq_disable();
/* safe_halt() will enable IRQ */
if (READ_ONCE(*ptr) == val)
safe_halt();
else
local_irq_enable();
}
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvmclock.c |
static int __init parse_no_kvmclock(char *arg) {
kvmclock = 0;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvmclock.c |
void kvmclock_disable(void) { native_write_msr(msr_kvm_system_time, 0, 0); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kvmclock.c | static void __init kvmclock_init_mem(void) {
unsigned long ncpus;
unsigned int order;
struct page *p;
int r;
if (HVC_BOOT_ARRAY_SIZE >= num_possible_cpus())
return;
ncpus = num_possible_cpus() - HVC_BOOT_ARRAY_SIZE;
order = get_order(ncpus * sizeof(*hvclock_mem));
p = alloc_pages(GFP_KERNEL, orde... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ldt.c |
static inline void *ldt_slot_va(int slot) {
return (void *)(LDT_BASE_ADDR + LDT_SLOT_STRIDE * slot);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ldt.c |
static void sanity_check_ldt_mapping(struct mm_struct *mm) {
pgd_t *k_pgd = pgd_offset(mm, LDT_BASE_ADDR);
pgd_t *u_pgd = kernel_to_user_pgdp(k_pgd);
bool had_kernel, had_user;
pmd_t *k_pmd, *u_pmd;
k_pmd = pgd_to_pmd_walk(k_pgd, LDT_BASE_ADDR);
u_pmd = pgd_to_pmd_walk(u_pgd, LDT_BASE_ADDR);
had_kernel ... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ldt.c | static void sanity_check_ldt_mapping(struct mm_struct *mm) {
pgd_t *pgd = pgd_offset(mm, LDT_BASE_ADDR);
bool had_kernel = (pgd->pgd != 0);
bool had_user = (kernel_to_user_pgdp(pgd)->pgd != 0);
do_sanity_check(mm, had_kernel, had_user);
}
#endif | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ldt.c | static int map_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt,
int slot) {
unsigned long va;
bool is_vmalloc;
spinlock_t *ptl;
int i, nr_pages;
if (!boot_cpu_has(X86_FEATURE_PTI))
return 0;
WARN_ON(ldt->slot != -1);
/* Check if the current mappings are sane */
s... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ldt.c | static void unmap_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt) {
unsigned long va;
int i, nr_pages;
if (!ldt)
return;
if (!boot_cpu_has(X86_FEATURE_PTI))
return;
nr_pages = DIV_ROUND_UP(ldt->nr_entries * LDT_ENTRY_SIZE, PAGE_SIZE);
for (i = 0; i < nr_pages; i++) {
unsigned long o... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ldt.c | static void install_ldt(struct mm_struct *mm, struct ldt_struct *ldt) {
mutex_lock(&mm->context.lock);
smp_store_release(&mm->context.ldt, ldt);
/* Activate the LDT for all CPUs using currents mm. */
on_each_cpu_mask(mm_cpumask(mm), flush_ldt, mm, true);
mutex_unlock(&mm->context.lock);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/machine_kexec_32.c |
static void machine_kexec_free_page_tables(struct kimage *image) {
free_pages((unsigned long)image->arch.pgd, PGD_ALLOCATION_ORDER);
image->arch.pgd = NULL;
#ifdef CONFIG_X86_PAE
free_page((unsigned long)image->arch.pmd0);
image->arch.pmd0 = NULL;
free_page((unsigned long)image->arch.pmd1);
image->arch.pmd... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/machine_kexec_64.c |
static void free_transition_pgtable(struct kimage *image) {
free_page((unsigned long)image->arch.p4d);
image->arch.p4d = NULL;
free_page((unsigned long)image->arch.pud);
image->arch.pud = NULL;
free_page((unsigned long)image->arch.pmd);
image->arch.pmd = NULL;
free_page((unsigned long)image->arch.pte);
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/machine_kexec_64.c |
void arch_kexec_unprotect_crashkres(void) { kexec_mark_crashkres(false); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/machine_kexec_64.c | int arch_kexec_post_alloc_pages(void *vaddr, unsigned int pages, gfp_t gfp) {
if (!cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))
return 0;
return set_memory_decrypted((unsigned long)vaddr, pages);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/module.c |
void *module_alloc(unsigned long size) {
gfp_t gfp_mask = GFP_KERNEL;
void *p;
if (PAGE_ALIGN(size) > MODULES_LEN)
return NULL;
p = __vmalloc_node_range(
size, MODULE_ALIGN, MODULES_VADDR + get_module_load_offset(), MODULES_END,
gfp_mask, PAGE_KERNEL, VM_DEFER_KMEMLEAK, NUMA_NO_NODE,
__... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/mpparse.c | static void __init mpc_oem_bus_info(struct mpc_bus *m, char *str) {
memcpy(str, m->bustype, 6);
str[6] = 0;
apic_printk(APIC_VERBOSE, "Bus #%d is %s\n", m->busid, str);
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/mpparse.c | void __init default_get_smp_config(unsigned int early) {
struct mpf_intel *mpf;
if (!smp_found_config)
return;
if (!mpf_found)
return;
if (acpi_lapic && early)
return;
if (acpi_lapic && acpi_ioapic)
return;
mpf = early_memremap(mpf_base, sizeof(*mpf));
if (!mpf) {
pr_err("MPTABLE:... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/mpparse.c |
static void __init smp_reserve_memory(struct mpf_intel *mpf) {
memblock_reserve(mpf->physptr, get_mpc_size(mpf->physptr));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/mpparse.c | void __init default_find_smp_config(void) {
unsigned int address;
/*
* FIXME: Linux assumes you have 640K of base ram..
* this continues the error...
*
* 1) Scan the bottom 1K for a signature
* 2) Scan the top 1K of base RAM
* 3) Scan the 64K of bios
*/
if (smp_scan_config(0x0, 0x400) || smp... | [
0,
1
] |
Linux Kernel | arch/x86/kernel/mpparse.c | static int __init get_MP_intsrc_index(struct mpc_intsrc *m) {
int i;
if (m->irqtype != mp_INT)
return 0;
if (m->irqflag != (MP_IRQTRIG_LEVEL | MP_IRQPOL_ACTIVE_LOW))
return 0;
for (i = 0; i < mp_irq_entries; i++) {
if (mp_irqs[i].irqtype != mp_INT)
continue;
if (mp_irqs[i].irqflag != (... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/mpparse.c | static void __init check_irq_src(struct mpc_intsrc *m, int *nr_m_spare) {
int i;
apic_printk(APIC_VERBOSE, "OLD ");
print_mp_irq_info(m);
i = get_MP_intsrc_index(m);
if (i > 0) {
memcpy(m, &mp_irqs[i], sizeof(*m));
apic_printk(APIC_VERBOSE, "NEW ");
print_mp_irq_info(&mp_irqs[i]);
return;
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/mpparse.c |
static int __init update_mptable_setup(char *str) {
enable_update_mptable = 1;
#ifdef CONFIG_PCI
pci_routeirq = 1;
#endif
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/msr.c | static int msr_open(struct inode *inode, struct file *file) {
unsigned int cpu = iminor(file_inode(file));
struct cpuinfo_x86 *c;
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
if (cpu >= nr_cpu_ids || !cpu_online(cpu))
return -ENXIO;
c = &cpu_data(cpu);
if (!cpu_has(c, X86_FEATURE_MSR))
return ... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/msr.c |
static char *msr_devnode(struct device *dev, umode_t *mode) {
return kasprintf(GFP_KERNEL, "cpu/%u/msr", MINOR(dev->devt));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/msr.c |
static void __exit msr_exit(void) {
cpuhp_remove_state(cpuhp_msr_state);
class_destroy(msr_class);
__unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/msr.c | static int set_allow_writes(const char *val, const struct kernel_param *cp) {
char *s = strstrip((char *)val);
if (!strcmp(s, "on"))
allow_writes = MSR_WRITES_ON;
else if (!strcmp(s, "off"))
allow_writes = MSR_WRITES_OFF;
else
allow_writes = MSR_WRITES_DEFAULT;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/nmi.c | void local_touch_nmi(void) { __this_cpu_write(last_nmi_rip, 0); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/nmi_selftest.c |
static void __init remote_ipi(void) {
cpumask_copy(to_cpumask(nmi_ipi_mask), cpu_online_mask);
cpumask_clear_cpu(smp_processor_id(), to_cpumask(nmi_ipi_mask));
if (!cpumask_empty(to_cpumask(nmi_ipi_mask)))
test_nmi_ipi(to_cpumask(nmi_ipi_mask));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/nmi_selftest.c | static void __init dotest(void (*testcase_fn)(void), int expected) {
testcase_fn();
if (nmi_fail != expected) {
unexpected_testcase_failures++;
if (nmi_fail == FAILURE)
printk(KERN_CONT "FAILED |");
else if (nmi_fail == TIMEOUT)
printk(KERN_CONT "TIMEOUT|");
else
printk(KERN_CONT... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/paravirt.c |
void __init default_banner(void) {
printk(KERN_INFO "Booting paravirtualized kernel on %s\n", pv_info.name);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/paravirt.c | unsigned int paravirt_patch(u8 type, void *insn_buff, unsigned long addr,
unsigned int len) {
void *opfunc = *((void **)&pv_ops + type);
unsigned ret;
if (opfunc == NULL)
/* If there's no function, patch it with paravirt_BUG() */
ret = paravirt_patch_call(insn_buff, paravirt_... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/paravirt.c |
void paravirt_flush_lazy_mmu(void) {
preempt_disable();
if (paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU) {
arch_leave_lazy_mmu_mode();
arch_enter_lazy_mmu_mode();
}
preempt_enable();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/paravirt.c |
static noinstr void pv_native_write_cr2(unsigned long val) {
native_write_cr2(val);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/paravirt.c |
static noinstr unsigned long pv_native_get_debugreg(int regno) {
return native_get_debugreg(regno);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/pci-dma.c | static void __init pci_swiotlb_detect(void) {
if (!no_iommu && max_possible_pfn > MAX_DMA32_PFN)
x86_swiotlb_enable = true;
/*
* Set swiotlb to 1 so that bounce buffers are allocated and used for
* devices that can't support DMA to encrypted memory.
*/
if (cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/pci-dma.c |
void __init pci_iommu_alloc(void) {
if (xen_pv_domain()) {
pci_xen_swiotlb_init();
return;
}
pci_swiotlb_detect();
gart_iommu_hole_init();
amd_iommu_detect();
detect_intel_iommu();
swiotlb_init(x86_swiotlb_enable, x86_swiotlb_flags);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/pci-dma.c | static int via_no_dac_cb(struct pci_dev *pdev, void *data) {
pdev->dev.bus_dma_limit = DMA_BIT_MASK(32);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/perf_regs.c |
u64 perf_reg_value(struct pt_regs *regs, int idx) {
struct x86_perf_regs *perf_regs;
if (idx >= PERF_REG_X86_XMM0 && idx < PERF_REG_X86_XMM_MAX) {
perf_regs = container_of(regs, struct x86_perf_regs, regs);
if (!perf_regs->xmm_regs)
return 0;
return perf_regs->xmm_regs[idx - PERF_REG_X86_XMM0];
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/platform-quirks.c | bool __init arch_pnpbios_disabled(void) { return x86_pnpbios_disabled(); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/pmem.c |
static int found(struct resource *res, void *data) { return 1; } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/probe_roms.c |
static struct resource *find_oprom(struct pci_dev *pdev) {
struct resource *oprom = NULL;
int i;
for (i = 0; i < ARRAY_SIZE(adapter_rom_resources); i++) {
struct resource *res = &adapter_rom_resources[i];
unsigned short offset, vendor, device, list, rev;
const void *rom;
if (res->end == 0)
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/probe_roms.c |
void __iomem *pci_map_biosrom(struct pci_dev *pdev) {
struct resource *oprom = find_oprom(pdev);
if (!oprom)
return NULL;
return ioremap(oprom->start, resource_size(oprom));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) {
memcpy(dst, src, arch_task_struct_size);
#ifdef CONFIG_VM86
dst->thread.vm86 = NULL;
#endif
dst->thread.fpu.fpstate = NULL;
return 0;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/process.c |
static int set_new_tls(struct task_struct *p, unsigned long tls) {
struct user_desc __user *utls = (struct user_desc __user *)tls;
if (in_ia32_syscall())
return do_set_thread_area(p, -1, utls, 0);
else
return do_set_thread_area_64(p, ARCH_SET_FS, tls);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static void pkru_flush_thread(void) { pkru_write_default(); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c |
int get_tsc_mode(unsigned long adr) {
unsigned int val;
if (test_thread_flag(TIF_NOTSC))
val = PR_TSC_SIGSEGV;
else
val = PR_TSC_ENABLE;
return put_user(val, (unsigned int __user *)adr);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c |
int set_tsc_mode(unsigned int val) {
if (val == PR_TSC_SIGSEGV)
disable_TSC();
else if (val == PR_TSC_ENABLE)
enable_TSC();
else
return -EINVAL;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static inline void switch_to_bitmap(unsigned long tifp) {
if (tifp & _TIF_IO_BITMAP)
tss_invalidate_io_bitmap();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static void tss_copy_io_bitmap(struct tss_struct *tss, struct io_bitmap *iobm) {
memcpy(tss->io_bitmap.bitmap, iobm->bitmap,
max(tss->io_bitmap.prev_max, iobm->max));
/*
* Store the new max and the sequence number of this bitmap
* and a pointer to the bitmap itself.
*/
tss->io_bitmap.prev_max ... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static __always_inline void amd_set_core_ssb_state(unsigned long tifn) {
u64 msr = x86_amd_ls_cfg_base | ssbd_tif_to_amd_ls_cfg(tifn);
wrmsrl(MSR_AMD64_LS_CFG, msr);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static __always_inline void amd_set_ssb_virt_state(unsigned long tifn) {
wrmsrl(MSR_AMD64_VIRT_SPEC_CTRL, ssbd_tif_to_spec_ctrl(tifn));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static __always_inline void __speculation_ctrl_update(unsigned long tifp,
unsigned long tifn) {
unsigned long tif_diff = tifp ^ tifn;
u64 msr = x86_spec_ctrl_base;
bool updmsr = false;
lockdep_assert_irqs_disabled();
if (static_cpu_has(X86_FEATURE_VIRT_S... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/process.c | void arch_cpu_idle(void) { x86_idle(); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c | static void amd_e400_idle(void) {
if (!boot_cpu_has_bug(X86_BUG_AMD_APIC_C1E)) {
default_idle();
return;
}
tick_broadcast_enter();
default_idle();
/*
* The switch back from broadcast mode needs to be called with
* interrupts disabled.
*/
raw_local_irq_disable();
tick_broadcast_exit();... | [
0,
1
] |
Linux Kernel | arch/x86/kernel/process.c |
unsigned long arch_align_stack(unsigned long sp) {
if (!(current->personality & ADDR_NO_RANDOMIZE) && randomize_va_space)
sp -= get_random_u32_below(8192);
return sp & ~0xf;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c |
unsigned long arch_randomize_brk(struct mm_struct *mm) {
return randomize_page(mm->brk, 0x02000000);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process.c |
long do_arch_prctl_common(int option, unsigned long arg2) {
switch (option) {
case ARCH_GET_CPUID:
return get_cpuid_mode();
case ARCH_SET_CPUID:
return set_cpuid_mode(arg2);
case ARCH_GET_XCOMP_SUPP:
case ARCH_GET_XCOMP_PERM:
case ARCH_REQ_XCOMP_PERM:
case ARCH_GET_XCOMP_GUEST_PERM:
case ARCH_R... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/process.h | static inline void switch_to_extra(struct task_struct *prev,
struct task_struct *next) {
unsigned long next_tif = read_task_thread_flags(next);
unsigned long prev_tif = read_task_thread_flags(prev);
if (IS_ENABLED(CONFIG_SMP)) {
if (!static_branch_likely(&switch_to_cond_st... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/process_32.c |
void release_thread(struct task_struct *dead_task) {
BUG_ON(dead_task->mm);
release_vm86_irqs(dead_task);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c |
void release_thread(struct task_struct *dead_task) { WARN_ON(dead_task->mm); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | static __always_inline void save_base_legacy(struct task_struct *prev_p,
unsigned short selector,
enum which_selector which) {
if (likely(selector == 0)) {
} else {
/*
* If the selector is 1, 2, or 3, then the base i... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | void current_save_fsgs(void) {
unsigned long flags;
local_irq_save(flags);
save_fsgs(current);
local_irq_restore(flags);
}
#if IS_ENABLED(CONFIG_KVM) | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | static __always_inline void load_seg_legacy(unsigned short prev_index,
unsigned long prev_base,
unsigned short next_index,
unsigned long next_base,
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | static __always_inline void x86_pkru_load(struct thread_struct *prev,
struct thread_struct *next) {
if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
return;
prev->pkru = rdpkru();
/*
* PKRU writes are slightly expensive. Avoid them when not
* strictly necessary:
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | static __always_inline void x86_fsgsbase_load(struct thread_struct *prev,
struct thread_struct *next) {
if (static_cpu_has(X86_FEATURE_FSGSBASE)) {
if (unlikely(prev->fsindex || next->fsindex))
loadseg(FS, next->fsindex);
if (unlikely(prev->gsindex || next-... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c |
void x86_gsbase_write_cpu_inactive(unsigned long gsbase) {
if (boot_cpu_has(X86_FEATURE_FSGSBASE)) {
unsigned long flags;
local_irq_save(flags);
__wrgsbase_inactive(gsbase);
local_irq_restore(flags);
} else {
wrmsrl(MSR_KERNEL_GS_BASE, gsbase);
}
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | void compat_start_thread(struct pt_regs *regs, u32 new_ip, u32 new_sp,
bool x32) {
start_thread_common(regs, new_ip, new_sp, x32 ? __USER_CS : __USER32_CS,
__USER_DS, __USER_DS);
}
#endif | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | static void __set_personality_ia32(void) {
#ifdef CONFIG_IA32_EMULATION
if (current->mm) {
current->mm->context.flags = MM_CONTEXT_UPROBE_IA32;
}
current->personality |= force_personality32;
/* Prepare the first "return" to user space */
task_pt_regs(current)->orig_ax = __NR_ia32_execve;
current_threa... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c | void set_personality_ia32(bool x32) {
set_thread_flag(TIF_ADDR32);
if (x32)
__set_personality_x32();
else
__set_personality_ia32();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/process_64.c |
unsigned long KSTK_ESP(struct task_struct *task) {
return task_pt_regs(task)->sp;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ptrace.c | static int set_flags(struct task_struct *task, unsigned long value) {
struct pt_regs *regs = task_pt_regs(task);
if (value & X86_EFLAGS_TF)
clear_tsk_thread_flag(task, TIF_FORCED_TF);
else if (test_tsk_thread_flag(task, TIF_FORCED_TF))
value |= X86_EFLAGS_TF;
regs->flags = (regs->flags & ~FLAG_MASK) |... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ptrace.c |
static unsigned long getreg(struct task_struct *task, unsigned long offset) {
switch (offset) {
case offsetof(struct user_regs_struct, cs):
case offsetof(struct user_regs_struct, ds):
case offsetof(struct user_regs_struct, es):
case offsetof(struct user_regs_struct, fs):
case offsetof(struct user_regs_stru... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ptrace.c |
static int genregs_get(struct task_struct *target,
const struct user_regset *regset, struct membuf to) {
int reg;
for (reg = 0; to.left; reg++)
membuf_store(&to, getreg(target, reg * sizeof(unsigned long)));
return 0;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/ptrace.c | static int ptrace_set_breakpoint_addr(struct task_struct *tsk, int nr,
unsigned long addr) {
struct thread_struct *t = &tsk->thread;
struct perf_event *bp = t->ptrace_bps[nr];
int err = 0;
if (!bp) {
bp = ptrace_register_breakpoint(tsk, X86_BREAKPOINT_LEN_1,
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ptrace.c | static int ptrace_set_debugreg(struct task_struct *tsk, int n,
unsigned long val) {
struct thread_struct *thread = &tsk->thread;
int rc = -EIO;
if (n < HBP_NUM) {
rc = ptrace_set_breakpoint_addr(tsk, n, val);
} else if (n == 6) {
thread->virtual_dr6 = val ^ DR6_RESERVED;... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ptrace.c |
static int genregs32_get(struct task_struct *target,
const struct user_regset *regset, struct membuf to) {
int reg;
for (reg = 0; to.left; reg++) {
u32 val;
getreg32(target, reg * 4, &val);
membuf_store(&to, val);
}
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/pvclock.c |
unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src) {
u64 pv_tsc_khz = 1000000ULL << 32;
do_div(pv_tsc_khz, src->tsc_to_system_mul);
if (src->tsc_shift < 0)
pv_tsc_khz <<= -src->tsc_shift;
else
pv_tsc_khz >>= src->tsc_shift;
return pv_tsc_khz;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/pvclock.c | u64 pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) {
unsigned version;
u64 ret;
u64 last;
u8 flags;
do {
version = pvclock_read_begin(src);
ret = __pvclock_read_cycles(src, rdtsc_ordered());
flags = src->flags;
} while (pvclock_read_retry(src, version));
if (unlikely((flags & P... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/pvclock.c | void pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock,
struct pvclock_vcpu_time_info *vcpu_time,
struct timespec64 *ts) {
u32 version;
u64 delta;
struct timespec64 now;
do {
version = wall_clock->version;
rmb(); /* fetch version before... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/quirks.c | static void ich_force_hpet_resume(void) {
u32 val;
if (!force_hpet_address)
return;
BUG_ON(rcba_base == NULL);
val = readl(rcba_base + 0x3404);
if (!(val & 0x80)) {
/* HPET disabled in HPTC. Trying to enable */
writel(val | 0x80, rcba_base + 0x3404);
}
val = readl(rcba_base + 0x3404);
if... | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.