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

Re: [PATCH] docs: fusa: Add requirements for generic timer


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 21 Aug 2024 15:06:46 +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=+uWScQgZ/FGTixKPh5t+4Rh/Q7ataUUkp3iF9Bmccmo=; b=LkWnhr4xqNbxMAgzJ5cmRR+41GvM92L4db35gzKQbiyQoKxOicbukTtwksEBgitWRaMHmKqDuGRbBJiyjRfsv1V3xOh2LRjSBCY4bus0M3U91cGLTrkmFBo4addizd9mIffKujOSCoZmIPv3Prq0BPKksTw8CjVa+3bDetn6RAkKISnZkzmWwwTXlGPFw5qJspxkflCaE8NYN6G3cY0DSghJiwi3xlF/xoPrPbqi+iu2HNAF0/xQkAROqPyP6IR0bGmTNG2fucRuqYuFnc4aQ4JojgP2Q9PfZnBnc2pRzzUw1V7UJyUvR3P3ftCw37YlLVZU7QdjWVNy24RmwsS7Cg==
  • 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=+uWScQgZ/FGTixKPh5t+4Rh/Q7ataUUkp3iF9Bmccmo=; b=rPd8+gkKlXMId2hm9g61FtPzDDsA1Cmg53uSxH0Xn4d/SFx8qwlAnYXqL8nD6ZlF3v8rdRov2sWea9nAEivwMOrErEABOYdPu7odpRrws6fIfWaV6eT/3qyNbE98v0/BUeDtFrdHdPTKfD0252ZSnp5C3YzqpanLShCcmrHZc0+RE1vifI2du/1MIzpkBKR7vF5qaV1dtMJeoBXiS3nAjkPNg8aDoBDyEEp285cfDse74h/EcOEv4T0vhs4O0LMydqteVhgNFRDNmoRE6efaGIqTbxbxXdSRbnIFn5/uiB1XP4rd+FmWcjHPVjErFgUF8ZzXeHXQdNgtDnJmAVqUGg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=nBs55hzK6XoLqHCgsw+EARkOkF+8pzNhBZgfCX42QpRZuKFkeu0NQmGFOW671VPn7K4NBU+7OGrDHlSH6Er5ws6FvxSjS5ZTjNJ0rnXrJhp/qLYEatx0vjKuaffJUZPe678qC8ztMEt1vNqWVQBQR4pVxeY4APau3VDIv//F426QjUEzU9GhUmzrQuN251xOdy0Dpc7CGWpd7UlMikT5PPb9E5DK+TO3vvfoKcB4D8LJdREjSv9aSiy/DYeq0ZA0a0sFe/ebqJ+N4w9vw6x2w85JmjWrKoxlzwh4aH5ZmZ70/6RjXrmotjIUazvi0y1MHbzvIih53Yt3CzkJ4moV9g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mHZyjH+m/bbzx/oy4gjCZfI7EzX1bI8Hz5MypX6j3Ln519tTVtFUDu11mRQxj4Sgbb1Qlxsjbh8l5akKQW91LLm7C7FIZ+DVNvDQwRF1j12j82xOZDb+gadRpZJCC77pmDP4ylvImOvTUAyUGZcT79hWFh8Cy9bVXUZkhYcnS1snspzAW03+ntV/95SY+Zgs3LmXKlxsuv8h0Pqvr2fBnt4JA+ohtJ7Jx2f068Xin3sInaTMv4YqGvrjH6jgFSRRTmpz0mVItJMjBwTTEEnhI7z9pD5mpsP86vUsf8hmNMvowrH9+eLibvUVJWHl7ejN5VDGAXSrAD7uXawQY+JoSQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Artem Mygaiev <artem_mygaiev@xxxxxxxx>
  • Delivery-date: Wed, 21 Aug 2024 15:08:06 +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: AQHa8u0jnfgC5boSJE+t9AfK5MrS+7Ix0ZQA
  • Thread-topic: [PATCH] docs: fusa: Add requirements for generic timer

Hi Ayan,

> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx> wrote:
> 
> From: Michal Orzel <michal.orzel@xxxxxxx>
> 
> Add the requirements for the use of generic timer by a domain
> 
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
> ---
> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
> docs/fusa/reqs/index.rst                      |   3 +
> docs/fusa/reqs/intro.rst                      |   3 +-
> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
> 5 files changed, 202 insertions(+), 1 deletion(-)
> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
> 
> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst 
> b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> new file mode 100644
> index 0000000000..bdd4fbf696
> --- /dev/null
> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> @@ -0,0 +1,139 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Generic Timer
> +=============
> +
> +The following are the requirements related to ARM Generic Timer [1] interface
> +exposed by Xen to Arm64 domains.
> +
> +Probe the Generic Timer device tree node from a domain
> +------------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
> +
> +Description:
> +Xen shall generate a device tree node for the Generic Timer (in accordance to
> +ARM architected timer device tree binding [2]).

You might want to say where here. The domain device tree ?

> +
> +Rationale:
> +
> +Comments:
> +Domains shall probe the Generic Timer device tree node.

Please prevent the use of "shall" here. I would use "can".
Also detect the presence of might be better than probe.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Read system counter frequency
> +-----------------------------
> +
> +`XenSwdgn~arm64_generic_timer_read_freq~1`
> +
> +Description:
> +Xen shall expose the frequency of the system counter to the domains.

The requirement would need to say in CNTFRQ_EL0 and in the domain device tree 
xxx entry.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" device 
> tree
> +property.

I do not think this comment is needed.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access CNTKCTL_EL1 system register from a domain
> +------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
> +
> +Description:
> +Xen shall expose counter-timer kernel control register to the domains.

"counter-timer kernel" is a bit odd here, is it the name from arm arm ?
Generic Timer control registers ? or directly the register name.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall access the counter-timer kernel control register to allow
> +controlling the access to the timer from userspace (EL0).

This is documented in the arm arm, this comment is not needed.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access virtual timer from a domain
> +----------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
> +
> +Description:
> +Xen shall expose the virtual timer registers to the domains.
> +
> +Rationale:
> +
> +Comments:
> +Domains shall access and make use of the virtual timer by accessing the
> +following system registers:
> +CNTVCT_EL0,
> +CNTV_CTL_EL0,
> +CNTV_CVAL_EL0,
> +CNTV_TVAL_EL0.

The requirement to be complete should give this list, not the comment.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access physical timer from a domain
> +-----------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
> +
> +Description:
> +Xen shall expose physical timer registers to the domains.
> +
> +Rationale:
> +
> +Comments:
> +Domains shall access and make use of the physical timer by accessing the
> +following system registers:
> +CNTPCT_EL0,
> +CNTP_CTL_EL0,
> +CNTP_CVAL_EL0,
> +CNTP_TVAL_EL0.

same as upper

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Trigger the virtual timer interrupt from a domain
> +-------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
> +
> +Description:
> +Xen shall enable the domains to program the virtual timer to generate the
> +interrupt.

I am not sure this is right here.
You gave access to the registers upper so Xen responsibility is not really to
enable anything but rather make sure that it generates an interrupt according to
how the registers have been programmed.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall program the virtual timer to generate the interrupt when the
> +asserted condition is met.

What a timer is used for should not really be documented here

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Trigger the physical timer interrupt from a domain
> +--------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_trigger_physical_interrupt~1`
> +
> +Description:
> +Xen shall enable the domains to program the physical timer to generate the
> +interrupt

same as upper

> +
> +Rationale:
> +
> +Comments:
> +Domains shall program the physical timer to generate the interrupt when the
> +asserted condition is met.

same as upper

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +[1] Arm Architecture Reference Manual for A-profile architecture, Chapter 11
> +[2] 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
> diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
> index 78c02b1d9b..183f183b1f 100644
> --- a/docs/fusa/reqs/index.rst
> +++ b/docs/fusa/reqs/index.rst
> @@ -7,3 +7,6 @@ Requirements documentation
>    :maxdepth: 2
> 
>    intro
> +   market-reqs
> +   product-reqs
> +   design-reqs/arm64
> diff --git a/docs/fusa/reqs/intro.rst b/docs/fusa/reqs/intro.rst
> index d67b18dd9f..245a219ff2 100644
> --- a/docs/fusa/reqs/intro.rst
> +++ b/docs/fusa/reqs/intro.rst
> @@ -55,7 +55,8 @@ Title of the requirement
>   be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or design
>   requirement.
>   name - This denotes name of the requirement. In case of architecture 
> specific
> -  requirements, this starts with the architecture type (ie x86_64, arm64).
> +  requirements, this starts with the architecture type (eg x86_64, arm64)
> +  followed by component name (eg generic_timer) and action (eg read_xxx).
>   revision number - This gets incremented each time the requirement is 
> modified.
> 
> 
> diff --git a/docs/fusa/reqs/market-reqs/reqs.rst 
> b/docs/fusa/reqs/market-reqs/reqs.rst
> new file mode 100644
> index 0000000000..9c98c84a9a
> --- /dev/null
> +++ b/docs/fusa/reqs/market-reqs/reqs.rst
> @@ -0,0 +1,34 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Functional Requirements
> +=======================
> +
> +Run Arm64 VMs
> +-------------
> +
> +`XenMkt~run_arm64_vms~1`
> +
> +Description:
> +Xen shall run Arm64 VMs.
> +
> +Rationale:
> +
> +Comments:
> +
> +Needs:
> + - XenProd
> +
> +Provide timer to the VMs
> +------------------------
> +
> +`XenMkt~provide_timer_vms~1`
> +
> +Description:
> +Xen shall provide a timer to a VM.
> +
> +Rationale:
> +
> +Comments:
> +
> +Needs:
> + - XenProd
> diff --git a/docs/fusa/reqs/product-reqs/arm64/reqs.rst 
> b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
> new file mode 100644
> index 0000000000..9b579cc606
> --- /dev/null
> +++ b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
> @@ -0,0 +1,24 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Domain Creation And Runtime
> +===========================
> +
> +Emulated Timer
> +--------------
> +
> +`XenProd~emulated_timer~1`
> +
> +Description:
> +Xen shall emulate Arm Generic Timer timer on behalf of domains.

Xen is not emulating but giving access or providing one.
How it is done is down to the implementation.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall use it for scheduling and other needs.

This comment should be removed.

> +
> +Covers:
> + - `XenMkt~run_arm64_vms~1`
> + - `XenMkt~provide_timer_vms~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®.