Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp122337ybj; Mon, 4 May 2020 17:25:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJrK/uJegN6iocjiXKatmxvb0XgBfTFEBb8wiVanmLjd4Zc1h+rX/9jH7Ik5Wr9SNR3bYzq X-Received: by 2002:a17:906:804a:: with SMTP id x10mr429806ejw.86.1588638356259; Mon, 04 May 2020 17:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588638356; cv=none; d=google.com; s=arc-20160816; b=O75ynnLPUGjY5P6X9ss/KhXXogIobE/DV3QsfRQwKrFwDdm9u4Y0pAjEiJMVg6XsV9 JOwqlJxczkITJnS7x2xtauBoLKo2Agr5tlewZng/85u1JFy18eaq/AcHoxSW49AmXHMy CCFh4IzdN5TrSZWSMXl0yUEImD/MXaq6lIYtAhVDZLrMbdznFVGwqL2w3uuglzIv4nwD HF49BVbOvpslT1iNXr0lsmP0mgZvrC2Ikye2kuv3bU7BJSK5ZbHFJ2ZIMvgshYunVCSh utKSogi7LZq68D3VIGL20b9BuNdQulfhhH4d26yStctgg2Tnwt4azcpzAo7NtN0LWtfk dMCw== 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=LbTFGAO939OtgC3J478q1/lLZNcOmbmZm/bb6JPA+3g=; b=Aaaxl17hO/acaux8MFgVJKEqTPfcgj+dhXpf3wRheNy6ScD6MSRkQlkhhDbRf2leq4 r3w7Ii1T/EjMzvgoASdohNN0kY8Bve9b/aMRyXdGBkPNODSfKMaSEKPV3PnfWuLD1tI3 j3cksSlk6Nvj6qK6eTsEAB4q4EfcSQtjIgHAV0kPtSmf2QGIUBo5C3DvJyJZ41ipu73a iI4AIYIrq+Mzz9RE1koVmTXP5z/HQOp4HCcEXVpbGikztn3Fr8V95AJFfOP5pgVrpc9W zdVQefWEy4PjTj85fjON3Wkmxw6SKREADSN9jH/gTLA5wSts31EmAIfPP1IJw9Hh7cJz KTyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qw4J8O9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c17si128144ejm.84.2020.05.04.17.25.32; Mon, 04 May 2020 17:25:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qw4J8O9R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728336AbgEEAXs (ORCPT + 99 others); Mon, 4 May 2020 20:23:48 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:7495 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727028AbgEEAXs (ORCPT ); Mon, 4 May 2020 20:23:48 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 04 May 2020 17:21:40 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 04 May 2020 17:23:48 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 04 May 2020 17:23:48 -0700 Received: from [10.2.56.198] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 5 May 2020 00:23:47 +0000 Subject: Re: [PATCH hmm v2 4/5] mm/hmm: remove HMM_PFN_SPECIAL To: Jason Gunthorpe , , Ralph Campbell CC: Alex Deucher , , Ben Skeggs , =?UTF-8?Q?Christian_K=c3=b6nig?= , "David (ChunMing) Zhou" , , Felix Kuehling , Christoph Hellwig , , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , , Niranjana Vishwanathapura , , "Yang, Philip" References: <4-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <11e39f2e-e244-a75f-15f4-83d2f5dd2f26@nvidia.com> Date: Mon, 4 May 2020 17:23:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <4-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1588638100; bh=LbTFGAO939OtgC3J478q1/lLZNcOmbmZm/bb6JPA+3g=; 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=qw4J8O9R40LD/qwoUcwvvA/9rtpnX8IImDRS9vHOyZrJtm90MVganf/mHpIZLk1G2 TAaZxWVsiQD4LfvXhom5hDALdA1n9rwzM/TX7FVswoGDDHCxrarRiboHsnvtRGwfaB XKUfU9+NeTQ12kJUC1MpdFE2FpDUzqsBAAJ2qH76Gr+U2Wn+OGtNJBOQeTAFsxD7Xb hzwEziNt+xMaVGWJ2xKZIj1gPJ5+BVHFfaGuaAaky5NcasEmrfLU4+U+l+TVi4bLUh O7o5uuDV8EwCSq3Qst8WqzmyAaKwQMM7ipuSr9hNn9vnKmA4K1RyrTUleAA0KmoAm6 HX5++tYtaWNGw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-01 11:20, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > This is just an alias for HMM_PFN_ERROR, nothing cares that the error was > because of a special page vs any other error case. Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA > > Acked-by: Felix Kuehling > Reviewed-by: Christoph Hellwig > Signed-off-by: Jason Gunthorpe > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 - > drivers/gpu/drm/nouveau/nouveau_svm.c | 1 - > include/linux/hmm.h | 8 -------- > mm/hmm.c | 2 +- > 4 files changed, 1 insertion(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > index 41ae7f96f48194..76b4a4fa39ed04 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > @@ -775,7 +775,6 @@ static const uint64_t hmm_range_flags[HMM_PFN_FLAG_MAX] = { > static const uint64_t hmm_range_values[HMM_PFN_VALUE_MAX] = { > 0xfffffffffffffffeUL, /* HMM_PFN_ERROR */ > 0, /* HMM_PFN_NONE */ > - 0xfffffffffffffffcUL /* HMM_PFN_SPECIAL */ > }; > > /** > diff --git a/drivers/gpu/drm/nouveau/nouveau_svm.c b/drivers/gpu/drm/nouveau/nouveau_svm.c > index c68e9317cf0740..cf0d9bd61bebf9 100644 > --- a/drivers/gpu/drm/nouveau/nouveau_svm.c > +++ b/drivers/gpu/drm/nouveau/nouveau_svm.c > @@ -379,7 +379,6 @@ static const u64 > nouveau_svm_pfn_values[HMM_PFN_VALUE_MAX] = { > [HMM_PFN_ERROR ] = ~NVIF_VMM_PFNMAP_V0_V, > [HMM_PFN_NONE ] = NVIF_VMM_PFNMAP_V0_NONE, > - [HMM_PFN_SPECIAL] = ~NVIF_VMM_PFNMAP_V0_V, > }; > > /* Issue fault replay for GPU to retry accesses that faulted previously. */ > diff --git a/include/linux/hmm.h b/include/linux/hmm.h > index 0df27dd03d53d7..81c302c884c0e3 100644 > --- a/include/linux/hmm.h > +++ b/include/linux/hmm.h > @@ -44,10 +44,6 @@ enum hmm_pfn_flag_e { > * Flags: > * HMM_PFN_ERROR: corresponding CPU page table entry points to poisoned memory > * HMM_PFN_NONE: corresponding CPU page table entry is pte_none() > - * HMM_PFN_SPECIAL: corresponding CPU page table entry is special; i.e., the > - * result of vmf_insert_pfn() or vm_insert_page(). Therefore, it should not > - * be mirrored by a device, because the entry will never have HMM_PFN_VALID > - * set and the pfn value is undefined. > * > * Driver provides values for none entry, error entry, and special entry. > * Driver can alias (i.e., use same value) error and special, but > @@ -56,12 +52,10 @@ enum hmm_pfn_flag_e { > * HMM pfn value returned by hmm_vma_get_pfns() or hmm_vma_fault() will be: > * hmm_range.values[HMM_PFN_ERROR] if CPU page table entry is poisonous, > * hmm_range.values[HMM_PFN_NONE] if there is no CPU page table entry, > - * hmm_range.values[HMM_PFN_SPECIAL] if CPU page table entry is a special one > */ > enum hmm_pfn_value_e { > HMM_PFN_ERROR, > HMM_PFN_NONE, > - HMM_PFN_SPECIAL, > HMM_PFN_VALUE_MAX > }; > > @@ -110,8 +104,6 @@ static inline struct page *hmm_device_entry_to_page(const struct hmm_range *rang > return NULL; > if (entry == range->values[HMM_PFN_ERROR]) > return NULL; > - if (entry == range->values[HMM_PFN_SPECIAL]) > - return NULL; > if (!(entry & range->flags[HMM_PFN_VALID])) > return NULL; > return pfn_to_page(entry >> range->pfn_shift); > diff --git a/mm/hmm.c b/mm/hmm.c > index f06bcac948a79b..2e975eedb14f89 100644 > --- a/mm/hmm.c > +++ b/mm/hmm.c > @@ -301,7 +301,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, > pte_unmap(ptep); > return -EFAULT; > } > - *pfn = range->values[HMM_PFN_SPECIAL]; > + *pfn = range->values[HMM_PFN_ERROR]; > return 0; > } > >