Commit b87c52e4 authored by Alexander Gordeev's avatar Alexander Gordeev Committed by Jens Axboe

s390/dasd: sort out physical vs virtual pointers usage

This does not fix a real bug, since virtual addresses
are currently indentical to physical ones.
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
Link: https://lore.kernel.org/r/20230210000253.1644903-2-sth@linux.ibm.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 9af99354
...@@ -3978,7 +3978,7 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, ...@@ -3978,7 +3978,7 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
ccw = cqr->cpaddr; ccw = cqr->cpaddr;
ccw->cmd_code = CCW_CMD_RDC; ccw->cmd_code = CCW_CMD_RDC;
ccw->cda = (__u32)(addr_t) cqr->data; ccw->cda = (__u32)virt_to_phys(cqr->data);
ccw->flags = 0; ccw->flags = 0;
ccw->count = rdc_buffer_size; ccw->count = rdc_buffer_size;
cqr->startdev = device; cqr->startdev = device;
...@@ -4022,8 +4022,7 @@ char *dasd_get_sense(struct irb *irb) ...@@ -4022,8 +4022,7 @@ char *dasd_get_sense(struct irb *irb)
if (scsw_is_tm(&irb->scsw) && (irb->scsw.tm.fcxs == 0x01)) { if (scsw_is_tm(&irb->scsw) && (irb->scsw.tm.fcxs == 0x01)) {
if (irb->scsw.tm.tcw) if (irb->scsw.tm.tcw)
tsb = tcw_get_tsb((struct tcw *)(unsigned long) tsb = tcw_get_tsb(phys_to_virt(irb->scsw.tm.tcw));
irb->scsw.tm.tcw);
if (tsb && tsb->length == 64 && tsb->flags) if (tsb && tsb->length == 64 && tsb->flags)
switch (tsb->flags & 0x07) { switch (tsb->flags & 0x07) {
case 1: /* tsa_iostat */ case 1: /* tsa_iostat */
......
...@@ -220,7 +220,7 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier) ...@@ -220,7 +220,7 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier)
memset(ccw, 0, sizeof(struct ccw1)); memset(ccw, 0, sizeof(struct ccw1));
ccw->cmd_code = CCW_CMD_DCTL; ccw->cmd_code = CCW_CMD_DCTL;
ccw->count = 4; ccw->count = 4;
ccw->cda = (__u32)(addr_t) DCTL_data; ccw->cda = (__u32)virt_to_phys(DCTL_data);
dctl_cqr->flags = erp->flags; dctl_cqr->flags = erp->flags;
dctl_cqr->function = dasd_3990_erp_DCTL; dctl_cqr->function = dasd_3990_erp_DCTL;
dctl_cqr->refers = erp; dctl_cqr->refers = erp;
...@@ -1714,7 +1714,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1714,7 +1714,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT; ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT;
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)(addr_t) DE_data; ccw->cda = (__u32)virt_to_phys(DE_data);
/* create LO ccw */ /* create LO ccw */
ccw++; ccw++;
...@@ -1722,7 +1722,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1722,7 +1722,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD; ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD;
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)(addr_t) LO_data; ccw->cda = (__u32)virt_to_phys(LO_data);
/* TIC to the failed ccw */ /* TIC to the failed ccw */
ccw++; ccw++;
...@@ -2419,7 +2419,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) ...@@ -2419,7 +2419,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
tcw = erp->cpaddr; tcw = erp->cpaddr;
tsb = (struct tsb *) &tcw[1]; tsb = (struct tsb *) &tcw[1];
*tcw = *((struct tcw *)cqr->cpaddr); *tcw = *((struct tcw *)cqr->cpaddr);
tcw->tsb = (long)tsb; tcw->tsb = virt_to_phys(tsb);
} else if (ccw->cmd_code == DASD_ECKD_CCW_PSF) { } else if (ccw->cmd_code == DASD_ECKD_CCW_PSF) {
/* PSF cannot be chained from NOOP/TIC */ /* PSF cannot be chained from NOOP/TIC */
erp->cpaddr = cqr->cpaddr; erp->cpaddr = cqr->cpaddr;
...@@ -2430,7 +2430,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) ...@@ -2430,7 +2430,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
ccw->flags = CCW_FLAG_CC; ccw->flags = CCW_FLAG_CC;
ccw++; ccw++;
ccw->cmd_code = CCW_CMD_TIC; ccw->cmd_code = CCW_CMD_TIC;
ccw->cda = (long)(cqr->cpaddr); ccw->cda = (__u32)virt_to_phys(cqr->cpaddr);
} }
erp->flags = cqr->flags; erp->flags = cqr->flags;
......
...@@ -443,7 +443,7 @@ static int read_unit_address_configuration(struct dasd_device *device, ...@@ -443,7 +443,7 @@ static int read_unit_address_configuration(struct dasd_device *device,
ccw->cmd_code = DASD_ECKD_CCW_PSF; ccw->cmd_code = DASD_ECKD_CCW_PSF;
ccw->count = sizeof(struct dasd_psf_prssd_data); ccw->count = sizeof(struct dasd_psf_prssd_data);
ccw->flags |= CCW_FLAG_CC; ccw->flags |= CCW_FLAG_CC;
ccw->cda = (__u32)(addr_t) prssdp; ccw->cda = (__u32)virt_to_phys(prssdp);
/* Read Subsystem Data - feature codes */ /* Read Subsystem Data - feature codes */
memset(lcu->uac, 0, sizeof(*(lcu->uac))); memset(lcu->uac, 0, sizeof(*(lcu->uac)));
...@@ -451,7 +451,7 @@ static int read_unit_address_configuration(struct dasd_device *device, ...@@ -451,7 +451,7 @@ static int read_unit_address_configuration(struct dasd_device *device,
ccw++; ccw++;
ccw->cmd_code = DASD_ECKD_CCW_RSSD; ccw->cmd_code = DASD_ECKD_CCW_RSSD;
ccw->count = sizeof(*(lcu->uac)); ccw->count = sizeof(*(lcu->uac));
ccw->cda = (__u32)(addr_t) lcu->uac; ccw->cda = (__u32)virt_to_phys(lcu->uac);
cqr->buildclk = get_tod_clock(); cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED; cqr->status = DASD_CQR_FILLED;
...@@ -747,7 +747,7 @@ static int reset_summary_unit_check(struct alias_lcu *lcu, ...@@ -747,7 +747,7 @@ static int reset_summary_unit_check(struct alias_lcu *lcu,
ccw->cmd_code = DASD_ECKD_CCW_RSCK; ccw->cmd_code = DASD_ECKD_CCW_RSCK;
ccw->flags = CCW_FLAG_SLI; ccw->flags = CCW_FLAG_SLI;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32)(addr_t) cqr->data; ccw->cda = (__u32)virt_to_phys(cqr->data);
((char *)cqr->data)[0] = reason; ((char *)cqr->data)[0] = reason;
clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags); clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
......
This diff is collapsed.
...@@ -491,7 +491,7 @@ int dasd_eer_enable(struct dasd_device *device) ...@@ -491,7 +491,7 @@ int dasd_eer_enable(struct dasd_device *device)
ccw->cmd_code = DASD_ECKD_CCW_SNSS; ccw->cmd_code = DASD_ECKD_CCW_SNSS;
ccw->count = SNSS_DATA_SIZE; ccw->count = SNSS_DATA_SIZE;
ccw->flags = 0; ccw->flags = 0;
ccw->cda = (__u32)(addr_t) cqr->data; ccw->cda = (__u32)virt_to_phys(cqr->data);
cqr->buildclk = get_tod_clock(); cqr->buildclk = get_tod_clock();
cqr->status = DASD_CQR_FILLED; cqr->status = DASD_CQR_FILLED;
......
...@@ -83,7 +83,7 @@ define_extent(struct ccw1 * ccw, struct DE_fba_data *data, int rw, ...@@ -83,7 +83,7 @@ define_extent(struct ccw1 * ccw, struct DE_fba_data *data, int rw,
ccw->cmd_code = DASD_FBA_CCW_DEFINE_EXTENT; ccw->cmd_code = DASD_FBA_CCW_DEFINE_EXTENT;
ccw->flags = 0; ccw->flags = 0;
ccw->count = 16; ccw->count = 16;
ccw->cda = (__u32) __pa(data); ccw->cda = (__u32)virt_to_phys(data);
memset(data, 0, sizeof (struct DE_fba_data)); memset(data, 0, sizeof (struct DE_fba_data));
if (rw == WRITE) if (rw == WRITE)
(data->mask).perm = 0x0; (data->mask).perm = 0x0;
...@@ -103,7 +103,7 @@ locate_record(struct ccw1 * ccw, struct LO_fba_data *data, int rw, ...@@ -103,7 +103,7 @@ locate_record(struct ccw1 * ccw, struct LO_fba_data *data, int rw,
ccw->cmd_code = DASD_FBA_CCW_LOCATE; ccw->cmd_code = DASD_FBA_CCW_LOCATE;
ccw->flags = 0; ccw->flags = 0;
ccw->count = 8; ccw->count = 8;
ccw->cda = (__u32) __pa(data); ccw->cda = (__u32)virt_to_phys(data);
memset(data, 0, sizeof (struct LO_fba_data)); memset(data, 0, sizeof (struct LO_fba_data));
if (rw == WRITE) if (rw == WRITE)
data->operation.cmd = 0x5; data->operation.cmd = 0x5;
...@@ -262,7 +262,7 @@ static void ccw_write_zero(struct ccw1 *ccw, int count) ...@@ -262,7 +262,7 @@ static void ccw_write_zero(struct ccw1 *ccw, int count)
ccw->cmd_code = DASD_FBA_CCW_WRITE; ccw->cmd_code = DASD_FBA_CCW_WRITE;
ccw->flags |= CCW_FLAG_SLI; ccw->flags |= CCW_FLAG_SLI;
ccw->count = count; ccw->count = count;
ccw->cda = (__u32) (addr_t) dasd_fba_zero_page; ccw->cda = (__u32)virt_to_phys(dasd_fba_zero_page);
} }
/* /*
...@@ -528,11 +528,11 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular( ...@@ -528,11 +528,11 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular(
ccw->cmd_code = cmd; ccw->cmd_code = cmd;
ccw->count = block->bp_block; ccw->count = block->bp_block;
if (idal_is_needed(dst, blksize)) { if (idal_is_needed(dst, blksize)) {
ccw->cda = (__u32)(addr_t) idaws; ccw->cda = (__u32)virt_to_phys(idaws);
ccw->flags = CCW_FLAG_IDA; ccw->flags = CCW_FLAG_IDA;
idaws = idal_create_words(idaws, dst, blksize); idaws = idal_create_words(idaws, dst, blksize);
} else { } else {
ccw->cda = (__u32)(addr_t) dst; ccw->cda = (__u32)virt_to_phys(dst);
ccw->flags = 0; ccw->flags = 0;
} }
ccw++; ccw++;
...@@ -590,9 +590,9 @@ dasd_fba_free_cp(struct dasd_ccw_req *cqr, struct request *req) ...@@ -590,9 +590,9 @@ dasd_fba_free_cp(struct dasd_ccw_req *cqr, struct request *req)
ccw++; ccw++;
if (dst) { if (dst) {
if (ccw->flags & CCW_FLAG_IDA) if (ccw->flags & CCW_FLAG_IDA)
cda = *((char **)((addr_t) ccw->cda)); cda = *((char **)phys_to_virt(ccw->cda));
else else
cda = (char *)((addr_t) ccw->cda); cda = phys_to_virt(ccw->cda);
if (dst != cda) { if (dst != cda) {
if (rq_data_dir(req) == READ) if (rq_data_dir(req) == READ)
memcpy(dst, cda, bv.bv_len); memcpy(dst, cda, bv.bv_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment