blob: 3f501159ee9fc2ac1200219337859a03bb02c99f [file] [log] [blame]
Vasily Gorbik5abb9352019-04-01 19:11:03 +02001// SPDX-License-Identifier: GPL-2.0
2#include <asm/uv.h>
3#include <asm/facility.h>
4#include <asm/sections.h>
5
6int __bootdata_preserved(prot_virt_guest);
7
8void 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
Christian Borntraeger27dc0702020-02-10 11:27:37 -050018 /* rc==0x100 means that there is additional data we do not process */
19 if (uv_call(0, (uint64_t)&uvcb) && uvcb.header.rc != 0x100)
Vasily Gorbik5abb9352019-04-01 19:11:03 +020020 return;
21
22 if (test_bit_inv(BIT_UVC_CMD_SET_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list) &&
23 test_bit_inv(BIT_UVC_CMD_REMOVE_SHARED_ACCESS, (unsigned long *)uvcb.inst_calls_list))
24 prot_virt_guest = 1;
25}