Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Georgi Djakov <djakov@kernel.org>
To: Greg KH <greg@kroah.com>, Georgi Djakov <quic_c_gdjako@quicinc.com>
Cc: stable@vger.kernel.org, rppt@linux.ibm.com,
	anshuman.khandual@arm.com, david@redhat.com, will@kernel.org,
	catalin.marinas@arm.com, hch@lst.de, akpm@linux-foundation.org,
	surenb@google.com, quic_sudaraja@quicinc.com
Subject: Re: [PATCH 5.15 1/2] dma-mapping: remove bogus test for pfn_valid from dma_map_resource
Date: Thu, 21 Apr 2022 10:51:39 +0300	[thread overview]
Message-ID: <ebccb5ef-e9df-48f5-ecf6-3969fb62df16@kernel.org> (raw)
In-Reply-To: <YmD8+0S2AxAlUaG4@kroah.com>


On 21.04.22 9:43, Greg KH wrote:
> On Wed, Apr 20, 2022 at 05:43:40AM -0700, Georgi Djakov wrote:
>> From: Mike Rapoport <rppt@linux.ibm.com>
>>
>> [ Upstream commit a9c38c5d267cb94871dfa2de5539c92025c855d7 ]
>>
>> dma_map_resource() uses pfn_valid() to ensure the range is not RAM.
>> However, pfn_valid() only checks for availability of the memory map for a
>> PFN but it does not ensure that the PFN is actually backed by RAM.
>>
>> As dma_map_resource() is the only method in DMA mapping APIs that has this
>> check, simply drop the pfn_valid() test from dma_map_resource().
>>
>> Link: https://lore.kernel.org/all/20210824173741.GC623@arm.com/
>> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>> Acked-by: David Hildenbrand <david@redhat.com>
>> Link: https://lore.kernel.org/r/20210930013039.11260-2-rppt@kernel.org
>> Signed-off-by: Will Deacon <will@kernel.org>
>> Fixes: 859a85ddf90e ("mm: remove pfn_valid_within() and CONFIG_HOLES_IN_ZONE")
>> Link: https://lore.kernel.org/r/Yl0IZWT2nsiYtqBT@linux.ibm.com
>> Signed-off-by: Georgi Djakov <quic_c_gdjako@quicinc.com>
>> ---
>>   kernel/dma/mapping.c | 4 ----
>>   1 file changed, 4 deletions(-)
> 
> I took this, but I do not understand why patch 2/2 in this series is
> needed, as Sasha points out.  Cleanups are nice, but is it necessary
> here?

It's needed as it removes the "select HAVE_ARCH_PFN_VALID" from the arm64/Kconfig.
This will make us use the generic pfn_valid() function in mmzone.h, instead of the
arch-specific one, that we are dropping.

Thanks,
Georgi

  reply	other threads:[~2022-04-21  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 12:43 [PATCH 5.15 1/2] dma-mapping: remove bogus test for pfn_valid from dma_map_resource Georgi Djakov
2022-04-20 12:43 ` [PATCH 5.15 2/2] arm64/mm: drop HAVE_ARCH_PFN_VALID Georgi Djakov
2022-04-20 14:49   ` Sasha Levin
2022-04-20 16:11     ` Georgi Djakov
2022-04-21  6:43 ` [PATCH 5.15 1/2] dma-mapping: remove bogus test for pfn_valid from dma_map_resource Greg KH
2022-04-21  7:51   ` Georgi Djakov [this message]
2022-04-21  8:25     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ebccb5ef-e9df-48f5-ecf6-3969fb62df16@kernel.org \
    --to=djakov@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=david@redhat.com \
    --cc=greg@kroah.com \
    --cc=hch@lst.de \
    --cc=quic_c_gdjako@quicinc.com \
    --cc=quic_sudaraja@quicinc.com \
    --cc=rppt@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox