[Skiboot] [RFC PATCH v3 4/6] xscoms: read/write xscoms using ucall
Ryan Grimm
grimm at linux.vnet.ibm.com
Thu Feb 27 23:19:19 AEDT 2020
On Tue, 2020-01-28 at 17:27 +1100, Oliver O'Halloran wrote:
> +#define UCALL_BUFSIZE 4
>
> From 1/6:
>
> > Return value of all ultracalls is in register R3. Other output
> > values
> > from the ultracall, if any, are returned in registers R4 through
> > R12.
>
> Which is up to 9 returned values. So where did 4 come from? This is
> an
> accident waiting to happen.
I found out this was coded up quickly to support the xscom ucall.
We will follow hcall convention and post an implementation of ucall4
and ucall9.
> +static inline int uv_xscom_write(u64 partid, u64 pcb_addr, u64
> > val)
> > +{
> > + unsigned long retbuf[UCALL_BUFSIZE];
> > +
> > + return ucall(UV_WRITE_SCOM, retbuf, partid, pcb_addr, val);
> > +}
>
> Do we need to be logging xscom errors in skiboot?
>
Do you mean check RC and print to skiboot log? Or do something more?
> > static inline int xscom_read(uint32_t partid, uint64_t pcb_addr,
> > uint64_t *val)
> > {
> > - return _xscom_read(partid, pcb_addr, val, true);
> > + if (!uv_present)
> > + return _xscom_read(partid, pcb_addr, val, true);
> > +
> > + return uv_xscom_read(partid, pcb_addr, val);
> > }
> > static inline int xscom_write(uint32_t partid, uint64_t pcb_addr,
> > uint64_t val) {
> > - return _xscom_write(partid, pcb_addr, val, true);
> > + if (!uv_present)
> > + return _xscom_write(partid, pcb_addr, val, true);
> > +
> > + return uv_xscom_write(partid, pcb_addr, val);
>
> Seems kind of backwards since having a UV is the exceptional case.
> IMO
> do:
>
> if (uv_present)
> return do_uv_scom()
> return _scom_write();
>
> Less noise in the diff too.
>
k
Thanks,
Ryan
More information about the Skiboot
mailing list