Skip to contentSkip to conversation

s390/vfio-ap: GISA: sort out physical vs virtual pointers usage

PATCH In review Nico Boehr 2 participants 2 messages Nov 18, 2022

Subsystems (4)
lore
Share & tools
lore

Nico Boehr

author
#0 lore raw

PATCH v2 1/1 s390/vfio-ap: GISA: sort out physical vs virtual pointers usage

Fix virtual vs physical address confusion (which currently are the same) for the GISA when enabling the IRQ.

---
v1->v2:
* remove useless cast

 drivers/s390/crypto/vfio_ap_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/vfio_ap_ops.c +1 -1
index 0b4cc8c597ae..205a00105858 100644
@@ -429,7 +429,7 @@ static struct ap_queue_status vfio_ap_irq_enable(struct vfio_ap_queue *q,
 
 	aqic_gisa.isc = nisc;
 	aqic_gisa.ir = 1;
-	aqic_gisa.gisa = (uint64_t)gisa >> 4;
+	aqic_gisa.gisa = virt_to_phys(gisa) >> 4;
 
 	status = ap_aqic(q->apqn, aqic_gisa, h_nib);
 	switch (status.response_code) {
Signature · 1 line
2.37.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · On Fri, 18 Nov 2022 11:04:29 +0100 Nico Boehr <[email protected]> wrote:

Fix virtual vs physical address confusion (which currently are the same) for the GISA when enabling the IRQ.

Quoted 20 lines

---
v1->v2:
* remove useless cast

 drivers/s390/crypto/vfio_ap_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/crypto/vfio_ap_ops.c +1 -1
index 0b4cc8c597ae..205a00105858 100644
@@ -429,7 +429,7 @@ static struct ap_queue_status vfio_ap_irq_enable(struct vfio_ap_queue *q,
 
 	aqic_gisa.isc = nisc;
 	aqic_gisa.ir = 1;
-	aqic_gisa.gisa = (uint64_t)gisa >> 4;
+	aqic_gisa.gisa = virt_to_phys(gisa) >> 4;
 
 	status = ap_aqic(q->apqn, aqic_gisa, h_nib);
 	switch (status.response_code) {