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

2017-06-27 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

Re: [Xen-devel] [PATCH v3 10/16] xen/arm: lpae: Fix comments coding style

2017-07-02 Thread Sergej Proskurin
eviewed-by because of the description > update. > >Changes in v2: > - Fix description regarding x86 page-table > > Changes in v3: > - Add Stefano's reviewed-by Reviewed-by: Sergej Proskurin > --- > xen/include/asm-arm/lpae.h | 49 &

Re: [Xen-devel] [PATCH v3 11/16] xen/arm: p2m: Rename p2m_valid, p2m_table, p2m_mapping and p2m_is_superpage

2017-07-02 Thread Sergej Proskurin
3: > - Add Stefano's reviewed-by Reviewed-by: Sergej Proskurin > --- > xen/arch/arm/p2m.c | 45 +++-- > 1 file changed, 23 insertions(+), 22 deletions(-) > > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c > index

Re: [Xen-devel] [PATCH v3 12/16] xen/arm: p2m: Move lpae_* helpers in lpae.h

2017-07-02 Thread Sergej Proskurin
prosku...@sec.in.tum.de > > Changes in v2: > - Patch added > > Changes in v3: > - Add Stefano's reviewed-by Reviewed-by: Sergej Proskurin > --- > xen/arch/arm/p2m.c | 23 --- > xen/include/asm-arm/lpae.h | 25 ++

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

2017-07-03 Thread Sergej Proskurin
Hi Jan, On 06/27/2017 02:04 PM, Jan Beulich wrote: >>>> Sergej Proskurin 06/27/17 1:52 PM >>> >> The following commits introduce a software guest page table walk >> software implementation that supports varying guest page size >> granularities. This commi

Re: [Xen-devel] [PATCH v3 09/16] xen/arm: Move LPAE definition in a separate header

2017-07-03 Thread Sergej Proskurin
c.in.tum.de > > Changes in v2: > - Move comment after the #endif rather than before > - Add Stefano's reviewed-by Reviewed-by: Sergej Proskurin > --- > xen/include/asm-arm/lpae.h | 169 >

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

2017-07-03 Thread Sergej Proskurin
Hi Jan, On 07/03/2017 10:40 AM, Sergej Proskurin wrote: > Hi Jan, > > > On 06/27/2017 02:04 PM, Jan Beulich wrote: >>>>> Sergej Proskurin 06/27/17 1:52 PM >>> >>> The following commits introduce a software guest page table walk >>> softwar

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

2017-07-03 Thread Sergej Proskurin
Hi Jan, On 07/03/2017 11:16 AM, Jan Beulich wrote: On 03.07.17 at 11:03, wrote: >> To prevent potential type width issues with ARMv7, I would reuse the >> macro from xen/iommu.h at this point: >> >> PAGE_MASK_GRAN(sz) (~(u64)0 << PAGE_SHIFT_##sz) > Seems reasonable, exce

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

2017-07-03 Thread Sergej Proskurin
Hi Jan, On 07/03/2017 11:13 AM, Jan Beulich wrote: >>>> On 03.07.17 at 10:40, wrote: >> On 06/27/2017 02:04 PM, Jan Beulich wrote: >>>>>> Sergej Proskurin 06/27/17 1:52 PM >>> >>>> The following commits introduce a software guest p

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

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

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

2017-07-04 Thread Sergej Proskurin
Hi Julien, On 07/04/2017 06:58 PM, Julien Grall wrote: > Hi Sergej, > > On 06/27/2017 12:52 PM, Sergej Proskurin wrote: >> The function p2m_mem_access_check_and_get_page in mem_access.c >> translates a gva to an ipa by means of the hardware functionality of the >>

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

2017-07-04 Thread Sergej Proskurin
Hi Julien, On 07/04/2017 06:28 PM, Julien Grall wrote: > Hi Sergej, > > On 06/27/2017 12:52 PM, Sergej Proskurin wrote: >> 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 >&

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

2017-07-04 Thread Sergej Proskurin
Hi Julien, On 07/04/2017 06:15 PM, Julien Grall wrote: > Hi Sergej, > [...] >> + >> +#define GUEST_TABLE_OFFSET(offs, gran) ((paddr_t)(offs) & >> lpae_entry_mask(gran)) >> +#define >> GUEST_TABLE_OFFSET_HELPERS(gran) >> >> \ >> +static in

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

2017-07-04 Thread Sergej Proskurin
Hi Julien, On 07/04/2017 10:46 PM, Sergej Proskurin wrote: > Hi Julien, > > On 07/04/2017 06:28 PM, Julien Grall wrote: >> Hi Sergej, >> >> On 06/27/2017 12:52 PM, Sergej Proskurin wrote: >>> The current implementation of GENMASK is capable of creating bitm

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

2017-07-05 Thread Sergej Proskurin
Hi Julien, On 07/05/2017 01:41 PM, Julien Grall wrote: > > > On 04/07/17 22:33, Sergej Proskurin wrote: >> Hi Julien, > > Hi Sergej, > >> On 07/04/2017 06:15 PM, Julien Grall wrote: >>> Hi Sergej, >>> >> >> [...] >> >>&g

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

2017-07-05 Thread Sergej Proskurin
Hi Julien, > >> >>> In this case, you need a bit more rationale to explain why setting to >>> GV2M_READ by default is fine... If it is just a random value, then >>> say it. >>> >> >> I will add a comment in the change log stating that we set perms to >> GV2M_READ (that equals to 0) by default to

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

2017-07-05 Thread Sergej Proskurin
Hi Julien, On 07/04/2017 06:23 PM, Julien Grall wrote: > Hi Sergej, > > On 06/27/2017 12:52 PM, Sergej Proskurin wrote: >> 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

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

2017-07-05 Thread Sergej Proskurin
Hi Julien, [...] >> +/* Access the guest's memory to read only one PTE. */ >> +ret = vgic_access_guest_memory(d, paddr, &pte, >> sizeof(lpae_t), false); > > It really doesn't make sense to call a function vgic_* in guest page > table walk code. I wasn't expected that I needed to

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

2017-07-06 Thread Sergej Proskurin
Hi Julien, On 07/04/2017 07:06 PM, Julien Grall wrote: > Hi Sergej, > > >> +/* >> + * According to to ARM DDI 0487B.a J1-5927, we return an error >> if the found >> + * PTE is invalid or holds a reserved entry (PTE<1:0> == x0)) or >> if the PTE >> + * maps a memory block at level

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

2017-07-06 Thread Sergej Proskurin
have been adapted accordingly. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v6: We added this patch to our patch series. --- xen/arch/arm/guestcopy.c | 8 xen/arch/arm/vgic-v3-its.c | 36 ++-- xen/in

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

2017-07-06 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 v6 14/14] arm/mem_access: Walk the guest's pt in software

2017-07-06 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 v6 08/14] arm/mem_access: Introduce GENMASK_ULL bit operation

2017-07-06 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 v6 05/14] arm/mem_access: Add short-descriptor pte typedefs and macros

2017-07-06 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 v6 00/14] arm/mem_access: Walk guest page tables in SW if mem_access is active

2017-07-06 Thread Sergej Proskurin
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-walk-v6) Sergej Proskurin (14): arm/mem_access: Add and cleanup (TCR_|TTBCR_)* defines arm/mem_access:

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

2017-07-06 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 v6 07/14] arm/mem_access: Introduce BIT_ULL bit operation

2017-07-06 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 v6 12/14] arm/mem_access: Add long-descriptor based gpt

2017-07-06 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 v6 13/14] arm/mem_access: Add short-descriptor based gpt

2017-07-06 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 v6 02/14] arm/mem_access: Move PAGE_*_* macros to xen/page-defs.h

2017-07-06 Thread Sergej Proskurin
xen/page-defs.h as to allow the following commits to use the consolidated defines. Signed-off-by: Sergej Proskurin --- Cc: Jan Beulich --- v6: Move in addition to PAGE_SHIFT_* also PAGE_(SIZE|MASK|ALIGN)_(4K|64K) macros and introduce the corresponding macros for 16K. Also, move the macros

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

2017-07-06 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 v6 11/14] arm/mem_access: Add software guest-page-table walk

2017-07-06 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 v6 06/14] arm/mem_access: Introduce GV2M_EXEC permission

2017-07-06 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 v6 09/14] arm/guest_access: Move vgic_access_guest_memory to guest_access.h

2017-07-06 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 --- Cc: Stefano Stabellini Cc: Julien Grall --- v6

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

2017-07-06 Thread Sergej Proskurin
Hi Jan, On 07/06/2017 02:18 PM, Jan Beulich wrote: On 06.07.17 at 13:50, wrote: >> --- a/xen/include/asm-arm/config.h >> +++ b/xen/include/asm-arm/config.h >> @@ -19,6 +19,8 @@ >> #define BITS_PER_LONG (BYTES_PER_LONG << 3) >> #define POINTER_ALIGN BYTES_PER_LONG >> >> +#define BITS_PER

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

2017-07-06 Thread Sergej Proskurin
Hi Jan, On 07/06/2017 02:10 PM, Jan Beulich wrote: On 06.07.17 at 13:50, wrote: >> --- /dev/null >> +++ b/xen/include/xen/page-defs.h >> @@ -0,0 +1,24 @@ >> +#ifndef __XEN_PAGE_DEFS_H__ >> +#define __XEN_PAGE_DEFS_H__ >> + >> +/* Helpers for different page granularities. */ >> +#define PAGE

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

2017-07-06 Thread Sergej Proskurin
Hi Jan, On 07/06/2017 05:24 PM, Jan Beulich wrote: On 06.07.17 at 16:53, wrote: >> On 07/06/2017 02:10 PM, Jan Beulich wrote: >> On 06.07.17 at 13:50, wrote: --- /dev/null +++ b/xen/include/xen/page-defs.h @@ -0,0 +1,24 @@ +#ifndef __XEN_PAGE_DEFS_H__ +#define

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

2017-07-06 Thread Sergej Proskurin
Hi Jan, On 07/06/2017 05:22 PM, Jan Beulich wrote: On 06.07.17 at 16:38, wrote: >> On 07/06/2017 02:18 PM, Jan Beulich wrote: >> On 06.07.17 at 13:50, wrote: @@ -128,7 +131,7 @@ static inline int generic_fls64(__u64 x) static __inline__ int get_bitmask_order(unsigned int cou

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

2017-07-07 Thread Sergej Proskurin
Hi Jan, On 07/06/2017 06:20 PM, Jan Beulich wrote: On 06.07.17 at 17:34, wrote: >> On 07/06/2017 05:24 PM, Jan Beulich wrote: >> On 06.07.17 at 16:53, wrote: On 07/06/2017 02:10 PM, Jan Beulich wrote: On 06.07.17 at 13:50, wrote: >> --- /dev/null >> +++ b/xen/incl

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

2017-07-17 Thread Sergej Proskurin
Hi all, My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8 (LeMaker HiKey, Linux kernel v4.9.0) development board. On both boards, I have Xen version 4.10-unstable running with the associated tools to manage a domu. Currently, I am trying to get xl mem-{set|max} to work on b

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

2017-07-17 Thread Sergej Proskurin
Hi Julien, On 07/17/2017 03:53 PM, Julien Grall wrote: > (+Wei and Ian) > > Hi Sergej > > On 17/07/17 13:04, Sergej Proskurin wrote: >> Hi all, >> >> My setup comprises an ARMv7 (Arndale, Linux kernel v4.11.6) and an ARMv8 >> (LeMaker HiKey, Linux kernel v4

Re: [Xen-devel] Xen 4.8 Development Update

2016-08-31 Thread Sergej Proskurin
Hi all, > === ARM === > > * Altp2m for ARM > - Sergej Proskurin > We have submitted a patch-series version 3 and still waiting for remaining reviews. Cheers, ~Sergej ___ Xen-devel mailing list Xen-devel@lists.xen.org https://li

Re: [Xen-devel] [PATCH v3 03/38] arm/p2m: Introduce p2m_(switch|restore)_vttbr_and_(g|s)et_flags

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/01/2016 05:51 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> This commit introduces macros for switching and restoring the vttbr >> considering the currently set irq flags. We define these macros, as the >>

Re: [Xen-devel] [PATCH v3 06/38] arm/p2m: Add HVMOP_altp2m_get_domain_state

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/01/2016 07:06 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> This commit adopts the x86 HVMOP_altp2m_get_domain_state implementation. >> >> Signed-off-by: Sergej Proskurin >> --- >> Cc:

Re: [Xen-devel] [PATCH v3 10/38] arm/p2m: Move hostp2m init/teardown to individual functions

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/01/2016 07:36 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> --- >> xen/arch/arm/p2m.c| 71 >> +-- >> xen/include/asm-arm/p2m.h | 11 >>

Re: [Xen-devel] [PATCH v3 04/38] arm/p2m: Add first altp2m HVMOP stubs

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/01/2016 06:09 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> This commit moves the altp2m-related code from x86 to ARM. Functions > > s/moves/copies/ > > However, this is not really true because the code

Re: [Xen-devel] [PATCH v3 08/38] arm/p2m: Free p2m entries only in the hostp2m

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/01/2016 07:08 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> Freeing p2m entries of arbitrary p2m's (in particular in alternate >> p2m's) will lead to unpredicted behavior as the entries might still be >

Re: [Xen-devel] [PATCH v3 02/38] arm/p2m: Expose p2m_*lock helpers

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/01/2016 05:48 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> This commit exposes the "p2m_*lock" helpers, as they will be used within >> the file ./xen/arch/arm/altp2m.c, as will be shown in the following

Re: [Xen-devel] [PATCH v3 03/38] arm/p2m: Introduce p2m_(switch|restore)_vttbr_and_(g|s)et_flags

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/02/2016 11:57 AM, Julien Grall wrote: > > > On 02/09/16 09:40, Sergej Proskurin wrote: >> Hi Julien, > > Hello Sergej, > >> On 09/01/2016 05:51 PM, Julien Grall wrote: >>> Hello Sergej, >>> >>> On 16/08/16 23:16, Serge

Re: [Xen-devel] [PATCH v3 04/38] arm/p2m: Add first altp2m HVMOP stubs

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/02/2016 12:12 PM, Julien Grall wrote: > > > On 02/09/16 10:26, Sergej Proskurin wrote: >> Hi Julien, > > Hello Sergej, > >> On 09/01/2016 06:09 PM, Julien Grall wrote: >>> Hello Sergej, >>> >>> On 16/08/16 23:16,

Re: [Xen-devel] [PATCH v3 02/38] arm/p2m: Expose p2m_*lock helpers

2016-09-02 Thread Sergej Proskurin
Hi Julien, On 09/02/2016 12:15 PM, Julien Grall wrote: > On 02/09/16 11:12, Sergej Proskurin wrote: >> Hi Julien, > > Hello Sergej, > >> On 09/01/2016 05:48 PM, Julien Grall wrote: >>> Hello Sergej, >>> >>> On 16/08/16 23:16, Sergej Prosk

Re: [Xen-devel] [PATCH v3 10/38] arm/p2m: Move hostp2m init/teardown to individual functions

2016-09-05 Thread Sergej Proskurin
Hi Julien, On 09/02/2016 12:51 PM, Julien Grall wrote: > > > On 02/09/16 10:09, Sergej Proskurin wrote: >> Hi Julien, >> >> On 09/01/2016 07:36 PM, Julien Grall wrote: >>> Hello Sergej, >>> >>> On 16/08/16 23:16, Sergej Proskuri

Re: [Xen-devel] [PATCH v3 15/38] arm/p2m: Add altp2m table flushing routine

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/09/2016 07:02 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> The current implementation differentiates between flushing and >> destroying altp2m views. This commit adds the function altp2m_flush, >> which a

Re: [Xen-devel] [PATCH v3 16/38] arm/p2m: Add HVMOP_altp2m_set_domain_state

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/09/2016 07:14 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:16, Sergej Proskurin wrote: >> +static int altp2m_init_helper(struct domain *d, unsigned int idx) >> +{ >> +int rc; >> +struct p2m_domain *p2m = d->arch.altp

Re: [Xen-devel] [PATCH v3 18/38] arm/p2m: Add HVMOP_altp2m_destroy_p2m

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 10:41 AM, Julien Grall wrote: > Hello Sergej, > > On 16/08/2016 23:16, Sergej Proskurin wrote: >> Signed-off-by: Sergej Proskurin >> --- >> Cc: Stefano Stabellini >> Cc: Julien Grall >> --- >> v2: Substituted the call t

Re: [Xen-devel] [PATCH v3 19/38] arm/p2m: Add HVMOP_altp2m_switch_p2m

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 10:47 AM, Julien Grall wrote: > Hello Sergej, > > On 16/08/2016 23:16, Sergej Proskurin wrote: >> Signed-off-by: Sergej Proskurin >> --- >> Cc: Stefano Stabellini >> Cc: Julien Grall >> --- >> v3: Extended the function &

Re: [Xen-devel] [PATCH v3 23/38] arm/p2m: Cosmetic fixes -- __p2m_get_mem_access

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 10:53 AM, Julien Grall wrote: > Hello Sergej, > > On 16/08/2016 23:16, Sergej Proskurin wrote: >> This commit extends the function prototypes of the functions: >> * __p2m_get_mem_access >> * p2m_mem_access_check_and_get_page >> >&

Re: [Xen-devel] [PATCH v3 23/38] arm/p2m: Cosmetic fixes -- __p2m_get_mem_access

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/13/2016 03:30 PM, Julien Grall wrote: > > > On 13/09/16 14:27, Sergej Proskurin wrote: >> Hi Julien, > > Hello Sergej, > >> >> On 09/12/2016 10:53 AM, Julien Grall wrote: >>> Hello Sergej, >>> >>> On 16/08/2016 23:16

Re: [Xen-devel] [PATCH v3 24/38] arm/p2m: Make p2m_mem_access_check ready for altp2m

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 11:02 AM, Julien Grall wrote: > Hello Sergej, > > On 16/08/2016 23:17, Sergej Proskurin wrote: >> This commit extends the function "p2m_mem_access_check" and >> "p2m_mem_access_check_and_get_page" to consider altp2m. The funct

Re: [Xen-devel] [PATCH v3 28/38] arm/p2m: Modify reference count only if hostp2m active

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 11:17 AM, Julien Grall wrote: > Hello Sergej, > > On 16/08/2016 23:17, Sergej Proskurin wrote: >> This commit makes sure that the page reference count is updated through >> the function "p2m_put_l3_page" only the entries have bee

Re: [Xen-devel] [PATCH v3 33/38] arm/p2m: Add altp2m paging mechanism

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 04:18 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:17, Sergej Proskurin wrote: >> This commit adds the function "altp2m_lazy_copy" implementing the altp2m >> paging mechanism. The function "altp2m_lazy_copy" lazily

Re: [Xen-devel] [PATCH v3 35/38] arm/p2m: Adjust debug information to altp2m

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 04:29 PM, Julien Grall wrote: > Hello Sergej, > > On 16/08/16 23:17, Sergej Proskurin wrote: >> Signed-off-by: Sergej Proskurin >> --- >> Cc: Stefano Stabellini >> Cc: Julien Grall >> --- >> v2: Dump p2m information of the

Re: [Xen-devel] [PATCH v3 38/38] arm/p2m: Add test of xc_altp2m_change_gfn

2016-09-13 Thread Sergej Proskurin
Hi Wei, On 08/24/2016 02:27 PM, Wei Liu wrote: > On Wed, Aug 17, 2016 at 12:17:14AM +0200, Sergej Proskurin wrote: >> This commit extends xen-access by a simple test of the functionality >> provided by "xc_altp2m_change_gfn". The idea is to dynamically remap a >&

Re: [Xen-devel] [PATCH v3 33/38] arm/p2m: Add altp2m paging mechanism

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/13/2016 05:08 PM, Julien Grall wrote: > > > On 13/09/16 16:06, Sergej Proskurin wrote: >>>> +} >>>> + >>>> +out: >>>> +p2m_read_unlock(hp2m); >>>> + >>>> +return

Re: [Xen-devel] [PATCH v3 14/38] arm/p2m: Add altp2m init/teardown routines

2016-09-13 Thread Sergej Proskurin
Hi Julien, On 09/09/2016 06:56 PM, Julien Grall wrote: > Hello Sergej > > On 16/08/16 23:16, Sergej Proskurin wrote: >> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile >> index 23aaf52..4a7f660 100644 >> --- a/xen/arch/arm/Makefile >> +++ b/xen/

Re: [Xen-devel] [PATCH v3 14/38] arm/p2m: Add altp2m init/teardown routines

2016-09-13 Thread Sergej Proskurin
Hi Julien, >>> struct arch_vcpu >>> diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h >>> index 1a004ed..de0c90a 100644 >>> --- a/xen/include/asm-arm/p2m.h >>> +++ b/xen/include/asm-arm/p2m.h >>> @@ -9,6 +9,8 @@ >>> #include >>> #include >>> >>> +#define MAX_ALTP2M 10

Re: [Xen-devel] [PATCH v3 33/38] arm/p2m: Add altp2m paging mechanism

2016-09-14 Thread Sergej Proskurin
Hi Julien [...] >>> static void do_trap_instr_abort_guest(struct cpu_user_regs *regs, >>>const union hsr hsr) >>> { >>> @@ -2445,6 +2465,14 @@ static void do_trap_instr_abort_guest(struct >>> cpu_user_regs *regs, >>> break; >>> case FSC_FLT

Re: [Xen-devel] [PATCH v3 29/38] arm/p2m: Add HVMOP_altp2m_set_mem_access

2016-09-14 Thread Sergej Proskurin
Hi Julien, On 09/12/2016 02:08 PM, Julien Grall wrote: > Hi Sergej, > > On 16/08/16 23:17, Sergej Proskurin wrote: >> The HVMOP_altp2m_set_mem_access allows to set gfn permissions of >> (currently one page at a time) of a specific altp2m view. In case the >> view does

Re: [Xen-devel] [PATCH v3 19/38] arm/p2m: Add HVMOP_altp2m_switch_p2m

2016-09-14 Thread Sergej Proskurin
Hi Julien, On 09/14/2016 12:57 PM, Julien Grall wrote: > > > On 13/09/16 14:00, Sergej Proskurin wrote: >> Hi Julien, > > Hello Sergej, > >> >> On 09/12/2016 10:47 AM, Julien Grall wrote: >>> Hello Sergej, >>> >>> On 16/08/2016 23:1

Re: [Xen-devel] Xen 4.9 Development Update

2017-02-15 Thread Sergej Proskurin
wrote: > > * Altp2m for ARM > - Sergej Proskurin > > > This was a GSoC project last summer that unfortunately didn't make the > merge window. I'll probably pick it up sometime in the future and get it > rebased but it is unli

Re: [Xen-devel] [PATCH 15/22] xen/arm: Don't call p2m_alloc_table from arch_domain_create

2016-07-23 Thread Sergej Proskurin
Hi Julien, > > This patch moved p2m_alloc_table call into p2m_init (i.e your > p2m_init_one). You complained that the function was not exported > anymore, but you did not look how it was called in this patch. > Ok. At this point our patches indeed derailed too much from each other. We should co

Re: [Xen-devel] [PATCH 16/18] arm/altp2m: Extended libxl to activate altp2m on ARM.

2016-07-24 Thread Sergej Proskurin
Hi Wei, On 07/07/2016 06:27 PM, Wei Liu wrote: > On Mon, Jul 04, 2016 at 01:45:45PM +0200, Sergej Proskurin wrote: >> The current implementation allows to set the parameter HVM_PARAM_ALTP2M. >> This parameter allows further usage of altp2m on ARM. For this, we >> define an ad

Re: [Xen-devel] [PATCH 16/18] arm/altp2m: Extended libxl to activate altp2m on ARM.

2016-07-25 Thread Sergej Proskurin
Hi Wei, On 07/25/2016 10:32 AM, Wei Liu wrote: > On Sun, Jul 24, 2016 at 06:06:00PM +0200, Sergej Proskurin wrote: >> Hi Wei, >> >> On 07/07/2016 06:27 PM, Wei Liu wrote: >>> On Mon, Jul 04, 2016 at 01:45:45PM +0200, Sergej Proskurin wrote: >>>> Th

Re: [Xen-devel] [PATCH 16/18] arm/altp2m: Extended libxl to activate altp2m on ARM.

2016-07-25 Thread Sergej Proskurin
On 07/25/2016 12:08 PM, Wei Liu wrote: > On Mon, Jul 25, 2016 at 10:49:41AM +0100, Julien Grall wrote: >> Hello, >> >> On 25/07/16 10:04, Sergej Proskurin wrote: >>> On 07/25/2016 10:32 AM, Wei Liu wrote: >>>> On Sun, Jul 24, 2016 a

Re: [Xen-devel] [PATCH v2 5/6] xen/arm: traps: Avoid unnecessary VA -> IPA translation in abort handlers

2016-07-27 Thread Sergej Proskurin
Hi Julien, On 07/27/2016 07:09 PM, Julien Grall wrote: > Translating a VA to a IPA is expensive. Currently, Xen is assuming that > HPFAR_EL2 is only valid when the stage-2 data/instruction abort happened > during a translation table walk of a first stage translation (i.e S1PTW > is set). > > Howe

[Xen-devel] [PATCH v2 10/25] arm/altp2m: Add HVMOP_altp2m_create_p2m.

2016-08-01 Thread Sergej Proskurin
Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Cosmetic fixes. --- xen/arch/arm/altp2m.c| 23 +++ xen/arch/arm/hvm.c | 3 ++- xen/include/asm-arm/altp2m.h | 4 3 files changed, 29 insertions(+), 1 deletion

[Xen-devel] [PATCH v2 08/25] arm/altp2m: Add HVMOP_altp2m_set_domain_state.

2016-08-01 Thread Sergej Proskurin
The HVMOP_altp2m_set_domain_state allows to activate altp2m on a specific domain. This commit adopts the x86 HVMOP_altp2m_set_domain_state implementation. Note that the function altp2m_flush is currently implemented in form of a stub. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini

[Xen-devel] [PATCH v2 21/25] arm/altp2m: Add HVMOP_altp2m_change_gfn.

2016-08-01 Thread Sergej Proskurin
This commit adds the functionality to change mfn mappings for specified gfn's in altp2m views. This mechanism can be used within the context of VMI, e.g., to establish stealthy debugging. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/alt

[Xen-devel] [PATCH v2 07/25] arm/altp2m: Add altp2m init/teardown routines.

2016-08-01 Thread Sergej Proskurin
The p2m initialization now invokes initialization routines responsible for the allocation and initialization of altp2m structures. The same applies to teardown routines. The functionality has been adopted from the x86 altp2m implementation. Signed-off-by: Sergej Proskurin --- Cc: Stefano

[Xen-devel] [PATCH v2 02/25] arm/altp2m: Add HVMOP_altp2m_get_domain_state.

2016-08-01 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 --- xen/arch/arm/hvm.c | 9 - xen/include/asm-arm/altp2m.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff

[Xen-devel] [PATCH v2 00/25] arm/altp2m: Introducing altp2m to ARM.

2016-08-01 Thread Sergej Proskurin
custom XSM policy is necessary on both x86 and ARM. The current code-base is based on Julien Grall's branch abort-handlers-v2[2]. [0] https://github.com/sergej-proskurin/xen (branch arm-altp2m-v2) [1] https://summerofcode.withgoogle.com/projects/#4970052843470848 [2] git://xenbits.xen.org/people

[Xen-devel] [PATCH v2 04/25] arm/altp2m: Move hostp2m init/teardown to individual functions.

2016-08-01 Thread Sergej Proskurin
This commit pulls out generic init/teardown functionality out of p2m_init and p2m_teardown into p2m_init_one, p2m_free_one, and p2m_flush_table functions. This allows our future implementation to reuse existing code for the initialization/teardown of altp2m views. Signed-off-by: Sergej Proskurin

[Xen-devel] [PATCH v2 13/25] arm/altp2m: Make p2m_restore_state ready for altp2m.

2016-08-01 Thread Sergej Proskurin
This commit adapts the function "p2m_restore_state" in a way that the currently active altp2m table is considered during state restoration. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/p2m.c | 4 +++- xen/include/asm-arm/al

[Xen-devel] [PATCH v2 23/25] arm/altp2m: Extend libxl to activate altp2m on ARM.

2016-08-01 Thread Sergej Proskurin
ot; switch in the domain's configuration file (i.e. set altp2m=1). Note, that the old parameter "altp2mhvm" is still valid for x86. Since this commit defines this old parameter as deprecated, libxl will generate a warning during processing. Signed-off-by: Sergej Proskurin --- Cc:

[Xen-devel] [PATCH v2 05/25] arm/altp2m: Rename and extend p2m_alloc_table.

2016-08-01 Thread Sergej Proskurin
nd altp2m tables are allocated similarly. Since this function will be used by the altp2m initialization routines, it is not made static. In addition, this commit provides the overlay function "p2m_table_init" that is used for the host's p2m allocation/initialization. Signed-off-by: Sergej Pr

[Xen-devel] [PATCH v2 01/25] arm/altp2m: Add first altp2m HVMOP stubs.

2016-08-01 Thread Sergej Proskurin
domain. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Removed altp2m command-line option: Guard through HVM_PARAM_ALTP2M. Removed not used altp2m helper stubs in altp2m.h. --- xen/arch/arm/hvm.c | 79

[Xen-devel] [PATCH v2 09/25] arm/altp2m: Add altp2m table flushing routine.

2016-08-01 Thread Sergej Proskurin
-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Pages in p2m->pages are not cleared in p2m_flush_table anymore. VMID is freed in p2m_free_one. Cosmetic fixes. --- xen/arch/arm/altp2m.c| 38 ++ xen/include/asm-

[Xen-devel] [PATCH v2 12/25] arm/altp2m: Add HVMOP_altp2m_switch_p2m.

2016-08-01 Thread Sergej Proskurin
Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/altp2m.c| 32 xen/arch/arm/hvm.c | 2 +- xen/include/asm-arm/altp2m.h | 4 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/xen

[Xen-devel] [PATCH v2 19/25] arm/altp2m: Add altp2m_propagate_change.

2016-08-01 Thread Sergej Proskurin
lled/invalid entries. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/altp2m.c| 75 xen/arch/arm/p2m.c | 14 + xen/include/asm-arm/altp2m.h | 9 ++ xen/include/asm-arm/p2m.h

[Xen-devel] [PATCH v2 15/25] arm/altp2m: Extend __p2m_lookup.

2016-08-01 Thread Sergej Proskurin
so, we needed to extend the function's prototypes of the following functions: * __p2m_get_mem_access * p2m_mem_access_and_get_page Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/p2m.c | 59 ---

[Xen-devel] [PATCH v2 16/25] arm/altp2m: Make p2m_mem_access_check ready for altp2m.

2016-08-01 Thread Sergej Proskurin
This commit extends the function "p2m_mem_access_check" to consider altp2m. Also, the new implementation fills the request buffer to hold altp2m-related information. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/p2m.c | 17 ++

[Xen-devel] [PATCH v2 17/25] arm/altp2m: Cosmetic fixes - function prototypes.

2016-08-01 Thread Sergej Proskurin
views. Therefore, exiting function prototypes have been extended to hold another argument (of type struct p2m_domain *). This allows to specify the p2m/altp2m domain that should be processed by the individual function -- instead of accessing the host's default p2m domain. Signed-off-by: S

[Xen-devel] [PATCH v2 25/25] arm/altp2m: Add test of xc_altp2m_change_gfn.

2016-08-01 Thread Sergej Proskurin
This commit extends xen-access by a simple test of the functionality provided by "xc_altp2m_change_gfn". The idea is to dynamically remap a trapping gfn to another mfn, which holds the same content as the original mfn. Signed-off-by: Sergej Proskurin --- Cc: Razvan Cojocaru Cc: Tamas

[Xen-devel] [PATCH v2 14/25] arm/altp2m: Make get_page_from_gva ready for altp2m.

2016-08-01 Thread Sergej Proskurin
s p2m table for the associated gva to ma translation. This is required at this point, as altp2m lazily copies pages from the host's p2m and even might be flushed because of changes to the host's p2m (as it is done within the context of memory ballooning). Signed-off-by: Sergej Proskurin -

[Xen-devel] [PATCH v2 03/25] arm/altp2m: Add struct vttbr.

2016-08-01 Thread Sergej Proskurin
The struct vttbr introduces a simple way to precisely access the individual fields of the vttbr. --- xen/arch/arm/p2m.c | 8 xen/arch/arm/traps.c| 2 +- xen/include/asm-arm/p2m.h | 2 +- xen/include/asm-arm/processor.h | 16 4 files chang

[Xen-devel] [PATCH v2 18/25] arm/altp2m: Add HVMOP_altp2m_set_mem_access.

2016-08-01 Thread Sergej Proskurin
The HVMOP HVMOP_altp2m_set_mem_access allows to set gfn permissions of (currently one page at a time) of a specific altp2m view. In case the view does not hold the requested gfn entry, it will be first copied from the hostp2m table and then modified as requested. Signed-off-by: Sergej Proskurin

[Xen-devel] [PATCH v2 06/25] arm/altp2m: Cosmetic fixes - function prototypes.

2016-08-01 Thread Sergej Proskurin
This commit changes the prototype of the following functions: - p2m_alloc_vmid - p2m_free_vmid Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/p2m.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/p2m.c

[Xen-devel] [PATCH v2 11/25] arm/altp2m: Add HVMOP_altp2m_destroy_p2m.

2016-08-01 Thread Sergej Proskurin
Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Substituted the call to tlb_flush for p2m_flush_table. Added comments. Cosmetic fixes. --- xen/arch/arm/altp2m.c| 50 xen/arch/arm/hvm.c

[Xen-devel] [PATCH v2 20/25] arm/altp2m: Add altp2m paging mechanism.

2016-08-01 Thread Sergej Proskurin
p2m violation generates a vm_event. Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/altp2m.c| 86 ++ xen/arch/arm/p2m.c | 6 +++ xen/arch/arm/traps.c | 124 +++

[Xen-devel] [PATCH v2 22/25] arm/altp2m: Adjust debug information to altp2m.

2016-08-01 Thread Sergej Proskurin
Signed-off-by: Sergej Proskurin --- Cc: Stefano Stabellini Cc: Julien Grall --- v2: Dump p2m information of the hostp2m and all altp2m views. --- xen/arch/arm/p2m.c | 20 1 file changed, 20 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 2f4751b

<    1   2   3   4   5   >