]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
s390/cio: remove unneeded DMA zone allocation
authorPeter Oberparleiter <oberpar@linux.ibm.com>
Thu, 18 Jan 2024 15:09:39 +0000 (16:09 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 9 Feb 2024 12:58:15 +0000 (13:58 +0100)
Remove GFP_DMA flag when allocating memory to be used for CHSC control
blocks. The CHSC instruction can access memory beyond the DMA zone.

Suggested-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/chsc.c
drivers/s390/cio/chsc_sch.c
drivers/s390/cio/scm.c

index 64ed55c3aed6ce7c8eed64eb03b133a83bff8887..3d88899dff7cfcf4da1d68c939fc73bd3937ba1f 100644 (file)
@@ -1091,8 +1091,8 @@ int __init chsc_init(void)
 {
        int ret;
 
-       sei_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
-       chsc_page = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       sei_page = (void *)get_zeroed_page(GFP_KERNEL);
+       chsc_page = (void *)get_zeroed_page(GFP_KERNEL);
        if (!sei_page || !chsc_page) {
                ret = -ENOMEM;
                goto out_err;
index 902237d0baefea37cf2f04f199a272abdcd1b76b..e6c800653f9880a03c1dbe562f20fd5d127bd0bc 100644 (file)
@@ -293,7 +293,7 @@ static int chsc_ioctl_start(void __user *user_area)
        if (!css_general_characteristics.dynio)
                /* It makes no sense to try. */
                return -EOPNOTSUPP;
-       chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);
+       chsc_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!chsc_area)
                return -ENOMEM;
        request = kzalloc(sizeof(*request), GFP_KERNEL);
@@ -341,7 +341,7 @@ static int chsc_ioctl_on_close_set(void __user *user_area)
                ret = -ENOMEM;
                goto out_unlock;
        }
-       on_close_chsc_area = (void *)get_zeroed_page(GFP_DMA | GFP_KERNEL);
+       on_close_chsc_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!on_close_chsc_area) {
                ret = -ENOMEM;
                goto out_free_request;
@@ -393,7 +393,7 @@ static int chsc_ioctl_start_sync(void __user *user_area)
        struct chsc_sync_area *chsc_area;
        int ret, ccode;
 
-       chsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       chsc_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!chsc_area)
                return -ENOMEM;
        if (copy_from_user(chsc_area, user_area, PAGE_SIZE)) {
@@ -439,7 +439,7 @@ static int chsc_ioctl_info_channel_path(void __user *user_cd)
                u8 data[PAGE_SIZE - 20];
        } __attribute__ ((packed)) *scpcd_area;
 
-       scpcd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       scpcd_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!scpcd_area)
                return -ENOMEM;
        cd = kzalloc(sizeof(*cd), GFP_KERNEL);
@@ -501,7 +501,7 @@ static int chsc_ioctl_info_cu(void __user *user_cd)
                u8 data[PAGE_SIZE - 20];
        } __attribute__ ((packed)) *scucd_area;
 
-       scucd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       scucd_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!scucd_area)
                return -ENOMEM;
        cd = kzalloc(sizeof(*cd), GFP_KERNEL);
@@ -564,7 +564,7 @@ static int chsc_ioctl_info_sch_cu(void __user *user_cud)
                u8 data[PAGE_SIZE - 20];
        } __attribute__ ((packed)) *sscud_area;
 
-       sscud_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       sscud_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!sscud_area)
                return -ENOMEM;
        cud = kzalloc(sizeof(*cud), GFP_KERNEL);
@@ -626,7 +626,7 @@ static int chsc_ioctl_conf_info(void __user *user_ci)
                u8 data[PAGE_SIZE - 20];
        } __attribute__ ((packed)) *sci_area;
 
-       sci_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       sci_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!sci_area)
                return -ENOMEM;
        ci = kzalloc(sizeof(*ci), GFP_KERNEL);
@@ -697,7 +697,7 @@ static int chsc_ioctl_conf_comp_list(void __user *user_ccl)
                u32 res;
        } __attribute__ ((packed)) *cssids_parm;
 
-       sccl_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       sccl_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!sccl_area)
                return -ENOMEM;
        ccl = kzalloc(sizeof(*ccl), GFP_KERNEL);
@@ -757,7 +757,7 @@ static int chsc_ioctl_chpd(void __user *user_chpd)
        int ret;
 
        chpd = kzalloc(sizeof(*chpd), GFP_KERNEL);
-       scpd_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       scpd_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!scpd_area || !chpd) {
                ret = -ENOMEM;
                goto out_free;
@@ -797,7 +797,7 @@ static int chsc_ioctl_dcal(void __user *user_dcal)
                u8 data[PAGE_SIZE - 36];
        } __attribute__ ((packed)) *sdcal_area;
 
-       sdcal_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA);
+       sdcal_area = (void *)get_zeroed_page(GFP_KERNEL);
        if (!sdcal_area)
                return -ENOMEM;
        dcal = kzalloc(sizeof(*dcal), GFP_KERNEL);
index 6b21ba68c1fe62b3e24080dce36b8642cb94406b..a734b323e0631e288893f89613883ad7a2a1d54f 100644 (file)
@@ -228,7 +228,7 @@ int scm_update_information(void)
        size_t num;
        int ret;
 
-       scm_info = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
+       scm_info = (void *)__get_free_page(GFP_KERNEL);
        if (!scm_info)
                return -ENOMEM;