[Skiboot] [PATCH skiboot] npu2: Allow ATSD for LPAR other than 0
aik at ozlabs.ru
Wed Dec 12 15:19:48 AEDT 2018
On 12/12/2018 14:57, Andrew Donnellan wrote:
> On 12/12/18 1:07 pm, Alistair Popple wrote:
>>> You got me there :) It is "ibm,npu-link-index" in the hypervisor/vfio
>>> but nothing says the index from npu2::devices[index] is the same thing,
>>> I need this conversion here as "index" is not visible to the host
>>> system :-/
>> Yeah, that is what I was getting at. You could just use
>> dev->link_index (which
>> is the same as "ibm,npu-link-index") instead of npu2::devices[index].
>> would make me somewhat happier. Theorectically there is nothing in HW
>> guarantees there will be a matching ATSD register for every
>> but in practice there is and it looks likely that won't change in
>> future so it
>> should be ok.
> I didn't see this patch early enough and only noticed it when rebasing
> my current OpenCAPI work.
> As part of my Witherspoon OpenCAPI enablement work I am currently
> looking at every place where we're currently indexing into the devices
> array (as that's a place where you probably want to check the type of
> the device you're looking at). There should be no uses of the array
> index at all, IMHO - always check link_index or brick_index explicitly.\
The current plan is to ditch dev->link_index and store the device
pointer in npu2::devices[dt_prop_get_u32(link, "ibm,npu-link-index")] as
ibm,npu-link-index is a skiboot made-up thing anyway,
and then the index in devices will make sense.
> Anyway, the v2 of this patch will need to be rebased on top of the
> series I'm about to send :)
More information about the Skiboot