[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b0cdddeb-c790-082b-810a-77c79de48557@redhat.com>
Date: Thu, 25 Mar 2021 14:26:35 +0100
From: David Hildenbrand <david@...hat.com>
To: Miaohe Lin <linmiaohe@...wei.com>, akpm@...ux-foundation.org
Cc: jglisse@...hat.com, shy828301@...il.com, aquini@...hat.com,
apopple@...dia.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH v3 3/5] mm/migrate.c: fix potential indeterminate pte
entry in migrate_vma_insert_page()
On 25.03.21 14:15, Miaohe Lin wrote:
> If the zone device page does not belong to un-addressable device memory,
> the variable entry will be uninitialized and lead to indeterminate pte
> entry ultimately. Fix this unexpected case and warn about it.
>
> Fixes: df6ad69838fc ("mm/device-public-memory: device memory cache coherent with CPU")
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
> ---
> mm/migrate.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/mm/migrate.c b/mm/migrate.c
> index dacbdc9710ac..87bbad578127 100644
> --- a/mm/migrate.c
> +++ b/mm/migrate.c
> @@ -2968,6 +2968,13 @@ static void migrate_vma_insert_page(struct migrate_vma *migrate,
>
> swp_entry = make_device_private_entry(page, vma->vm_flags & VM_WRITE);
> entry = swp_entry_to_pte(swp_entry);
> + } else {
> + /*
> + * For now we only support migrating to un-addressable
> + * device memory.
> + */
> + pr_warn_once("Unsupported ZONE_DEVICE page type.\n");
> + goto abort;
> }
> } else {
> entry = mk_pte(page, vma->vm_page_prot);
>
Reviewed-by: David Hildenbrand <david@...hat.com>
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists