RFC altp2m: Move altp2m routines to common code and add ARM support
Get series with b4
b4 am [email protected]Versions newest first
- v6 RFC Latest33 of 43 patches 0 repliesNew
33 of 43 patches are in this archive. The cover letter announces 43.
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/43 | altp2m: Add template common altp2m.c/altp2m.hxen/ xen/ xen/ | +18 | 0 replies | |
| 2/43 | altp2m: Move altp2m_active to common domain structxen/ xen/ xen/ +14 more | +40 | 0 replies | |
| 3/43 | altp2m: Move altp2m_p2m to common domain structxen/ xen/ xen/ +7 more | +33 | 0 replies | |
| 4/43 | x86/altp2m: Rename hvm_altp2m_supported to altp2m_supportedxen/ xen/ xen/ +3 more | +12 | 0 replies | |
| 5/43 | altp2m: Move altp2m_supported to arch headerxen/ xen/ xen/ +1 more | +19 | 0 replies | |
| 6/43 | arm/altp2m: Add template arch-specific altp2m.c/altp2m.hxen/ xen/ xen/ +1 more | +54 | 0 replies | |
| 7/43 | arm/altp2m: Introduce CONFIG_ALTP2M Kconfig optionxen/ xen/ xen/ | +36 | 0 replies | |
| 8/43 | altp2m: Rename p2m_*_altp2m functions and move declarations out of p2m.hxen/ xen/ xen/ +10 more | +186 | 0 replies | |
| 9/43 | altp2m: Move do_altp2m_op to common codexen/ xen/ xen/ | +424 | 0 replies | |
| 10/43 | altp2m: Add ARM support to do_altp2m_opxen/ xen/ | +23 | 0 replies | |
| 11/43 | arm/altp2m: Add support for HVMOP_altp2m_get_domain_statexen/ | +1 | 0 replies | |
| 12/43 | x86/p2m: Move p2m_{init,free}_one declarations to arch headerxen/ xen/ | +3 | 0 replies | |
| 13/43 | x86/altp2m: Add lock functions accessible from common codexen/ xen/ | +31 | 0 replies | |
| 14/43 | altp2m: Move altp2m_{init,teardown} to common codexen/ xen/ xen/ +2 more | +63 | 0 replies | |
| 15/43 | arm/p2m: Allocate hostp2m with xzallocxen/ xen/ xen/ +6 more | +32 | 0 replies | |
| 16/43 | arm/p2m: Cosmetic fix - substitute _gfn(ULONG_MAX) for INVALID_GFNxen/ | +1 | 0 replies | |
| 17/43 | arm/p2m: Move hostp2m init/teardown to individual functionsxen/ xen/ | +65 | 0 replies | |
| 18/43 | arm/p2m: Invalidate root page table entries and flush TLB in p2m_flush_tablexen/ | +13 | 0 replies | |
| 19/43 | arm/p2m: Change function prototype of p2m_alloc_tablexen/ | +2 | 0 replies | |
| 20/43 | arm/p2m: Rename parameter in p2m_alloc_vmidxen/ | +6 | 0 replies | |
| 21/43 | arm/p2m: Change func prototype and impl of p2m_{alloc,free}_vmidxen/ xen/ xen/ | +14 | 0 replies | |
| 22/43 | arm/p2m: Introduce p2m_is_{hostp2m,altp2m}xen/ | +18 | 0 replies | |
| 23/43 | arm/altp2m: Add support for altp2m init/teardown routinesxen/ xen/ xen/ +3 more | +60 | 0 replies | |
| 24/43 | altp2m: Move altp2m_{get,set}_altp2m to common codexen/ xen/ xen/ +1 more | +43 | 0 replies | |
| 25/43 | arm/altp2m: Add altp2m index to arch_vcpuxen/ xen/ | +6 | 0 replies | |
| 26/43 | altp2m: Add altp2m_set_vcpu_idxxen/ xen/ | +10 | 0 replies | |
| 27/43 | arm/altp2m: Add support for altp2m_{get,set}_altp2mxen/ | +4 | 0 replies | |
| 28/43 | altp2m: Move altp2m_vcpu_{initialise,destroy} to common codexen/ xen/ xen/ +1 more | +47 | 0 replies | |
| 29/43 | arm/altp2m: Add support for altp2m_vcpu_{initialise,destroy}xen/ xen/ | +10 | 0 replies | |
| 30/43 | arm/altp2m: Add altp2m view validity/visibility indicatorxen/ xen/ xen/ +1 more | +43 | 0 replies | |
| 31/43 | altp2m: Add altp2m_view_is_{valid,visible}xen/ xen/ xen/ | +23 | 0 replies | |
| 32/43 | x86/altp2m: Add altp2m_set_view_visibility_lockedxen/ xen/ | +15 | 0 replies | |
| 33/43 | arm/altp2m: Add altp2m_set_view_visibility{,_locked} supportxen/ xen/ | +38 | 0 replies |
Reviews trailers per patch
1 of 33 patches has a Reviewed-by or Acked-by.
| Patch | Julien Grall |
|---|---|
| 1/43 | |
| 2/43 | |
| 3/43 | |
| 4/43 | |
| 5/43 | |
| 6/43 | |
| 7/43 | |
| 8/43 | |
| 9/43 | |
| 10/43 | |
| 11/43 | |
| 12/43 | |
| 13/43 | |
| 14/43 | |
| 15/43 | |
| 16/43 | |
| 17/43 | |
| 18/43 | |
| 19/43 | A-b |
| 20/43 | |
| 21/43 | |
| 22/43 | |
| 23/43 | |
| 24/43 | |
| 25/43 | |
| 26/43 | |
| 27/43 | |
| 28/43 | |
| 29/43 | |
| 30/43 | |
| 31/43 | |
| 32/43 | |
| 33/43 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC PATCH v6 00/43] altp2m: Move altp2m routines to common code and add ARM support
From: Rose Spangler <[email protected]>
Hi all,
For the past few months, myself and Aqib Javid have been working to port altp2m to ARM with support from Stewart Hildebrand and Stefano Stabellini. At the recent Spring Xen Summit, Aqib and Stewart gave a presentation which discussed the motivation behind this, along with an overview of the rebasing and testing process. While this effort started as a rebase[1] of the v5 patch series[2] by Sergej Proskurin and Tamas Lengyel, I have been reworking the branch to make most of the altp2m code common between x86 and ARM. This should address the major concerns that came up during review of the original patch series. For a quick overview of altp2m functionality and scope of the patch series, here's an excerpt from Sergej's cover letter:
Quoted 10 lines
In this patch series, we provide an implementation of the altp2m subsystem for ARM. Our implementation is based on the altp2m subsystem for x86, providing additional --alternate-- views on the guest's physical memory by means of the ARM 2nd stage translation mechanism. The patches introduce new HVMOPs and extend the p2m subsystem. [...] To be more precise, altp2m allows to create and switch to additional p2m views (i.e. gfn to mfn mappings). These views can be manipulated and activated as will through the provided HVMOPs. In this way, the active guest instance in question can seamlessly proceed execution without noticing that anything has changed.
As of right now, I've reworked patch series up through the HVMOP_altp2m_set_domain_state command and plan to continue implementing the remaining altp2m features. I've continued the patch series versioning by labeling my notes as v6, and the patch notes from v1-v5 have been preserved where applicable. I am hoping for some feedback on the general approach I've taken with this patch series, and I can incorporate any changes requested into the actual patch series submission.
This is a pretty big patch series, so I've tried to make it as easy as possible to follow. I've tried to minimize the number of changes in each patch; there are quite a lot of patches so if it would be preferred to combine some patches I can do so. Here is the general approach I used throughout the patch series to turn x86 altp2m code into common altp2m code with ARM support:
- Move function(s) from arch/x86/mm/altp2m.c to common/altp2m.c, gating declarations/definitions with #ifdef CONFIG_X86
- Add any additional features to ARM code needed to implement these functions
- Make any changes necessary to functions to support ARM, and remove #ifdef CONFIG_X86
This approach makes it possible to separate out code movement patches from the actual changes needed to support ARM. Furthermore, each patch in the patch series still compiles for both x86 and ARM.
Additionally, I've split the patch series into a number of "phases" to make it easier to understand the context of each patch. Each patch description indicates which phase it's a part of.
- Preparation (8 commits)
- Common do_altp2m_op (2 commits)
- get_domain_state (1 commit)
- altp2m_{init,teardown} routines (12 commits)
- altp2m_{get,set}_altp2m (4 commits)
- Needed for altp2m_vcpu_{initialise,destroy}
- altp2m_vcpu_{initialise,destroy} (2 commits)
- Needed for HVMOP_set_domain_state
- altp2m view visibility (5 commits)
- Needed for altp2m_init_by_id, altp2m_flush
- altp2m_activate_altp2m (2 commits)
- Needed for altp2m_init_by_id
- altp2m_init_by_id (2 commits)
- Needed for HVMOP_altp2m_set_domain_state
- altp2m_reset_altp2m (2 commits)
- Needed for altp2m_flush
- altp2m_flush (2 commits)
- Needed for HVMOP_altp2m_set_domain_state
- set_domain_state (1 commit)
The code for this patch series can also be found on GitLab:
https://gitlab.com/xen-project/people/elektrobit/xen/-/tree/altp2m-arm-rework-rfc
Best,
Rose Spangler
[1] Rebase of original patch series:
https://gitlab.com/xen-project/people/elektrobit/xen/-/commits/altp2m-arm-rebase
[2] Original patch series:
v1: https://lore.kernel.org/xen-devel/[email protected]/
v2: https://lore.kernel.org/xen-devel/[email protected]/
v3: https://lore.kernel.org/xen-devel/[email protected]/
v4: https://lore.kernel.org/xen-devel/[email protected]/
v5 was never submitted to mailing list, but is available on GitHub:
https://github.com/sergej-proskurin/xen/tree/arm-altp2m-v5
Rose Spangler (38):
altp2m: Add template common altp2m.c/altp2m.h
altp2m: Move altp2m_active to common domain struct
altp2m: Move altp2m_p2m to common domain struct x86/altp2m: Rename hvm_altp2m_supported to altp2m_supported
altp2m: Move altp2m_supported to arch header arm/altp2m: Add template arch-specific altp2m.c/altp2m.h arm/altp2m: Introduce CONFIG_ALTP2M Kconfig option
altp2m: Rename p2m_*_altp2m functions and move declarations out of
p2m.h
altp2m: Move do_altp2m_op to common code
altp2m: Add ARM support to do_altp2m_op
arm/altp2m: Add support for HVMOP_altp2m_get_domain_state x86/p2m: Move p2m_{init,free}_one declarations to arch header x86/altp2m: Add lock functions accessible from common code
altp2m: Move altp2m_{init,teardown} to common code arm/p2m: Allocate hostp2m with xzalloc
arm/p2m: Move hostp2m init/teardown to individual functions arm/p2m: Invalidate root page table entries and flush TLB in
p2m_flush_table
arm/altp2m: Add support for altp2m init/teardown routines
altp2m: Move altp2m_{get,set}_altp2m to common code arm/altp2m: Add altp2m index to arch_vcpu
altp2m: Add altp2m_set_vcpu_idx
arm/altp2m: Add support for altp2m_{get,set}_altp2m
altp2m: Move altp2m_vcpu_{initialise,destroy} to common code arm/altp2m: Add support for altp2m_vcpu_{initialise,destroy} arm/altp2m: Add altp2m view validity/visibility indicator
altp2m: Add altp2m_view_is_{valid,visible}
x86/altp2m: Add altp2m_set_view_visibility_locked arm/altp2m: Add altp2m_set_view_visibility{,_locked} support arm/altp2m: Add support for HVMOP_altp2m_set_visibility x86/altp2m: Add altp2m_activate_altp2m declaration to arch header arm/altp2m: Add support for altp2m_activate_altp2m
altp2m: Move altp2m_init_by_id to common code arm/altp2m: Add support for altp2m_init_by_id x86/altp2m: Add altp2m_reset_altp2m declaration to arch header arm/altp2m: Add altp2m_reset_altp2m routine
altp2m: Move altp2m_flush to common code
arm/altp2m: Add support for altp2m_flush
arm/p2m: Add support for HVMOP_altp2m_set_domain_state
Sergej Proskurin (5):
arm/p2m: Cosmetic fix - substitute _gfn(ULONG_MAX) for INVALID_GFN arm/p2m: Change function prototype of p2m_alloc_table arm/p2m: Rename parameter in p2m_alloc_vmid
arm/p2m: Change func prototype and impl of p2m_{alloc,free}_vmid arm/p2m: Introduce p2m_is_{hostp2m,altp2m}
xen/arch/arm/Kconfig | 11 + xen/arch/arm/Makefile | 1 + xen/arch/arm/altp2m.c | 122 +++++ xen/arch/arm/domain.c | 2 +- xen/arch/arm/hvm.c | 9 + xen/arch/arm/include/asm/Makefile | 1 - xen/arch/arm/include/asm/altp2m.h | 84 ++++ xen/arch/arm/include/asm/domain.h | 19 +- xen/arch/arm/include/asm/p2m.h | 41 +- xen/arch/arm/mm.c | 2 +- xen/arch/arm/mmu/p2m.c | 162 ++++++- xen/arch/arm/p2m.c | 31 +- xen/arch/arm/traps.c | 2 +- xen/arch/x86/domain.c | 3 +- xen/arch/x86/hvm/emulate.c | 1 + xen/arch/x86/hvm/hvm.c | 413 +---------------- xen/arch/x86/hvm/monitor.c | 3 +- xen/arch/x86/hvm/vmx/vmx.c | 9 +- xen/arch/x86/include/asm/altp2m.h | 115 ++++- xen/arch/x86/include/asm/domain.h | 5 - xen/arch/x86/include/asm/hvm/hvm.h | 11 - xen/arch/x86/include/asm/p2m.h | 112 +---- xen/arch/x86/mm/altp2m.c | 242 +++------- xen/arch/x86/mm/hap/hap.c | 17 +- xen/arch/x86/mm/mem_access.c | 22 +- xen/arch/x86/mm/mem_sharing.c | 3 +- xen/arch/x86/mm/p2m-basic.c | 7 +- xen/arch/x86/mm/p2m-ept.c | 13 +- xen/arch/x86/mm/p2m-pt.c | 1 + xen/arch/x86/mm/p2m.c | 9 +- xen/arch/x86/mm/p2m.h | 6 - xen/common/Makefile | 1 + xen/common/altp2m.c | 551 +++++++++++++++++++++++ xen/common/monitor.c | 1 + xen/common/vm_event.c | 2 +- xen/drivers/passthrough/arm/ipmmu-vmsa.c | 2 +- xen/drivers/passthrough/arm/smmu-v3.c | 2 +- xen/drivers/passthrough/arm/smmu.c | 2 +- xen/include/asm-generic/altp2m.h | 5 +- xen/include/xen/altp2m.h | 98 ++++ xen/include/xen/p2m-common.h | 2 +- xen/include/xen/sched.h | 3 + 42 files changed, 1330 insertions(+), 818 deletions(-) create mode 100644 xen/arch/arm/altp2m.c create mode 100644 xen/arch/arm/include/asm/altp2m.h create mode 100644 xen/common/altp2m.c create mode 100644 xen/include/xen/altp2m.h
Signature · 1 line
2.34.1