mm/hmm: use device_private_entry_to_pfn()
swp_offset() should not be called directly, the wrappers are supposed to abstract away the encoding of the device_private specific information in the swap entry. Link: https://lore.kernel.org/r/20200327200021.29372-7-jgg@ziepe.ca Reviewed-by: Ralph Campbell <rcampbell@nvidia.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Tested-by: Ralph Campbell <rcampbell@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
6bfef2f919
commit
f66c9a33ae
2
mm/hmm.c
2
mm/hmm.c
|
@ -267,7 +267,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
|
||||||
*/
|
*/
|
||||||
if (hmm_is_device_private_entry(range, entry)) {
|
if (hmm_is_device_private_entry(range, entry)) {
|
||||||
*pfn = hmm_device_entry_from_pfn(range,
|
*pfn = hmm_device_entry_from_pfn(range,
|
||||||
swp_offset(entry));
|
device_private_entry_to_pfn(entry));
|
||||||
*pfn |= range->flags[HMM_PFN_VALID];
|
*pfn |= range->flags[HMM_PFN_VALID];
|
||||||
if (is_write_device_private_entry(entry))
|
if (is_write_device_private_entry(entry))
|
||||||
*pfn |= range->flags[HMM_PFN_WRITE];
|
*pfn |= range->flags[HMM_PFN_WRITE];
|
||||||
|
|
Loading…
Reference in New Issue