*/voidinitialize_tlbstate_and_flush(void){inti;structmm_struct*mm=this_cpu_read(cpu_tlbstate.loaded_mm);u64 tlb_gen =atomic64_read(&init_mm.context.tlb_gen);unsignedlongcr3 = __read_cr3();/* Assert that CR3 already references the right mm. */WARN_ON((cr3 & CR3_ADDR_MASK) != ...
下面的atomic64_read代码在x86环境中工作,但是对于x64失败。 代码语言:javascript 复制 asm volatile( "mov %%ebx, %%eax\n" "mov %%ecx, %%edx\n" "lock cmpxchg8b %1\n" : "=&A" (ret) : "m" (v->counter64) ); 有趣的是,锁操作指的是x86中的寄存器'ecx'(:edx),而在x64中,它是指'rax...