Skip to content

Commit 22fdd8b

Browse files
Nina Schoetterl-GlauschAlexander Gordeev
authored andcommitted
KVM: s390: vsie: Use virt_to_phys for facility control block
In order for SIE to interpretively execute STFLE, it requires the real or absolute address of a facility-list control block. Before writing the location into the shadow SIE control block, convert it from a virtual address. We currently do not run into this bug because the lower 31 bits are the same for virtual and physical addresses. Signed-off-by: Nina Schoetterl-Glausch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Janosch Frank <[email protected]> Message-Id: <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 8692a24 commit 22fdd8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/s390/kvm/vsie.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/list.h>
1313
#include <linux/bitmap.h>
1414
#include <linux/sched/signal.h>
15+
#include <linux/io.h>
1516

1617
#include <asm/gmap.h>
1718
#include <asm/mmu_context.h>
@@ -1005,7 +1006,7 @@ static int handle_stfle(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
10051006
if (read_guest_real(vcpu, fac, &vsie_page->fac,
10061007
stfle_size() * sizeof(u64)))
10071008
return set_validity_icpt(scb_s, 0x1090U);
1008-
scb_s->fac = (__u32)(__u64) &vsie_page->fac;
1009+
scb_s->fac = (u32)virt_to_phys(&vsie_page->fac);
10091010
}
10101011
return 0;
10111012
}

0 commit comments

Comments
 (0)