[Skiboot] [RFC PATCH v2 2/8] Add ultravisor support in OPAL

Ryan Grimm grimm at linux.vnet.ibm.com
Tue Dec 3 07:36:45 AEDT 2019


Oliver, Michael, 

Questions about implementation below and generally how to search for
devices in the device tree.  I've found myself and other team members
confused about how to do so.

On Thu, 2019-11-21 at 15:26 +1100, Oliver O'Halloran wrote:
*snip*
> > 
> > How about we have something like this in the doc, and use
> > device_type
> > "secure_memory" so we don't have the kernel try to use it as
> > regular
> > memory:
> > 
> > Skiboot parses secure memory from the HDAT tables and creates the
> > secure-memory device tree node, similar to a memory@ node except
> > the
> > device_type is "secure_memory". For example:
> > 
> > .. code-block:: dts
> > 
> >         secure-memory at 100fe00000000 {
> >                 device_type = "secure_memory";
> >                 ibm,chip-id = <0>;
> >                 reg = < 0x100fe 0x0 0x2 0x0>;
> >         }
> > 
> > Regions of secure memory will be reserved by hostboot such as OCC,
> > HOMER, and SBE.  Skiboot will use the existing reserve
> > infrastructure
> > to reserve them.
> > For example:
> > 
> > .. code-block::
> > 
> >         ibm,HCODE at 100fffcaf0000
> >         ibm,OCC at 100fffcdd0000
> >         ibm,RINGOVD at 100fffcae0000
> >         ibm,WOFDATA at 100fffcb90000
> >         ibm,arch-reg-data at 100fffd700000
> >         ibm,hbrt-code-image at 100fffcec0000
> >         ibm,hbrt-data at 100fffd420000
> >         ibm,homer-image at 100fffd800000
> >         ibm,homer-image at 100fffdc00000
> >         ibm,occ-common-area at 100ffff800000
> >         ibm,sbe-comm at 100fffce90000
> >         ibm,sbe-comm at 100fffceb0000
> >         ibm,sbe-ffdc at 100fffce80000
> >         ibm,sbe-ffdc at 100fffcea0000
> >         ibm,secure-crypt-algo-code at 100fffce70000
> >         ibm,uvbwlist at 100fffcad0000
> > 
> > For Mambo, ultra.tcl creates the secure-memory device tree node and
> > is
> > currently defined at 8GB with size 8GB.  Mambo has no protection on
> > securememory, so a watchpoint could be used to ensure Skiboot does
> > not
> > touch secure memory.
> > 
> > For BML, the BML script parses secure memory from the Cronus config
> > file and creates the secure-memory device tree node.
> 
> Looks ok to me. mpe might have some comments.
> 

How should Skiboot search for secure-memory in the device
tree?   Should we be looking at device_type the way the kernel does
with of_find_node_by_type?

Skiboot searches for some device nodes by compatible, and this is
stated in https://elinux.org/Device_Tree_Usage :

"Every node in the tree that represents a device is required to have 
the compatible property. compatible is the key an operating system uses
to decidewhich device driver to bind to a device."

I looked at memory@ of a running system and it has no compatible
property, so is memory not considered a device like a cpu, bus, or
ethernet adapter?

When is it correct to search by name or by path?

Thanks,
Ryan



More information about the Skiboot mailing list