cpu_context
struct cpu_context_save cpu_context; /* cpu context */
((unsigned long)(task_thread_info(tsk)->cpu_context.pc))
((unsigned long)(task_thread_info(tsk)->cpu_context.sp))
((unsigned long)(task_thread_info(tsk)->cpu_context.fp))
((unsigned long)(task_thread_info(tsk)->cpu_context.r7))
DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
gdb_regs[_PC] = ti->cpu_context.pc;
gdb_regs[_R4] = ti->cpu_context.r4;
gdb_regs[_R5] = ti->cpu_context.r5;
gdb_regs[_R6] = ti->cpu_context.r6;
gdb_regs[_R7] = ti->cpu_context.r7;
gdb_regs[_R8] = ti->cpu_context.r8;
gdb_regs[_R9] = ti->cpu_context.r9;
gdb_regs[_R10] = ti->cpu_context.sl;
gdb_regs[_FP] = ti->cpu_context.fp;
gdb_regs[_SPT] = ti->cpu_context.sp;
memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save));
thread->cpu_context.r4 = (unsigned long)args->fn_arg;
thread->cpu_context.r5 = (unsigned long)args->fn;
thread->cpu_context.pc = (unsigned long)ret_from_fork;
thread->cpu_context.sp = (unsigned long)childregs;
thread->cpu_context.extra[0] = 0;
thread->cpu_context.extra[1] = 0;
dsp_save_state(current_thread_info()->cpu_context.extra);
dsp_load_state(thread->cpu_context.extra);
struct cpu_context cpu_context; /* cpu context */
((unsigned long)(tsk->thread.cpu_context.pc))
((unsigned long)(tsk->thread.cpu_context.sp))
((unsigned long)(tsk->thread.cpu_context.fp))
DEFINE(THREAD_CPU_CONTEXT, offsetof(struct task_struct, thread.cpu_context));
struct cpu_context *cpu_context = &task->thread.cpu_context;
gdb_regs[19] = cpu_context->x19;
gdb_regs[20] = cpu_context->x20;
gdb_regs[21] = cpu_context->x21;
gdb_regs[22] = cpu_context->x22;
gdb_regs[23] = cpu_context->x23;
gdb_regs[24] = cpu_context->x24;
gdb_regs[25] = cpu_context->x25;
gdb_regs[26] = cpu_context->x26;
gdb_regs[27] = cpu_context->x27;
gdb_regs[28] = cpu_context->x28;
gdb_regs[29] = cpu_context->fp;
gdb_regs[31] = cpu_context->sp;
gdb_regs[32] = cpu_context->pc;
memset(&p->thread.cpu_context, 0, sizeof(struct cpu_context));
p->thread.cpu_context.x19 = (unsigned long)args->fn;
p->thread.cpu_context.x20 = (unsigned long)args->fn_arg;
p->thread.cpu_context.pc = (unsigned long)ret_from_fork;
p->thread.cpu_context.sp = (unsigned long)childregs;
p->thread.cpu_context.fp = (unsigned long)&childregs->stackframe;
cpu_context(cpu, mm) = 0;
#define cpu_asid(cpu, mm) (cpu_context((cpu), (mm)) & cpu_asid_mask(&cpu_data[cpu]))
if ((cpu_context(cpu, mm) ^ asid_cache(cpu)) & asid_version_mask(cpu))
cpu_context(cpu, mm) = asid_cache(cpu) = asid;
cpu_context(i, mm) = 0;
if (cpu != smp_processor_id() && cpu_context(cpu, mm))
cpu_context(cpu, mm) = 0;
if (cpu != smp_processor_id() && cpu_context(cpu, mm))
cpu_context(cpu, mm) = 0;
if (cpu != smp_processor_id() && cpu_context(cpu, vma->vm_mm))
cpu_context(cpu, vma->vm_mm) = 0;
struct cpu_context cpu_context;
DEFINE(CC_R15, offsetof(struct cpu_context, r15));
DEFINE(CC_R16, offsetof(struct cpu_context, r16));
DEFINE(CC_R17, offsetof(struct cpu_context, r17));
DEFINE(CC_R18, offsetof(struct cpu_context, r18));
DEFINE(CC_R19, offsetof(struct cpu_context, r19));
DEFINE(CC_R20, offsetof(struct cpu_context, r20));
DEFINE(CC_R21, offsetof(struct cpu_context, r21));
DEFINE(CC_R22, offsetof(struct cpu_context, r22));
DEFINE(CC_R23, offsetof(struct cpu_context, r23));
DEFINE(CC_R24, offsetof(struct cpu_context, r24));
DEFINE(CC_R25, offsetof(struct cpu_context, r25));
DEFINE(CC_R26, offsetof(struct cpu_context, r26));
DEFINE(CC_R27, offsetof(struct cpu_context, r27));
DEFINE(CC_R28, offsetof(struct cpu_context, r28));
DEFINE(CC_R29, offsetof(struct cpu_context, r29));
DEFINE(CC_R30, offsetof(struct cpu_context, r30));
DEFINE(CC_MSR, offsetof(struct cpu_context, msr));
DEFINE(CC_EAR, offsetof(struct cpu_context, ear));
DEFINE(CC_ESR, offsetof(struct cpu_context, esr));
DEFINE(CC_FSR, offsetof(struct cpu_context, fsr));
DEFINE(TI_CPU_CONTEXT, offsetof(struct thread_info, cpu_context));
DEFINE(CC_R1, offsetof(struct cpu_context, r1)); /* r1 */
DEFINE(CC_R2, offsetof(struct cpu_context, r2));
DEFINE(CC_R13, offsetof(struct cpu_context, r13));
DEFINE(CC_R14, offsetof(struct cpu_context, r14));
ti->cpu_context.msr = (childregs->msr|MSR_VM);
ti->cpu_context.msr &= ~MSR_UMS; /* switch_to to kernel mode */
ti->cpu_context.msr &= ~MSR_IE;
ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8;
memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
ti->cpu_context.r1 = (unsigned long)childregs;
ti->cpu_context.r20 = (unsigned long)args->fn;
ti->cpu_context.r19 = (unsigned long)args->fn_arg;
ti->cpu_context.msr = childregs->msr & ~MSR_IE;
ti->cpu_context.r15 = (unsigned long)ret_from_kernel_thread - 8;
memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
ti->cpu_context.r1 = (unsigned long)childregs;
(task->stack))->cpu_context.r1;
const struct cpu_context *cpu_context =
&thread_info->cpu_context;
cpu_context->r1,
cpu_context->r15,
(cpu_context((cpu), (mm)) & cpu_asid_mask(&cpu_data[cpu]))
ctx = cpu_context(cpu, mm);
if (cpu != smp_processor_id() && cpu_context(cpu, mm))
if (cpu != smp_processor_id() && cpu_context(cpu, mm))
if (cpu != smp_processor_id() && cpu_context(cpu, vma->vm_mm))
cpu_context(smp_processor_id(), mm), addr);
if (cpu_context(smp_processor_id(), mm) == 0)
return cpu_context(0, mm) != 0;
if (cpu_context(i, mm))
mmid = cpu_context(0, mm);
ctx = cpu_context(cpu, mm);
ctx = cpu_context(cpu, mm);
if (!asid_versions_eq(cpu, cpu_context(cpu, mm), asid_cache(cpu)))
if (cpu_context(cpu, vma->vm_mm) != 0) {
printk("[tlbpage<%lu,0x%08lx>]", cpu_context(cpu, vma->vm_mm), page);
newpid = cpu_context(cpu, vma->vm_mm) & asid_mask;
if ((pid != (cpu_context(cpu, vma->vm_mm) & asid_mask)) || (cpu_context(cpu, vma->vm_mm) == 0)) {
(cpu_context(cpu, vma->vm_mm)), pid);
if (cpu_context(cpu, mm) != 0) {
cpu_context(cpu, mm) & asid_mask, start, end);
int newpid = cpu_context(cpu, mm) & asid_mask;
if (cpu_context(cpu, mm) != 0) {
if (cpu_context(cpu, vma->vm_mm) != 0) {
(cpu_context((cpu), (mm)) & MMU_CONTEXT_ASID_MASK)
if (((cpu_context(cpu, mm) ^ asid) & MMU_CONTEXT_VERSION_MASK) == 0)
cpu_context(cpu, mm) = asid_cache(cpu) = asid;
cpu_context(i, mm) = NO_CONTEXT;
cpu_context(i, mm) = 0;
cpu_context(i, mm) = 0;
cpu_context(i, vma->vm_mm) = 0;
if (cpu_context(smp_processor_id(), mm) == NO_CONTEXT)
if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
if (cpu_context(smp_processor_id(), vma->vm_mm) == NO_CONTEXT)
if (cpu_context(cpu, mm) != NO_CONTEXT) {
cpu_context(cpu, mm) = NO_CONTEXT;
if (vma->vm_mm && cpu_context(cpu, vma->vm_mm) != NO_CONTEXT) {
if (cpu_context(cpu, mm) != NO_CONTEXT) {
cpu_context(cpu, mm) = NO_CONTEXT;
= per_cpu_ptr(hv_context.cpu_context, cpu);
= per_cpu_ptr(hv_context.cpu_context, cpu);
hv_cpu = per_cpu_ptr(hv_context.cpu_context, cpu);
hv_cpu = per_cpu_ptr(hv_context.cpu_context, cpu);
per_cpu_ptr(hv_context.cpu_context, cpu);
per_cpu_ptr(hv_context.cpu_context, cpu);
= per_cpu_ptr(hv_context.cpu_context, cpu);
hv_context.cpu_context = alloc_percpu(struct hv_per_cpu_context);
if (!hv_context.cpu_context)
per_cpu_ptr(hv_context.cpu_context, cpu);
struct hv_per_cpu_context *hv_cpu = this_cpu_ptr(hv_context.cpu_context);
aligned_msg = this_cpu_ptr(hv_context.cpu_context)->post_msg_page;
struct hv_per_cpu_context __percpu *cpu_context;
struct mshv_vtl_cpu_context cpu_context;
per_cpu = this_cpu_ptr(hv_context.cpu_context);
mshv_cpu = this_cpu_ptr(hv_context.cpu_context);
mshv_vtl_return(&mshv_vtl_this_run()->cpu_context);
struct hv_per_cpu_context *mshv_cpu = this_cpu_ptr(hv_context.cpu_context);
= this_cpu_ptr(hv_context.cpu_context);
hv_context.cpu_context, VMBUS_CONNECT_CPU);
= per_cpu_ptr(hv_context.cpu_context, cpu);