mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Can we break RDPID/RDTSCP ABI ASAP and see if it's okay?
@ 2017-10-28 19:38 Andy Lutomirski
  2017-10-28 23:23 ` Linus Torvalds
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andy Lutomirski @ 2017-10-28 19:38 UTC (permalink / raw)
  To: Linus Torvalds, Peter Zijlstra, X86 ML, Borislav Petkov,
	linux-kernel, linux-abi

We currently do this on boot:

write_rdtscp_aux((node << 12) | cpu);

This *sucks*.  It means that, to very quickly obtain the CPU number
using RDPID, an ALU op is needed.  It also doesn't bloody work on
systems with more than 4096 CPUs.

IMO it should be ((u64)node << 32) | cpu.  Then getting the CPU number is just:

RDPID %rax
MOVL %eax, %eax

I'm thinking about this because rseq users could avoid ever *loading*
the rseq cacheline if they used RDPID to get the CPU number, and it
would be nice to give them a sane way to do it.

This won't break any existing RDPID users if we do it quickly because
there aren't any (the CPUs aren't available).  I would be a bit
surprised if anyone uses RDTSCP for this because it's absurdly slow.

We can change this without affecting the LSL hack, and I think there
are user programs that do the LSL hack.

--Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-11-13 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28 19:38 Can we break RDPID/RDTSCP ABI ASAP and see if it's okay? Andy Lutomirski
2017-10-28 23:23 ` Linus Torvalds
2017-10-29  9:08 ` Thomas Gleixner
2017-11-13 13:54 ` Paolo Bonzini
2017-11-13 18:06   ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®