[Xen-devel] [PATCH v6] altp2m: Allow shared entries to be copied to altp2m views during lazycopy

2016-07-25 Thread Tamas K Lengyel
these entries in altp2m views as well. Signed-off-by: Tamas K Lengyel --- Cc: George Dunlap Cc: Jan Beulich Cc: Andrew Cooper v6: Lock the altp2m list when checking during nomination Update commit message --- xen/arch/x86/mm/mem_sharing.c | 32 +++- xen/arch

Re: [Xen-devel] [PATCH v8] x86/mem-sharing: mem-sharing a range of memory

2016-07-26 Thread Tamas K Lengyel
On Tue, Jul 26, 2016 at 3:12 AM, George Dunlap wrote: > On Wed, Jul 20, 2016 at 7:01 PM, Tamas K Lengyel > wrote: >> Currently mem-sharing can be performed on a page-by-page basis from the >> control >> domain. However, this process is quite wasteful when a rang

Re: [Xen-devel] [PATCH v6] altp2m: Allow shared entries to be copied to altp2m views during lazycopy

2016-07-26 Thread Tamas K Lengyel
On Tue, Jul 26, 2016 at 4:25 AM, George Dunlap wrote: > On Tue, Jul 26, 2016 at 10:35 AM, George Dunlap > wrote: >> On Mon, Jul 25, 2016 at 7:33 PM, Tamas K Lengyel >> wrote: >>> Move sharing locks above altp2m to avoid locking order violation and >>>

Re: [Xen-devel] [RFC 21/22] xen/arm: p2m: Re-implement p2m_set_mem_access using p2m_{set, get}_entry

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 8:51 AM, Julien Grall wrote: > The function p2m_set_mem_access can be re-implemented using the generic > functions p2m_get_entry and __p2m_set_entry. > > Note that because of the implementation of p2m_get_entry, a TLB > invalidation instruction will be issued for each 4KB p

Re: [Xen-devel] [RFC 13/22] xen/arm: p2m: Replace all usage of __p2m_lookup with p2m_get_entry

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 8:51 AM, Julien Grall wrote: > __p2m_lookup is just a wrapper to p2m_get_entry. > > Signed-off-by: Julien Grall > Cc: Razvan Cojocaru > Cc: Tamas K Lengyel > > --- > It might be possible to rework the memaccess code to take advantage >

Re: [Xen-devel] [RFC 13/22] xen/arm: p2m: Replace all usage of __p2m_lookup with p2m_get_entry

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 11:29 AM, Tamas K Lengyel wrote: > On Thu, Jul 28, 2016 at 8:51 AM, Julien Grall wrote: >> __p2m_lookup is just a wrapper to p2m_get_entry. >> >> Signed-off-by: Julien Grall >> Cc: Razvan Cojocaru >> Cc: Tamas K Lengyel >> >&

Re: [Xen-devel] [RFC 00/22] xen/arm: Rework the P2M code to follow break-before-make sequence

2016-07-28 Thread Tamas K Lengyel
Hi Julien, > I sent this patch series as an RFC because there are still some TODOs > in the code (mostly sanity check and possible optimization) and I have > done limited testing. However, I think it is a good shape to start reviewing, > get more feedback and have wider testing on different board.

[Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-28 Thread Tamas K Lengyel
use monitor_traps to place events on the ring and to fill in the common parts of the requests. Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc: Andrew Cooper Cc: Razvan Cojocaru Cc: George Dunlap --- xen/arch/arm/p2m.c| 69

[Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
Add support for getting/setting registers through vm_event on ARM. The set of registers can be expanded in the future to include other registers as well if necessary but for now it is limited to TTB/CR/R0/R1, PC and CPSR. Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 2:26 PM, Andrew Cooper wrote: > On 28/07/2016 21:05, Tamas K Lengyel wrote: >> Add support for getting/setting registers through vm_event on ARM. >> The set of registers can be expanded in the future to include other registers >> as well if necess

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 2:38 PM, Julien Grall wrote: > > > On 28/07/2016 21:36, Tamas K Lengyel wrote: >> >> On Thu, Jul 28, 2016 at 2:26 PM, Andrew Cooper >> wrote: >>> >>> On 28/07/2016 21:05, Tamas K Lengyel wrote: >>>> >>>&

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 2:41 PM, Andrew Cooper wrote: > On 28/07/2016 21:36, Tamas K Lengyel wrote: >> On Thu, Jul 28, 2016 at 2:26 PM, Andrew Cooper >> wrote: >>> On 28/07/2016 21:05, Tamas K Lengyel wrote: >>>> Add support for getting/setting registers thro

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 3:01 PM, Julien Grall wrote: > > > On 28/07/2016 21:48, Tamas K Lengyel wrote: >> >> On Thu, Jul 28, 2016 at 2:41 PM, Andrew Cooper >> wrote: >>> >>> On 28/07/2016 21:36, Tamas K Lengyel wrote: >>>> >&g

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
On Jul 28, 2016 15:25, "Julien Grall" wrote: > > > > On 28/07/2016 22:05, Tamas K Lengyel wrote: >> >> On Thu, Jul 28, 2016 at 3:01 PM, Julien Grall wrote: >> That's not how we do it with vm_event. Even on x86 we only selectively >> set r

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 4:03 PM, Julien Grall wrote: > > > On 28/07/2016 22:33, Tamas K Lengyel wrote: >> >> On Jul 28, 2016 15:25, "Julien Grall" > <mailto:julien.gr...@arm.com>> wrote: >>> >>> >>> >>> >>> On

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 2:54 PM, Andrew Cooper wrote: > On 28/07/2016 20:35, Tamas K Lengyel wrote: >> The two functions monitor_traps and mem_access_send_req duplicate >> some of the same functionality. The mem_access_send_req however leaves a >> lot of the standard vm_even

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-28 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 2:38 PM, Julien Grall wrote: > Hello Tamas, > > > On 28/07/2016 20:35, Tamas K Lengyel wrote: >> >> The two functions monitor_traps and mem_access_send_req duplicate >> some of the same functionality. The mem_access_send_req however leaves a &

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-29 Thread Tamas K Lengyel
On Jul 29, 2016 02:50, "Julien Grall" wrote: > > > > On 28/07/16 23:54, Tamas K Lengyel wrote: >> >> On Thu, Jul 28, 2016 at 2:38 PM, Julien Grall wrote: >>> >>> On 28/07/2016 20:35, Tamas K Lengyel wrote: >>> This patch is doing more

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-29 Thread Tamas K Lengyel
On Jul 29, 2016 08:21, "Razvan Cojocaru" wrote: > > On 07/29/2016 05:11 PM, Julien Grall wrote: > > Which lead to my next question. For instance, we have an app A which is > > built for Xen 4.N and they want to also support Xen 4.(N + 1) which will > > set more registers and take advantage of it.

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-29 Thread Tamas K Lengyel
On Jul 29, 2016 01:27, "Razvan Cojocaru" wrote: > > On 07/28/2016 10:35 PM, Tamas K Lengyel wrote: > > The two functions monitor_traps and mem_access_send_req duplicate > > some of the same functionality. The mem_access_send_req however leaves a > > lot of

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-29 Thread Tamas K Lengyel
On Fri, Jul 29, 2016 at 10:27 AM, Andrew Cooper wrote: > On 29/07/16 15:21, Tamas K Lengyel wrote: > > On Jul 29, 2016 02:50, "Julien Grall" wrote: >> >> >> >> On 28/07/16 23:54, Tamas K Lengyel wrote: >>> >>> On Thu, Jul 28, 2016 at

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-29 Thread Tamas K Lengyel
On Fri, Jul 29, 2016 at 11:38 AM, Stefano Stabellini wrote: > On Fri, 29 Jul 2016, Tamas K Lengyel wrote: >> On Jul 29, 2016 02:50, "Julien Grall" wrote: >> > >> > >> > >> > On 28/07/16 23:54, Tamas K Lengyel wrote: >> >>

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-07-29 Thread Tamas K Lengyel
On Fri, Jul 29, 2016 at 3:38 PM, Julien Grall wrote: > > > On 29/07/2016 22:02, Tamas K Lengyel wrote: >> >> On Fri, Jul 29, 2016 at 11:38 AM, Stefano Stabellini >> wrote: >>> >>> On Fri, 29 Jul 2016, Tamas K Lengyel wrote: >>&

Re: [Xen-devel] [RFC 13/22] xen/arm: p2m: Replace all usage of __p2m_lookup with p2m_get_entry

2016-07-29 Thread Tamas K Lengyel
On Fri, Jul 29, 2016 at 9:06 AM, Julien Grall wrote: > > > On 28/07/16 18:36, Tamas K Lengyel wrote: >> >> On Thu, Jul 28, 2016 at 11:29 AM, Tamas K Lengyel >> wrote: >>> >>> On Thu, Jul 28, 2016 at 8:51 AM, Julien Grall >>> wrote: >

Re: [Xen-devel] [PATCH] xen/arm: p2m: Don't use default access permission when shattering a superpage

2016-07-29 Thread Tamas K Lengyel
On Fri, Jul 29, 2016 at 12:53 PM, Julien Grall wrote: > The following message flood the console when memaccess is enabled on > various platforms: > > traps.c:2510:d1v0 HSR=0x9383004f pc=0x08b7d4c4 gva=0x08eeb8e0 > gpa=0x004903f8e0 > > This is because a data abort from a guest

Re: [Xen-devel] [PATCH] arm/vm_event: get/set registers

2016-07-29 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 10:16 PM, Razvan Cojocaru wrote: > On 07/29/16 00:25, Julien Grall wrote: >> >> >> On 28/07/2016 22:05, Tamas K Lengyel wrote: >>> On Thu, Jul 28, 2016 at 3:01 PM, Julien Grall >>> wrote: >>> That's not how we do it w

Re: [Xen-devel] [RFC 12/22] xen/arm: p2m: Introduce p2m_get_entry and use it to implement __p2m_lookup

2016-07-30 Thread Tamas K Lengyel
On Thu, Jul 28, 2016 at 8:51 AM, Julien Grall wrote: > Currently, for a given GFN, the function __p2m_lookup will only return > the associated MFN and the p2m type of the mapping. > > In some case we need the order of the mapping and the memaccess > permission. Rather than providing separate funct

Re: [Xen-devel] [RFC 18/22] xen/arm: p2m: Introduce p2m_set_entry and __p2m_set_entry

2016-07-30 Thread Tamas K Lengyel
> +static int p2m_set_entry(struct p2m_domain *p2m, > + gfn_t sgfn, > + unsigned long todo, > + mfn_t smfn, > + p2m_type_t t, > + p2m_access_t a) It is going to be necessary to m

Re: [Xen-devel] [RFC 21/22] xen/arm: p2m: Re-implement p2m_set_mem_access using p2m_{set, get}_entry

2016-08-01 Thread Tamas K Lengyel
s now >>> safe on all the processors. >>> >>> Also the function apply_p2m_changes is dropped completely as it is not >>> unused anymore. >>> >>> Signed-off-by: Julien Grall >>> Cc: Razvan Cojocaru >>> Cc: Tamas K Lengyel >&

Re: [Xen-devel] [PATCH] mem_access: Use monitor_traps instead of mem_access_send_req

2016-08-01 Thread Tamas K Lengyel
On Mon, Aug 1, 2016 at 4:33 AM, Julien Grall wrote: > Hello Tamas, > > On 29/07/16 23:26, Tamas K Lengyel wrote: >> >> However, as this patch really only touches >> things that belong to mem_access/monitor components maybe we should >> split these from the gen

Re: [Xen-devel] [RFC 21/22] xen/arm: p2m: Re-implement p2m_set_mem_access using p2m_{set, get}_entry

2016-08-01 Thread Tamas K Lengyel
On Mon, Aug 1, 2016 at 10:15 AM, Julien Grall wrote: > > > On 01/08/16 16:59, Tamas K Lengyel wrote: >> >> On Mon, Aug 1, 2016 at 9:40 AM, Julien Grall wrote: >> IMHO we should just pause the domain while mem_access permissions are >> being changed. On x86 it i

Re: [Xen-devel] [RFC 21/22] xen/arm: p2m: Re-implement p2m_set_mem_access using p2m_{set, get}_entry

2016-08-01 Thread Tamas K Lengyel
On Mon, Aug 1, 2016 at 10:33 AM, Julien Grall wrote: > > > On 01/08/16 17:27, Tamas K Lengyel wrote: >> >> On Mon, Aug 1, 2016 at 10:15 AM, Julien Grall >> wrote: >>> >>> >>> >>> On 01/08/16 16:59, Tamas K Lengyel wrote: >>

[Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-01 Thread Tamas K Lengyel
that all other call-sites can ommit this step. Finally, this change identifies that errors from mem_access_send_req() were never checked. As errors constitute a problem with the monitor ring, crashing the domain is the most appropriate action to take. Signed-off-by: Tamas K Lengyel Reviewed-by

[Xen-devel] [PATCH v9] x86/mem-sharing: mem-sharing a range of memory

2016-08-01 Thread Tamas K Lengyel
each page in both the source and destination domain, and the looping over all pages happen in the hypervisor. This significantly reduces the overhead of sharing a range of memory. Signed-off-by: Tamas K Lengyel Acked-by: Wei Liu Reviewed-by: Andrew Cooper --- Cc: Ian Jackson Cc: George Dunlap Cc

[Xen-devel] [PATCH v2] arm/vm_event: get/set registers

2016-08-01 Thread Tamas K Lengyel
c vm_event handling routines + * + * Copyright (c) 2016 Tamas K Lengyel (tamas.leng...@zentific.com) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License v2 as published by the Free Software Foundation. + * + * Th

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

2016-08-01 Thread Tamas K Lengyel
7;s Google Summer of Code (GSoC)[1]. My project is >> managed by the organization The Honeynet Project. As part of GSoC, I am >> being >> supervised by the Xen developer Tamas K. Lengyel , >> George >> D. Webster, and Steven Maresca. >> >> In this patch serie

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

2016-08-01 Thread Tamas K Lengyel
On Mon, Aug 1, 2016 at 1:55 PM, Julien Grall wrote: > > > On 01/08/2016 20:20, Tamas K Lengyel wrote: >> >> On Mon, Aug 1, 2016 at 12:15 PM, Julien Grall >> wrote: >>> >>> On 01/08/16 18:10, Sergej Proskurin wrote: >>>> >>>

Re: [Xen-devel] [PATCH v9] x86/mem-sharing: mem-sharing a range of memory

2016-08-02 Thread Tamas K Lengyel
On Aug 2, 2016 06:17, "Wei Liu" wrote: > > On Mon, Aug 01, 2016 at 11:14:27AM -0600, Tamas K Lengyel wrote: > > Currently mem-sharing can be performed on a page-by-page basis from the control > > domain. However, this process is quite wasteful when a range of pages

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-02 Thread Tamas K Lengyel
On Aug 2, 2016 06:45, "Jan Beulich" wrote: > > >>> On 01.08.16 at 18:52, wrote: > > --- a/xen/arch/x86/hvm/hvm.c > > +++ b/xen/arch/x86/hvm/hvm.c > > @@ -1707,7 +1707,7 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla, > > int rc, fall_through = 0, paged = 0; > > int shar

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

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 5:17 AM, George Dunlap wrote: > On 02/08/16 08:38, Julien Grall wrote: >> Hello Tamas, >> >> On 01/08/2016 21:41, Tamas K Lengyel wrote: >>> On Mon, Aug 1, 2016 at 1:55 PM, Julien Grall >>> wrote: >>>>> we did discus

Re: [Xen-devel] monitor access to pages with a specific p2m_type_t

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 12:19 AM, sepanta s wrote: > > > On Sat, Jul 23, 2016 at 3:49 PM, sepanta s wrote: > >> Hi, Is there any sample code which I can undestand how to capture the events on the gfns which have p2m_ram_shared enabled ? I couldn't find any ... . I would b

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

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 1:38 AM, Julien Grall wrote: > Hello Tamas, > > On 01/08/2016 21:41, Tamas K Lengyel wrote: >> >> On Mon, Aug 1, 2016 at 1:55 PM, Julien Grall wrote: >>>> >>>> we did discuss whether altp2m on ARM should be exposed to gu

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 9:23 AM, Tamas K Lengyel wrote: > On Aug 2, 2016 06:45, "Jan Beulich" wrote: >> >> >>> On 01.08.16 at 18:52, wrote: >> > --- a/xen/arch/x86/hvm/hvm.c >> > +++ b/xen/arch/x86/hvm/hvm.c >> > @@ -1707,7 +1707,7 @@

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

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 10:05 AM, George Dunlap wrote: > On 02/08/16 16:48, Tamas K Lengyel wrote: >> On Tue, Aug 2, 2016 at 5:17 AM, George Dunlap >> wrote: >>> On 02/08/16 08:38, Julien Grall wrote: >>>> Hello Tamas, >>>> >>>> On

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

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 10:11 AM, Julien Grall wrote: > > > On 02/08/16 17:00, Tamas K Lengyel wrote: >> >> On Tue, Aug 2, 2016 at 1:38 AM, Julien Grall wrote: >> Hi Julien, >> as I said our use-case is purely external so I don't have an actual >>

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

2016-08-02 Thread Tamas K Lengyel
gt;>>>> project is >>>>> managed by the organization The Honeynet Project. As part of GSoC, I >>>>> am being >>>>> supervised by the Xen developer Tamas K. Lengyel >>>>> , George >>>>> D. Webster, and Steven Mare

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

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 10:40 AM, Julien Grall wrote: > > > On 02/08/16 17:05, George Dunlap wrote: >> >> On 02/08/16 16:48, Tamas K Lengyel wrote: >>> >>> On Tue, Aug 2, 2016 at 5:17 AM, George Dunlap >>> wrote: >>>> >>

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

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 10:40 AM, Julien Grall wrote: > > > On 02/08/16 17:05, George Dunlap wrote: >> >> On 02/08/16 16:48, Tamas K Lengyel wrote: >>> >>> On Tue, Aug 2, 2016 at 5:17 AM, George Dunlap >>> wrote: >>>> >>

[Xen-devel] [PATCH] arm/mem_access: properly handle traps caused by no-longer current settings

2016-08-02 Thread Tamas K Lengyel
corrupted. Requested-by: Julien Grall Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/p2m.c | 29 ++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 40a0b80..a4b6b7b

Re: [Xen-devel] [PATCH] arm/mem_access: properly handle traps caused by no-longer current settings

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 2:02 PM, Julien Grall wrote: > Hello Tamas, > > Thank you for taking care of this bug. > > On 02/08/2016 19:53, Tamas K Lengyel wrote: >> >> When mem_access settings change, the active vCPUs may still cause a >> violation >> unti

Re: [Xen-devel] [PATCH] arm/mem_access: properly handle traps caused by no-longer current settings

2016-08-02 Thread Tamas K Lengyel
On Tue, Aug 2, 2016 at 4:05 PM, Julien Grall wrote: > > > On 02/08/2016 22:34, Tamas K Lengyel wrote: >> >> On Tue, Aug 2, 2016 at 2:02 PM, Julien Grall wrote: >>> >>> Hello Tamas, >>> >>> Thank you for taking care of thi

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 8:41 AM, George Dunlap wrote: > On 01/08/16 17:52, Tamas K Lengyel wrote: >> The two functions monitor_traps and mem_access_send_req duplicate some of the >> same functionality. The mem_access_send_req however leaves a lot of the >> standard vm_event f

Re: [Xen-devel] [PATCH] arm/mem_access: properly handle traps caused by no-longer current settings

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 5:43 AM, Julien Grall wrote: > Hi Tamas, > > On 02/08/16 23:47, Tamas K Lengyel wrote: >> >> On Tue, Aug 2, 2016 at 4:05 PM, Julien Grall wrote: >>> >>> On 02/08/2016 22:34, Tamas K Lengyel wrote: >>>> >>&g

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 9:30 AM, George Dunlap wrote: > On 03/08/16 16:18, Tamas K Lengyel wrote: >> On Wed, Aug 3, 2016 at 8:41 AM, George Dunlap >> wrote: >>> On 01/08/16 17:52, Tamas K Lengyel wrote: >>>> The two functions monitor_traps and mem_access_

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 9:44 AM, George Dunlap wrote: > On 03/08/16 16:40, Tamas K Lengyel wrote: >> On Wed, Aug 3, 2016 at 9:30 AM, George Dunlap >> wrote: >>> On 03/08/16 16:18, Tamas K Lengyel wrote: >>>> On Wed, Aug 3, 2016 at 8:41 AM, George Dunlap

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

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 8:08 AM, Julien Grall wrote: > Hello Sergej, > > Please try to reply to all when answering on the ML. Otherwise the answer > may be delayed/lost. > > On 03/08/16 13:45, Sergej Proskurin wrote: >> >> The interesting part about #VE is that it allows to handle certain >> violat

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 10:10 AM, George Dunlap wrote: > On 03/08/16 16:58, Tamas K Lengyel wrote: >> On Wed, Aug 3, 2016 at 9:44 AM, George Dunlap >> wrote: >>> On 03/08/16 16:40, Tamas K Lengyel wrote: >>>> On Wed, Aug 3, 2016 at 9:30 AM, George Dunlap

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

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 10:24 AM, Julien Grall wrote: > Hi Tamas, > > > On 03/08/16 17:01, Tamas K Lengyel wrote: >> >> On Wed, Aug 3, 2016 at 8:08 AM, Julien Grall wrote: >>> >>> Hello Sergej, >>> >>> Please try to reply to all when

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

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 11:30 AM, Andrew Cooper wrote: > On 03/08/16 17:51, Julien Grall wrote: >> >> >> On 03/08/16 17:42, Tamas K Lengyel wrote: >>> On Wed, Aug 3, 2016 at 10:24 AM, Julien Grall >>> wrote: >>>> Hi Tamas, >>>> >

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

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 11:45 AM, Julien Grall wrote: > > > On 03/08/16 18:43, Tamas K Lengyel wrote: >> >> On Wed, Aug 3, 2016 at 11:30 AM, Andrew Cooper >> wrote: >>> >>> On 03/08/16 17:51, Julien Grall wrote: >>>> >>>> >&g

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

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 11:56 AM, Julien Grall wrote: > > > On 03/08/16 18:51, Tamas K Lengyel wrote: >> >> On Wed, Aug 3, 2016 at 11:45 AM, Julien Grall >> wrote: >>> >>> The whole discussion of this series was to defer the exposition of altp2m >&g

[Xen-devel] [PATCH v2] arm/mem_access: don't reinject stage 2 access exceptions

2016-08-03 Thread Tamas K Lengyel
The only way a guest may trip with stage 2 access violation is if mem_access is or was in-use, so reinjecting these exceptions to the guest is never required. Requested-by: Julien Grall Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall v2: simplify the patch by never

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

2016-08-03 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 12:16 PM, Julien Grall wrote: > > > On 03/08/16 19:11, Tamas K Lengyel wrote: >> >> On Wed, Aug 3, 2016 at 11:56 AM, Julien Grall >> wrote: >>> >>> >>> >>> On 03/08/16 18:51, Tamas K Lengyel wrote: >>&

[Xen-devel] [PATCH v3] mem_access: sanitize code around sending vm_event request

2016-08-03 Thread Tamas K Lengyel
mem_access_send_req() were never checked. As errors constitute a problem with the monitor ring, crashing the domain is the most appropriate action to take. Signed-off-by: Tamas K Lengyel Reviewed-by: Andrew Cooper Acked-by: Razvan Cojocaru --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Jan Beulich Cc

Re: [Xen-devel] [PATCH v3] mem_access: sanitize code around sending vm_event request

2016-08-03 Thread Tamas K Lengyel
_traps to now >> include setting the common vcpu_id field so that all other call-sites can >> ommit >> this step. >> >> Finally, this change identifies that errors from mem_access_send_req() were >> never checked. As errors constitute a problem with the monitor r

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-04 Thread Tamas K Lengyel
On Thu, Aug 4, 2016 at 8:10 AM, George Dunlap wrote: > On 03/08/16 17:31, Tamas K Lengyel wrote: >> On Wed, Aug 3, 2016 at 10:10 AM, George Dunlap >> wrote: >>> On 03/08/16 16:58, Tamas K Lengyel wrote: >>>> On Wed, Aug 3, 2016 at 9:44 AM, George Dunlap

Re: [Xen-devel] [PATCH v3] mem_access: sanitize code around sending vm_event request

2016-08-04 Thread Tamas K Lengyel
On Thu, Aug 4, 2016 at 1:51 AM, Jan Beulich wrote: On 04.08.16 at 08:36, wrote: >> On Thu, Aug 4, 2016 at 12:29 AM, Jan Beulich wrote: >> On 03.08.16 at 20:41, wrote: @@ -1846,11 +1846,15 @@ int hvm_hap_nested_page_fault(paddr_t gpa, unsigned long gla,

Re: [Xen-devel] [PATCH v2] mem_access: sanitize code around sending vm_event request

2016-08-04 Thread Tamas K Lengyel
On Thu, Aug 4, 2016 at 10:45 AM, Julien Grall wrote: > Hello Tamas, > > On 04/08/16 17:12, Tamas K Lengyel wrote: >> >> On Thu, Aug 4, 2016 at 8:10 AM, George Dunlap >> wrote: >>> >>> On 03/08/16 17:31, Tamas K Lengyel wrote: >>>> >>

Re: [Xen-devel] monitor access to pages with a specific p2m_type_t

2016-08-05 Thread Tamas K Lengyel
On Fri, Aug 5, 2016 at 5:35 AM, sepanta s wrote: > > > On Tue, Aug 2, 2016 at 8:23 PM, Tamas K Lengyel > wrote: > >> >> >> On Tue, Aug 2, 2016 at 12:19 AM, sepanta s wrote: >> >>> >>> >>> On Sat, Jul 23, 2016 at 3:49 PM, sep

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

2016-08-07 Thread Tamas K Lengyel
On Thu, Aug 4, 2016 at 5:13 AM, George Dunlap wrote: > On 03/08/16 19:21, Tamas K Lengyel wrote: >>> Although the behavior is very different compare to what x86 does. By default >>> the guest will be able to play with altp2m. >> >> Personally my life would

Re: [Xen-devel] VM_EVENT_FLAG_SET_REGISTERS and sync_vcpu_execstate()

2016-08-08 Thread Tamas K Lengyel
On Mon, Aug 8, 2016 at 9:10 AM, Razvan Cojocaru wrote: > On 08/08/2016 03:47 PM, Razvan Cojocaru wrote: >> On 08/08/2016 03:01 PM, Andrew Cooper wrote: >>> On 08/08/16 11:31, Razvan Cojocaru wrote: Hello, We've been mostly setting registers by using xc_vcpu_setcontext(): h

Re: [Xen-devel] VM_EVENT_FLAG_SET_REGISTERS and sync_vcpu_execstate()

2016-08-08 Thread Tamas K Lengyel
On Mon, Aug 8, 2016 at 10:29 AM, Razvan Cojocaru wrote: > On 08/08/16 18:52, Tamas K Lengyel wrote: >>> I think the issue might be that vm_event_vcpu_pause() uses >>> > vcpu_pause_nosync(), and it's being used everywhere we pause the VCPU in >>>

[Xen-devel] [PATCH 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-08 Thread Tamas K Lengyel
, all other options were gated on altp2m_enabled. Since altp2m_enabled only gets set during set altp2m domain state, this change introduces no new requirements to the other ops but makes it more clear that it is required for all ops. Signed-off-by: Tamas K Lengyel --- Cc: Ian Jackson Cc: Wei Liu

[Xen-devel] [PATCH 1/2] x86/altp2m: use __get_gfn_type_access to avoid lock conflicts

2016-08-08 Thread Tamas K Lengyel
From: Tamas K Lengyel Use __get_gfn_type_access instead of get_gfn_type_access when checking the hostp2m entries during altp2m mem_access setting and gfn remapping to avoid a lock conflict which can make dom0 freeze. Signed-off-by: Tamas K Lengyel --- Cc: George Dunlap Cc: Jan Beulich Cc

Re: [Xen-devel] [PATCH 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-09 Thread Tamas K Lengyel
On Tue, Aug 9, 2016 at 2:06 AM, Jan Beulich wrote: On 09.08.16 at 01:56, wrote: >> @@ -5238,18 +5238,19 @@ static int do_altp2m_op( >> goto out; >> } >> >> -if ( (rc = xsm_hvm_altp2mhvm_op(XSM_TARGET, d)) ) >> +if ( !d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] ) >> +

Re: [Xen-devel] [PATCH 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-09 Thread Tamas K Lengyel
>>> --- a/xen/include/public/hvm/params.h >>> +++ b/xen/include/public/hvm/params.h >>> @@ -225,8 +225,16 @@ >>> /* Location of the VM Generation ID in guest physical address space. */ >>> #define HVM_PARAM_VM_GENERATION_ID_ADDR 34 >>> >>> -/* Boolean: Enable altp2m */ >>> +/* >>> + * Set mode fo

Re: [Xen-devel] VM_EVENT_FLAG_SET_REGISTERS and sync_vcpu_execstate()

2016-08-09 Thread Tamas K Lengyel
On Tue, Aug 9, 2016 at 3:41 AM, Tim Deegan wrote: > At 19:29 +0300 on 08 Aug (1470684579), Razvan Cojocaru wrote: >> On 08/08/16 18:52, Tamas K Lengyel wrote: >> >> I think the issue might be that vm_event_vcpu_pause() uses >> >> > vcpu_pause_nosync(), and it&

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

2016-08-09 Thread Tamas K Lengyel
On Wed, Aug 3, 2016 at 10:54 AM, Julien Grall wrote: > Hello Sergej, > > > On 01/08/16 18:10, Sergej Proskurin wrote: >> >> This commit moves the altp2m-related code from x86 to ARM. Functions >> that are no yet supported notify the caller or print a BUG message >> stating their absence. >> >> Als

Re: [Xen-devel] [PATCH V2] common/vm_event: synchronize vCPU state in vm_event_resume()

2016-08-10 Thread Tamas K Lengyel
On Aug 10, 2016 05:52, "Jan Beulich" wrote: > > >>> On 10.08.16 at 12:55, wrote: > > On 08/10/2016 01:12 PM, Jan Beulich wrote: > > On 10.08.16 at 09:35, wrote: > >>> --- a/xen/common/vm_event.c > >>> +++ b/xen/common/vm_event.c > >>> @@ -388,6 +388,13 @@ void vm_event_resume(struct domain *

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

2016-08-10 Thread Tamas K Lengyel
On Aug 10, 2016 03:52, "Julien Grall" wrote: > > Hello Tamas, > > > On 09/08/2016 21:16, Tamas K Lengyel wrote: >> >> On Wed, Aug 3, 2016 at 10:54 AM, Julien Grall wrote: >>> >>> Hello Sergej, >>> >>> >>> On 0

[Xen-devel] [PATCH v2 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-10 Thread Tamas K Lengyel
state, all other options were gated on altp2m_enabled. Since altp2m_enabled only gets set during set altp2m domain state, this change introduces no new requirements to the other ops but makes it more clear that it is required for all ops. Signed-off-by: Tamas K Lengyel --- Cc: Ian Jackson Cc: Wei

[Xen-devel] [PATCH v2 1/2] x86/altp2m: use __get_gfn_type_access to avoid lock conflicts

2016-08-10 Thread Tamas K Lengyel
From: Tamas K Lengyel Use __get_gfn_type_access instead of get_gfn_type_access when checking the hostp2m entries during altp2m mem_access setting and gfn remapping to avoid a lock conflict which can make dom0 freeze. During mem_access setting the hp2m is already locked. For gfn remapping we

Re: [Xen-devel] [PATCH v2 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-11 Thread Tamas K Lengyel
On Aug 11, 2016 06:02, "Jan Beulich" wrote: > > >>> On 10.08.16 at 17:00, wrote: > > @@ -5238,18 +5238,19 @@ static int do_altp2m_op( > > goto out; > > } > > > > -if ( (rc = xsm_hvm_altp2mhvm_op(XSM_TARGET, d)) ) > > +if ( !d->arch.hvm_domain.params[HVM_PARAM_ALTP2M] ) > > +

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

2016-08-11 Thread Tamas K Lengyel
On Aug 11, 2016 02:18, "Julien Grall" wrote: > > Hello Tamas, > > > On 10/08/2016 16:49, Tamas K Lengyel wrote: >> >> On Aug 10, 2016 03:52, "Julien Grall" > <mailto:julien.gr...@arm.com>> wrote: >>> >>> On 09/08/2016 21

Re: [Xen-devel] [PATCH V3] common/vm_event: synchronize vCPU state in vm_event_resume()

2016-08-11 Thread Tamas K Lengyel
uffices since there's only one ring / consumer at a > time, and events are being processed one-by-one, so the > toolstack won't unpause the vCPU behind our backs. > > Signed-off-by: Razvan Cojocaru Acked-by: Tamas K Lengyel > > --- > Changes since V2: > - Updat

Re: [Xen-devel] [PATCH v2 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-11 Thread Tamas K Lengyel
On Thu, Aug 11, 2016 at 11:17 AM, Wei Liu wrote: > On Wed, Aug 10, 2016 at 09:00:15AM -0600, Tamas K Lengyel wrote: >> Currently setting altp2mhvm=1 in the domain configuration allows access to >> the >> altp2m interface for both in-guest and external privileged tools. Th

Re: [Xen-devel] [PATCH v2 2/2] x86/altp2m: allow specifying external-only use-case

2016-08-12 Thread Tamas K Lengyel
On Aug 12, 2016 05:24, "Julien Grall" wrote: > > Hello Tamas, > > > On 10/08/2016 17:00, Tamas K Lengyel wrote: >> >> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl >> index ef614be..97948fd 100644 >> --- a/tools/libxl/lib

Re: [Xen-devel] HVMOP_altp2m_vcpu_enable_notify code example usage

2016-08-21 Thread Tamas K Lengyel
Hi Dmitry, as long as you are testing with a HVM Linux guest you should be able to just compile the Xen tools in the guest and then use libxc from within the guest to issue that hypercall via xc_altp2m_set_vcpu_enable_notify. You will need to load a couple Xen related kernel-modules for it to work

Re: [Xen-devel] HVMOP_altp2m_vcpu_enable_notify code example usage

2016-08-22 Thread Tamas K Lengyel
; [23261.230188] We are in Xen domain HVM = 1 >> [23261.307840] err = 0 >> [23261.352587] CONSOLE PFN = fefff >> === >> >> Looks like usermode wrappers don't support many requests to hypervisor, >> right? Not sure about HVMOP_

Re: [Xen-devel] HVMOP_altp2m_vcpu_enable_notify code example usage

2016-08-22 Thread Tamas K Lengyel
HEAD#l5510. I'm not sure which HVMOPs are allowed by default to be executed by the guest itself. Tamas > > Thank you for answers! > > Best Regards, > Rockosov Dmitry > > 2016-08-22 21:28 GMT+03:00 Tamas K Lengyel : >> >> On Mon, Aug 22, 2016 at 12:12 PM, Dmi

[Xen-devel] [PATCH] arm/p2m: Fix regression during domain shutdown with active mem_access

2017-01-24 Thread Tamas K Lengyel
the ASSERT. Ideally this fix would be part of Xen 4.8.1. Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/p2m.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 09ceb378a5..1f0ecc9970 100644 --- a/xen/a

Re: [Xen-devel] [PATCH] arm/p2m: Fix regression during domain shutdown with active mem_access

2017-01-24 Thread Tamas K Lengyel
On Tue, Jan 24, 2017 at 3:13 PM, Julien Grall wrote: > Hi Tamas, > > On 24/01/2017 22:10, Tamas K Lengyel wrote: >> >> The change in commit 438c5fe4f0c introduced a regression for domains where >> mem_acces is or was active. When relinquish_p2m_mapping attempts to clea

Re: [Xen-devel] [PATCH] arm/p2m: Fix regression during domain shutdown with active mem_access

2017-01-24 Thread Tamas K Lengyel
On Tue, Jan 24, 2017 at 3:32 PM, Julien Grall wrote: > > > On 24/01/2017 22:19, Tamas K Lengyel wrote: >> >> On Tue, Jan 24, 2017 at 3:13 PM, Julien Grall >> wrote: >>> >>> Hi Tamas, >>> >>> On 24/01/2017 22:10, Tamas K Lengyel wrot

Re: [Xen-devel] [PATCH] arm/p2m: Fix regression during domain shutdown with active mem_access

2017-01-24 Thread Tamas K Lengyel
On Tue, Jan 24, 2017 at 4:19 PM, Julien Grall wrote: > > > On 24/01/2017 22:45, Tamas K Lengyel wrote: >> >> On Tue, Jan 24, 2017 at 3:32 PM, Julien Grall >> wrote: >>> >>> >>> >>> On 24/01/2017 22:19, Tamas K Lengyel wrot

[Xen-devel] [PATCH v2] arm/p2m: Fix regression during domain shutdown with active mem_access

2017-01-24 Thread Tamas K Lengyel
was unfortunately not caught during testing in preparation for the 4.8 release. In this patch we adjust the ASSERT to not trip when the domain is being shutdown. Ideally this fix would be part of Xen 4.8.1. Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall v2: Add dy

[Xen-devel] [PATCH v3] arm/p2m: Fix regression during domain shutdown with active mem_access

2017-01-25 Thread Tamas K Lengyel
was unfortunately not caught during testing in preparation for the 4.8 release. In this patch we adjust the ASSERT to not trip when the domain is being shutdown. Ideally this fix would be part of Xen 4.8.1. Signed-off-by: Tamas K Lengyel --- Cc: Stefano Stabellini Cc: Julien Grall v3: Mi

[Xen-devel] [PATCH] arm/monitor: flush the icache during SMC traps

2017-01-25 Thread Tamas K Lengyel
During an SMC trap it is possible that the user may change the memory from where the SMC was fetched. However, without flushing the icache the SMC may still trigger if the pCPU was idle during the trap. Flush the icache to ensure consistency. Signed-off-by: Tamas K Lengyel --- Cc: Razvan

Re: [Xen-devel] [PATCH] arm/monitor: flush the icache during SMC traps

2017-01-26 Thread Tamas K Lengyel
On Thu, Jan 26, 2017 at 4:30 AM, Julien Grall wrote: > (CC xen-devel, Ravzan, and Stefao) > > Hi Tamas, > > Not sure why you only CC me on the answer. I have CCed again xen-devel as I > don't see any sensible discussion in it. > > On 26/01/2017 00:11, Tamas K Lengye

Re: [Xen-devel] [PATCH] arm/monitor: flush the icache during SMC traps

2017-01-26 Thread Tamas K Lengyel
On Thu, Jan 26, 2017 at 10:54 AM, Tamas K Lengyel wrote: > On Thu, Jan 26, 2017 at 4:30 AM, Julien Grall wrote: >> (CC xen-devel, Ravzan, and Stefao) >> >> Hi Tamas, >> >> Not sure why you only CC me on the answer. I have CCed again xen-devel as I >>

[Xen-devel] [PATCH] xen/arm: flush icache as well when XEN_DOMCTL_cacheflush is issued

2017-01-26 Thread Tamas K Lengyel
xc_domain_cacheflush through xenctrl.h. Signed-off-by: Tamas K Lengyel --- Cc: Ian Jackson Cc: Wei Liu Cc: Stefano Stabellini Cc: Julien Grall Note: patch has been verified to solve stale icache issues on the HiKey platform. --- tools/libxc/include/xenctrl.h| 6 ++ tools/libxc

<    1   2   3   4   5   6   7   8   9   10   >