docs: fusa: Add requirements for mapping domain address to machine address
PATCH 1/1 docs: fusa: Add requirements for mapping domain address to machine address
The following are the requirements written mapping :- domain virtual address to machine address intermediate physical address to machine address
--- .../design-reqs/arm64/domain_buffer_copy.rst | 172 ++++++++++++++++++ docs/fusa/reqs/market-reqs/reqs.rst | 30 +++ docs/fusa/reqs/product-reqs/arm64/reqs.rst | 40 +++- 3 files changed, 240 insertions(+), 2 deletions(-) create mode 100644 docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +172 -0
@@ -0,0 +1,172 @@ +.. SPDX-License-Identifier: CC-BY-4.0 + +Translate domain address to machine address +------------------------------------------- + +`XenSwdgn~arm64_translate_domain_addr_to_machine_addr~1` + +Description: +Xen shall translate a domain address to machine address using Address +Translation Stage 1+2 Non-Secure Kernel Read/Write registers. + +Rationale: + +Comments: + +Covers: + - `XenProd~translate_domain_va_to_ma~1` + +Get machine address +------------------- + +`XenSwdgn~arm64_get_machine_addr~1` + +Description: +Xen shall be able to get the machine address for a domain by reading +the physical address register. + +Rationale: + +Comments: +It should return the fault information if the translation has failed. + +Covers: + - `XenProd~translate_domain_va_to_ma~1` + - `XenProd~access_check_fetch_page~1` + +Translate domain address to intermediate physical address +--------------------------------------------------------- + +`XenSwdgn~arm64_translate_domain_addr_to_ipa~1` + +Description: +Xen shall translate a domain address to intermediate physical address using +Address Translation Stage 1 Non-Secure Kernel Read/Write registers. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Set domain address as intermediate physical address +--------------------------------------------------- + +`XenSwdgn~arm64_set_ipa_eq_gva~1` + +Description: +Xen shall set domain virtual address as intermediate physical address when EL1 +MMU is disabled. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 4KB domain address to IPA +---------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr0~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 4KB page granularity using TTBR0 +for intermediate physical address size = 48 bits. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 16KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbbr0~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 16KB page granularity using TTBR0 for +intermediate physical address size = 48 bits. + + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 64KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr0~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 64KB page granularity using TTBR0 for +intermediate physical address size = 48 bits. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 4KB domain address to IPA +---------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr1~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 4KB page granularity using TTBR1 for +intermediate physical address size = 48 bits. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 16KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbbr1~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 16KB page granularity using TTBR1 for +intermediate physical address size = 48 bits. + + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 64KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr1~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 64KB page granularity using TTBR1 for +intermediate physical address size = 48 bits. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` +
docs/fusa/reqs/market-reqs/reqs.rst +30 -0
@@ -60,5 +60,35 @@ Rationale: Comments: +Needs: + - XenProd + +Copy buffer to domain +--------------------- + +`XenMkt~copy_buffer_to_domain~1` + +Description: +Xen shall support copying a buffer to a domain. + +Rationale: + +Comments: + +Needs: + - XenProd + +Copy buffer from domain +----------------------- + +`XenMkt~copy_buffer_from_domain~1` + +Description: +Xen shall support copying a buffer from a domain. + +Rationale: + +Comments: + Needs: - XenProd
docs/fusa/reqs/product-reqs/arm64/reqs.rst +38 -2
@@ -53,10 +53,46 @@ Rationale: Comments: +Covers: + - `XenMkt~static_vm_definition~1` + +Needs: + - XenSwdgn + +Translate domain virtual address to machine address +--------------------------------------------------- + +`XenProd~translate_domain_va_to_ma~1` + +Description: +Xen shall support translating domain's virtual address to machine address. + Rationale: +Comments: + Covers: - - `XenMkt~static_vm_definition~1` + - `XenMkt~copy_buffer_from_domain~1` + - `XenMkt~copy_buffer_to_domain~1` Needs: - - XenSwdgn + - XenSwdgn + +Access check and fetch page from domain +--------------------------------------- + +`XenProd~access_check_fetch_page~1` + +Description: +Xen shall support access check and fetching page from a domain. + +Rationale: + +Comments: + +Covers: + - `XenMkt~copy_buffer_from_domain~1` + - `XenMkt~copy_buffer_to_domain~1` + +Needs: + - XenSwdgn
Signature · 1 line
2.25.1
Hi Ayan,
First a general comment: you use some terms such as machine address or domain address which are a bit undefined to me. This needs some definition first for those to be clear. Maybe use Virtual, IPA and PA instead all the time.
Quoted 20 lines · Ayan Kumar Halder
The following are the requirements written mapping :- domain virtual address to machine address intermediate physical address to machine address
Signed-off-by Ayan Kumar Halder <[email protected]>---
.../design-reqs/arm64/domain_buffer_copy.rst | 172 ++++++++++++++++++ docs/fusa/reqs/market-reqs/reqs.rst | 30 +++ docs/fusa/reqs/product-reqs/arm64/reqs.rst | 40 +++- 3 files changed, 240 insertions(+), 2 deletions(-)create mode 100644
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rstdocs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +0
-0
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 10
Quoted 10 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +10
-0@@ -0,0 +1,172 @@ +.. SPDX-License-Identifier: CC-BY-4.0 + +Translate domain address to machine address +------------------------------------------- + +`XenSwdgn~arm64_translate_domain_addr_to_machine_addr~1` + +Description: +Xen shall translate a domain address to machine address using Address +Translation Stage 1+2 Non-Secure Kernel Read/Write registers.
domain address here is a bit unprecise. Do you mean VA or IPA ?
Also is this only in the MPU case ?
Quoted 6 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +6
-0+ +Rationale: + +Comments: + +Covers:
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 26
Quoted 10 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +10
-0+ - `XenProd~translate_domain_va_to_ma~1` + +Get machine address +------------------- + +`XenSwdgn~arm64_get_machine_addr~1` + +Description: +Xen shall be able to get the machine address for a domain by reading +the physical address register.
This needs rephrasing to remove the "be able to":
Xen shall use the physical address register to retrieve the machine address.
Also what you mean by "machine address" needs to be defined here.
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 31
Quoted 5 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +5
-0+ +Rationale: + +Comments: +It should return the fault information if the translation has failed.
I do not understand this one. Maybe this requirement needs more context to be understood.
Quoted 19 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +19
-0+ +Covers: + - `XenProd~translate_domain_va_to_ma~1` + - `XenProd~access_check_fetch_page~1` + +Translate domain address to intermediate physical address +--------------------------------------------------------- + +`XenSwdgn~arm64_translate_domain_addr_to_ipa~1` + +Description: +Xen shall translate a domain address to intermediate physical address using +Address Translation Stage 1 Non-Secure Kernel Read/Write registers. + +Rationale: + +Comments: + +Covers:
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 60
Quoted 10 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +10
-0+ - `XenProd~access_check_fetch_page~1` + +Set domain address as intermediate physical address +--------------------------------------------------- + +`XenSwdgn~arm64_set_ipa_eq_gva~1` + +Description: +Xen shall set domain virtual address as intermediate physical address when EL1 +MMU is disabled.
Here you start using virtual address. I also do not get what is to be set here. Do you mean that Xen shall consider VA=IPA when EL1 MMU is disabled ?
Quoted 7 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +7
-0+ +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1`
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 77
Quoted 10 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +10
-0+ +Walk the domain's stage 1 page tables to translate 4KB domain address to IPA +---------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr0~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 4KB page granularity using TTBR0 +for intermediate physical address size = 48 bits.
Is this always the case ? aren't there cases where we should not do that ?
Do we really want in the certified case to accept to have to walk stage 1 page tables instead of using the hardware way ?
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 89
Quoted 12 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +12
-0+ +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 16KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbbr0~1`
Req is name 4KB for 16KB
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 94
Quoted 5 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +5
-0+ +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 16KB page granularity using TTBR0 for +intermediate physical address size = 48 bits.
I am not quite sure that it is a good solution to duplicate for each page table size here. Do you want to support all possibilities ?
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 107
Quoted 13 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +13
-0+ + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 64KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr0~1`
Same here
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 112
Quoted 5 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +5
-0+ +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 64KB page granularity using TTBR0 for +intermediate physical address size = 48 bits.
Ditto
Quoted 8 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +8
-0+ +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` +
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst line 130
Quoted 10 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +10
-0+Walk the domain's stage 1 page tables to translate 4KB domain address to IPA +---------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr1~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 4KB page granularity using TTBR1 for +intermediate physical address size = 48 bits. +
You duplicate the requirement for TTBR1 but do not say when TTBR0 or TTBR1 shall be used.
Quoted 50 lines
docs/fusa/reqs/design-reqs/arm64/domain_buffer_copy.rst new file +42
-0+Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 16KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbbr1~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 16KB page granularity using TTBR1 for +intermediate physical address size = 48 bits. + + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` + +Walk the domain's stage 1 page tables to translate 64KB domain address to IPA +----------------------------------------------------------------------------- + +`XenSwdgn~arm64_walk_stage1_page_table_4KB_gva_ipa_ttbr1~1` + +Description: +Xen shall walk the stage 1 page tables to translate domain address to +intermediate physical address for 64KB page granularity using TTBR1 for +intermediate physical address size = 48 bits. + +Rationale: + +Comments: + +Covers: + - `XenProd~access_check_fetch_page~1` +docs/fusa/reqs/market-reqs/reqs.rst +0
-0@@ -60,5 +60,35 @@ Rationale:Comments:
docs/fusa/reqs/market-reqs/reqs.rst Rationale: · line 72
Quoted 10 lines
docs/fusa/reqs/market-reqs/reqs.rst +10
-0+Needs: + - XenProd + +Copy buffer to domain +--------------------- + +`XenMkt~copy_buffer_to_domain~1` + +Description: +Xen shall support copying a buffer to a domain.
What kind of buffer ?
This requirement is very generic and not that precise.
At the end this is just saying that Xen shall be able to copy memory.
Quoted 34 lines
docs/fusa/reqs/market-reqs/reqs.rst +20
-0+ +Rationale: + +Comments: + +Needs: + - XenProd + +Copy buffer from domain +----------------------- + +`XenMkt~copy_buffer_from_domain~1` + +Description: +Xen shall support copying a buffer from a domain. + +Rationale: + +Comments: +Needs:
- XenProd
\ No newline at end of filedocs/fusa/reqs/product-reqs/arm64/reqs.rst +0
-0@@ -53,10 +53,46 @@ Rationale:Comments:
docs/fusa/reqs/product-reqs/arm64/reqs.rst +3
-0+Covers: + - `XenMkt~static_vm_definition~1` +
docs/fusa/reqs/product-reqs/arm64/reqs.rst Rationale: · line 68
Quoted 10 lines
docs/fusa/reqs/product-reqs/arm64/reqs.rst +10
-0+Needs: + - XenSwdgn + +Translate domain virtual address to machine address +--------------------------------------------------- + +`XenProd~translate_domain_va_to_ma~1` + +Description: +Xen shall support translating domain's virtual address to machine address.
I find the "support" here a bit strange.
Maybe it would be simpler to define that Xen shall have a function named xxx to do this ?
I am not quite convince this is not only a design req.
Quoted 14 lines
+
Rationale:docs/fusa/reqs/product-reqs/arm64/reqs.rst +2
-0+Comments: +Covers:
- -XenMkt~static_vm_definition~1
+ -XenMkt~copy_buffer_from_domain~1
+ -XenMkt~copy_buffer_to_domain~1Needs:
- - XenSwdgn
\ No newline at end of file
+ - XenSwdgn
docs/fusa/reqs/product-reqs/arm64/reqs.rst Rationale: · line 87
Quoted 8 lines
docs/fusa/reqs/product-reqs/arm64/reqs.rst +8
-0+ +Access check and fetch page from domain +--------------------------------------- + +`XenProd~access_check_fetch_page~1` + +Description: +Xen shall support access check and fetching page from a domain.
This should be split in 2 reqs.
Quoted 14 lines
docs/fusa/reqs/product-reqs/arm64/reqs.rst +11
-0+ +Rationale: + +Comments: + +Covers: + - `XenMkt~copy_buffer_from_domain~1` + - `XenMkt~copy_buffer_to_domain~1` + +Needs: + - XenSwdgnSignature · 1 line
2.25.1