[Skiboot] [RFC PATCH skiboot] npu2: Clear XTS_BDF_MAP when destroying context for next init_context

Reza Arbab arbab at linux.ibm.com
Fri Oct 5 01:16:24 AEST 2018


On Thu, Oct 04, 2018 at 07:17:49PM +1000, Alexey Kardashevskiy wrote:
>Once programmed into the NPU, the NPU2_XTS_PID_MAP register content does
>not change and if we try calling opal_npu_init_context() with a different
>MSR (which is going to happen when GPU+NPU virtualization becomes
>available), that will fail.
>
>This clears XTS_BDF_MAP when the context is destroyed.

Doesn't this mean that we will now need to keep a refcount for items in 
the map? Otherwise you could get

PID A creates context w/MSR foo -> BDF wildcard entry created
PID B creates context w/MSR foo
PID C creates context w/MSR foo
PID B destroys context -> BDF wildcard entry removed

-- 
Reza Arbab



More information about the Skiboot mailing list