hv_output_page_exists() controls whether the per-CPU Hyper-V output
argument page is allocated at boot. This page is required for hypercalls
that return results via an output GPA, like HvCallGetVpRegisters.

The VSM drivers read VSM-specific VP registers (e.g. HvRegisterVsmVpStatus,
HvRegisterVsmCapabilities) via get_vp_registers(), which issues
HvCallGetVpRegisters and therefore depends on the output argument page
being present. Without it, those hypercalls fail and VSM initialization
cannot proceed.

Extend hv_output_page_exists() to return true when CONFIG_HYPERV_VSM is
enabled.

Signed-off-by: Thara Gopinath <[email protected]>
---
 drivers/hv/hv_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
index 31256cb22b39e..44f4a10984618 100644
--- a/drivers/hv/hv_common.c
+++ b/drivers/hv/hv_common.c
@@ -259,7 +259,8 @@ static void hv_kmsg_dump_register(void)
 
 static inline bool hv_output_page_exists(void)
 {
-       return hv_parent_partition() || IS_ENABLED(CONFIG_HYPERV_VTL_MODE);
+       return hv_parent_partition() || IS_ENABLED(CONFIG_HYPERV_VTL_MODE) ||
+               IS_ENABLED(CONFIG_HYPERV_VSM);
 }
 
 void __init hv_get_partition_id(void)
-- 
2.34.1


Reply via email to