Skip to content

Commit

Permalink
s390/cio: remove unneeded DMA zone allocation
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Vineeth Vijayan <[email protected]>
Signed-off-by: Peter Oberparleiter <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
  • Loading branch information
oberpar authored and hcahca committed Feb 9, 2024
1 parent 86f48f9 commit a3a64a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions drivers/s390/cio/chsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions drivers/s390/cio/chsc_sch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/cio/scm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a3a64a4

Please sign in to comment.