Skip to content

Commit 8a46df7

Browse files
Nico Boehrfrankjaa
authored andcommitted
KVM: s390: pci: fix virtual-physical confusion on module unload/load
When the kvm module is unloaded, zpci_setup_aipb() perists some data in the zpci_aipb structure in s390 pci code. Note that this struct is also passed to firmware in the zpci_set_irq_ctrl() call and thus the GAIT must be a physical address. On module re-insertion, the GAIT is restored from this structure in zpci_reset_aipb(). But it is a physical address, hence this may cause issues when the kvm module is unloaded and loaded again. Fix virtual vs physical address confusion (which currently are the same) by adding the necessary physical-to-virtual-conversion in zpci_reset_aipb(). Signed-off-by: Nico Boehr <nrb@linux.ibm.com> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com> Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Link: https://lore.kernel.org/r/20230222155503.43399-1-nrb@linux.ibm.com Message-Id: <20230222155503.43399-1-nrb@linux.ibm.com>
1 parent 7be3e33 commit 8a46df7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/s390/kvm/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int zpci_reset_aipb(u8 nisc)
112112
return -EINVAL;
113113

114114
aift->sbv = zpci_aif_sbv;
115-
aift->gait = (struct zpci_gaite *)zpci_aipb->aipb.gait;
115+
aift->gait = phys_to_virt(zpci_aipb->aipb.gait);
116116

117117
return 0;
118118
}

0 commit comments

Comments
 (0)