Subject: Re: [PATCH] powerpc/book3s_hv_uvmem: Check for failed page migration

From: Alistair Popple <[email-masked]>
Date: Mon, 07 Dec 2020 10:55:49 +1100

On Friday, 4 December 2020 9:18:41 PM AEDT Bharata B Rao wrote:
> 
> Reviewed-by: Bharata B Rao <[email-masked]>
> 
> Did you actually hit this scenario with secure VMs where a UV-paged-in
> page was later found to be not migratable?

No, this was found by inspection. I have no way of testing this but we had a 
similar issue in Nouveau and I think you would have a similar issue here 
although it might be hard to hit.

migrate_vma_pages() will fail a page migration if a CPU thread has raced and 
established a non-zero page PTE for the address. See migrate_vma_insert_page() 
for the implementation. It will also fail if something else has taken a 
reference on the page after calling migrate_vma_setup(), but that is less 
likely as any existing pages will have been isolated.

 - Alistair

> Regards,
> Bharata.