struct iommu_resv_region *region;
 
                        region = iommu_alloc_resv_region(base + SZ_64K, SZ_64K,
-                                                        prot, IOMMU_RESV_MSI);
+                                                        prot, IOMMU_RESV_MSI,
+                                                        GFP_KERNEL);
                        if (region)
                                list_add_tail(®ion->list, head);
                }
 
                        type = IOMMU_RESV_RESERVED;
 
                region = iommu_alloc_resv_region(entry->address_start,
-                                                length, prot, type);
+                                                length, prot, type,
+                                                GFP_KERNEL);
                if (!region) {
                        dev_err(dev, "Out of memory allocating dm-regions\n");
                        return;
 
        region = iommu_alloc_resv_region(MSI_RANGE_START,
                                         MSI_RANGE_END - MSI_RANGE_START + 1,
-                                        0, IOMMU_RESV_MSI);
+                                        0, IOMMU_RESV_MSI, GFP_KERNEL);
        if (!region)
                return;
        list_add_tail(®ion->list, head);
 
        region = iommu_alloc_resv_region(HT_RANGE_START,
                                         HT_RANGE_END - HT_RANGE_START + 1,
-                                        0, IOMMU_RESV_RESERVED);
+                                        0, IOMMU_RESV_RESERVED, GFP_KERNEL);
        if (!region)
                return;
        list_add_tail(®ion->list, head);
 
 
                region = iommu_alloc_resv_region(DOORBELL_ADDR,
                                                 PAGE_SIZE, prot,
-                                                IOMMU_RESV_MSI);
+                                                IOMMU_RESV_MSI, GFP_KERNEL);
                if (!region)
                        return;
 
 
        int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
 
        region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
-                                        prot, IOMMU_RESV_SW_MSI);
+                                        prot, IOMMU_RESV_SW_MSI, GFP_KERNEL);
        if (!region)
                return;
 
 
        int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
 
        region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
-                                        prot, IOMMU_RESV_SW_MSI);
+                                        prot, IOMMU_RESV_SW_MSI, GFP_KERNEL);
        if (!region)
                return;
 
 
                                IOMMU_RESV_DIRECT_RELAXABLE : IOMMU_RESV_DIRECT;
 
                        resv = iommu_alloc_resv_region(rmrr->base_address,
-                                                      length, prot, type);
+                                                      length, prot, type,
+                                                      GFP_KERNEL);
                        if (!resv)
                                break;
 
 
                if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) {
                        reg = iommu_alloc_resv_region(0, 1UL << 24, prot,
-                                                  IOMMU_RESV_DIRECT_RELAXABLE);
+                                       IOMMU_RESV_DIRECT_RELAXABLE,
+                                       GFP_KERNEL);
                        if (reg)
                                list_add_tail(®->list, head);
                }
 
        reg = iommu_alloc_resv_region(IOAPIC_RANGE_START,
                                      IOAPIC_RANGE_END - IOAPIC_RANGE_START + 1,
-                                     0, IOMMU_RESV_MSI);
+                                     0, IOMMU_RESV_MSI, GFP_KERNEL);
        if (!reg)
                return;
        list_add_tail(®->list, head);
 
        LIST_HEAD(stack);
 
        nr = iommu_alloc_resv_region(new->start, new->length,
-                                    new->prot, new->type);
+                                    new->prot, new->type, GFP_KERNEL);
        if (!nr)
                return -ENOMEM;
 
 
 struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start,
                                                  size_t length, int prot,
-                                                 enum iommu_resv_type type)
+                                                 enum iommu_resv_type type,
+                                                 gfp_t gfp)
 {
        struct iommu_resv_region *region;
 
-       region = kzalloc(sizeof(*region), GFP_KERNEL);
+       region = kzalloc(sizeof(*region), gfp);
        if (!region)
                return NULL;
 
 
                        continue;
 
                region = iommu_alloc_resv_region(resv->iova_base, resv->size,
-                                                prot, IOMMU_RESV_RESERVED);
+                                                prot, IOMMU_RESV_RESERVED,
+                                                GFP_KERNEL);
                if (!region)
                        return;
 
 
                fallthrough;
        case VIRTIO_IOMMU_RESV_MEM_T_RESERVED:
                region = iommu_alloc_resv_region(start, size, 0,
-                                                IOMMU_RESV_RESERVED);
+                                                IOMMU_RESV_RESERVED,
+                                                GFP_KERNEL);
                break;
        case VIRTIO_IOMMU_RESV_MEM_T_MSI:
                region = iommu_alloc_resv_region(start, size, prot,
-                                                IOMMU_RESV_MSI);
+                                                IOMMU_RESV_MSI,
+                                                GFP_KERNEL);
                break;
        }
        if (!region)
         */
        if (!msi) {
                msi = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
-                                             prot, IOMMU_RESV_SW_MSI);
+                                             prot, IOMMU_RESV_SW_MSI,
+                                             GFP_KERNEL);
                if (!msi)
                        return;
 
 
 extern bool iommu_default_passthrough(void);
 extern struct iommu_resv_region *
 iommu_alloc_resv_region(phys_addr_t start, size_t length, int prot,
-                       enum iommu_resv_type type);
+                       enum iommu_resv_type type, gfp_t gfp);
 extern int iommu_get_group_resv_regions(struct iommu_group *group,
                                        struct list_head *head);