Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | arch/x86/kernel/fpu/regset.c | static inline unsigned short twd_i387_to_fxsr(unsigned short twd) {
unsigned int tmp;
/* Transform each pair of bits into 01 (valid) or 00 (empty) */
tmp = ~twd;
tmp = (tmp | (tmp >> 1)) & 0x5555; /* 0V0V0V0V0V0V0V0V */
/* and move the valid bits to the lower byte. */
tmp = (tmp | (tmp >> 1)) & 0x3333; /* ... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/regset.c | static void __convert_from_fxsr(struct user_i387_ia32_struct *env,
struct task_struct *tsk,
struct fxregs_state *fxsave) {
struct _fpreg *to = (struct _fpreg *)&env->st_space[0];
struct _fpxreg *from = (struct _fpxreg *)&fxsave->st_space[0];
int i;
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/regset.c | void convert_to_fxsr(struct fxregs_state *fxsave,
const struct user_i387_ia32_struct *env)
{
struct _fpreg *from = (struct _fpreg *)&env->st_space[0];
struct _fpxreg *to = (struct _fpxreg *)&fxsave->st_space[0];
int i;
fxsave->cwd = env->cwd;
fxsave->swd = env->swd;
fxsave->twd = twd_... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/signal.c | static inline bool save_xstate_epilog(void __user *buf, int ia32_frame,
struct fpstate *fpstate) {
struct xregs_state __user *x = buf;
struct _fpx_sw_bytes sw_bytes = {};
u32 xfeatures;
int err;
save_sw_bytes(&sw_bytes, ia32_frame, fpstate);
err = __copy_to_user(&x->i3... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/signal.c | bool fpu__restore_sig(void __user *buf, int ia32_frame) {
struct fpu *fpu = ¤t->thread.fpu;
void __user *buf_fx = buf;
bool ia32_fxstate = false;
bool success = false;
unsigned int size;
if (unlikely(!buf)) {
fpu__clear_user_states(fpu);
return true;
}
size = xstate_sigframe_size(fpu->fp... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c |
static bool xfeature_is_supervisor(int xfeature_nr) {
return xstate_flags[xfeature_nr] & XSTATE_FLAG_SUPERVISOR;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static unsigned int xfeature_get_offset(u64 xcomp_bv, int xfeature) {
unsigned int offs, i;
if (!cpu_feature_enabled(X86_FEATURE_XCOMPACTED) || xfeature <= XFEATURE_SSE)
return xstate_offsets[xfeature];
/*
* Compacted format offsets depend on the actual content of the
* compacted xsave area which is d... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static void __init setup_xstate_cache(void) {
u32 eax, ebx, ecx, edx, i;
unsigned int last_good_offset =
offsetof(struct xregs_state, extended_state_area);
/*
* The FP xstates and SSE xstates are legacy states. They are always
* in the fixed offsets in the xsave area in either compacted form
* or ... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c |
static void __init print_xstate_feature(u64 xstate_mask) {
const char *feature_name;
if (cpu_has_xfeatures(xstate_mask, &feature_name))
pr_info("x86/fpu: Supporting XSAVE feature 0x%03Lx: '%s'\n", xstate_mask,
feature_name);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static void __init print_xstate_features(void) {
print_xstate_feature(XFEATURE_MASK_FP);
print_xstate_feature(XFEATURE_MASK_SSE);
print_xstate_feature(XFEATURE_MASK_YMM);
print_xstate_feature(XFEATURE_MASK_BNDREGS);
print_xstate_feature(XFEATURE_MASK_BNDCSR);
print_xstate_feature(XFEATURE_MASK_OPMASK);
pr... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static void __init __xstate_dump_leaves(void) {
int i;
u32 eax, ebx, ecx, edx;
static int should_dump = 1;
if (!should_dump)
return;
should_dump = 0;
for (i = 0; i < XFEATURE_MAX + 10; i++) {
cpuid_count(XSTATE_CPUID, i, &eax, &ebx, &ecx, &edx);
pr_warn("CPUID[%02x, %02x]: eax=%08x ebx=%08x ec... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c |
static unsigned int xstate_calculate_size(u64 xfeatures, bool compacted) {
unsigned int topmost = fls64(xfeatures) - 1;
unsigned int offset = xstate_offsets[topmost];
if (topmost <= XFEATURE_SSE)
return sizeof(struct xregs_state);
if (compacted)
offset = xfeature_get_offset(xfeatures, topmost);
ret... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static bool __init paranoid_xstate_size_valid(unsigned int kernel_size) {
bool compacted = cpu_feature_enabled(X86_FEATURE_XCOMPACTED);
bool xsaves = cpu_feature_enabled(X86_FEATURE_XSAVES);
unsigned int size = FXSAVE_SIZE + XSAVE_HDR_SIZE;
int i;
for_each_extended_xfeature(i, fpu_kernel_cfg.max_features) {
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static unsigned int __init get_xsave_compacted_size(void) {
u64 mask = xfeatures_mask_independent();
unsigned int size;
if (!mask)
return get_compacted_size();
wrmsrl(MSR_IA32_XSS, xfeatures_mask_supervisor());
/*
* Ask the hardware what size is required of the buffer.
* This is the size required... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static void __init fpu__init_disable_system_xstate(unsigned int legacy_size) {
fpu_kernel_cfg.max_features = 0;
cr4_clear_bits(X86_CR4_OSXSAVE);
setup_clear_cpu_cap(X86_FEATURE_XSAVE);
fpu_kernel_cfg.max_size = legacy_size;
fpu_kernel_cfg.default_size = legacy_size;
fpu_user_cfg.max_size = legacy_size;
f... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static void *__raw_xsave_addr(struct xregs_state *xsave, int xfeature_nr) {
u64 xcomp_bv = xsave->header.xcomp_bv;
if (WARN_ON_ONCE(!xfeature_enabled(xfeature_nr)))
return NULL;
if (cpu_feature_enabled(X86_FEATURE_XCOMPACTED)) {
if (WARN_ON_ONCE(!(xcomp_bv & BIT_ULL(xfeature_nr))))
return NULL;
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | int copy_uabi_from_kernel_to_xstate(struct fpstate *fpstate, const void *kbuf,
u32 *pkru) {
return copy_uabi_to_xstate(fpstate, kbuf, NULL, pkru);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c |
static bool validate_independent_components(u64 mask) {
u64 xchk;
if (WARN_ON_FPU(!cpu_feature_enabled(X86_FEATURE_XSAVES)))
return false;
xchk = ~xfeatures_mask_independent();
if (WARN_ON_ONCE(!mask || mask & xchk))
return false;
return true;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | void xrstors(struct xregs_state *xstate, u64 mask) {
int err;
if (!validate_independent_components(mask))
return;
XSTATE_OP(XRSTORS, xstate, (u32)mask, (u32)(mask >> 32), err);
WARN_ON_ONCE(err);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | void fpstate_clear_xstate_component(struct fpstate *fps,
unsigned int xfeature) {
void *addr = get_xsave_addr(&fps->regs.xsave, xfeature);
if (addr)
memset(addr, 0, xstate_sizes[xfeature]);
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c |
void fpstate_free(struct fpu *fpu) {
if (fpu->fpstate && fpu->fpstate != &fpu->__fpstate)
vfree(fpu->fpstate);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static int xstate_request_perm(unsigned long idx, bool guest) {
u64 permitted, requested;
int ret;
if (idx >= XFEATURE_MAX)
return -EINVAL;
idx = array_index_nospec(idx, ARRAY_SIZE(xstate_prctl_req));
requested = xstate_prctl_req[idx];
if (!requested)
return -EOPNOTSUPP;
if ((fpu_user_cfg.max_f... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | static inline int xstate_request_perm(unsigned long idx, bool guest) {
return -EPERM;
}
#endif | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c |
u64 xstate_get_guest_group_perm(void) { return xstate_get_group_perm(true); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | long fpu_xstate_prctl(int option, unsigned long arg2) {
u64 __user *uptr = (u64 __user *)arg2;
u64 permitted, supported;
unsigned long idx = arg2;
bool guest = false;
switch (option) {
case ARCH_GET_XCOMP_SUPP:
supported = fpu_user_cfg.max_features | fpu_user_cfg.legacy_features;
return put_user(su... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.c | int proc_pid_arch_status(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task) {
if (cpu_feature_enabled(X86_FEATURE_AVX512F))
avx512_status(m, task);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.h | static inline u64 xstate_get_group_perm(bool guest) {
struct fpu *fpu = ¤t->group_leader->thread.fpu;
struct fpu_state_perm *perm;
perm = guest ? &fpu->guest_perm : &fpu->perm;
return READ_ONCE(perm->__state_perm);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/fpu/xstate.h | static inline void os_xsave(struct fpstate *fpstate) {
u64 mask = fpstate->xfeatures;
u32 lmask = mask;
u32 hmask = mask >> 32;
int err;
WARN_ON_FPU(!alternatives_patched);
xfd_validate_state(fpstate, mask, false);
XSTATE_XSAVE(&fpstate->regs.xsave, lmask, hmask, err);
WARN_ON_FPU(err);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ftrace.c |
static const char *ftrace_call_replace(unsigned long ip, unsigned long addr) {
return text_gen_insn(CALL_INSN_OPCODE, (void *)ip, (void *)addr);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ftrace.c | static int ftrace_verify_code(unsigned long ip, const char *old_code) {
char cur_code[MCOUNT_INSN_SIZE];
/* read the text we want to modify */
if (copy_from_kernel_nofault(cur_code, (void *)ip, MCOUNT_INSN_SIZE)) {
WARN_ON(1);
return -EFAULT;
}
/* Make sure it is what we expect it to be */
if (mem... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ftrace.c |
int ftrace_update_ftrace_func(ftrace_func_t func) {
unsigned long ip;
const char *new;
ip = (unsigned long)(&ftrace_call);
new = ftrace_call_replace(ip, (unsigned long)func);
text_poke_bp((void *)ip, new, MCOUNT_INSN_SIZE, NULL);
ip = (unsigned long)(&ftrace_regs_call);
new = ftrace_call_replace(ip, (u... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ftrace.c |
static unsigned long calc_trampoline_call_offset(bool save_regs) {
unsigned long start_offset;
unsigned long call_offset;
if (save_regs) {
start_offset = (unsigned long)ftrace_regs_caller;
call_offset = (unsigned long)ftrace_regs_call;
} else {
start_offset = (unsigned long)ftrace_caller;
call... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ftrace.c | static void *addr_from_call(void *ptr) {
union text_poke_insn call;
int ret;
ret = copy_from_kernel_nofault(&call, ptr, CALL_INSN_SIZE);
if (WARN_ON_ONCE(ret < 0))
return NULL;
if (WARN_ON_ONCE(call.opcode != CALL_INSN_OPCODE)) {
pr_warn("Expected E8, got %x\n", call.opcode);
return NULL;
}
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/ftrace.c | void *arch_ftrace_trampoline_func(struct ftrace_ops *ops,
struct dyn_ftrace *rec) {
unsigned long offset;
if (!ops || !(ops->flags & FTRACE_OPS_FL_ALLOC_TRAMP))
return static_tramp_func(ops, rec);
offset = calc_trampoline_call_offset(ops->flags & FTRACE_OPS_FL_SAVE_REGS);
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/head32.c | asmlinkage __visible void __init i386_start_kernel(void) {
idt_setup_early_handler();
cr4_init_shadow();
sanitize_boot_params(&boot_params);
x86_early_init_platform_quirks();
/* Call the subarch specific early setup function */
switch (boot_params.hdr.hardware_subarch) {
case X86_SUBARCH_INTEL_MID:
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/head32.c | void __init mk_early_pgtbl_32(void) {
#ifdef __pa
#undef __pa
#endif
#define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
pte_t pte, *ptep;
int i;
unsigned long *ptr;
const unsigned long limit =
__pa(_end) + (PAGE_TABLE_SIZE(LOWMEM_PAGES) << PAGE_SHIFT);
#ifdef CONFIG_X86_PAE
pmd_t pl2, *pl2p = (pmd_t *)... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/head64.c | static unsigned int __head *fixup_int(void *ptr, unsigned long physaddr) {
return fixup_pointer(ptr, physaddr);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/head64.c | static bool __head check_la57_support(unsigned long physaddr) {
if (!(native_read_cr4() & X86_CR4_LA57))
return false;
*fixup_int(&__pgtable_l5_enabled, physaddr) = 1;
*fixup_int(&pgdir_shift, physaddr) = 48;
*fixup_int(&ptrs_per_p4d, physaddr) = 512;
*fixup_long(&page_offset_base, physaddr) = __PAGE_OF... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/head64.c |
static void set_bringup_idt_handler(gate_desc *idt, int n, void *handler) {
#ifdef CONFIG_AMD_MEM_ENCRYPT
struct idt_data data;
gate_desc desc;
init_idt_data(&data, n, handler);
idt_init_desc(&desc, &data);
native_write_idt_entry(idt, n, &desc);
#endif
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/head64.c | void early_setup_idt(void) {
if (IS_ENABLED(CONFIG_AMD_MEM_ENCRYPT)) {
setup_ghcb();
set_bringup_idt_handler(bringup_idt_table, X86_TRAP_VC, vc_boot_ghcb);
}
bringup_idt_descr.address = (unsigned long)bringup_idt_table;
native_load_idt(&bringup_idt_descr);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/head64.c | void __head startup_64_setup_env(unsigned long physbase) {
startup_gdt_descr.address =
(unsigned long)fixup_pointer(startup_gdt, physbase);
native_load_gdt(&startup_gdt_descr);
/* New GDT is live - reload data segment registers */
asm volatile("movl %%eax, %%ds\n"
"movl %%eax, %%ss\n"
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c |
static inline struct hpet_channel *
clockevent_to_channel(struct clock_event_device *evt) {
return container_of(evt, struct hpet_channel, evt);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | static void __init hpet_reserve_platform_timers(void) {
struct hpet_data hd;
unsigned int i;
memset(&hd, 0, sizeof(hd));
hd.hd_phys_address = hpet_address;
hd.hd_address = hpet_virt_address;
hd.hd_nirqs = hpet_base.nr_channels;
hd.hd_irq[0] = HPET_LEGACY_8254;
hd.hd_irq[1] = HPET_LEGACY_RTC;
for (i... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | static inline void hpet_reserve_platform_timers(void) {} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | static inline void hpet_select_device_channel(void) {} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c |
static void hpet_restart_counter(void) {
hpet_stop_counter();
hpet_reset_counter();
hpet_start_counter();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c |
static void hpet_resume_counter(struct clocksource *cs) {
hpet_resume_device();
hpet_restart_counter();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c |
static void hpet_enable_legacy_int(void) {
unsigned int cfg = hpet_readl(HPET_CFG);
cfg |= HPET_CFG_LEGACY;
hpet_writel(cfg, HPET_CFG);
hpet_legacy_int_enabled = true;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | static int hpet_clkevt_set_next_event(unsigned long delta,
struct clock_event_device *evt) {
unsigned int channel = clockevent_to_channel(evt)->num;
u32 cnt;
s32 res;
cnt = hpet_readl(HPET_COUNTER);
cnt += (u32)delta;
hpet_writel(cnt, HPET_Tn_CMP(channel));
res = (s... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | static void hpet_msi_unmask(struct irq_data *data) {
struct hpet_channel *hc = irq_data_get_irq_handler_data(data);
unsigned int cfg;
cfg = hpet_readl(HPET_Tn_CFG(hc->num));
cfg |= HPET_TN_ENABLE | HPET_TN_FSB;
hpet_writel(cfg, HPET_Tn_CFG(hc->num));
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c |
static void hpet_msi_free(struct irq_domain *domain,
struct msi_domain_info *info, unsigned int virq) {
irq_clear_status_flags(virq, IRQ_MOVE_PCNTXT);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | static int hpet_clkevt_msi_resume(struct clock_event_device *evt) {
struct hpet_channel *hc = clockevent_to_channel(evt);
struct irq_data *data = irq_get_irq_data(hc->irq);
struct msi_msg msg;
irq_chip_compose_msi_msg(data, &msg);
hpet_msi_write(hc, &msg);
hpet_msi_unmask(data);
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c |
static int hpet_setup_msi_irq(struct hpet_channel *hc) {
if (request_irq(hc->irq, hpet_msi_interrupt_handler,
IRQF_TIMER | IRQF_NOBALANCING, hc->name, hc))
return -1;
disable_irq(hc->irq);
irq_set_affinity(hc->irq, cpumask_of(hc->cpu));
enable_irq(hc->irq);
pr_debug("%s irq %u for MSI... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | int hpet_register_irq_handler(rtc_irq_handler handler) {
if (!is_hpet_enabled())
return -ENODEV;
if (irq_handler)
return -EBUSY;
irq_handler = handler;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | int hpet_rtc_timer_init(void) {
unsigned int cfg, cnt, delta;
unsigned long flags;
if (!is_hpet_enabled())
return 0;
if (!hpet_default_delta) {
struct clock_event_device *evt = &hpet_base.channels[0].evt;
uint64_t clc;
clc = (uint64_t)evt->mult * NSEC_PER_SEC;
clc >>= evt->shift + DEFAULT... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/hpet.c | int hpet_mask_rtc_irq_bit(unsigned long bit_mask) {
if (!is_hpet_enabled())
return 0;
hpet_rtc_flags &= ~bit_mask;
if (unlikely(!hpet_rtc_flags))
hpet_disable_rtc_channel();
return 1;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/hw_breakpoint.c | int arch_check_bp_in_kernelspace(struct arch_hw_breakpoint *hw) {
unsigned long va;
int len;
va = hw->address;
len = arch_bp_generic_len(hw->len);
WARN_ON_ONCE(len < 0);
return (va >= TASK_SIZE_MAX) || ((va + len - 1) >= TASK_SIZE_MAX);
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/hw_breakpoint.c | static inline bool within_area(unsigned long addr, unsigned long end,
unsigned long base, unsigned long size) {
return end >= base && addr < (base + size);
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/i8237.c | static void i8237A_resume(void) {
unsigned long flags;
int i;
flags = claim_dma_lock();
dma_outb(0, DMA1_RESET_REG);
dma_outb(0, DMA2_RESET_REG);
for (i = 0; i < 8; i++) {
set_dma_addr(i, 0x000000);
set_dma_count(i, 1);
}
/* Enable cascade DMA or channel 0-3 won't work */
enable_dma(4);
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/i8237.c | static int __init i8237A_init_ops(void) {
if (dma_inb(DMA_PAGE_0) == 0xFF)
return -ENODEV;
/*
* It is not required to load this driver as newer SoC may not
* support 8237 DMA or bus mastering from LPC. Platform firmware
* must announce the support for such legacy devices via
* ACPI_FADT_LEGACY_DEV... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/i8253.c |
bool __init pit_timer_init(void) {
if (!use_pit())
return false;
clockevent_i8253_init(true);
global_clock_event = &i8253_clockevent;
return true;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/i8259.c | static void legacy_pic_noop(void) {}; | [
0,
0
] |
Linux Kernel | arch/x86/kernel/idt.c | void __init idt_setup_traps(void) {
idt_setup_from_table(idt_table, def_idts, ARRAY_SIZE(def_idts), true);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/io_delay.c |
static int __init io_delay_param(char *s) {
if (!s)
return -EINVAL;
if (!strcmp(s, "0x80"))
io_delay_type = IO_DELAY_TYPE_0X80;
else if (!strcmp(s, "0xed"))
io_delay_type = IO_DELAY_TYPE_0XED;
else if (!strcmp(s, "udelay"))
io_delay_type = IO_DELAY_TYPE_UDELAY;
else if (!strcmp(s, "none"))
... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/irq.c | static void smp_thermal_vector(void) {
if (x86_thermal_enabled())
intel_thermal_interrupt();
else
pr_err("CPU%d: Unexpected LVT thermal interrupt!\n", smp_processor_id());
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/irq_32.c | static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc) {
struct irq_stack *curstk, *irqstk;
u32 *isp, *prev_esp, arg1;
curstk = (struct irq_stack *)current_stack();
irqstk = __this_cpu_read(hardirq_stack_ptr);
if (unlikely(curstk == irqstk))
return 0;
isp = (u32 *)((char *)irqstk... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/irq_work.c |
void arch_irq_work_raise(void) {
if (!arch_irq_work_has_interrupt())
return;
apic->send_IPI_self(IRQ_WORK_VECTOR);
apic_wait_icr_idle();
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/itmt.c |
int arch_asym_cpu_priority(int cpu) {
return per_cpu(sched_core_priority, cpu);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/jailhouse.c |
static void __init jailhouse_timer_init(void) {
lapic_timer_period = setup_data.v1.apic_khz * (1000 / HZ);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/jailhouse.c |
static unsigned long jailhouse_get_tsc(void) { return precalibrated_tsc_khz; } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/jailhouse.c | static inline bool jailhouse_uart_enabled(unsigned int uart_nr) {
return setup_data.v2.flags & BIT(uart_nr);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/jailhouse.c | static bool __init jailhouse_x2apic_available(void) { return x2apic_enabled(); } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/jump_label.c |
static void __ref jump_label_transform(struct jump_entry *entry,
enum jump_label_type type, int init) {
mutex_lock(&text_mutex);
__jump_label_transform(entry, type, init);
mutex_unlock(&text_mutex);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kdebugfs.c |
static int __init create_setup_data_nodes(struct dentry *parent) {
struct setup_indirect *indirect;
struct setup_data_node *node;
struct setup_data *data;
u64 pa_data, pa_next;
struct dentry *d;
int error;
u32 len;
int no = 0;
d = debugfs_create_dir("setup_data", parent);
pa_data = boot_params.hd... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kexec-bzimage64.c | static int setup_e820_entries(struct boot_params *params) {
unsigned int nr_e820_entries;
nr_e820_entries = e820_table_kexec->nr_entries;
/* TODO: Pass entries more than E820_MAX_ENTRIES_ZEROPAGE in bootparams setup
* data */
if (nr_e820_entries > E820_MAX_ENTRIES_ZEROPAGE)
nr_e820_entries = E820_MAX_E... | [
1,
1
] |
Linux Kernel | arch/x86/kernel/kgdb.c | void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs,
struct task_struct *p) {
#ifndef CONFIG_X86_32
u32 *gdb_regs32 = (u32 *)gdb_regs;
#endif
gdb_regs[GDB_AX] = 0;
gdb_regs[GDB_BX] = 0;
gdb_regs[GDB_CX] = 0;
gdb_regs[GDB_DX] = 0;
gdb_regs[GDB_SI] = 0;
gdb_regs[GDB_DI]... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c |
static int kgdb_remove_hw_break(unsigned long addr, int len,
enum kgdb_bptype bptype) {
int i;
for (i = 0; i < HBP_NUM; i++)
if (breakinfo[i].addr == addr && breakinfo[i].enabled)
break;
if (i == HBP_NUM)
return -1;
if (hw_break_release_slot(i)) {
printk(KERN... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c |
static int kgdb_set_hw_break(unsigned long addr, int len,
enum kgdb_bptype bptype) {
int i;
for (i = 0; i < HBP_NUM; i++)
if (!breakinfo[i].enabled)
break;
if (i == HBP_NUM)
return -1;
switch (bptype) {
case BP_HARDWARE_BREAKPOINT:
len = 1;
breakinfo[i].ty... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c | static void kgdb_disable_hw_debug(struct pt_regs *regs) {
int i;
int cpu = raw_smp_processor_id();
struct perf_event *bp;
set_debugreg(0UL, 7);
for (i = 0; i < HBP_NUM; i++) {
if (!breakinfo[i].enabled)
continue;
if (dbg_is_early) {
early_dr7 &= ~encode_dr7(i, breakinfo[i].len, breakinfo[... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c | int kgdb_arch_handle_exception(int e_vector, int signo, int err_code,
char *remcomInBuffer, char *remcomOutBuffer,
struct pt_regs *linux_regs) {
unsigned long addr;
char *ptr;
switch (remcomInBuffer[0]) {
case 'c':
case 's':
ptr = &remcomInBu... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c | static int __kgdb_notify(struct die_args *args, unsigned long cmd) {
struct pt_regs *regs = args->regs;
switch (cmd) {
case DIE_DEBUG:
if (atomic_read(&kgdb_cpu_doing_single_step) != -1) {
if (user_mode(regs))
return single_step_cont(regs, args);
break;
} else if (test_thread_flag(TIF... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c |
int kgdb_ll_trap(int cmd, const char *str, struct pt_regs *regs, long err,
int trap, int sig) {
struct die_args args = {
.regs = regs,
.str = str,
.err = err,
.trapnr = trap,
.signr = sig,
};
if (!kgdb_io_module_registered)
return NOTIFY_DONE;
return __kgdb... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kgdb.c | void kgdb_arch_late(void) {
int i, cpu;
struct perf_event_attr attr;
struct perf_event **pevent;
hw_breakpoint_init(&attr);
attr.bp_addr = (unsigned long)kgdb_arch_init;
attr.bp_len = HW_BREAKPOINT_LEN_1;
attr.bp_type = HW_BREAKPOINT_W;
attr.disabled = 1;
for (i = 0; i < HBP_NUM; i++) {
if (break... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c | static unsigned long __recover_probed_insn(kprobe_opcode_t *buf,
unsigned long addr) {
struct kprobe *kp;
bool faddr;
kp = get_kprobe((void *)addr);
faddr = ftrace_location(addr) == addr;
if (!kp && !faddr)
return addr;
/*
* Basically, kp->ainsn.insn has ... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c | kprobe_opcode_t *arch_adjust_kprobe_addr(unsigned long addr,
unsigned long offset,
bool *on_func_entry) {
if (is_endbr(*(u32 *)addr)) {
*on_func_entry = !offset || offset == 4;
if (*on_func_entry)
offset = 4;
} else {
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c |
static void kprobe_emulate_ret(struct kprobe *p, struct pt_regs *regs) {
int3_emulate_ret(regs);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c |
static void kprobe_emulate_call_indirect(struct kprobe *p,
struct pt_regs *regs) {
unsigned long offs = addrmode_regoffs[p->ainsn.indirect.reg];
int3_emulate_call(regs, regs_get_register(regs, offs));
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c |
void arch_arm_kprobe(struct kprobe *p) {
u8 int3 = INT3_INSN_OPCODE;
text_poke(p->addr, &int3, 1);
text_poke_sync();
perf_event_text_poke(p->addr, &p->opcode, 1, &int3, 1);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c | static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb) {
switch (kcb->kprobe_status) {
case KPROBE_HIT_SSDONE:
case KPROBE_HIT_ACTIVE:
case KPROBE_HIT_SS:
kprobes_inc_nmissed_count(p);
setup_singlestep(p, regs, kcb, 1);
break;
case KP... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c | int kprobe_fault_handler(struct pt_regs *regs, int trapnr) {
struct kprobe *cur = kprobe_running();
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
if (unlikely(regs->ip == (unsigned long)cur->ainsn.insn)) {
WARN_ON(kcb->kprobe_status != KPROBE_HIT_SS &&
kcb->kprobe_status != KPROBE_REENTER);
... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c |
int __init arch_init_kprobes(void) { return 0; } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/core.c |
int arch_trampoline_kprobe(struct kprobe *p) { return 0; } | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/ftrace.c | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip,
struct ftrace_ops *ops, struct ftrace_regs *fregs) {
struct pt_regs *regs = ftrace_get_regs(fregs);
struct kprobe *p;
struct kprobe_ctlblk *kcb;
int bit;
bit = ftrace_test_recursion_trylock(ip, parent_ip);
if (... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/ftrace.c |
int arch_prepare_kprobe_ftrace(struct kprobe *p) {
p->ainsn.insn = NULL;
p->ainsn.boostable = false;
return 0;
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/opt.c | static void synthesize_clac(kprobe_opcode_t *addr) {
if (!boot_cpu_has(X86_FEATURE_SMAP))
return;
/* Replace the NOP3 with CLAC */
addr[0] = 0x0f;
addr[1] = 0x01;
addr[2] = 0xca;
} | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/opt.c | static void optimized_callback(struct optimized_kprobe *op,
struct pt_regs *regs) {
if (kprobe_disabled(&op->kp))
return;
preempt_disable();
if (kprobe_running()) {
kprobes_inc_nmissed_count(&op->kp);
} else {
struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
/* A... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/opt.c | static int insn_jump_into_range(struct insn *insn, unsigned long start,
int len) {
unsigned long target = 0;
switch (insn->opcode.bytes[0]) {
case 0xe0:
case 0xe1: /* loope */
case 0xe2: /* loop */
case 0xe3: /* jcxz */
case 0xe9: /* near relative jump */
case 0xeb: /* s... | [
1,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/opt.c | static int insn_is_indirect_jump(struct insn *insn) {
int ret = __insn_is_indirect_jump(insn);
#ifdef CONFIG_RETPOLINE
if (!ret)
ret = insn_jump_into_range(insn, (unsigned long)__indirect_thunk_start,
(unsigned long)__indirect_thunk_end -
(unsi... | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/opt.c |
void arch_remove_optimized_kprobe(struct optimized_kprobe *op) {
__arch_remove_optimized_kprobe(op, 1);
} | [
0,
0
] |
Linux Kernel | arch/x86/kernel/kprobes/opt.c | void arch_unoptimize_kprobe(struct optimized_kprobe *op) {
u8 new[JMP32_INSN_SIZE] = {
INT3_INSN_OPCODE,
};
u8 old[JMP32_INSN_SIZE];
u8 *addr = op->kp.addr;
memcpy(old, op->kp.addr, JMP32_INSN_SIZE);
memcpy(new + INT3_INSN_SIZE, op->optinsn.copied_insn,
JMP32_INSN_SIZE - INT3_INSN_SIZE);
... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.