mirror of
https://github.com/torvalds/linux.git
synced 2026-11-29 18:12:48 +00:00
The length of the facility list accessed when interpretively executing STFLE is the same as the hosts facility list (in case of format-0) The memory following the facility list doesn't need to be accessible. The current VSIE implementation accesses a fixed length that exceeds the guest/host facility list length and can therefore wrongly inject a validity intercept. Instead, find out the host facility list length by running STFLE and copy only as much as necessary when shadowing. Acked-by: David Hildenbrand <[email protected]> Reviewed-by: Claudio Imbrenda <[email protected]> Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Nina Schoetterl-Glausch <[email protected]> Reviewed-by: Janosch Frank <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Janosch Frank <[email protected]> Message-ID: <[email protected]>
22 lines
321 B
C
22 lines
321 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Copyright IBM Corp. 2023
|
|
*/
|
|
|
|
#include <asm/facility.h>
|
|
|
|
unsigned int stfle_size(void)
|
|
{
|
|
static unsigned int size;
|
|
unsigned int r;
|
|
u64 dummy;
|
|
|
|
r = READ_ONCE(size);
|
|
if (!r) {
|
|
r = __stfle_asm(&dummy, 1) + 1;
|
|
WRITE_ONCE(size, r);
|
|
}
|
|
return r;
|
|
}
|
|
EXPORT_SYMBOL(stfle_size);
|