[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 1/2] docs: fusa: Define the requirements for XEN_VERSION hypercall.


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 28 Feb 2025 13:32:02 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BNzYYsP4FeSvOWqeroEvJkXrv3GztU/Cr5n5PE0niJc=; b=suLz2KpJCvWIbkgXoXOjZt7svw7HXfkA5d6HjCqAWcFLYC2J1Kp2sP9Y5nSnif6UzRSDB53SGYzKCR0m97FiexBk9q+RVoqO3IBPsjXugENp7/uO0d8Lvfvce7SUQBgDFORVvZAbAkVJq2yOU3YlRsx7sahfuLt2ShTYGY/DROEPjClUJWeVjXmgYiRELjQ+YXqfxYA3wed8FEbaJJzc4dm0YxAmXfO279KVjKis/8e9OsCgI6gGDTAyPgA7w7jfxRwxGuLTVecdiZEsjZJE1Lfg5lrDPbL+ZZIfw/MmVmOq5eYCLufmB9P/h8GSUeF6EbjBSx0tlJ6ksCBxxMjVxw==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BNzYYsP4FeSvOWqeroEvJkXrv3GztU/Cr5n5PE0niJc=; b=OGvlNGvuBhaoU3AXiWHwcKhK411fd2hU1SSYh1Ltp3VwBTCm+S0dA/A6CuOc2BJlcJBLUlVTIgyiiziGH08lDPvd4OOb5RdIipD6Kbu7w+OlsgCDpUQmr6fMYNfY0hSeWNtB971CFCyMKxtgmzh/q2sT/ZXt7+O6se2CpKo7l9BEpqd6I0EUcUcLkKiAKUuOTRmdUM4TxHLL9tvdh2E/eJUCI9CBVOEy/3kK2sq2Lwasm8rrcE6TWXUYjEkdMPbYr35Uh3hZ25WF6mgHfHyjDYMPmkBOz2os5/NZQIRQxewAOcoS0PrCL3PS8vgYJjPO9gVgDuMsQEpuu3xs0501xg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=JhBoSeHTHn9PvFr2FrPfZvmfgGmspwMMnOT80wwOWzGY8o+CDxqOT2Og2S8dPi1uOauXJC4hrtNoR7rsuXKxVv+tpe/BIgbtooLL+y+nikexFxITvizm7yj1JfF7o0P9R1H3ES1VDBpkvT43W30C/rZ+VvbWhwjF6fdq5mQRaPQrvQtp8b+dRoYytjhbd89vK5EiZaFBQmBZw0Qm7F5I2h3cPzEhXWK6kvffOy6paYPFDAI3FPONzbVbHZkqjwIK05CYKL95c1825uCXV5liG9kmXmKJf5LCHqgM0x7USVgODoK38UIZ/T6q7CsRkC4fhv+w6TIlpvsVw2YbzvaOVQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sa43kEmixeClAXEuVLiSvg3CM1haCMLknEaba0GQCU0438yz7lDub5BcEejCx/7YcP+Tr+MbIOyKANCv3hdDayiAhhvYVKGelwgZ+BSZvgqr+YDb0gDJOARALbbZ1K9banvfdcGkOqBrVgQMysXvGmZBe0GgrwTyr7GEeFhjwNQHHC2LhjCx8lSO0GgYRNg/gHqtfSFhbdtnX3hIb0kixy45wU0V136Kpn3bMMb6DWxJGAN47TIKum8QrdrIdq3XLeWp4aaFDUtHsJxkrYPw7GvbIRS35++vMr5oEwfs153qCEMdb6Oavl29YMPFduSSr4wL4T8x3FOU7rhMFXLF7w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Artem Mygaiev <artem_mygaiev@xxxxxxxx>
  • Delivery-date: Fri, 28 Feb 2025 13:32:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHbiSmfhnajI8fAUU6893mrw5oGSLNcaxGAgAAw0QCAABwKgA==
  • Thread-topic: [PATCH v2 1/2] docs: fusa: Define the requirements for XEN_VERSION hypercall.

Hi Ayan,

> On 28 Feb 2025, at 12:51, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
> 
> 
> On 28/02/2025 08:56, Julien Grall wrote:
>> Hi,
> Hi Julien/Bertrand,
>> 
>> On 27/02/2025 15:09, Ayan Kumar Halder wrote:
>>> In the current patch, we have defined the requirements which are common for
>>> all the commands.
>>> 
>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
>>> ---
>>> Changes from -
>>> 
>>> v1 - 1. Fixed `XenProd~version_hyp_ret_val~1` requirement as Xen does not 
>>> return
>>> 0 for success in all the cases.
>>> 2. Reworded the requirements so as to write them from Xen's perspective (not
>>> domain's perspective).
>>> 
>>>   .../fusa/reqs/design-reqs/arm64/hypercall.rst | 55 +++++++++++++++++
>>>   docs/fusa/reqs/index.rst                      |  2 +
>>>   docs/fusa/reqs/market-reqs/reqs.rst           | 16 +++++
>>>   .../reqs/product-reqs/version_hypercall.rst   | 61 +++++++++++++++++++
>>>   4 files changed, 134 insertions(+)
>>>   create mode 100644 docs/fusa/reqs/design-reqs/arm64/hypercall.rst
>>>   create mode 100644 docs/fusa/reqs/product-reqs/version_hypercall.rst
>>> 
>>> diff --git a/docs/fusa/reqs/design-reqs/arm64/hypercall.rst 
>>> b/docs/fusa/reqs/design-reqs/arm64/hypercall.rst
>>> new file mode 100644
>>> index 0000000000..ffd883260c
>>> --- /dev/null
>>> +++ b/docs/fusa/reqs/design-reqs/arm64/hypercall.rst
>>> @@ -0,0 +1,55 @@
>>> +.. SPDX-License-Identifier: CC-BY-4.0
>>> +
>>> +Hypercall
>>> +=========
>>> +
>>> +Instruction
>>> +-----------
>>> +
>>> +`XenSwdgn~arm64_hyp_instr~1`
>>> +
>>> +Description:
>>> +Xen shall treat domain hypercall exception as hypercall requests.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Hypercall is one of the communication mechanism between Xen and domains.
>>> +Domains use hypercalls for various requests to Xen.
>>> +Domains use 'hvc' instruction to invoke hypercalls.
>> 
>> Are you trying to describe any hypercalls (e.g. SMCCC, Xen...) or just the 
>> Xen one? If the latter, only "hvc #0xEA1" will be used for Xen hypercalls. 
>> Other immediate/space will be used for something different (i.e. #0 is used 
>> for SMCCC).
> Yes, only the Xen one. I will mention "hvc #0xEA1".
>> 
>> > +> +Covers:
>>> + - `XenProd~version_hyp_first_param~1`
>>> + - `XenProd~version_hyp_second_param~1`
>>> +
>>> +Parameters
>>> +----------
>>> +
>>> +`XenSwdgn~arm64_hyp_param~1`
>>> +
>>> +Description:
>>> +Xen shall use x0 to read the first parameter, x1 for second parameter and 
>>> so
>>> +on, for domain hypercall requests.
>> 
>> This implies we are supporting a large number of parameters. However, Xen is 
>> only support 5 arguments. So I would just list all the registers.
> 
> Xen shall use the first five cpu core registers to obtain the arguments for 
> domain hypercall requests. Xen shall read the first register for the first 
> argument, second register for the second argument and so on.
> 
> @Bertrand :- Does this look ok to you ? I deliberately changed from x0 to 
> first register so that this can be valid for both arm64 and arm32. Please 
> comment.

Yes we should mention the 5 registers as those are the one supported by Xen and 
also the register where the hypercall number is passed as mentioned after

Cheers
Bertrand

> 
>> 
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenProd~version_hyp_first_param~1`
>>> + - `XenProd~version_hyp_second_param~1`
>>> +
>> 
>> You don't seem to describe how the hypercall number is passed. Is this 
>> intended?
> 
> Good catch. I will add a requirement.
> 
> Xen shall read x16 to obtain the hypercall number.
> 
> Xen shall read r12 to obtain the hypercall number.
> 
>> 
>>> +Return value
>>> +------------
>>> +
>>> +`XenSwdgn~arm64_ret_val~1`
>>> +
>>> +Description:
>>> +Xen shall store the return value in x0 register.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenProd~version_hyp_ret_val~1`
>>> diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
>>> index 1088a51d52..d8683edce7 100644
>>> --- a/docs/fusa/reqs/index.rst
>>> +++ b/docs/fusa/reqs/index.rst
>>> @@ -10,5 +10,7 @@ Requirements documentation
>>>      market-reqs/reqs
>>>      product-reqs/reqs
>>>      product-reqs/arm64/reqs
>>> +   product-reqs/version_hypercall
>>>      design-reqs/arm64/generic-timer
>>>      design-reqs/arm64/sbsa-uart
>>> +   design-reqs/arm64/hypercall
>>> diff --git a/docs/fusa/reqs/market-reqs/reqs.rst 
>>> b/docs/fusa/reqs/market-reqs/reqs.rst
>>> index 2d297ecc13..0e29fe5362 100644
>>> --- a/docs/fusa/reqs/market-reqs/reqs.rst
>>> +++ b/docs/fusa/reqs/market-reqs/reqs.rst
>>> @@ -79,3 +79,19 @@ Comments:
>>>     Needs:
>>>    - XenProd
>>> +
>>> +Version hypercall
>>> +-----------------
>>> +
>>> +`XenMkt~version_hypercall~1`
>>> +
>>> +Description:
>>> +Xen shall provide an interface for the domains to retrieve Xen's version, 
>>> type
>>> +and compilation information.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Needs:
>>> + - XenProd
>>> diff --git a/docs/fusa/reqs/product-reqs/version_hypercall.rst 
>>> b/docs/fusa/reqs/product-reqs/version_hypercall.rst
>>> new file mode 100644
>>> index 0000000000..03221f70c3
>>> --- /dev/null
>>> +++ b/docs/fusa/reqs/product-reqs/version_hypercall.rst
>>> @@ -0,0 +1,61 @@
>>> +.. SPDX-License-Identifier: CC-BY-4.0
>>> +
>>> +Version hypercall
>>> +=================
>>> +
>>> +First Parameter
>>> +---------------
>>> +
>>> +`XenProd~version_hyp_first_param~1`
>>> +
>>> +Description:
>>> +Xen shall treat the first argument (as an integer) to denote the command 
>>> number
>>> +for the hypercall.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenMkt~version_hypercall~1`
>>> +
>>> +Needs:
>>> + - XenSwdgn
>>> +
>>> +Second Parameter
>>> +----------------
>>> +
>>> +`XenProd~version_hyp_second_param~1`
>>> +
>>> +Description:
>>> +Xen shall treat the second argument as a virtual address to buffer in 
>>> domain's
>>> +memory.
>> 
>> We don't support any VA. The VA will need to be mapped with specifc 
>> attributes (see include/public/arch-arm.h). Should this be mentioned in the 
>> requirement?
> 
> ....as a virtual address (mapped as Normal Inner Write-Back Outer Write-Back 
> Inner-Shareable) to buffer in domain's ....
> 
> - Ayan
> 
>> 
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenMkt~version_hypercall~1`
>>> +
>>> +Needs:
>>> + - XenSwdgn
>>> +
>>> +Return Value
>>> +------------
>>> +
>>> +`XenProd~version_hyp_ret_val~1`
>>> +
>>> +Description:
>>> +In case the hypercall fails, Xen shall return one of the error codes 
>>> defined
>>> +in 
>>> http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/include/public/errno.h.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenMkt~version_hypercall~1`
>>> +
>>> +Needs:
>>> + - XenSwdgn
>>> \ No newline at end of file





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.