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

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


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Thu, 17 Jul 2025 14:57:35 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=epam.com 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=CELqq8N+YWNiI+jez+yFjyy7C59nj0OmfAU2Ll37/7s=; b=KgG/fSAcgtev9WgspqmDKti6y0ieu60RpNp6oSgVAQQPnqRQw02uVTBqtT4qskZnayIJbdp3dvdQGPXrmCXS5qotpLZNuHuyFSi57PBMrUg8OusDtuSF8O2czrB1my2CMytRsZ9wSt9w9ZuT6d8IZ+9KjaOAZvgWQ5T4ubnBZUnOAxxXuUzsUq+wH1Eu0h9iJpU/aAJkxfiQm1cRbNXrSMpj0495CKDC+OBYOTxr2sSk35d6oOFG7Sq8Sr23TSXSQpozvyezwive/ezFj8SfA5VolFK8TAP9iZnt1Qnvc51bY/vjL0zFPOG2PdM5tunAhf6Ubzp8L1eNRoYUhakHZQ==
  • 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=CELqq8N+YWNiI+jez+yFjyy7C59nj0OmfAU2Ll37/7s=; b=LP+mJ+7gUfxlxoX9TtjSitWqq9WkRpMtkq1Aa4Pj20N/VUskJJiet1KVi6TwjyZfey6Nz6pDOhbc48aZ4xal+A0whIlxY8DiMLWmw2ISdz0dnk0sjXxQHHV9m9BzRHgZdC+CHaCgDX31G42vizoQ9kR1nMzCPqAvWNBBazEfLN6tIpuMhlyZLKFlxY7E36o63dIvHNjxAPjlG+emVbULL5MNnNg/cPD2LDRRv1nc6WtU2Ig+yZsujVEhl9AtizDOtFUrIw2+1jXB8m041adGbbHtJVmi9O3zajuNC8o+5a+ShsVnKBtvyoo9VPn/abOd0mZF2u+C83AaPB6MWHbvFQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=wtrTV03/TtrfZD3DjVXCdsOKSkDbB+9bNE5G4yJByT9csTBHY4684Dymace4ESE67T6z3sz5KOc3t7Auf/QRf2FkbXVFEyl+tLmC85+W8lIsdK6pjbG4YRa3bf69GUbleZDFfMGrMk7pSW2NiwGv6VFR25gX82AkEFbDgEHflFTs4WvwUyy4Kmm3Q2YyMkL/F+dCiNYwqRhkTCfxHfqZraLZ4JfD64go/btUR+CX2iK1lqtDQ3zcPal+TE1xc8jKeEZHXK4/3CptLP7eovXhnrqjSTdm3UyS7+ePUBz9yi8nsD6ehEPKVy2nvBY4hjVyu73MHRQXOtDd7R/XZJ2h7Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UMoj1kfaNXU2i+VX6MQyhZjhShgzknAjM84FCs+mokLcyiueGdSH5KfTQ+M33KquCXYD9Jhg7tbNaVR5cccsIvosJZJg8vFspCXtjuSz5fExTzF6opJQ54EyFYNcmSBC2o7xvACRmHSHE0NkFnViz87aukhOXbLeT6+4rSstovBfKbq7WU5at4u6pPE05IcLBq4lK5zXMouakCFzVQewmBhVDaCMwxgwMjMZdAKRU36hAKcY+Qsk0TmFkuoG4zos8lDKTjvfzfOJzMVv91eqlI13MICZNWhgBgC0MVbn93Ub3cerSsVRl4YsG5AlRBXx7idsMGRYhO96+Oen73QgIQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: 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: Thu, 17 Jul 2025 14:59:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHbwNT/SvCvWvdWh0CT9yLy3QlhobPdDqQAgBRQjQCARXVaAA==
  • Thread-topic: [PATCH v3 1/2] docs: fusa: Define the requirements for XEN_VERSION hypercall.

Hi Ayan,

> On 3 Jun 2025, at 12:15, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
> 
> 
> On 21/05/2025 13:02, Bertrand Marquis wrote:
>> Hi Ayan,
> 
> Hi Bertrand,
> 
>> 
>>> On 9 May 2025, at 13:24, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx> 
>>> wrote:
>>> 
>>> Define the requirements which are common for all the commands for 
>>> XEN_VERSION
>>> hypercall.
>>> 
>>> 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).
>>> 
>>> v2 - 1. Specified the register details.
>>> 2. Specified the type of buffer.
>>> 
>>> .../fusa/reqs/design-reqs/arm64/hypercall.rst | 58 +++++++++++++++++++
>>> docs/fusa/reqs/index.rst                      |  2 +
>>> docs/fusa/reqs/market-reqs/reqs.rst           | 16 +++++
>>> .../reqs/product-reqs/version_hypercall.rst   | 43 ++++++++++++++
>>> 4 files changed, 119 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..f00b0b00f9
>>> --- /dev/null
>>> +++ b/docs/fusa/reqs/design-reqs/arm64/hypercall.rst
>>> @@ -0,0 +1,58 @@
>>> +.. SPDX-License-Identifier: CC-BY-4.0
>>> +
>>> +Hypercall
>>> +=========
>>> +
>>> +Instruction
>>> +-----------
>>> +
>>> +`XenSwdgn~arm64_hyp_instr~1`
>>> +
>>> +Description:
>>> +Xen shall treat domain hypercall exception as hypercall requests.
>> This really reads weirdly.
>> Maybe: Xen shall treat domain hvc instruction execution as hypercall 
>> requests.
>> 
>> Then you can add a comment to explain that this is detected through a 
>> specific exception.
>> 
>> Also this is not completely true as hvc is also used in other scenarios:
>> - PSCI calls
>> - Firmware calls
>> 
>> So i would put the 0xEA1 value as part of the requirement.
> 
> Description:
> 
> Xen shall treat domain hvc instruction execution (with 0xEA1) as hypercall 
> requests.
> 
> Comments:
> The exception syndrome register should have the following values :-
> ESR_EL2.ISS should be 0xEA1.
> ESR_EL2.EC should be 0x16.

yes a lot better :-)

> 
>> 
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Hypercall is one of the communication mechanism between Xen and domains.
>>> +Domains use hypercalls for various requests to Xen.
>>> +Domains use 'hvc #0xEA1' instruction to invoke hypercalls.
>>> +
>>> +Covers:
>>> + - `XenProd~version_hyp_first_param~1`
>>> + - `XenProd~version_hyp_second_param~1`
>>> +
>>> +Parameters
>>> +----------
>>> +
>>> +`XenSwdgn~arm64_hyp_param~1`
>>> +
>>> +Description:
>>> +Xen shall use the first five cpu core registers to obtain the arguments for
>>> +domain hypercall requests.
>> Why not say x0 to x4 registers instead ? You use x16 after anyway
> Ack
>> 
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Xen shall read the first register for the first argument, second register 
>>> for
>>> +the second argument and so on.
>>> +
>>> +Covers:
>>> + - `XenProd~version_hyp_first_param~1`
>>> + - `XenProd~version_hyp_second_param~1`
>>> +
>>> +Hypercall number
>>> +----------------
>>> +
>>> +`XenSwdgn~arm64_hyp_num~1`
>>> +
>>> +Description:
>>> +Xen shall read x16 to obtain the hypercall number.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenProd~version_hyp_first_param~1`
>>> + - `XenProd~version_hyp_second_param~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.
>> I would say hypercall instead of interface here
> Ack
>> 
>>> +
>>> +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..400d51bbeb
>>> --- /dev/null
>>> +++ b/docs/fusa/reqs/product-reqs/version_hypercall.rst
>>> @@ -0,0 +1,43 @@
>>> +.. 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.
>> I would be more precise and say x0 value.
> Ack
>> 
>> Also "integer" is unspecified, use a more specific type definition (32/64 
>> bit signed/unsigned integer).
> 
> It is a signed integer. The size is not mentioned.
> 
> ret = do_xen_version((int)(a1), (XEN_GUEST_HANDLE_PARAM(void)){ _p(a2) });

This is compiler dependent and architecture dependent so sounds weird.
I would expect this to be int32_t.
Maybe something to check here.

> 
>> 
>>> +
>>> +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 (mapped as Normal
>>> +Inner Write-Back Outer Write-Back Inner-Shareable) to buffer in domain's
>>> +memory.
>> You should say "guest virtual address" to be more precise.
> 
> Ack
> 
> s/guest/domain
> 

yes

Cheers
Bertrand

> - Ayan
> 
>> 
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +
>>> +Covers:
>>> + - `XenMkt~version_hypercall~1`
>>> +
>>> +Needs:
>>> + - XenSwdgn
>>> -- 
>>> 2.25.1
>>> 
>> Cheers
>> Bertrand





 


Rackspace

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