Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4773603ybi; Sat, 20 Jul 2019 05:53:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqw22BwM1q5NoVtegioeL3SeVs8L5z6D6q/iybBdg3vipWiXxhNY41AqstXPGKX6I1nQMohd X-Received: by 2002:a63:221f:: with SMTP id i31mr61294604pgi.251.1563627229218; Sat, 20 Jul 2019 05:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563627229; cv=none; d=google.com; s=arc-20160816; b=h8fjKmnnx833mjoIMiOtARbfzX/JsU46e19JpYNVKu/UXm14kYWythdyCZOpGYBkLw aZNjK+T7XTgUkEUyKQJ1UGfc4Xt8LXlU3hWbO2X/KBURuGCdV/xNCWf54E0IlKey1G4N Xbps7AsAi+++0Rux8a1qoDai82OzjmiwDoeW3Ce+xaHaFaaFOsG5zpGQB+DCwZmeKkeX F2YznKhhpB5VJ+l8JZZSXlbX3u6xIuJ4gjizJIzXIKcfDFjk5cj8vuo5nT6iNH3AWsqb 1Ir2Xp3wMbEyTKhLlZEfEBf4y6zx7Lxfm7rcZmhLcGhPnfbAjVEVE1zwSeTVmuJz8+Ld ZiaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=K89J2IEPJbk6VmuKgUrqZ1VHo+WQOc0Cte4m7yFZoOE=; b=0r/t3M998Wd0Pdax+w9BlASj6HDuIxNnpqEMK9cekJECzWJ9QzQgJq6y77CbqYvVp6 i+4kJC6bkBIh1QNm4eJk6EsBu4FON3lLZ7hPZnkvaotn9GO9ZKuRqv4uU3vvA9of+oYT 8zzPIWNVa0yrMCE1tNtSjxrfYoCeYpLBIQm3z1rn7vu2d27coPsp544ZeZxVUoTVFjII QNQOLljCm4J/xHOJ7rT2TInjYO3DMeW4ogmUJ1pX9Z+Oxh7+YO68iAL4ckhBigTxDc7p 18trQSAmqKgGwZ22LGS64lj+axNtZKIPB/EWsfINRrRvcfJXelhefcTdM+nTZcqghBHA KHsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=FxK9AQGw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si5728410plo.98.2019.07.20.05.53.27; Sat, 20 Jul 2019 05:53:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=FxK9AQGw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390121AbfGTCD5 (ORCPT + 99 others); Fri, 19 Jul 2019 22:03:57 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:1032 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733067AbfGTCD4 (ORCPT ); Fri, 19 Jul 2019 22:03:56 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 19 Jul 2019 19:04:02 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 19 Jul 2019 19:03:55 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 19 Jul 2019 19:03:55 -0700 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sat, 20 Jul 2019 02:03:54 +0000 Subject: Re: [PATCH] mm/migrate: initialize pud_entry in migrate_vma() To: Ralph Campbell , CC: , , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton References: <20190719233225.12243-1-rcampbell@nvidia.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: Date: Fri, 19 Jul 2019 19:03:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190719233225.12243-1-rcampbell@nvidia.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1563588242; bh=K89J2IEPJbk6VmuKgUrqZ1VHo+WQOc0Cte4m7yFZoOE=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=FxK9AQGwhecU2l9E5xWnRjCI47IQqIB1G9YP1qaTQccoxr6/fiLGGjY0YSYude6Ss ldx4YsThY7WOYGW4UCOdZSHrOrMLWRiaOTTqh477zVcFtymsttcJvuAtY4Kshpzop0 05PJiu02FZmZ+NtH84hCL4TFh8r/ULQplJ+ck6f5iEkLuxOYPAGxEadkPzJhh3hB4q IUYfFsqgnuCrhIfSyTwbQMWR6k03sGAIe3VaTzUem3j/u0Ougpqao7phyGoi//a8jr hWzwc654tVQdZg+yMN4xCgTR00cQoYFuD3oWQHcYpWnpmuw23c/tdcZX3fkdD6w1+o 8ynbqObsmbohw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/19 4:32 PM, Ralph Campbell wrote: > When CONFIG_MIGRATE_VMA_HELPER is enabled, migrate_vma() calls > migrate_vma_collect() which initializes a struct mm_walk but > didn't initialize mm_walk.pud_entry. (Found by code inspection) > Use a C structure initialization to make sure it is set to NULL. >=20 > Fixes: 8763cb45ab967 ("mm/migrate: new memory migration helper for use wi= th > device memory") > Cc: stable@vger.kernel.org > Signed-off-by: Ralph Campbell > Cc: "J=C3=A9r=C3=B4me Glisse" > Cc: Andrew Morton > --- > mm/migrate.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) >=20 > diff --git a/mm/migrate.c b/mm/migrate.c > index 515718392b24..a42858d8e00b 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -2340,16 +2340,13 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, > static void migrate_vma_collect(struct migrate_vma *migrate) > { > struct mmu_notifier_range range; > - struct mm_walk mm_walk; > - > - mm_walk.pmd_entry =3D migrate_vma_collect_pmd; > - mm_walk.pte_entry =3D NULL; > - mm_walk.pte_hole =3D migrate_vma_collect_hole; > - mm_walk.hugetlb_entry =3D NULL; > - mm_walk.test_walk =3D NULL; > - mm_walk.vma =3D migrate->vma; > - mm_walk.mm =3D migrate->vma->vm_mm; > - mm_walk.private =3D migrate; > + struct mm_walk mm_walk =3D { > + .pmd_entry =3D migrate_vma_collect_pmd, > + .pte_hole =3D migrate_vma_collect_hole, > + .vma =3D migrate->vma, > + .mm =3D migrate->vma->vm_mm, > + .private =3D migrate, > + }; Neatly done. > =20 > mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, NULL, mm_walk.mm, > migrate->start, >=20 Reviewed-by: John Hubbard thanks, --=20 John Hubbard NVIDIA