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

Alexey Kardashevskiy aik at ozlabs.ru
Tue Oct 16 12:55:06 AEDT 2018

On 16/10/2018 02:05, Reza Arbab wrote:
> On Mon, Oct 15, 2018 at 05:32:27PM +1100, 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

The idea is to detach OPAL from NPU in powernv, i.e.
pnv_npu2_map_lpar_phb() maps LPAR and creates the wildcard entry and
opal_npu_init_context()/opal_npu_destroy_context() do not call OPAL at
all so the wildcard entry remains there; only KVM device assignment will
call OPAL for these.


More information about the Skiboot mailing list