[Skiboot] [PATCH skiboot] npu2/tce: Fix page size checking

Alistair Popple alistair at popple.id.au
Mon Feb 5 18:04:02 AEDT 2018


Good catch! Thanks Alexey.

Stewart this should probably go into whatever stable branches we have too.

Acked-By: Alistair Popple <alistair at popple.id.au>

On Monday, 5 February 2018 5:46:26 PM AEDT Alexey Kardashevskiy wrote:
> The page size is encoded in the TVT data [59:63] as @shift+11 but
> the tce_kill handler does not do the math right; this fixes it.
> 
> Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
> ---
>  hw/npu2.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/npu2.c b/hw/npu2.c
> index c88394b..806f848 100644
> --- a/hw/npu2.c
> +++ b/hw/npu2.c
> @@ -1256,7 +1256,9 @@ static int64_t npu2_tce_kill(struct phb *phb, uint32_t kill_type,
>  	sync();
>  	switch(kill_type) {
>  	case OPAL_PCI_TCE_KILL_PAGES:
> -		tce_page_size = GETFIELD(npu->tve_cache[pe_number], NPU2_ATS_IODA_TBL_TVT_PSIZE);
> +		tce_page_size = 1ULL << (
> +				11 + GETFIELD(npu->tve_cache[pe_number],
> +					NPU2_ATS_IODA_TBL_TVT_PSIZE));
>  		if (tce_page_size != tce_size) {
>  			NPU2ERR(npu, "npu2_tce_kill: Unexpected TCE size (got 0x%x expected 0x%x)\n",
>  				tce_size, tce_page_size);
> 




More information about the Skiboot mailing list