Re: [PATCH v1 1/1] KVM: s390: pci: fix virtual-physical confusion on module unload/load

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/22/23 10:55 AM, Nico Boehr wrote:
> 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@xxxxxxxxxxxxx>

Yeah, that's right, in fact there is another address also stashed in the zpci_aipb which is also saved as physical addresses since, as you say, this structure is sent to firmware; the GAIT address just happens to be the one we care about at this spot, so I think it makes sense to leave zpci_aipb alone and just convert back to virt in this one place its needed.

Since we're looking at this bit of code, it's also worth noting that the other address restored here (aift->sbv) comes from zpci_aif_sbv which was instead stashed as a virtual address to begin with and that's why it doesn't need similar treatment.

Thanks Nico!

Reviewed-by: Matthew Rosato <mjrosato@xxxxxxxxxxxxx>






[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux