[PATCH] powerpc: Add support for userspace P9 copy paste

David Laight David.Laight at ACULAB.COM
Thu Apr 28 01:25:59 AEST 2016


From: Chris Smart
> Sent: 26 April 2016 01:29
> The copy paste facility introduced in POWER9 provides an optimised
> mechanism for a userspace application to copy a cacheline. This is
> provided by a pair of instructions, copy and paste, while a third,
> cp_abort (copy paste abort), provides a clean up of the state in case of
> a failure.
> 
> The copy instruction will read a 128 byte cacheline and store it in an
> internal buffer. The subsequent paste instruction will store this
> internal buffer to memory and set a CR field if the paste succeeds.
> 
> Since the state of the copy paste buffer is internal (and not
> architecturally visible), in the unlikely event of a context switch, the
> state cannot be stored and the paste should therefore fail.
> 
> The cp_abort instruction exists to fail and clean up any such
> interrupted copy paste sequence and is to be called by the kernel as
> part of the context switch. Doing so prevents data from a preceding copy
> in one process leaking into the paste of another.
> 
> This code enables use of the cp_abort instruction if a supported
> processor is detected.

In that case what actually completes the copy?
I think you'd need to be inside a 'restartable atomic sequence'
in which case the cp_abort need only be done when the/a RAS
block is detected.

Or have I missed something??

	David



More information about the Linuxppc-dev mailing list