[Xen-devel] [PATCH] tools/xenstore-watch: Add new timeout parameter

2016-03-19 Thread Razvan Cojocaru
This patch allows xenstore-watch to exit even if no changes to its XenStore key have occured in a specified interval (in seconds), via a new -T parameter. Signed-off-by: Razvan Cojocaru --- tools/xenstore/xenstore_client.c | 64 ++-- 1 file changed, 48

[Xen-devel] HPA <-> GPA mapping

2016-04-04 Thread Razvan Cojocaru
Hello, Does Xen under any circumstances ever modify GPA -> HPA translations _while_ a HVM guest is running? I could find no cases where that would happen, but I would appreciate an authoritative answer. Thanks, Razvan ___ Xen-devel mailing list Xen-de

[Xen-devel] Failed vm entry when emulating in hvm_do_resume()

2016-04-04 Thread Razvan Cojocaru
Hello, As a test, I've modified xen-access.c to this simplified skeleton: http://pastebin.com/48WYwW00 then started up an x86 Windows 7 HVM guest, and ran it with: # ./xen-access write once the login screen appeared. The guest promptly crashed with this backtrace: http://pastebin.com/Bz0GeFt

[Xen-devel] Issues with the xen-access.c model

2016-04-05 Thread Razvan Cojocaru
Hello, xen-access.c does roughly this: for (;;) { poll_evt_channel(); if (new_events) { while (ring_buffer_has_requests) { pull_request(); process_request(); put_response(); }

Re: [Xen-devel] Issues with the xen-access.c model

2016-04-05 Thread Razvan Cojocaru
On 04/05/16 18:35, Tamas K Lengyel wrote: > > > On Tue, Apr 5, 2016 at 6:13 AM, Andrew Cooper <mailto:andrew.coop...@citrix.com>> wrote: > > On 05/04/16 11:55, Razvan Cojocaru wrote: > > Hello, > > > > xen-acces

Re: [Xen-devel] Issues with the xen-access.c model

2016-04-06 Thread Razvan Cojocaru
On 04/05/2016 07:10 PM, Andrew Cooper wrote: > On 05/04/16 16:55, Razvan Cojocaru wrote: >> On 04/05/16 18:35, Tamas K Lengyel wrote: >>> >>> On Tue, Apr 5, 2016 at 6:13 AM, Andrew Cooper >> <mailto:andrew.coop...@citrix.com>> wrote: >>&g

[Xen-devel] [PATCH] x86/emulate: Check current->arch.vm_event in hvmemul_virtual_to_linear()

2016-04-07 Thread Razvan Cojocaru
Theoretically it is possible for mem_access_emulate_each_rep to be true even when current->arch.vm_event == NULL, so add an extra check to hvmemul_virtual_to_linear(). Signed-off-by: Razvan Cojocaru --- xen/arch/x86/hvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: [Xen-devel] [PATCH] x86/emulate: Check current->arch.vm_event in hvmemul_virtual_to_linear()

2016-04-07 Thread Razvan Cojocaru
On 04/07/16 20:27, Jan Beulich wrote: On 07.04.16 at 10:39, wrote: >> Theoretically it is possible for mem_access_emulate_each_rep to be >> true even when current->arch.vm_event == NULL, so add an extra >> check to hvmemul_virtual_to_linear(). > > Mind saying what those theoretical condition

Re: [Xen-devel] [PATCH] x86/emulate: Check current->arch.vm_event in hvmemul_virtual_to_linear()

2016-04-07 Thread Razvan Cojocaru
On 04/07/16 20:54, Razvan Cojocaru wrote: > On 04/07/16 20:27, Jan Beulich wrote: >>>>> On 07.04.16 at 10:39, wrote: >>> Theoretically it is possible for mem_access_emulate_each_rep to be >>> true even when current->arch.vm_event == NULL, so add an extra

Re: [Xen-devel] [PATCH] x86/emulate: Check current->arch.vm_event in hvmemul_virtual_to_linear()

2016-04-07 Thread Razvan Cojocaru
On 04/08/16 00:17, Jan Beulich wrote: On 07.04.16 at 19:54, wrote: >> On 04/07/16 20:27, Jan Beulich wrote: >> On 07.04.16 at 10:39, wrote: Theoretically it is possible for mem_access_emulate_each_rep to be true even when current->arch.vm_event == NULL, so add an extra che

[Xen-devel] [PATCH] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-04-08 Thread Razvan Cojocaru
ase. Signed-off-by: Razvan Cojocaru --- xen/include/asm-x86/monitor.h | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/monitor.h b/xen/include/asm-x86/monitor.h index 0954b59..0544836 100644 --- a/xen/include/asm-x86/monitor.h +++ b/xen/incl

Re: [Xen-devel] [PATCH] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-04-08 Thread Razvan Cojocaru
On 04/08/16 10:10, Razvan Cojocaru wrote: > It is meaningless (and potentially dangerous - see > hvmemul_virtual_to_linear()) > to set mem_access_emulate_each_rep before xc_monitor_enable() (which allocates > vcpu->arch.vm_event) has been called, so return an

Re: [Xen-devel] [PATCH] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-04-08 Thread Razvan Cojocaru
On 04/08/16 11:17, Andrew Cooper wrote: > On 08/04/2016 08:16, Razvan Cojocaru wrote: >> On 04/08/16 10:10, Razvan Cojocaru wrote: >>> It is meaningless (and potentially dangerous - see >>> hvmemul_virtual_to_linear()) >>> to set mem_access_emulate_each_r

[Xen-devel] [PATCH V2] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-04-08 Thread Razvan Cojocaru
ase. Signed-off-by: Razvan Cojocaru --- Changes since V1: - Fixed the if() condition. - Introduced an rc return variable to simplify the code. --- xen/include/asm-x86/monitor.h | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/monitor.h b/

[Xen-devel] [PATCH V3] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-04-08 Thread Razvan Cojocaru
ase. Signed-off-by: Razvan Cojocaru Reviewed-by: Andrew Cooper --- Changes since V2: - Updated the if() condition as recommended by Andrew Cooper. - Added Andrew Cooper's Reviewed-by. --- xen/include/asm-x86/monitor.h | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(

[Xen-devel] [PATCH] xen: Filter out MSR write events

2016-04-11 Thread Razvan Cojocaru
This patch only allows introspection-related MSR write events to be sent out, improving performance. Should additional events be required, they can then simply be added to the list of vmx_introspection_force_enabled_msrs[]. Signed-off-by: Razvan Cojocaru --- xen/arch/x86/hvm/hvm.c | 14

Re: [Xen-devel] [PATCH] xen: Filter out MSR write events

2016-04-11 Thread Razvan Cojocaru
On 04/11/16 22:18, Konrad Rzeszutek Wilk wrote: > On Mon, Apr 11, 2016 at 07:41:54PM +0300, Razvan Cojocaru wrote: >> This patch only allows introspection-related MSR write events to >> be sent out, improving performance. Should additional events be >> required, they can th

Re: [Xen-devel] [PATCH] vm_event: Implement ARM SMC events

2016-04-11 Thread Razvan Cojocaru
On 04/12/16 07:31, Jan Beulich wrote: Tamas K Lengyel 04/11/16 9:47 PM >>> >> --- a/xen/include/public/vm_event.h >> +++ b/xen/include/public/vm_event.h >> @@ -166,6 +166,31 @@ struct vm_event_regs_x86 { > >uint32_t _pad; > >}; > > >> +struct vm_event_regs_arm { >> +uint32_t r0; >>

Re: [Xen-devel] [PATCH] xen: Filter out MSR write events

2016-04-12 Thread Razvan Cojocaru
On 04/12/2016 12:38 PM, Andrew Cooper wrote: > On 12/04/16 05:26, Razvan Cojocaru wrote: >> On 04/11/16 22:18, Konrad Rzeszutek Wilk wrote: >>> On Mon, Apr 11, 2016 at 07:41:54PM +0300, Razvan Cojocaru wrote: >>>> This patch only allows introspection-related MSR wr

[Xen-devel] [PATCH] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-12 Thread Razvan Cojocaru
. This replaces the previously posted "xen: Filter out MSR write events" patch. Signed-off-by: Razvan Cojocaru --- tools/libxc/include/xenctrl.h | 4 +-- tools/libxc/xc_monitor.c | 6 ++-- xen/arch/x86/hvm/event.c | 3 +- xen/arch/x86/hvm/hvm.c |

Re: [Xen-devel] [PATCH] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-12 Thread Razvan Cojocaru
On 04/12/2016 05:42 PM, Julien Grall wrote: > Hello Razvan, > > On 12/04/2016 15:34, Razvan Cojocaru wrote: >> Previously, subscribing to MSR write events was an all-or-none >> approach, with special cases for introspection MSR-s. This patch >> allows the vm_event consu

Re: [Xen-devel] [PATCH] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-12 Thread Razvan Cojocaru
On 04/12/16 20:49, Tamas K Lengyel wrote: > diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c > index 1fec412..1be058a 100644 > --- a/xen/arch/x86/monitor.c > +++ b/xen/arch/x86/monitor.c > @@ -20,6 +20,7 @@ > */ > > #include > +#include > #incl

[Xen-devel] [PATCH V2] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-12 Thread Razvan Cojocaru
. This replaces the previously posted "xen: Filter out MSR write events" patch. Signed-off-by: Razvan Cojocaru --- Changes since V1: - Removed ARM stubs. - Corrected domain_unpause(d) omission. - Moved enable / disable and query functions from vm_event.c to monitor.c. --- tools/lib

Re: [Xen-devel] [PATCH V2] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-13 Thread Razvan Cojocaru
On 04/13/2016 12:47 PM, Konrad Rzeszutek Wilk wrote: >> diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c >> index 1fec412..4c96968 100644 >> --- a/xen/arch/x86/monitor.c >> +++ b/xen/arch/x86/monitor.c >> @@ -22,6 +22,58 @@ >> #include >> #include >> >> +static int arch_monitor_en

[Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-13 Thread Razvan Cojocaru
LOCK-prefixed instructions are currenly allowed to run in parallel in x86_emulate(), which can lead the guest into an undefined state. This patch fixes the issue. Signed-off-by: Razvan Cojocaru --- tools/tests/x86_emulator/test_x86_emulator.c | 12 xen/arch/x86/hvm/emulate.c

Re: [Xen-devel] [PATCH V2] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-13 Thread Razvan Cojocaru
On 04/13/2016 05:50 PM, Tamas K Lengyel wrote: > > diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c > index 1fec412..4c96968 100644 > --- a/xen/arch/x86/monitor.c > +++ b/xen/arch/x86/monitor.c > @@ -22,6 +22,58 @@ > #include > #include > > +static

Re: [Xen-devel] [PATCH V2] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-13 Thread Razvan Cojocaru
On 04/13/2016 05:52 PM, Tamas K Lengyel wrote: > > >> diff --git a/xen/include/public/domctl.h > b/xen/include/public/domctl.h > >> index 2457698..875c09a 100644 > >> --- a/xen/include/public/domctl.h > >> +++ b/xen/include/public/domctl.h > >> @@ -1107,8 +1107,7 @@ struct

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-13 Thread Razvan Cojocaru
On 04/14/16 07:35, Jan Beulich wrote: >>>> Razvan Cojocaru 04/13/16 7:53 PM >>> >> LOCK-prefixed instructions are currenly allowed to run in parallel >> in x86_emulate(), which can lead the guest into an undefined state. >> This patch fixes the is

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-13 Thread Razvan Cojocaru
On 04/14/16 09:09, Juergen Gross wrote: > On 14/04/16 07:56, Razvan Cojocaru wrote: >> This indeed doesn't guard against LOCKed instructions being run in >> parallel with and without emulation, however that is a case that should >> almost never occur - at least not

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 11:07 AM, Andrew Cooper wrote: > On 14/04/2016 06:56, Razvan Cojocaru wrote: >> >>>> --- a/xen/common/domain.c >>>> +++ b/xen/common/domain.c >>>> @@ -272,6 +272,8 @@ struct domain *domain_create(domid_t domid, unsigned &g

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 11:18 AM, Juergen Gross wrote: > On 14/04/16 10:01, Andrew Cooper wrote: >> On 14/04/2016 08:46, Juergen Gross wrote: >>> On 14/04/16 08:31, Razvan Cojocaru wrote: >>>> On 04/14/16 09:09, Juergen Gross wrote: >>>>> On 14/04/16 07:56, Razv

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 07:35 AM, Jan Beulich wrote: >> --- a/xen/arch/x86/hvm/emulate.c >> >+++ b/xen/arch/x86/hvm/emulate.c >> >@@ -25,6 +25,8 @@ > >#include > >#include > > >> >+DEFINE_PERCPU_RWLOCK_GLOBAL(emulate_locked_rwlock); > You should try hard to make this static. On second though, this woul

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 08:56 AM, Razvan Cojocaru wrote: >>> --- a/xen/arch/x86/mm.c >>> >> +++ b/xen/arch/x86/mm.c >>> >> @@ -112,6 +112,7 @@ >> > >#include >> > >#include >> > >#include >>> >> +#incl

Re: [Xen-devel] [PATCH V2] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-14 Thread Razvan Cojocaru
On 04/13/2016 06:05 PM, Tamas K Lengyel wrote: > > > On Wed, Apr 13, 2016 at 9:01 AM, Andrew Cooper > mailto:andrew.coop...@citrix.com>> wrote: > > On 13/04/16 15:56, Razvan Cojocaru wrote: > > On 04/13/2016 05:52 PM, Tamas K Lengyel wrote: > &

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 01:35 PM, David Vrabel wrote: > On 13/04/16 13:26, Razvan Cojocaru wrote: >> LOCK-prefixed instructions are currenly allowed to run in parallel >> in x86_emulate(), which can lead the guest into an undefined state. >> This patch fixes the issue. > > I

Re: [Xen-devel] [PATCH V2] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 06:33 PM, Tamas K Lengyel wrote: > > > On Thu, Apr 14, 2016 at 9:20 AM, Jan Beulich <mailto:jbeul...@suse.com>> wrote: > > >>> Razvan Cojocaru <mailto:rcojoc...@bitdefender.com>> 04/14/16 11:37 AM >>> &

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 06:31 PM, Jan Beulich wrote: >>>> Razvan Cojocaru 04/14/16 10:50 AM >>> >> On 04/14/2016 07:35 AM, Jan Beulich wrote: >>>> --- a/xen/arch/x86/hvm/emulate.c >>>>> +++ b/xen/arch/x86/hvm/emulate.c

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 06:40 PM, Jan Beulich wrote: >>>> Razvan Cojocaru 04/14/16 1:43 PM >>> >> On 04/14/2016 01:35 PM, David Vrabel wrote: >>> On 13/04/16 13:26, Razvan Cojocaru wrote: >>>> LOCK-prefixed instructions are currenly allowed to run in parallel

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-14 Thread Razvan Cojocaru
On 04/14/2016 06:44 PM, Jan Beulich wrote: >>>>> Razvan Cojocaru 04/14/16 7:57 AM >>> >> On 04/14/16 07:35, Jan Beulich wrote: >>>>>> Razvan Cojocaru 04/13/16 7:53 PM >>> >>>> @@ -1589,6 +1591,8 @@ x86_emulate( >>

Re: [Xen-devel] [PATCH] monitor: Rename vm_event_monitor_get_capabilities to arch_monitor_get_capabilities

2016-04-14 Thread Razvan Cojocaru
On 04/14/16 19:33, Tamas K Lengyel wrote: > The monitor_get_capabilities check actually belongs to the monitor subsystem > so > relocating and renaming it to sanitize the code's name and location. > > Signed-off-by: Tamas K Lengyel > Cc: Razvan Cojocaru > Cc: Keir

[Xen-devel] [PATCH V3] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-15 Thread Razvan Cojocaru
. This replaces the previously posted "xen: Filter out MSR write events" patch. Signed-off-by: Razvan Cojocaru --- Changes since V2: - Bumped XEN_DOMCTL_INTERFACE_VERSION. - Introduced struct monitor_msr_bitmap as recommended by Andrew Cooper, which allowed removing some pointer

Re: [Xen-devel] [PATCH V3] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-15 Thread Razvan Cojocaru
On 04/15/16 12:02, Razvan Cojocaru wrote: > +else if ( (msr >= 0x8000) && (msr <= 0x80001fff) ) > +{ > +msr &= 0x1fff; > +__set_bit(msr, &d->arch.monitor_msr_bitmap->high); > +} This of course should be 0xc000 and 0xc

Re: [Xen-devel] [PATCH V3] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-15 Thread Razvan Cojocaru
On 04/15/16 20:12, Tamas K Lengyel wrote: > > > On Fri, Apr 15, 2016 at 3:02 AM, Razvan Cojocaru > mailto:rcojoc...@bitdefender.com>> wrote: > > Previously, subscribing to MSR write events was an all-or-none > approach, with special cases for introspection MSR

Re: [Xen-devel] [PATCH V3] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-15 Thread Razvan Cojocaru
On 04/15/16 20:38, Tamas K Lengyel wrote: > > > On Fri, Apr 15, 2016 at 11:19 AM, Razvan Cojocaru > mailto:rcojoc...@bitdefender.com>> wrote: > > On 04/15/16 20:12, Tamas K Lengyel wrote: > > > > > > On Fri, Apr 15, 2016 at 3:02

[Xen-devel] [PATCH V4] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-17 Thread Razvan Cojocaru
. This replaces the previously posted "xen: Filter out MSR write events" patch. Signed-off-by: Razvan Cojocaru Acked-by: Wei Liu --- Changes since V3: - Fixed high MSR range. - Added comment about where to find MSR indices to xenctrl.h. - Added Wei Liu's ack. --- tools/libxc/in

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-18 Thread Razvan Cojocaru
On 04/14/2016 07:08 PM, Jan Beulich wrote: >>>> Razvan Cojocaru 04/14/16 5:45 PM >>> >> On 04/14/2016 06:40 PM, Jan Beulich wrote: >>> To be honest, just having remembered that we do the write back for locked >>> instructions using CMPXCHG, I'd

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-19 Thread Razvan Cojocaru
On 04/18/2016 07:45 PM, Jan Beulich wrote: >>>> Razvan Cojocaru 04/18/16 2:40 PM >>> >> On 04/14/2016 07:08 PM, Jan Beulich wrote: >>>>>> Razvan Cojocaru 04/14/16 5:45 PM >>> >>>> On 04/14/2016 06:40 PM, Jan Beulich wrote: >&g

Re: [Xen-devel] [PATCH] xenaccess: minor fixes and extra printouts

2016-04-20 Thread Razvan Cojocaru
On 04/21/16 03:39, Tamas K Lengyel wrote: > Without specifying the altp2m flag on the response the view never got > switched. > Also, add extra information printouts that can be useful during debugging. > > Signed-off-by: Tamas K Lengyel > --- > Cc: Razvan Cojocaru > Cc

Re: [Xen-devel] [PATCH V4] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-22 Thread Razvan Cojocaru
On 04/22/16 21:07, Andrew Cooper wrote: > On 17/04/16 20:15, Razvan Cojocaru wrote: >> diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c >> index 56c5514..9c17f37 100644 >> --- a/xen/arch/x86/hvm/event.c >> +++ b/xen/arch/x86/hvm/event.c >> @@ -

[Xen-devel] [PATCH V5] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-26 Thread Razvan Cojocaru
. This replaces the previously posted "xen: Filter out MSR write events" patch. Signed-off-by: Razvan Cojocaru --- Changes since V4: - Added arch_monitor_init_domain() and arch_monitor_cleanup_domain() as suggested by Tamas Lengyel and Andrew Cooper. - Factored out common MSR ran

Re: [Xen-devel] [PATCH V5] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-26 Thread Razvan Cojocaru
On 04/26/2016 11:49 AM, Razvan Cojocaru wrote: > Previously, subscribing to MSR write events was an all-or-none > approach, with special cases for introspection MSR-s. This patch > allows the vm_event consumer to specify exactly what MSR-s it is > interested in, and as a side-effect

Re: [Xen-devel] [PATCH V5] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-26 Thread Razvan Cojocaru
On 04/26/2016 12:26 PM, Julien Grall wrote: > Hi Razvan, > > On 26/04/2016 09:49, Razvan Cojocaru wrote: >> diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c >> index 2906407..1ba12cb 100644 >> --- a/xen/common/vm_event.c >> +++ b/xen/common/vm_event.c &

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-26 Thread Razvan Cojocaru
On 04/26/16 19:03, George Dunlap wrote: > On 19/04/16 17:35, Jan Beulich wrote: >>>>> Razvan Cojocaru 04/19/16 1:01 PM >>> >>> I think this might be because the LOCK prefix should guarantee that the >>> instruction that follows it has exclusive use of

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-04-27 Thread Razvan Cojocaru
On 04/27/2016 09:22 AM, Jan Beulich wrote: >>>> On 26.04.16 at 19:23, wrote: >> On 04/26/16 19:03, George Dunlap wrote: >>> On 19/04/16 17:35, Jan Beulich wrote: >>>>>>> Razvan Cojocaru 04/19/16 1:01 PM >>> >>>>>

Re: [Xen-devel] [PATCH V5] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-27 Thread Razvan Cojocaru
On 04/26/2016 06:28 PM, Tamas K Lengyel wrote: > > > @@ -55,6 +61,9 @@ void vm_event_cleanup_domain(struct domain *d) > > v->arch.vm_event = NULL; > > } > > > > +xfree(d->arch.monitor_msr_bitmap); > > +d->arch.monitor_msr_bitmap = NULL; > > + >

[Xen-devel] [PATCH V6] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-27 Thread Razvan Cojocaru
vents" patch. Signed-off-by: Razvan Cojocaru --- Changes since V5: - Modified patch description to mention the new monitor functions. - Fixed duplicated xzalloc() / xfree() code. - Moved the monitor setup code (memset()s from vm_event_init_domain() to arch_monitor_init_domain(). - Now r

Re: [Xen-devel] [PATCH] x86/hvm: Add debug exception vm_events

2016-04-27 Thread Razvan Cojocaru
On 04/27/16 23:33, Tamas K Lengyel wrote: > Since in-guest debug exceptions are now unconditionally trapped to Xen, adding > a hook for vm_event subscribers to tap into this new always-on guest event. We > rename along the way hvm_event_breakpoint_type to hvm_event_type to better > match the variou

Re: [Xen-devel] [PATCH V6] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-28 Thread Razvan Cojocaru
On 04/29/16 05:44, Tian, Kevin wrote: >> From: Razvan Cojocaru [mailto:rcojoc...@bitdefender.com] >> Sent: Wednesday, April 27, 2016 3:48 PM >> + >> +static void *monitor_bitmap_for_msr(struct domain *d, u32 *msr) >> +{ >> +ASSERT(d->arch.monitor_msr_bit

[Xen-devel] [PATCH V7] vm_event: Allow subscribing to write events for specific MSR-s

2016-04-28 Thread Razvan Cojocaru
vents" patch. Signed-off-by: Razvan Cojocaru Acked-by: Wei Liu --- Changes since V6: - Fixed monitor_enable_msr() (thanks to Kevin Tian). - Added Wei Liu's ack. --- tools/libxc/include/xenctrl.h | 9 ++- tools/libxc/xc_monitor.c | 6 +- xen/arch/x86/hvm/event.c

[Xen-devel] Patch ping

2016-04-29 Thread Razvan Cojocaru
Hello, Just for my internal patch book-keeping, I assume this patch did not get into staging because of the code freeze and is planned for 4.8? http://lists.xen.org/archives/html/xen-devel/2016-04/msg01444.html Thanks, Razvan ___ Xen-devel mailing li

Re: [Xen-devel] [PATCH V3] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-04-29 Thread Razvan Cojocaru
On 04/09/16 08:54, Razvan Cojocaru wrote: > It is meaningless (and potentially dangerous - see > hvmemul_virtual_to_linear()) > to set mem_access_emulate_each_rep before xc_monitor_enable() (which allocates > vcpu->arch.vm_event) has been called, so return an

Re: [Xen-devel] [PATCH v2 2/5] vm_event: Implement ARM SMC events

2016-04-29 Thread Razvan Cojocaru
roducing the PRIVILEGED_CALL type. > > Signed-off-by: Tamas K Lengyel > --- > Cc: Razvan Cojocaru > Cc: Ian Jackson > Cc: Stefano Stabellini > Cc: Wei Liu > Cc: Julien Grall > Cc: Keir Fraser > Cc: Jan Beulich > Cc: Andrew Cooper > > v2: introduce VM

Re: [Xen-devel] [PATCH v2 2/5] vm_event: Implement ARM SMC events

2016-04-29 Thread Razvan Cojocaru
On 04/29/16 23:27, Tamas K Lengyel wrote: > > > > > > diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c > > index 2906407..a29bda8 100644 > > --- a/xen/common/vm_event.c > > +++ b/xen/common/vm_event.c > > @@ -818,7 +818,6 @@ int vm_event_mo

Re: [Xen-devel] [PATCH V3] x86/monitor: Disallow setting mem_access_emulate_each_rep when vm_event is NULL

2016-05-03 Thread Razvan Cojocaru
On 05/03/2016 11:14 AM, Jan Beulich wrote: >>>> On 29.04.16 at 18:12, wrote: >> On 04/09/16 08:54, Razvan Cojocaru wrote: >>> It is meaningless (and potentially dangerous - see >>> hvmemul_virtual_to_linear()) >>> to set mem_access_emula

Re: [Xen-devel] [PATCH v2 5/5] MAINTAINERS: Update monitor/vm_event covered code

2016-05-03 Thread Razvan Cojocaru
an and should. Thoughts? FWIW, I agree, and it's also appropriate to add: Acked-by: Razvan Cojocaru Thanks, Razvan ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-05-03 Thread Razvan Cojocaru
On 04/27/2016 10:14 AM, Razvan Cojocaru wrote: > On 04/27/2016 09:22 AM, Jan Beulich wrote: >>>>> On 26.04.16 at 19:23, wrote: >>> On 04/26/16 19:03, George Dunlap wrote: >>>> On 19/04/16 17:35, Jan Beulich wrote: >>>>>>>> Razvan Cojo

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-05-03 Thread Razvan Cojocaru
On 05/03/2016 05:30 PM, Jan Beulich wrote: On 03.05.16 at 16:20, wrote: >> I've kept experimenting with the patch but can't quite figure out why >> minimizing the lock scope to the writeback part would not be sufficient, >> but it isn't. >> >> I.e. with this code: >> >> 3824 writeback: >> 38

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-05-04 Thread Razvan Cojocaru
On 05/03/2016 06:13 PM, Jan Beulich wrote: On 03.05.16 at 16:41, wrote: >> On 05/03/2016 05:30 PM, Jan Beulich wrote: >> On 03.05.16 at 16:20, wrote: I've kept experimenting with the patch but can't quite figure out why minimizing the lock scope to the writeback part would not

Re: [Xen-devel] [PATCH v2 2/5] vm_event: Implement ARM SMC events

2016-05-04 Thread Razvan Cojocaru
On 05/04/2016 04:26 PM, Julien Grall wrote: > I may misunderstand some parts of the vm event subsystem. To get/set the > full set of registers, the user will have to use the > DOMCTL_{set,get}vcpucontext, correct? So why does Xen expose a part of > the vCPU context through the vm_event? Because DO

Re: [Xen-devel] [PATCH V7] vm_event: Allow subscribing to write events for specific MSR-s

2016-05-05 Thread Razvan Cojocaru
On 05/04/2016 05:45 PM, Jan Beulich wrote: On 29.04.16 at 08:03, wrote: >> --- a/xen/arch/x86/monitor.c >> +++ b/xen/arch/x86/monitor.c >> @@ -22,6 +22,104 @@ >> #include >> #include >> >> +int arch_monitor_init_domain(struct domain *d) >> +{ >> +if ( !d->arch.monitor_msr_bitmap ) >

Re: [Xen-devel] [for-4.7] x86/emulate: synchronize LOCKed instruction emulation

2016-05-05 Thread Razvan Cojocaru
On 05/04/2016 04:42 PM, Jan Beulich wrote: On 04.05.16 at 13:32, wrote: >> But while implementing a stub that falls back to the actual LOCK CMPXCHG >> and replacing hvm_copy_to_guest_virt() with it would indeed be an >> improvement (with the added advantage of being able to treat >> non-emula

Re: [Xen-devel] [PATCH v3 2/9] monitor: Don't call vm_event_fill_regs from common

2016-05-05 Thread Razvan Cojocaru
t_request as > monitor_guest_request from vm_event to monitor. > > Signed-off-by: Tamas K Lengyel > --- > Cc: Stefano Stabellini > Cc: Julien Grall > Cc: Jan Beulich > Cc: Andrew Cooper > Cc: Razvan Cojocaru > --- > xen/arch/arm/Makefile | 1 + > xen/arch/arm/h

Re: [Xen-devel] [PATCH v3 3/9] monitor: ARM SMC events

2016-05-05 Thread Razvan Cojocaru
c: Julien Grall > Cc: Razvan Cojocaru > > v3: Split parts off as separate patches > Union for arm32/64 register structs in vm_event > Cosmetic fixes > --- > xen/arch/arm/monitor.c| 49 > +++ > xen/arch/arm/tra

Re: [Xen-devel] [PATCH v3 6/9] tools/xen-access: add test-case for ARM SMC

2016-05-05 Thread Razvan Cojocaru
On 05/04/2016 05:51 PM, Tamas K Lengyel wrote: > Signed-off-by: Tamas K Lengyel > --- > Cc: Razvan Cojocaru > Cc: Ian Jackson > Cc: Wei Liu > --- > tools/tests/xen-access/xen-access.c | 32 ++-- > 1 file changed, 30 insertions(+), 2 deleti

Re: [Xen-devel] [PATCH v3 7/9] x86/hvm: Rename hvm/event to hvm/monitor

2016-05-05 Thread Razvan Cojocaru
On 05/04/2016 05:51 PM, Tamas K Lengyel wrote: > Mechanical renaming to better describe that the code in hvm/event is part of > the monitor subsystem. > > Signed-off-by: Tamas K Lengyel > Acked-by: Kevin Tian > --- > Cc: Jan Beulich > Cc: Andrew Cooper > Cc:

Re: [Xen-devel] [PATCH v3 9/9] MAINTAINERS: Update monitor/vm_event covered code

2016-05-05 Thread Razvan Cojocaru
gt; Cc: Tim Deegan > Cc: Wei Liu > --- > MAINTAINERS | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) Acked-by: Razvan Cojocaru ___ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH v3 8/9] x86/hvm: Add debug exception vm_events

2016-05-05 Thread Razvan Cojocaru
t; match the various events that can be passed with it. We also introduce the > necessary monitor_op domctl's to enable subscribing to the events. > > Signed-off-by: Tamas K Lengyel > --- > Cc: Ian Jackson > Cc: Wei Liu > Cc: Razvan Cojocaru > Cc: Jan Beulich >

Re: [Xen-devel] [PATCH V7] vm_event: Allow subscribing to write events for specific MSR-s

2016-05-05 Thread Razvan Cojocaru
On 05/04/2016 05:45 PM, Jan Beulich wrote: >> +*msr &= 0x1fff; >> > +return &d->arch.monitor_msr_bitmap->high; >> > + >> > +default: >> > +return NULL; >> > +} >> > +} >> > + >> > +static int monitor_enable_msr(struct domain *d, u32 msr) >> > +{ >> > +u32 *bitmap

[Xen-devel] [PATCH V8] vm_event: Allow subscribing to write events for specific MSR-s

2016-05-06 Thread Razvan Cojocaru
vents" patch. Signed-off-by: Razvan Cojocaru Acked-by: Wei Liu Acked-by: Kevin Tian --- Changes since V7: - Added Kevin Tian's ack. - Moved memset()s from arch_monitor_init_domain() to arch_monitor_cleanup_domain(), as suggested by Jan Beulich. - Now using sizeof() instead of

[Xen-devel] [PATCH V9] vm_event: Allow subscribing to write events for specific MSR-s

2016-05-06 Thread Razvan Cojocaru
vents" patch. Signed-off-by: Razvan Cojocaru Acked-by: Wei Liu Acked-by: Kevin Tian --- Changes since V8: - Now using DECLARE_BITMAP() for the monitor bitmaps. - Const-ified monitored_msr(). --- tools/libxc/include/xenctrl.h | 9 ++- tools/libxc/xc_monitor.c | 6 +- xe

Re: [Xen-devel] [PATCH] tests/xen-access: Added vm_event emulation tests

2017-04-14 Thread Razvan Cojocaru
On 04/14/2017 09:08 PM, Tamas K Lengyel wrote: > > > On Thu, Apr 13, 2017 at 4:20 AM, Razvan Cojocaru > mailto:rcojoc...@bitdefender.com>> wrote: > > On 04/12/2017 08:11 PM, Tamas K Lengyel wrote: > > > > > > On Mon

[Xen-devel] [PATCH V2] tests/xen-access: Added vm_event emulation tests

2017-04-15 Thread Razvan Cojocaru
ncomplete and has trouble with emulating competing writes in SMP scenarios, the new tests are only meant for debugging issues. Signed-off-by: Razvan Cojocaru --- Changes since V1: - Moved emulate_write and emulate_exec to the x86-only part of the code. - Stopped pointlessly setting after_fi

Re: [Xen-devel] [PATCH 1/2] tools: Use POSIX poll.h instead of sys/poll.h

2017-04-18 Thread Razvan Cojocaru
hanges. I don't think acks from Tamas > and George are strictly required. FWIW: Acked-by: Razvan Cojocaru Thanks, Razvan ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

Re: [Xen-devel] [PATCH 2/2] tools: Use POSIX signal.h instead of sys/signal.h

2017-04-18 Thread Razvan Cojocaru
695399/functions/signal.html >> >> This removes the warning: >> #warning redirecting incorrect #include to >> when building with the musl C-library. >> >> Signed-off-by: Alistair Francis > > Acked-by: Wei Liu FWIW: Acked-by: Razvan Cojocaru Thank

Re: [Xen-devel] [PATCH v2 3/4] VMX: don't blindly enable descriptor table exiting control

2017-04-18 Thread Razvan Cojocaru
On 04/18/2017 01:32 PM, Jan Beulich wrote: > This is an optional feature and hence we should check for it before > use. > > Signed-off-by: Jan Beulich > --- > v2: Re-do detection of availability, resulting in almost all of the > changes done here being different than in

[Xen-devel] [PATCH] x86/vm_event: fix race between vmx_vmexit_handler() and vm_event_resume()

2017-04-27 Thread Razvan Cojocaru
ent). Signed-off-by: Razvan Cojocaru Signed-off-by: Andrew Cooper --- xen/arch/x86/hvm/hvm.c | 35 +++ xen/arch/x86/vm_event.c| 22 ++ xen/common/vm_event.c | 14 +++--- xen/include/asm-x86/vm_event.h | 2 ++ 4 fi

Re: [Xen-devel] [PATCH] x86/vm_event: fix race between vmx_vmexit_handler() and vm_event_resume()

2017-04-27 Thread Razvan Cojocaru
On 04/27/17 11:01, Jan Beulich wrote: On 27.04.17 at 09:22, wrote: >> The introspection agent can reply to a vm_event faster than >> vmx_vmexit_handler() can complete in some cases, where it is then >> not safe for vm_event_set_registers() to modify v->arch.user_regs. > > This needs more exp

Re: [Xen-devel] [PATCH] x86/vm_event: fix race between vmx_vmexit_handler() and vm_event_resume()

2017-04-27 Thread Razvan Cojocaru
On 04/27/17 11:18, Jan Beulich wrote: On 27.04.17 at 10:11, wrote: >> On 04/27/17 11:01, Jan Beulich wrote: >> On 27.04.17 at 09:22, wrote: --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -473,6 +473,39 @@ static bool hvm_get_pending_event(struct vcpu *v, >>>

Re: [Xen-devel] [PATCH] x86/vm_event: fix race between vmx_vmexit_handler() and vm_event_resume()

2017-04-27 Thread Razvan Cojocaru
On 04/27/17 12:00, Jan Beulich wrote: On 27.04.17 at 10:34, wrote: >> On 04/27/17 11:18, Jan Beulich wrote: >> On 27.04.17 at 10:11, wrote: On 04/27/17 11:01, Jan Beulich wrote: On 27.04.17 at 09:22, wrote: >> --- a/xen/arch/x86/hvm/hvm.c >> +++ b/xen/arch/x86/hvm/

Re: [Xen-devel] [PATCH] x86/vm_event: fix race between vmx_vmexit_handler() and vm_event_resume()

2017-04-27 Thread Razvan Cojocaru
On 04/28/2017 09:25 AM, Jan Beulich wrote: On 27.04.17 at 19:31, wrote: >> On 27/04/17 09:52, Jan Beulich wrote: >> On 27.04.17 at 10:34, wrote: On 27/04/2017 09:01, Jan Beulich wrote: On 27.04.17 at 09:22, wrote: >> --- a/xen/common/vm_event.c >> +++ b/xen/common/

Re: [Xen-devel] [RFC PATCH 4/4] arm/mem_access: Add software guest-page-table walk

2017-05-01 Thread Razvan Cojocaru
n might fail, as gva_to_ipa uses the > guest's translation tables, access to which might be restricted by the > active VTTBR. To address this issue, we perform the gva to ipa > translation in software. > > Signed-off-by: Sergej Proskurin > --- > Cc: Razvan Cojocaru

[Xen-devel] [PATCH] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
c on CPU 5: (XEN) FATAL PAGE FAULT (XEN) [error_code=] (XEN) Faulting linear address: 830492cbb447 (XEN) **** Reported-by: Razvan Cojocaru Signed-off-by: Andrew Cooper Signed-off-by: Razvan Cojocaru Tested-by: Razvan Cojocaru --- xen/common/hvm/save.c |

Re: [Xen-devel] [PATCH] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
On 05/02/17 16:41, Tim Deegan wrote: > Hi, > > At 16:25 +0300 on 02 May (1493742339), Razvan Cojocaru wrote: >> hvm_save_cpu_ctxt() does a memset(&ctxt, 0, sizeof(ctxt)), which >> can lead to ctxt.cur being 0. This can then crash the hypervisor >> (with FATAL PAGE F

Re: [Xen-devel] [PATCH] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
On 05/02/17 16:48, Jan Beulich wrote: On 02.05.17 at 15:25, wrote: >> hvm_save_cpu_ctxt() does a memset(&ctxt, 0, sizeof(ctxt)), which >> can lead to ctxt.cur being 0. This can then crash the hypervisor >> (with FATAL PAGE FAULT) in hvm_save_one() via the >> "off < (ctxt.cur - sizeof(*desc))"

Re: [Xen-devel] [PATCH] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
On 05/02/17 17:09, Jan Beulich wrote: On 02.05.17 at 15:54, wrote: >> On 05/02/17 16:48, Jan Beulich wrote: >> On 02.05.17 at 15:25, wrote: --- a/xen/common/hvm/save.c +++ b/xen/common/hvm/save.c @@ -113,7 +113,7 @@ int hvm_save_one(struct domain *d, uint16_t typecode, >>

[Xen-devel] [PATCH V2] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
ff830492cbb447 (XEN) Reported-by: Razvan Cojocaru Signed-off-by: Andrew Cooper Signed-off-by: Razvan Cojocaru Tested-by: Razvan Cojocaru --- Changes since V1: - Corrected patch description. - Now checking whether the function got back any data at all, prior to

Re: [Xen-devel] [PATCH V2] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
(XEN) >> (XEN) Pagetable walk from 830492cbb447: >> (XEN) L4[0x106] = dbc36063 >> (XEN) L3[0x012] = >> (XEN) >> (XEN) >> (XEN) Panic on CPU 5: >> (XEN) FATAL PAGE FAULT >> (XEN) [error_

Re: [Xen-devel] [PATCH V2] xen/hvm: fix hypervisor crash with hvm_save_one()

2017-05-02 Thread Razvan Cojocaru
On 05/02/2017 07:11 PM, Andrew Cooper wrote: > On 02/05/17 17:02, Tim Deegan wrote: >> At 18:21 +0300 on 02 May (1493749307), Razvan Cojocaru wrote: >>> hvm_save_cpu_ctxt() returns success without writing any data into >>> hvm_domain_context_t when all VCPUs are o

[Xen-devel] [PATCH V2 0/2] Fix vm_event resume path race condition

2017-05-03 Thread Razvan Cojocaru
This small series first creates hvm/vm_event.{h,c}, in order to bring under vm_event maintainership the code that has previously lived in hvm_do_resume(), and then fixes a __context_switch()-related race condition when attempting to set registers via vm_event reply. Previously this has been a sing

[Xen-devel] [PATCH V2 2/2] x86/vm_event: fix race between __context_switch() and vm_event_resume()

2017-05-03 Thread Razvan Cojocaru
dditionally removes the sync_vcpu_execstate(v) call from vm_event_resume(), which is no longer necessary, which removes the associated broadcast TLB flush (read: performance improvement). Signed-off-by: Razvan Cojocaru Signed-off-by: Andrew Cooper --- xen/arch/x86/hvm/vm_even

  1   2   3   4   5   6   7   8   9   >