Skip to content

Commit 70ba8fa

Browse files
rosatomjfrankjaa
authored andcommitted
KVM: s390: pci: fix GAIT physical vs virtual pointers usage
The GAIT and all of its entries must be represented by physical addresses as this structure is shared with underlying firmware. We can keep a virtual address of the GAIT origin in order to handle processing in the kernel, but when traversing the entries we must again convert the physical AISB stored in that GAIT entry into a virtual address in order to process it. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Pierre Morel <[email protected]> Acked-by: Nico Boehr <[email protected]> Signed-off-by: Matthew Rosato <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Link: https://lore.kernel.org/r/[email protected] Message-Id: <[email protected]> Signed-off-by: Janosch Frank <[email protected]>
1 parent b3cefd6 commit 70ba8fa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/s390/kvm/interrupt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3324,7 +3324,7 @@ static void aen_host_forward(unsigned long si)
33243324
if (gaite->count == 0)
33253325
return;
33263326
if (gaite->aisb != 0)
3327-
set_bit_inv(gaite->aisbo, (unsigned long *)gaite->aisb);
3327+
set_bit_inv(gaite->aisbo, phys_to_virt(gaite->aisb));
33283328

33293329
kvm = kvm_s390_pci_si_to_kvm(aift, si);
33303330
if (!kvm)

arch/s390/kvm/pci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int zpci_setup_aipb(u8 nisc)
7171
rc = -ENOMEM;
7272
goto free_sbv;
7373
}
74-
aift->gait = (struct zpci_gaite *)page_to_phys(page);
74+
aift->gait = (struct zpci_gaite *)page_to_virt(page);
7575

7676
zpci_aipb->aipb.faisb = virt_to_phys(aift->sbv->vector);
7777
zpci_aipb->aipb.gait = virt_to_phys(aift->gait);

0 commit comments

Comments
 (0)