Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jun 2022 16:47:13 +0000
From:      Souradeep Chakrabarti <schakrabarti@microsoft.com>
To:        Andrew Turner <andrew@freebsd.org>, "freebsd-arm@FreeBSD.org" <freebsd-arm@FreeBSD.org>
Cc:        Wei Hu <weh@microsoft.com>
Subject:   Re: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call
Message-ID:  <PSAP153MB0536AE42F3023CC7BC7AAB9DCCBB9@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>
In-Reply-To: <PSAP153MB0536F8F1E6DBEFA6DB7A2346CCB89@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>
References:  <PSAP153MB05364B5DEC6F1379B71C3758CCB99@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM> <F752FD4D-66DA-4513-B493-3F2281FC3FA9@FreeBSD.org> <PSAP153MB0536F8F1E6DBEFA6DB7A2346CCB89@PSAP153MB0536.APCP153.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi Andrew,

It will be really helpful if arm smccc hvc 1.2 version is implemented in Fr=
eeBSD. It is required for Hyper-V HvCallGetVpRegisters hypercall. Please le=
t me know if there is any plan to implement smccc 1.2 version anytime soon =
or not.

Thanks & Regards,
 Souradeep

________________________________________
From: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sent: Tuesday, June 28, 2022 11:36 AM
To: Andrew Turner
Cc: freebsd-arm@FreeBSD.org; Wei Hu
Subject: Re: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call


Hi Andrew,

Thanks for your response. While looking into the code, it looked to me we h=
ave smccc version till 1.1 implemented.
But for hyper-v hypercall implementation we need to read registers beyond X=
0 to X3, which is implemented in 1.2 version.

Is there any plan on version 1.2 implementation ?

Thanks & Regards,
 Souradeep



From: Andrew Turner <andrew@FreeBSD.org>
Sent: Monday, June 27, 2022 9:59 PM
To: Souradeep Chakrabarti <schakrabarti@microsoft.com>
Cc: freebsd-arm@FreeBSD.org <freebsd-arm@FreeBSD.org>; Wei Hu <weh@microsof=
t.com>
Subject: [EXTERNAL] Re: SMCCC v1.1 compliant HVC call



On 27 Jun 2022, at 09:57, Souradeep Chakrabarti <schakrabarti@microsoft.com=
> wrote:

Hi Andrew,

In Linux we have SMCCC v1.1 compliant HVC call arm_smccc_1_1_hvc(), which i=
s used for SMCCC and HVC call convention.
In FreeBSD do we have something similar?

I can arm_smccc_smc() in sys/dev/psci/smccc.h, but could not find the imple=
mentation details of it. If I need to use SMCCC compliant
HVC call, what API should I use?

Thanks & Regards,
Souradeep

You can use arm_smccc_hvc to hard code the type. Both the hvc and smc versi=
ons are implemented in sys/dev/psci/smccc_arm64.S. They depend on the arm64=
 ABI to put the arguments into the correct registers to be passed into the =
hypervisor.

If your code is running after the psci device has attached you can use psci=
_callfn. It is a function pointer to either of the arm_smccc_* functions de=
pending on what is in ACPI/FDT.

Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?PSAP153MB0536AE42F3023CC7BC7AAB9DCCBB9>