From 9d8731a1757bef8630cb47e5ae3a1abbcf863e90 Mon Sep 17 00:00:00 2001 From: Nuno Das Neves Date: Fri, 21 Feb 2025 11:56:33 -0800 Subject: hyperv: Convert hypercall statuses to linux error codes Return linux-friendly error codes from hypercall helper functions, which allows them to be used more flexibly. Introduce hv_result_to_errno() for this purpose, which also handles the special value U64_MAX returned from hv_do_hypercall(). Signed-off-by: Nuno Das Neves Reviewed-by: Easwar Hariharan Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/1740167795-13296-2-git-send-email-nunodasneves@linux.microsoft.com Signed-off-by: Wei Liu Message-ID: <1740167795-13296-2-git-send-email-nunodasneves@linux.microsoft.com> --- include/asm-generic/mshyperv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/asm-generic') diff --git a/include/asm-generic/mshyperv.h b/include/asm-generic/mshyperv.h index 7adc10a4fa3e..3f115e2bcdaa 100644 --- a/include/asm-generic/mshyperv.h +++ b/include/asm-generic/mshyperv.h @@ -297,6 +297,7 @@ static inline int cpumask_to_vpset_skip(struct hv_vpset *vpset, return __cpumask_to_vpset(vpset, cpus, func); } +int hv_result_to_errno(u64 status); void hyperv_report_panic(struct pt_regs *regs, long err, bool in_die); bool hv_is_hyperv_initialized(void); bool hv_is_hibernation_supported(void); -- cgit v1.2.3