[Xen-devel] [PATCH v4 07/39] arm/p2m: Move hostp2m init/teardown to individual functions

2017-08-30 Thread Sergej Proskurin
alization/teardown of altp2m views. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Added the function p2m_flush_table to the previous version. v3: Removed struct vttbr. Moved define INVALID_VTTBR to p2m.h. Exported function prototypes of "p2m_flus

[Xen-devel] [PATCH v4 27/39] arm/p2m: Add altp2m_propagate_change

2017-08-30 Thread Sergej Proskurin
lled/invalid entries. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v3: Cosmetic fixes. Changed the locking mechanism to "p2m_write_lock" inside the function "altp2m_reset". Removed TLB flushing and resetting of the max_mapped_gfn

[Xen-devel] [PATCH v4 08/39] arm/p2m: Cosmetic fix - function prototype of p2m_alloc_table

2017-08-30 Thread Sergej Proskurin
The function "p2m_alloc_table" should be able to allocate 2nd stage translation tables not only for the host's p2m but also for alternate p2m's. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Removed altp2m table

[Xen-devel] [PATCH v4 39/39] arm/xen-access: Add test of xc_altp2m_change_gfn

2017-08-30 Thread Sergej Proskurin
violations will trap into Xen and be forced by xen-access to switch to the default view (altp2m[0]) as before. The introduced test can be invoked by providing the argument "altp2m_remap". Signed-off-by: Sergej Proskurin --- Cc: Razvan Cojocaru Cc: Tamas K Lengyel Cc: Ian Jackson

[Xen-devel] [PATCH v4 32/39] arm/altp2m: Make altp2m_vcpu_idx ready for altp2m

2017-08-30 Thread Sergej Proskurin
Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/include/asm-arm/altp2m.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/include/asm-arm/altp2m.h b/xen/include/asm-arm/altp2m.h index f9e14ab1dc..eff6bd5a38 100644 --- a/xen/include

[Xen-devel] [PATCH v4 11/39] altp2m: Move (MAX|INVALID)_ALTP2M to xen/p2m-common.h

2017-08-30 Thread Sergej Proskurin
We move the macros (MAX|INVALID)_ALTP2M out of x86-related code to common code, as the following patches will make use of them on ARM. Signed-off-by: Sergej Proskurin --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc

[Xen-devel] [PATCH v4 04/39] arm/p2m: Add HVMOP_altp2m_get_domain_state

2017-08-30 Thread Sergej Proskurin
This commit adopts the x86 HVMOP_altp2m_get_domain_state implementation. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v3: Removed the "altp2m_enabled" check in HVMOP_altp2m_get_domain_state case as it has been moved in front of the switch st

[Xen-devel] [PATCH v4 22/39] arm/p2m: Make p2m_mem_access_check ready for altp2m

2017-08-30 Thread Sergej Proskurin
currently active altp2m view might not have the required gva mapping yet. Also, the new implementation fills the request buffer to hold altp2m-related information. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v3: Extended the function "p2m_mem_access_ch

Re: [Xen-devel] [PATCH v4 29/39] x86/altp2m: Move altp2m_check to altp2m.c

2017-08-30 Thread Sergej Proskurin
Hi Razvan, On 08/30/2017 08:42 PM, Razvan Cojocaru wrote: > On 08/30/2017 09:32 PM, Sergej Proskurin wrote: >> diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c >> index 42e6f09029..66f1d83d84 100644 >> --- a/xen/common/vm_event.c >> +++ b/xen/common/v

Re: [Xen-devel] [PATCH v4 39/39] arm/xen-access: Add test of xc_altp2m_change_gfn

2017-08-30 Thread Sergej Proskurin
Hi Razvan, [...] >> + >> +*gfn_new = ++(xenaccess->max_gpfn); > Unnecessary parentheses. > Thanks. >> +rc = xc_domain_populate_physmap_exact(xenaccess->xc_handle, domain_id, >> 1, 0, 0, gfn_new); >> +if ( rc < 0 ) >> +goto err; >> + >> +/* Copy content of the old gfn i

Re: [Xen-devel] [PATCH v4 11/39] altp2m: Move (MAX|INVALID)_ALTP2M to xen/p2m-common.h

2017-08-31 Thread Sergej Proskurin
Hi Jan, On 08/31/2017 10:04 AM, Jan Beulich wrote: On 30.08.17 at 20:32, wrote: >> We move the macros (MAX|INVALID)_ALTP2M out of x86-related code to >> common code, as the following patches will make use of them on ARM. > But both seem not impossible to be require arch-specific values. Ri

Re: [Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-08-31 Thread Sergej Proskurin
Hi Volodymyr, hi Julien, On 08/24/2017 07:25 PM, Julien Grall wrote: > > > On 21/08/17 21:27, Volodymyr Babchuk wrote: >> This feature indicates that hypervisor is compatible with ARM >> SMC calling convention. Hypervisor will not inject an undefined >> instruction exception if an invalid SMC fun

Re: [Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-08-31 Thread Sergej Proskurin
Hi Volodymyr, On 08/31/2017 02:44 PM, Volodymyr Babchuk wrote: > Hello Sergej, > > On 31.08.17 15:20, Sergej Proskurin wrote: >> Hi Volodymyr, hi Julien, >> >> >> On 08/24/2017 07:25 PM, Julien Grall wrote: >>> >>> >>> On 21/08/17 21:2

Re: [Xen-devel] [PATCH v4 11/39] altp2m: Move (MAX|INVALID)_ALTP2M to xen/p2m-common.h

2017-08-31 Thread Sergej Proskurin
Hi Jan, On 08/31/2017 12:19 PM, Jan Beulich wrote: On 31.08.17 at 11:49, wrote: >> On 08/31/2017 10:04 AM, Jan Beulich wrote: >> On 30.08.17 at 20:32, wrote: We move the macros (MAX|INVALID)_ALTP2M out of x86-related code to common code, as the following patches will make use

Re: [Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-08-31 Thread Sergej Proskurin
Hi Volodymyr, On 08/31/2017 04:58 PM, Volodymyr Babchuk wrote: > Hi Sergej > > On 31.08.17 16:51, Sergej Proskurin wrote: >> Hi Volodymyr, >> >> >> On 08/31/2017 02:44 PM, Volodymyr Babchuk wrote: >>> Hello Sergej, >>> >>> On 31.08.17

Re: [Xen-devel] [PATCH v4 10/11] public: add XENFEAT_ARM_SMCCC_supported feature

2017-09-04 Thread Sergej Proskurin
Hi Julien, On 09/04/2017 08:07 AM, Julien Grall wrote: > Hello, > > Sorry for the formatting, writing from my phone. Ki > > On Thu, 31 Aug 2017, 22:18 Sergej Proskurin wrote: > [...] > > On your first mail, you started with "smc injection doesn't work",

[Xen-devel] [RFC PATCH 1/4] arm/monitor: Introduce monitoring of single-step events

2017-09-05 Thread Sergej Proskurin
In this commit, we extend the capabilities of the monitor to allow tracing of single-step events on ARM. Signed-off-by: Sergej Proskurin --- Cc: Razvan Cojocaru Cc: Tamas K Lengyel Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/monitor.c| 23 +++ xen

[Xen-devel] [RFC PATCH 2/4] arm/domctl: Add XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_{ON|OFF}

2017-09-05 Thread Sergej Proskurin
This commit adds the domctl that is required to enable single-stepping on ARM. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/domctl.c| 35 +++ xen/include/asm-arm/domain.h | 2 ++ 2 files changed, 37

[Xen-devel] [RFC PATCH 3/4] arm/traps: Allow trapping on single-step events

2017-09-05 Thread Sergej Proskurin
This commit concludes the single-stepping functionality on ARM by adding trapping on and setting up single-stepping events of the architecture. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/arm64/entry.S | 2 ++ xen/arch/arm/traps.c

[Xen-devel] [RFC PATCH 4/4] vm_event: Move vm_event_toggle_singlestep to

2017-09-05 Thread Sergej Proskurin
In this commit we move the declaration of the function vm_event_toggle_singlestep from to and implement the associated functionality on ARM. Signed-off-by: Sergej Proskurin --- Cc: Razvan Cojocaru Cc: Tamas K Lengyel Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew

[Xen-devel] [RFC PATCH 0/4] Introduce Single-Stepping to ARMv8

2017-09-05 Thread Sergej Proskurin
r use case. It would be of great help if we would discuss the upper issue and hopefully even find a solution to the presented issue. Thank you very much in advance. Cheers, ~Sergej [0] https://lists.xen.org/archives/html/xen-devel/2017-08/msg00661.html Sergej Proskurin (4): arm/monitor: Introduc

Re: [Xen-devel] [PATCH v4 00/39] arm/altp2m: Introducing altp2m to ARM

2017-10-07 Thread Sergej Proskurin
let me know if I should wait for reviews until the end of the extended code freeze deadline. Thanks, ~Sergej On 08/30/2017 08:32 PM, Sergej Proskurin wrote: > Hi all, > > The following patch series can be found on Github[0] and is part of my > contribution to last year's Goog

Re: [Xen-devel] [PATCH v4 00/39] arm/altp2m: Introducing altp2m to ARM

2017-10-07 Thread Sergej Proskurin
Hi Julien, On 10/07/2017 12:29 PM, Julien Grall wrote: > > > On 07/10/2017 11:18, Sergej Proskurin wrote: >> Hi all, > > Hello Sergej, > >> >> just wanted to friendly remind you about the next altp2m on ARM patch >> series, since it has been submitte

Re: [Xen-devel] [PATCH FOR-4.10] xen/arm: guest_walk: Fix check again the IPS

2017-10-10 Thread Sergej Proskurin
oduced software page-table walk for stage-1. > > Coverity-ID: 1457707 > Signed-off-by: Julien Grall > > --- > > Cc: Sergej Proskurin Acked-by: Sergej Proskurin Thanks, ~Sergej > --- > xen/arch/arm/guest_walk.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(

Re: [Xen-devel] [PATCHv2 for-4.10] xen/arm: guest_walk: Fix check again the IPS

2017-10-11 Thread Sergej Proskurin
iew comments to the initial implementation. You did not want to see any #define CONFIG_ARM_64 within the code. TCR_EL1 is a 64-bit Register: to prevent compilation issues for Aarch32 systems, why don't you use uint64_t for ips instead of register_t? Thanks, ~Sergej > > Coverity-ID: 14577

Re: [Xen-devel] [PATCHv2 for-4.10] xen/arm: guest_walk: Fix check again the IPS

2017-10-11 Thread Sergej Proskurin
Hi Julien, On 10/11/2017 04:57 PM, Julien Grall wrote: > > > On 11/10/17 15:51, Sergej Proskurin wrote: >> Hi Julien, > > Hi, > >> On 10/11/2017 04:29 PM, Julien Grall wrote: >>> The function get_ipa_output_size is check whether the input size >&g

Re: [Xen-devel] [PATCH v6 10/14] arm/guest_access: Rename vgic_access_guest_memory

2017-07-18 Thread Sergej Proskurin
Hi Julien, On 07/17/2017 05:43 PM, Julien Grall wrote: > Hi Sergej, > > On 06/07/17 12:50, Sergej Proskurin wrote: >> This commit renames the function vgic_access_guest_memory to >> access_guest_memory_by_ipa. As the function name suggests, the functions >> expects a

Re: [Xen-devel] [PATCH v6 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h

2017-07-18 Thread Sergej Proskurin
Hi Julien, On 07/17/2017 05:38 PM, Julien Grall wrote: > Hi Sergej, > > On 06/07/17 12:50, Sergej Proskurin wrote: >> This commit moves the function vgic_access_guest_memory to guestcopy.c >> and the header asm/guest_access.h. No functional changes are made. >> Please

[Xen-devel] [PATCH v2] arm/p2m: Cleanup access to the host's p2m

2017-07-18 Thread Sergej Proskurin
will be submitted in the future. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Razvan Cojocaru Cc: Tamas K Lengyel Cc: Stefano Stabellini Cc: Julien Grall --- v1: This commit has been already acknowledged in the altp2m patch series, however not yet applied to mainline.

Re: [Xen-devel] [PATCH v6 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h

2017-07-18 Thread Sergej Proskurin
Hi Julien, On 07/18/2017 12:43 PM, Julien Grall wrote: > > > On 18/07/17 10:49, Sergej Proskurin wrote: >> Hi Julien, > > Hello Sergej, > >> >> On 07/17/2017 05:38 PM, Julien Grall wrote: >>> Hi Sergej, >>> >>> On 06/07/17 12:

Re: [Xen-devel] [PATCH v6 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h

2017-07-18 Thread Sergej Proskurin
On 07/18/2017 02:12 PM, Julien Grall wrote: > > > On 18/07/17 12:59, Sergej Proskurin wrote: >> Hi Julien, >> >> >> On 07/18/2017 12:43 PM, Julien Grall wrote: >>> >>> >>> On 18/07/17 10:49, Sergej Proskurin wrote: >>>> Hi Ju

[Xen-devel] [PATCH v7 03/14] arm/mem_access: Add defines supporting PTs with varying page sizes

2017-07-18 Thread Sergej Proskurin
AArch64 supports pages with different (4K, 16K, and 64K) sizes. To enable guest page table walks for various configurations, this commit extends the defines and helpers of the current implementation. Signed-off-by: Sergej Proskurin Reviewed-by: Julien Grall --- Cc: Stefano Stabellini Cc

[Xen-devel] [PATCH v7 07/14] arm/mem_access: Introduce BIT_ULL bit operation

2017-07-18 Thread Sergej Proskurin
commits. Signed-off-by: Sergej Proskurin Reviewed-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v4: We reused the previous commit with the msg "arm/mem_access: Add defines holding the width of 32/64bit regs" from v3, as we can reuse the already exist

[Xen-devel] [PATCH v7 06/14] arm/mem_access: Introduce GV2M_EXEC permission

2017-07-18 Thread Sergej Proskurin
We extend the current implementation by an additional permission, GV2M_EXEC, which will be used to describe execute permissions of PTE's as part of our guest translation table walk implementation. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: J

[Xen-devel] [PATCH v7 05/14] arm/mem_access: Add short-descriptor pte typedefs and macros

2017-07-18 Thread Sergej Proskurin
The current implementation does not provide appropriate types for short-descriptor translation table entries. As such, this commit adds new types, which simplify managing the respective translation table entries. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini

[Xen-devel] [PATCH v7 01/14] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines

2017-07-18 Thread Sergej Proskurin
This commit adds (TCR_|TTBCR_)* defines to simplify access to the respective register contents. At the same time, we adjust the macros TCR_T0SZ and TCR_TG0_* by using the newly introduced TCR_T0SZ_SHIFT and TCR_TG0_SHIFT instead of the hardcoded values. Signed-off-by: Sergej Proskurin Acked-by

[Xen-devel] [PATCH v7 14/14] arm/mem_access: Walk the guest's pt in software

2017-07-18 Thread Sergej Proskurin
-step potential translation errors in the function p2m_mem_access_check_and_get_page due to restricted memory (e.g. to the guest's page tables themselves), we walk the guest's page tables in software. Signed-off-by: Sergej Proskurin Acked-by: Tamas K Lengyel --- Cc: Razvan Cojocaru Cc: Tama

[Xen-devel] [PATCH v7 02/14] arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h

2017-07-18 Thread Sergej Proskurin
xen/page-defs.h as to allow the following commits to use the consolidated defines. Signed-off-by: Sergej Proskurin --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- v6

[Xen-devel] [PATCH v7 10/14] arm/guest_access: Rename vgic_access_guest_memory

2017-07-18 Thread Sergej Proskurin
eliminate artefacts of the function's previous location. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v6: We added this patch to our patch series. v7: Renamed the function's argument ipa back to gpa. Removed any mentioning of "vITS&quo

[Xen-devel] [PATCH v7 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h

2017-07-18 Thread Sergej Proskurin
This commit moves the function vgic_access_guest_memory to guestcopy.c and the header asm/guest_access.h. No functional changes are made. Please note that the function will be renamed in the following commit. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc

[Xen-devel] [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-07-18 Thread Sergej Proskurin
ng of macros and function parameters. Some additional changes comprising code readability and correct type usage have been made and stated in the individual commits. The following patch series can be found on Github[0]. Cheers, ~Sergej [0] https://github.com/sergej-proskurin/xen (branch arm-gpt-wa

[Xen-devel] [PATCH v7 04/14] arm/lpae: Introduce lpae_is_page helper

2017-07-18 Thread Sergej Proskurin
This commit introduces a new helper that checks whether the target PTE holds a page mapping or not. This helper will be used as part of the following commits. Signed-off-by: Sergej Proskurin Reviewed-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v6: Change the name of the

[Xen-devel] [PATCH v7 08/14] arm/mem_access: Introduce GENMASK_ULL bit operation

2017-07-18 Thread Sergej Proskurin
implementation has been lifted from the linux kernel source code. Signed-off-by: Sergej Proskurin --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- v6: As similar patches have been

[Xen-devel] [PATCH v7 11/14] arm/mem_access: Add software guest-page-table walk

2017-07-18 Thread Sergej Proskurin
TTBR0_EL1, TTBR1_EL1, and SCTLR_EL1. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Rename p2m_gva_to_ipa to p2m_walk_gpt and move it to p2m.c. Move the functionality responsible for walking long-descriptor based translation tab

[Xen-devel] [PATCH v7 12/14] arm/mem_access: Add long-descriptor based gpt

2017-07-18 Thread Sergej Proskurin
M DDI 0487B.a J1-5922, J1-5999, and ARM DDI 0406C.b B3-1510. Note that the current implementation lacks support for Large VA/PA on ARMv8.2 architectures (LVA/LPA, 52-bit virtual and physical address sizes). The associated location in the code is marked appropriately. Signed-off-by: Sergej Proskurin -

[Xen-devel] [PATCH v7 13/14] arm/mem_access: Add short-descriptor based gpt

2017-07-18 Thread Sergej Proskurin
This commit adds functionality to walk the guest's page tables using the short-descriptor translation table format for both ARMv7 and ARMv8. The implementation is based on ARM DDI 0487B-a J1-6002 and ARM DDI 0406C-b B3-1506. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: St

Re: [Xen-devel] ARM: Adjusting guest memory size through xl mem-{set|max} fails

2017-07-19 Thread Sergej Proskurin
Hi Wei, On 07/18/2017 01:16 PM, Wei Liu wrote: > On Mon, Jul 17, 2017 at 06:19:09PM +0200, Sergej Proskurin wrote: >> Hi Julien, >> >> >> On 07/17/2017 03:53 PM, Julien Grall wrote: >>> (+Wei and Ian) >>> >>> Hi Sergej >>> >>&

Re: [Xen-devel] ARM: Adjusting guest memory size through xl mem-{set|max} fails

2017-07-19 Thread Sergej Proskurin
Hi Wei, On 07/19/2017 12:22 PM, Wei Liu wrote: > On Wed, Jul 19, 2017 at 11:40:19AM +0200, Sergej Proskurin wrote: >> Hi Wei, >> >> >> On 07/18/2017 01:16 PM, Wei Liu wrote: >>> On Mon, Jul 17, 2017 at 06:19:09PM +0200, Sergej Proskurin wrote: >>>&g

Re: [Xen-devel] ARM: Adjusting guest memory size through xl mem-{set|max} fails

2017-07-19 Thread Sergej Proskurin
On 07/19/2017 01:57 PM, Wei Liu wrote: > On Wed, Jul 19, 2017 at 01:52:08PM +0200, Sergej Proskurin wrote: >> --- >> root@avocet:~# xl list >> NameID Mem VCPUs State >> Time(s) >> Domain-0

Re: [Xen-devel] [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-08-04 Thread Sergej Proskurin
Hi Julien, Sorry for the late reply. On 07/31/2017 04:38 PM, Julien Grall wrote: > > > On 18/07/17 13:24, Sergej Proskurin wrote: >> Hi all, > > Hi, > >> >> The function p2m_mem_access_check_and_get_page is called from the function >> get_pag

Re: [Xen-devel] [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-08-08 Thread Sergej Proskurin
Hi Julien, On 08/04/2017 11:15 AM, Sergej Proskurin wrote: > Hi Julien, > > Sorry for the late reply. > > On 07/31/2017 04:38 PM, Julien Grall wrote: >> >> On 18/07/17 13:24, Sergej Proskurin wrote: >>> Hi all, >> Hi, >> >>> The func

Re: [Xen-devel] [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-08-08 Thread Sergej Proskurin
Hi Julien, > The patch belows solve my problem: > > diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c > index b258248322..6ca994e438 100644 > --- a/xen/arch/arm/guest_walk.c > +++ b/xen/arch/arm/guest_walk.c > @@ -112,7 +112,7 @@ static int guest_walk_sd(const struct vcpu *v, >

Re: [Xen-devel] [PATCH v7 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-08-08 Thread Sergej Proskurin
On 08/08/2017 04:58 PM, Andrew Cooper wrote: > On 08/08/17 15:47, Sergej Proskurin wrote: >> Hi Julien, >> >>> The patch belows solve my problem: >>> >>> diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c >>> index b258248322..6c

Re: [Xen-devel] [PATCH v7 13/14] arm/mem_access: Add short-descriptor based gpt

2017-08-08 Thread Sergej Proskurin
Hi Julien, On 07/18/2017 02:25 PM, Sergej Proskurin wrote: > This commit adds functionality to walk the guest's page tables using the > short-descriptor translation table format for both ARMv7 and ARMv8. The > implementation is based on ARM DDI 0487B-a J1-6002 and ARM DDI 040

Re: [Xen-devel] [PATCH v7 13/14] arm/mem_access: Add short-descriptor based gpt

2017-08-08 Thread Sergej Proskurin
On 08/08/2017 05:18 PM, Julien Grall wrote: > > > On 08/08/17 16:17, Sergej Proskurin wrote: >> Hi Julien, >> >> >> On 07/18/2017 02:25 PM, Sergej Proskurin wrote: >>> This commit adds functionality to walk the guest's page tables using >>&g

Re: [Xen-devel] [PATCH v7 13/14] arm/mem_access: Add short-descriptor based gpt

2017-08-08 Thread Sergej Proskurin
On 08/08/2017 06:20 PM, Andrew Cooper wrote: > On 08/08/17 16:28, Sergej Proskurin wrote: >> On 08/08/2017 05:18 PM, Julien Grall wrote: >>> On 08/08/17 16:17, Sergej Proskurin wrote: >>>> Hi Julien, >>>> >>>> >>>> On 0

Re: [Xen-devel] [PATCH v7 13/14] arm/mem_access: Add short-descriptor based gpt

2017-08-09 Thread Sergej Proskurin
Hi Andrew, >>> diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c >>> index b258248322..7f34a2b1d3 100644 >>> --- a/xen/arch/arm/guest_walk.c >>> +++ b/xen/arch/arm/guest_walk.c >>> @@ -112,7 +112,12 @@ static int guest_walk_sd(const struct vcpu *v, >>> * level translati

[Xen-devel] [PATCH v8 03/13] arm/lpae: Introduce lpae_is_page helper

2017-08-09 Thread Sergej Proskurin
This commit introduces a new helper that checks whether the target PTE holds a page mapping or not. This helper will be used as part of the following commits. Signed-off-by: Sergej Proskurin Reviewed-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v6: Change the name of the

[Xen-devel] [PATCH v8 08/13] arm/guest_access: Move vgic_access_guest_memory to guest_access.h

2017-08-09 Thread Sergej Proskurin
This commit moves the function vgic_access_guest_memory to guestcopy.c and the header asm/guest_access.h. No functional changes are made. Please note that the function will be renamed in the following commit. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc

[Xen-devel] [PATCH v8 01/13] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines

2017-08-09 Thread Sergej Proskurin
This commit adds (TCR_|TTBCR_)* defines to simplify access to the respective register contents. At the same time, we adjust the macros TCR_T0SZ and TCR_TG0_* by using the newly introduced TCR_T0SZ_SHIFT and TCR_TG0_SHIFT instead of the hardcoded values. Signed-off-by: Sergej Proskurin Acked-by

[Xen-devel] [PATCH v8 09/13] arm/guest_access: Rename vgic_access_guest_memory

2017-08-09 Thread Sergej Proskurin
eliminate artefacts of the function's previous location. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v6: We added this patch to our patch series. v7: Renamed the function's argument ipa back to gpa. Removed any mentioning of "vITS&quo

[Xen-devel] [PATCH v8 02/13] arm/mem_access: Add defines supporting PTs with varying page sizes

2017-08-09 Thread Sergej Proskurin
AArch64 supports pages with different (4K, 16K, and 64K) sizes. To enable guest page table walks for various configurations, this commit extends the defines and helpers of the current implementation. Signed-off-by: Sergej Proskurin Reviewed-by: Julien Grall --- Cc: Stefano Stabellini Cc

[Xen-devel] [PATCH v8 04/13] arm/mem_access: Add short-descriptor pte typedefs and macros

2017-08-09 Thread Sergej Proskurin
The current implementation does not provide appropriate types for short-descriptor translation table entries. As such, this commit adds new types, which simplify managing the respective translation table entries. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini

[Xen-devel] [PATCH v8 00/13] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-08-09 Thread Sergej Proskurin
t and position where we recursively rely on the p2m->lock. We also add casts to fields of the struct short_desc_t in guest_walk_sd as to cope with incorrect values due to the C type promotion. The following patch series can be found on Github[0]. Cheers, ~Sergej [0] https://github.com/sergej-prosk

[Xen-devel] [PATCH v8 07/13] arm/mem_access: Introduce GENMASK_ULL bit operation

2017-08-09 Thread Sergej Proskurin
implementation has been lifted from the linux kernel source code. Signed-off-by: Sergej Proskurin --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu --- v6: As similar patches have been

[Xen-devel] [PATCH v8 10/13] arm/mem_access: Add software guest-page-table walk

2017-08-09 Thread Sergej Proskurin
TTBR0_EL1, TTBR1_EL1, and SCTLR_EL1. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Rename p2m_gva_to_ipa to p2m_walk_gpt and move it to p2m.c. Move the functionality responsible for walking long-descriptor based translation tab

[Xen-devel] [PATCH v8 13/13] arm/mem_access: Walk the guest's pt in software

2017-08-09 Thread Sergej Proskurin
-step potential translation errors in the function p2m_mem_access_check_and_get_page due to restricted memory (e.g. to the guest's page tables themselves), we walk the guest's page tables in software. Signed-off-by: Sergej Proskurin Acked-by: Tamas K Lengyel --- Cc: Razvan Cojocaru Cc: Tama

[Xen-devel] [PATCH v8 05/13] arm/mem_access: Introduce GV2M_EXEC permission

2017-08-09 Thread Sergej Proskurin
We extend the current implementation by an additional permission, GV2M_EXEC, which will be used to describe execute permissions of PTE's as part of our guest translation table walk implementation. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: J

[Xen-devel] [PATCH v8 06/13] arm/mem_access: Introduce BIT_ULL bit operation

2017-08-09 Thread Sergej Proskurin
commits. Signed-off-by: Sergej Proskurin Reviewed-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v4: We reused the previous commit with the msg "arm/mem_access: Add defines holding the width of 32/64bit regs" from v3, as we can reuse the already exist

[Xen-devel] [PATCH v8 12/13] arm/mem_access: Add short-descriptor based gpt

2017-08-09 Thread Sergej Proskurin
This commit adds functionality to walk the guest's page tables using the short-descriptor translation table format for both ARMv7 and ARMv8. The implementation is based on ARM DDI 0487B-a J1-6002 and ARM DDI 0406C-b B3-1506. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: St

[Xen-devel] [PATCH v8 11/13] arm/mem_access: Add long-descriptor based gpt

2017-08-09 Thread Sergej Proskurin
M DDI 0487B.a J1-5922, J1-5999, and ARM DDI 0406C.b B3-1510. Note that the current implementation lacks support for Large VA/PA on ARMv8.2 architectures (LVA/LPA, 52-bit virtual and physical address sizes). The associated location in the code is marked appropriately. Signed-off-by: Sergej Proskurin -

Re: [Xen-devel] [PATCH v8 11/13] arm/mem_access: Add long-descriptor based gpt

2017-08-14 Thread Sergej Proskurin
Hi Julien, On 08/14/2017 07:37 PM, Julien Grall wrote: > Hi Sergej, > > On 09/08/17 09:20, Sergej Proskurin wrote: >> +/* >> + * According to to ARM DDI 0487B.a J1-5927, we return an error if >> the found > > Please drop one of the 'to'. The

Re: [Xen-devel] [RFC PATCH v3 08/10] arm/mem_access: Add long-descriptor based gpt

2017-06-19 Thread Sergej Proskurin
Hi Julien, [...] On 06/19/2017 02:45 PM, Julien Grall wrote: > Hi Sergej, > >> +/* Normalized page granule size indices. */ >> +#define GRANULE_SIZE_INDEX_4K (0) >> +#define GRANULE_SIZE_INDEX_16K (1) >> +#define GRANULE_SIZE_INDEX_64K (2) > > Why this is e

[Xen-devel] [PATCH v4 1/9] arm/mem_access: Add (TCR_|TTBCR_)* defines

2017-06-20 Thread Sergej Proskurin
This commit adds (TCR_|TTBCR_)* defines to simplify access to the respective register contents. At the same time, we adjust the macro TCR_T0SZ by using the newly introduced TCR_T0SZ_SHIFT instead of the hardcoded value. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall

[Xen-devel] [PATCH v4 3/9] arm/mem_access: Add short-descriptor pte typedefs

2017-06-20 Thread Sergej Proskurin
The current implementation does not provide appropriate types for short-descriptor translation table entries. As such, this commit adds new types, which simplify managing the respective translation table entries. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall

[Xen-devel] [PATCH v4 8/9] arm/mem_access: Add short-descriptor based gpt

2017-06-20 Thread Sergej Proskurin
This commit adds functionality to walk the guest's page tables using the short-descriptor translation table format for both ARMv7 and ARMv8. The implementation is based on ARM DDI 0487B-a J1-6002 and ARM DDI 0406C-b B3-1506. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: J

[Xen-devel] [PATCH v4 6/9] arm/mem_access: Add software guest-page-table walk

2017-06-20 Thread Sergej Proskurin
TTBR0_EL1, TTBR1_EL1, and SCTLR_EL1. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Rename p2m_gva_to_ipa to p2m_walk_gpt and move it to p2m.c. Move the functionality responsible for walking long-descriptor based translation tables out of the function p2

[Xen-devel] [PATCH v4 4/9] arm/mem_access: Introduce GV2M_EXEC permission

2017-06-20 Thread Sergej Proskurin
We extend the current implementation by an additional permission, GV2M_EXEC, which will be used to describe execute permissions of PTE's as part of our guest translation table walk implementation. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: J

[Xen-devel] [PATCH v4 5/9] arm/mem_access: Extend BIT-operations to unsigned long long

2017-06-20 Thread Sergej Proskurin
. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v4: We reused the previous commit with the msg "arm/mem_access: Add defines holding the width of 32/64bit regs" from v3, as we can reuse the already existing define BITS_PER_WORD. --- xen/inclu

[Xen-devel] [PATCH v4 9/9] arm/mem_access: Walk the guest's pt in software

2017-06-20 Thread Sergej Proskurin
-step potential translation errors in the function p2m_mem_access_check_and_get_page due to restricted memory (e.g. to the guest's page tables themselves), we walk the guest's page tables in software. Signed-off-by: Sergej Proskurin --- Cc: Razvan Cojocaru Cc: Tamas K Lengyel Cc: Stefano

[Xen-devel] [PATCH v4 7/9] arm/mem_access: Add long-descriptor based gpt

2017-06-20 Thread Sergej Proskurin
M DDI 0487B.a J1-5922, J1-5999, and ARM DDI 0406C.b B3-1510. Note that the current implementation lacks support for Large VA/PA on ARMv8.2 architectures (LVA/LPA, 52-bit virtual and physical address sizes). The associated location in the code is marked appropriately. Signed-off-by: Sergej Proskurin -

[Xen-devel] [PATCH v4 2/9] arm/mem_access: Add defines supporting PTs with varying page sizes

2017-06-20 Thread Sergej Proskurin
The ARMv8 architecture supports pages with different (4K, 16K, and 64K) sizes. To enable guest page table walks for various configurations, this commit extends the defines and helpers of the current implementation. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall

[Xen-devel] [PATCH v4 0/9] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-06-20 Thread Sergej Proskurin
arate header"[1]. The following patch series can be found on Github[0]. Cheers, ~Sergej [0] https://github.com/sergej-proskurin/xen (branch arm-gpt-walk-v4) [1] https://lists.xen.org/archives/html/xen-devel/2017-06/msg02095.html Sergej Proskurin (9): arm/mem_access: Add (TCR_|TTBCR_)* defi

Re: [Xen-devel] [PATCH v4 9/9] arm/mem_access: Walk the guest's pt in software

2017-06-20 Thread Sergej Proskurin
Hi Tamas, [...] >> +if ( guest_walk_tables(v, gva, &ipa, &perms) < 0 ) >> +/* >> + * The software gva to ipa translation can still fail, e.g., if >> the >> + * gva is not mapped. >> + */ > > If you end up sending another round of the serie

Re: [Xen-devel] [PATCH v4 6/9] arm/mem_access: Add software guest-page-table walk

2017-06-22 Thread Sergej Proskurin
Hi Julien, On 06/22/2017 01:16 PM, Julien Grall wrote: > Hi Sergej, > > On 20/06/17 21:33, Sergej Proskurin wrote: >> +int guest_walk_tables(const struct vcpu *v, vaddr_t gva, >> + paddr_t *ipa, unsigned int *perms) >> +{ >> +uint3

Re: [Xen-devel] [PATCH v4 7/9] arm/mem_access: Add long-descriptor based gpt

2017-06-23 Thread Sergej Proskurin
Hi Julien, [...] >> +static bool get_ttbr_and_gran_64bit(uint64_t *ttbr, unsigned int *gran, >> +register_t tcr, enum active_ttbr >> ttbrx) >> +{ >> +bool disabled; >> + >> +if ( ttbrx == TTBR0_ACTIVE ) >> +{ >> +/* Normalize granule size. *

Re: [Xen-devel] [PATCH v4 8/9] arm/mem_access: Add short-descriptor based gpt

2017-06-23 Thread Sergej Proskurin
Hi Julien, [...] > > Looking at the code, I see very limited point of having the offsets > array as you don't use a loop and also use each offset in a single place. > >> +((paddr_t)(gva >> 20) & ((1ULL << (12 - n)) - 1)), > Don't you think it is more readable to have the GVA offsets at

Re: [Xen-devel] [PATCH v4 8/9] arm/mem_access: Add short-descriptor based gpt

2017-06-26 Thread Sergej Proskurin
Hi Julien, [...] + +/* + * As we have considered up to 2 MSBs of the GVA for mapping the first + * level translation table, we need to make sure that we limit the table + * offset that is is indexed by GVA<31-n:20> to max 10 bits to avoid >

[Xen-devel] [PATCH v5 11/12] arm/mem_access: Add short-descriptor based gpt

2017-06-27 Thread Sergej Proskurin
This commit adds functionality to walk the guest's page tables using the short-descriptor translation table format for both ARMv7 and ARMv8. The implementation is based on ARM DDI 0487B-a J1-6002 and ARM DDI 0406C-b B3-1506. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: J

[Xen-devel] [PATCH v5 01/12] arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines

2017-06-27 Thread Sergej Proskurin
This commit adds (TCR_|TTBCR_)* defines to simplify access to the respective register contents. At the same time, we adjust the macros TCR_T0SZ and TCR_TG0_* by using the newly introduced TCR_T0SZ_SHIFT and TCR_TG0_SHIFT instead of the hardcoded values. Signed-off-by: Sergej Proskurin --- Cc

[Xen-devel] [PATCH v5 12/12] arm/mem_access: Walk the guest's pt in software

2017-06-27 Thread Sergej Proskurin
-step potential translation errors in the function p2m_mem_access_check_and_get_page due to restricted memory (e.g. to the guest's page tables themselves), we walk the guest's page tables in software. Signed-off-by: Sergej Proskurin Acked-by: Tamas K Lengyel --- Cc: Razvan Cojocaru Cc: Tama

[Xen-devel] [PATCH v5 07/12] arm/mem_access: Introduce BIT_ULL bit operation

2017-06-27 Thread Sergej Proskurin
commits. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v4: We reused the previous commit with the msg "arm/mem_access: Add defines holding the width of 32/64bit regs" from v3, as we can reuse the already existing define BITS_PER_WORD. v5: I

[Xen-devel] [PATCH v5 00/12] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-06-27 Thread Sergej Proskurin
f such. Please note that this patch series is based on the second part of Julien Grall's patch series in [1]: "xen/arm: Move LPAE definition in a separate header". The following patch series can be found on Github[0]. Cheers, ~Sergej [0] https://github.com/sergej-proskurin/x

[Xen-devel] [PATCH v5 06/12] arm/mem_access: Introduce GV2M_EXEC permission

2017-06-27 Thread Sergej Proskurin
We extend the current implementation by an additional permission, GV2M_EXEC, which will be used to describe execute permissions of PTE's as part of our guest translation table walk implementation. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: J

[Xen-devel] [PATCH v5 10/12] arm/mem_access: Add long-descriptor based gpt

2017-06-27 Thread Sergej Proskurin
M DDI 0487B.a J1-5922, J1-5999, and ARM DDI 0406C.b B3-1510. Note that the current implementation lacks support for Large VA/PA on ARMv8.2 architectures (LVA/LPA, 52-bit virtual and physical address sizes). The associated location in the code is marked appropriately. Signed-off-by: Sergej Proskurin -

[Xen-devel] [PATCH v5 02/12] arm/mem_access: Move PAGE_SHIFT_* macros to lib.h

2017-06-27 Thread Sergej Proskurin
to use the consolidated defines. Signed-off-by: Sergej Proskurin --- Cc: Jan Beulich --- xen/include/xen/iommu.h | 3 +-- xen/include/xen/lib.h | 4 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 5803e3f95b..75746e55b0

[Xen-devel] [PATCH v5 08/12] arm/mem_access: Introduce GENMASK_ULL bit operation

2017-06-27 Thread Sergej Proskurin
The current implementation of GENMASK is capable of creating bitmasks of 32-bit values on AArch32 and 64-bit values on AArch64. As we need to create masks for 64-bit values on AArch32 as well, in this commit we introduce the GENMASK_ULL bit operation. Signed-off-by: Sergej Proskurin --- Cc

[Xen-devel] [PATCH v5 03/12] arm/mem_access: Add defines supporting PTs with varying page sizes

2017-06-27 Thread Sergej Proskurin
The ARMv8 architecture supports pages with different (4K, 16K, and 64K) sizes. To enable guest page table walks for various configurations, this commit extends the defines and helpers of the current implementation. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall

[Xen-devel] [PATCH v5 09/12] arm/mem_access: Add software guest-page-table walk

2017-06-27 Thread Sergej Proskurin
TTBR0_EL1, TTBR1_EL1, and SCTLR_EL1. Signed-off-by: Sergej Proskurin Acked-by: Julien Grall --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Rename p2m_gva_to_ipa to p2m_walk_gpt and move it to p2m.c. Move the functionality responsible for walking long-descriptor based translation tab

[Xen-devel] [PATCH v5 04/12] arm/lpae: Introduce lpae_page helper

2017-06-27 Thread Sergej Proskurin
This commit introduces a new helper that checks whether the target PTE holds a page mapping or not. This helper will be used as part of the following commits. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/include/asm-arm/lpae.h | 5 + 1 file changed

<    1   2   3   4   5   >