The only reason to have the same virtual address is to keep mmap accounting the same. An original 'VDSO' is presented in mmap for all threads of the same mmap.
First some general questions: is there any reason to need the page used
to be at the same virtual address for each thread? I can't think of one,
and if that's the case then why not simply allocate a series of pages
per-thread via mmap_region or similar, on demand when a thread first
executes an FP branch instruction? That would of course consume some
more virtual address space, but would avoid the hassles of manually
prodding at the TLB, tracking ASIDs & flushing the caches. Perhaps the
shrinker interface could be used to allow freeing those pages if & when
it becomes necessary for long running threads.
Yes, I agree but that is outside of this patch. I think it has sense to rename the current stuff to something like "Emulation" right before some patch which implement the real VDSO capability on MIPS.
Also VDSO is really a misnomer throughout, as I've pointed out to you
before. I'm aware it's an existing misnomer, but it would be nice if
we could clear that up rather than repeat it...
Thank you, I missed it, may be due to long citation. I will add it.+ if (get_isa16_mode(regs->cp0_epc)) {This microMIPS case doesn't set badinst, as I pointed out internally.
+ *(u16 *)&fr->emul = (u16)(ir >> 16);
+ *((u16 *)(&fr->emul) + 1) = (u16)(ir & 0xffff);
II try to keep it as close as an original code for better understanding. Even with it there are questions.
think it would be much cleaner if you were to do something along the
lines of: