[PATCH v3 04/10] VAS: Define helpers for access MMIO regions

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Sat Mar 25 08:18:22 AEDT 2017


Michael Neuling [michael.neuling at au1.ibm.com] wrote:
> > +static inline void get_uwc_mmio_bar(struct vas_window *window,
> > +			uint64_t *start, int *len)
> > +{
> > +	uint64_t pbaddr;
> > +
> > +	pbaddr = window->vinst->uwc_bar_start;
> > +	*start = pbaddr + window->winid * VAS_UWC_SIZE;
> > +	*len = VAS_UWC_SIZE;
> 
> I'm not sure this works for 4K pages since VAS_UWC_SIZE = PAGE_SIZE but in
> reality I think it's always 64K.  Right?

I believe the idea is that each user process will have its OS/User Window
context on a separate page - to provide proper protection of the window
context between processes. So, the OS/User Window context size _is_ 
dependent on page size.

The page size is set to 64K in init_north_ctl() in skiboot but can be
set to 4K as well. The amount of memory allocated for the OS/User Window
Context MMIO BAR (init_uwcm() in skiboot) also depends on the page size
256MB for 4K or 4GB for 64K.

> 
> Seem like we are mixing pages sizes and hardware sizes here.
> 
> (I realise 4K isn't supported yet, but....)

Yes, only 64K page-size for now.

Thanks,

Sukadev



More information about the Linuxppc-dev mailing list