]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - drivers/vfio/vfio_iommu_spapr_tce.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[mirror_ubuntu-hirsute-kernel.git] / drivers / vfio / vfio_iommu_spapr_tce.c
index 6b64e45a52691ffd9dd4809d0e127fc8c450cf80..7048c9198c21c8592762f7b12f5b083912ff0764 100644 (file)
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * VFIO: IOMMU DMA mapping support for TCE on POWER
  *
  * Copyright (C) 2013 IBM Corp.  All rights reserved.
  *     Author: Alexey Kardashevskiy <aik@ozlabs.ru>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Derived from original vfio_iommu_type1.c:
  * Copyright (C) 2012 Red Hat, Inc.  All rights reserved.
  *     Author: Alex Williamson <alex.williamson@redhat.com>
@@ -532,7 +529,8 @@ static int tce_iommu_use_page(unsigned long tce, unsigned long *hpa)
        enum dma_data_direction direction = iommu_tce_direction(tce);
 
        if (get_user_pages_fast(tce & PAGE_MASK, 1,
-                       direction != DMA_TO_DEVICE, &page) != 1)
+                       direction != DMA_TO_DEVICE ? FOLL_WRITE : 0,
+                       &page) != 1)
                return -EFAULT;
 
        *hpa = __pa((unsigned long) page_address(page));