Skip to content

Commit 2210c54

Browse files
Alexander Gordeevdavem330
authored andcommitted
net/iucv: fix virtual vs physical address confusion
Fix virtual vs physical address confusion. This does not fix a bug since virtual and physical address spaces are currently the same. Acked-by: Alexandra Winter <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fc13636 commit 2210c54

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

net/iucv/iucv.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ static union iucv_param *iucv_param_irq[NR_CPUS];
286286
*/
287287
static inline int __iucv_call_b2f0(int command, union iucv_param *parm)
288288
{
289+
unsigned long reg1 = virt_to_phys(parm);
289290
int cc;
290291

291292
asm volatile(
@@ -296,7 +297,7 @@ static inline int __iucv_call_b2f0(int command, union iucv_param *parm)
296297
" srl %[cc],28\n"
297298
: [cc] "=&d" (cc), "+m" (*parm)
298299
: [reg0] "d" ((unsigned long)command),
299-
[reg1] "d" ((unsigned long)parm)
300+
[reg1] "d" (reg1)
300301
: "cc", "0", "1");
301302
return cc;
302303
}
@@ -1123,7 +1124,7 @@ int __iucv_message_receive(struct iucv_path *path, struct iucv_message *msg,
11231124

11241125
parm = iucv_param[smp_processor_id()];
11251126
memset(parm, 0, sizeof(union iucv_param));
1126-
parm->db.ipbfadr1 = (u32)(addr_t) buffer;
1127+
parm->db.ipbfadr1 = (u32)virt_to_phys(buffer);
11271128
parm->db.ipbfln1f = (u32) size;
11281129
parm->db.ipmsgid = msg->id;
11291130
parm->db.ippathid = path->pathid;
@@ -1241,7 +1242,7 @@ int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg,
12411242
parm->dpl.iptrgcls = msg->class;
12421243
memcpy(parm->dpl.iprmmsg, reply, min_t(size_t, size, 8));
12431244
} else {
1244-
parm->db.ipbfadr1 = (u32)(addr_t) reply;
1245+
parm->db.ipbfadr1 = (u32)virt_to_phys(reply);
12451246
parm->db.ipbfln1f = (u32) size;
12461247
parm->db.ippathid = path->pathid;
12471248
parm->db.ipflags1 = flags;
@@ -1293,7 +1294,7 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
12931294
parm->dpl.ipmsgtag = msg->tag;
12941295
memcpy(parm->dpl.iprmmsg, buffer, 8);
12951296
} else {
1296-
parm->db.ipbfadr1 = (u32)(addr_t) buffer;
1297+
parm->db.ipbfadr1 = (u32)virt_to_phys(buffer);
12971298
parm->db.ipbfln1f = (u32) size;
12981299
parm->db.ippathid = path->pathid;
12991300
parm->db.ipflags1 = flags | IUCV_IPNORPY;
@@ -1378,7 +1379,7 @@ int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
13781379
parm->dpl.iptrgcls = msg->class;
13791380
parm->dpl.ipsrccls = srccls;
13801381
parm->dpl.ipmsgtag = msg->tag;
1381-
parm->dpl.ipbfadr2 = (u32)(addr_t) answer;
1382+
parm->dpl.ipbfadr2 = (u32)virt_to_phys(answer);
13821383
parm->dpl.ipbfln2f = (u32) asize;
13831384
memcpy(parm->dpl.iprmmsg, buffer, 8);
13841385
} else {
@@ -1387,9 +1388,9 @@ int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
13871388
parm->db.iptrgcls = msg->class;
13881389
parm->db.ipsrccls = srccls;
13891390
parm->db.ipmsgtag = msg->tag;
1390-
parm->db.ipbfadr1 = (u32)(addr_t) buffer;
1391+
parm->db.ipbfadr1 = (u32)virt_to_phys(buffer);
13911392
parm->db.ipbfln1f = (u32) size;
1392-
parm->db.ipbfadr2 = (u32)(addr_t) answer;
1393+
parm->db.ipbfadr2 = (u32)virt_to_phys(answer);
13931394
parm->db.ipbfln2f = (u32) asize;
13941395
}
13951396
rc = iucv_call_b2f0(IUCV_SEND, parm);

0 commit comments

Comments
 (0)