xref: /openbmc/linux/arch/s390/boot/uv.c (revision b664e06d)
1 // SPDX-License-Identifier: GPL-2.0
2 #include <asm/uv.h>
3 #include <asm/facility.h>
4 #include <asm/sections.h>
5 
6 int __bootdata_preserved(prot_virt_guest);
7 
8 void uv_query_info(void)
9 {
10 	struct uv_cb_qui uvcb = {
11 		.header.cmd = UVC_CMD_QUI,
12 		.header.len = sizeof(uvcb)
13 	};
14 
15 	if (!test_facility(158))
16 		return;
17 
18 	if (uv_call(0, (uint64_t)&uvcb))
19 		return;
20 
21 	if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
22 	    test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list))
23 		prot_virt_guest = 1;
24 }
25