Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-07 Thread Corneliu ZUZU
On 3/7/2016 11:12 AM, Tamas K Lengyel wrote: EPT is not really required for CR3 monitoring, it just has been the case that vm_events have been only implemented for hap-enabled domains. I suppose this is not valid for vm-events in their entirety, right? I mean it seems to me that @ least for

Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-07 Thread Corneliu ZUZU
On 3/3/2016 4:10 PM, Corneliu ZUZU wrote: Then, QUESTIONS (FOR VM-EVENTS & ARM MAINTAINERS ESPECIALLY): Q1) [...] Q2) [...] Q3) [...] Q4) [...] Hey all, I have a question relating to this part of code @ vmx_update_guest_cr: if ( paging_mode_hap(v->

Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-04 Thread Corneliu ZUZU
On 3/3/2016 4:10 PM, Corneliu ZUZU wrote: Then, QUESTIONS (FOR VM-EVENTS & ARM MAINTAINERS ESPECIALLY): Q1) [...] Q2) [...] Q3) [...] Q4) [...] JSYK, I've realized I can find the answer for these easily (besides Q2, for which Razvan already gave feedback) with some tests (as soon

Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-03 Thread Corneliu ZUZU
On 3/3/2016 8:51 PM, Razvan Cojocaru wrote: On 03/03/2016 08:04 PM, Corneliu ZUZU wrote: On 3/3/2016 6:15 PM, Razvan Cojocaru wrote: On 03/03/2016 04:10 PM, Corneliu ZUZU wrote: Q2) About VM_EVENT_FLAG_DENY Q2.1) Doesn't it require sync = 1 (i.e. the vcpu to be paused) to work

Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-03 Thread Corneliu ZUZU
On 3/3/2016 6:15 PM, Razvan Cojocaru wrote: On 03/03/2016 04:10 PM, Corneliu ZUZU wrote: Q2) About VM_EVENT_FLAG_DENY Q2.1) Doesn't it require sync = 1 (i.e. the vcpu to be paused) to work? If so, shouldn't we call vm_event_register_write_resume only after checking

Re: [Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-03 Thread Corneliu ZUZU
On 3/3/2016 4:10 PM, Corneliu ZUZU wrote: The patch was currently tested on an ARMv8 (CONFIG_ARM_64) machine (after applying a fix I'll send soon). Shannon beat me to it with the fix ;) See "[PATCH] arm/timer: fix panic when booting with DT".

[Xen-devel] [PATCH 1/1] arm/monitor vm-events: implement write-ctrlreg support

2016-03-03 Thread Corneliu ZUZU
TCR_EL1 Trapping of write operations for these registers was attained by setting the HCR_EL2.TVM / HCR.TVM bit. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/arm/p2m.c | 5 + xen/arch/arm/traps.c| 128 +- xen/arch/x86/hvm/e

[Xen-devel] [PATCH 0/1] ARM: Implement support for write-ctrlreg vm-events

2016-03-03 Thread Corneliu ZUZU
list of registers that cause HYP traps on write when the HCR.TVM bit is set. Is that correct? If so, should I surround parts relevant to them in this changeset w/ CONFIG_ARM_64? Corneliu ZUZU (1): arm/monitor vm-events: implement write-ctrlreg support xen/arch/arm/p2m.c |

[Xen-devel] [PATCH v3] arm/monitor vm-events: Implement guest-request support

2016-02-28 Thread Corneliu ZUZU
_init_domain (does nothing), vm_event_cleanup_domain == Misc: * vm_event_fill_regs, no longer X86-specific. ARM-side implementation of this function currently does nothing, that will be added in a separate patch. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Acked-by: Jan Beulich

Re: [Xen-devel] [PATCH v2] arm/monitor vm-events: Implement guest-request support

2016-02-26 Thread Corneliu ZUZU
On 2/26/2016 2:31 PM, Jan Beulich wrote: On 26.02.16 at 13:20, <cz...@bitdefender.com> wrote: On 2/26/2016 2:14 PM, Razvan Cojocaru wrote: On 02/26/2016 02:05 PM, Corneliu ZUZU wrote: On 2/26/2016 1:56 PM, Jan Beulich wrote: On 26.02.16 at 12:07, <cz...@bitdefender.com> wrote

Re: [Xen-devel] [PATCH v2] arm/monitor vm-events: Implement guest-request support

2016-02-26 Thread Corneliu ZUZU
On 2/26/2016 2:14 PM, Razvan Cojocaru wrote: On 02/26/2016 02:05 PM, Corneliu ZUZU wrote: On 2/26/2016 1:56 PM, Jan Beulich wrote: On 26.02.16 at 12:07, <cz...@bitdefender.com> wrote: --- a/xen/include/asm-x86/altp2m.h +++ b/xen/include/asm-x86/altp2m.h @@ -15,8 +15,8 @@ * this p

Re: [Xen-devel] [PATCH v2] arm/monitor vm-events: Implement guest-request support

2016-02-26 Thread Corneliu ZUZU
On 2/26/2016 1:56 PM, Jan Beulich wrote: On 26.02.16 at 12:07, wrote: --- a/xen/include/asm-x86/altp2m.h +++ b/xen/include/asm-x86/altp2m.h @@ -15,8 +15,8 @@ * this program; If not, see . */ -#ifndef _X86_ALTP2M_H -#define

[Xen-devel] [PATCH v2] arm/monitor vm-events: Implement guest-request support

2016-02-26 Thread Corneliu ZUZU
_init_domain (does nothing), vm_event_cleanup_domain == Misc: * vm_event_fill_regs, no longer X86-specific. ARM-side implementation of this function currently does nothing, that will be added in a separate patch. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-22 Thread Corneliu ZUZU
On 2/22/2016 12:14 PM, Jan Beulich wrote: On 19.02.16 at 19:01, wrote: On 2/19/2016 7:15 PM, Jan Beulich wrote: On 19.02.16 at 17:25, wrote: On 2/19/2016 4:26 PM, Jan Beulich wrote: On 18.02.16 at 20:35, wrote: ---

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 8:42 PM, Tamas K Lengyel wrote: On Fri, Feb 19, 2016 at 11:33 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: On 2/19/2016 8:27 PM, Tamas K Lengyel wrote: On Fri, Feb 19, 2016 at 11:11 AM, Corneliu ZUZU <cz...@

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 8:27 PM, Tamas K Lengyel wrote: On Fri, Feb 19, 2016 at 11:11 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: On 2/19/2016 7:54 PM, Tamas K Lengyel wrote: On Fri, Feb 19, 2016 at 10:47 AM, Stefano Stabellini <

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 7:54 PM, Tamas K Lengyel wrote: On Fri, Feb 19, 2016 at 10:47 AM, Stefano Stabellini <stefano.stabell...@eu.citrix.com <mailto:stefano.stabell...@eu.citrix.com>> wrote: On Fri, 19 Feb 2016, Corneliu ZUZU wrote: > On 2/19/2016 6:05 PM, Andrew Cooper wrote

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 7:15 PM, Jan Beulich wrote: On 19.02.16 at 17:25, wrote: On 2/19/2016 4:26 PM, Jan Beulich wrote: On 18.02.16 at 20:35, wrote: --- MAINTAINERS | 1 + xen/arch/arm/hvm.c | 8 +++

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 6:02 PM, Tamas K Lengyel wrote: On Fri, Feb 19, 2016 at 7:26 AM, Jan Beulich > wrote: >>> On 18.02.16 at 20:35, > wrote: > --- > MAINTAINERS | 1

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 4:26 PM, Jan Beulich wrote: On 18.02.16 at 20:35, wrote: --- MAINTAINERS | 1 + xen/arch/arm/hvm.c | 8 +++ xen/arch/x86/hvm/event.c| 116 ++-- xen/arch/x86/hvm/hvm.c

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 6:05 PM, Andrew Cooper wrote: On 19/02/16 16:00, Stefano Stabellini wrote: On Fri, 19 Feb 2016, Corneliu ZUZU wrote: On 2/19/2016 3:49 PM, Stefano Stabellini wrote: On Thu, 18 Feb 2016, Corneliu ZUZU wrote: + +if ( sync ) +{ +req->fl

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-19 Thread Corneliu ZUZU
On 2/19/2016 3:49 PM, Stefano Stabellini wrote: On Thu, 18 Feb 2016, Corneliu ZUZU wrote: + +if ( sync ) +{ +req->flags |= VM_EVENT_FLAG_VCPU_PAUSED; +vm_event_vcpu_pause(v); +} + +#if CONFIG_X86 +if ( altp2m_active(d) ) I would rather #define altp2m_activ

Re: [Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-18 Thread Corneliu ZUZU
On 2/18/2016 11:25 PM, Tamas K Lengyel wrote: On Thu, Feb 18, 2016 at 1:08 PM, Razvan Cojocaru <rcojoc...@bitdefender.com <mailto:rcojoc...@bitdefender.com>> wrote: On 02/18/2016 09:35 PM, Corneliu ZUZU wrote: > This patch adds ARM support for guest-request mo

[Xen-devel] [PATCH] arm/monitor vm-events: Implement guest-request support

2016-02-18 Thread Corneliu ZUZU
ded in a separate patch. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- MAINTAINERS | 1 + xen/arch/arm/hvm.c | 8 +++ xen/arch/x86/hvm/event.c| 116 ++-- xen/arch/x86/hvm/hvm.c | 1 + xen

[Xen-devel] [PATCH] x86/monitor: minor left-shift undefined behavior checks

2016-02-18 Thread Corneliu ZUZU
This minor patch adds a range-check to avoid left-shift caused undefined behavior. Also replaces '1 <<' w/ '1U <<' @ x86 monitor.h in an effort to avoid a future potential '1 << 31' that would cause a similar issue. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> ---

[Xen-devel] [PATCH] x86/hvm_event: fix uninitialized struct field usage introduced by c/s f5365e6

2016-02-18 Thread Corneliu ZUZU
Initializes req @ hvm_event_breakpoint entry. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/event.c b/xen/arch/x86/hvm/event.c index 874a36c..cb9c152 100644 --- a/xen/a

Re: [Xen-devel] Uninitialized variables in hvm_event_breakpoint (Re: New Defects reported by Coverity Scan for XenProject)

2016-02-18 Thread Corneliu ZUZU
been introduced by: commit 557c7873f35aa39bd84977b28948457b1b342f92 Author: Corneliu ZUZU <czuzu@bitdef ender.com> Date: Mon Feb 15 14:14:16 2016 +0100 x86: merge 2 hvm_event_... functions into 1 This patch merges almost identical fun

Re: [Xen-devel] [PATCH v5 0/2] Vm-events: move monitor vm-events code to common-side.

2016-02-17 Thread Corneliu ZUZU
On 2/17/2016 5:09 PM, Konrad Rzeszutek Wilk wrote: On Wed, Feb 17, 2016 at 09:33:58AM +0200, Corneliu ZUZU wrote: This patch series is an attempt to move some of the monitor vm-events code to the common-side. Done to make it easier to move additional parts that can be moved to common when ARM

Re: [Xen-devel] EXTRA_CFLAGS when compiling Xen

2016-02-17 Thread Corneliu ZUZU
On 2/17/2016 3:54 PM, Jan Beulich wrote: On 17.02.16 at 14:11, wrote: On 2/17/2016 2:43 PM, Jan Beulich wrote: On 17.02.16 at 13:09, wrote: On 2/17/2016 12:34 PM, Jan Beulich wrote: The reason I need this is to pass '-save-temps' to GCC, I want

Re: [Xen-devel] EXTRA_CFLAGS when compiling Xen

2016-02-17 Thread Corneliu ZUZU
On 2/17/2016 2:43 PM, Jan Beulich wrote: On 17.02.16 at 13:09, wrote: On 2/17/2016 12:34 PM, Jan Beulich wrote: The reason I need this is to pass '-save-temps' to GCC, I want to inspect some code and it would be easier to do that on the preprocessed files. ... there's

Re: [Xen-devel] EXTRA_CFLAGS when compiling Xen

2016-02-17 Thread Corneliu ZUZU
On 2/17/2016 12:34 PM, Jan Beulich wrote: The reason I need this is to pass '-save-temps' to GCC, I want to inspect some code and it would be easier to do that on the preprocessed files. ... there's absolutely no need to for a case like this, at least as long as the xen/ subtree is where you

Re: [Xen-devel] EXTRA_CFLAGS when compiling Xen

2016-02-17 Thread Corneliu ZUZU
On 2/17/2016 12:23 PM, Razvan Cojocaru wrote: Could anyone tell me if and how I could pass some GCC extra compilation flags when building Xen (i.e. make dist-xen)? I tried: * when running make: passing EXTRA_CFLAGS * when running make: passing CFLAGS (this "works" but overrides the rest of the

[Xen-devel] EXTRA_CFLAGS when compiling Xen

2016-02-17 Thread Corneliu ZUZU
Hi all, Could anyone tell me if and how I could pass some GCC extra compilation flags when building Xen (i.e. make dist-xen)? I tried: * when running make: passing EXTRA_CFLAGS * when running make: passing CFLAGS (this "works" but overrides the rest of the CFLAGS) * when running ./configure:

[Xen-devel] [PATCH v5 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-16 Thread Corneliu ZUZU
g. X86-side handles XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP op * add arch-side monitor event handling function => arch_monitor_domctl_event. e.g. X86-side handles XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR event enable/disable * remove status_check Signed-off-by: Corneliu ZUZU <cz...@bitdefende

[Xen-devel] [PATCH v5 1/2] xen/arm: fix file comments

2016-02-16 Thread Corneliu ZUZU
Add file header comment and local variable block @ EOF of xen/arch/arm/hvm.c. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Acked-by: Stefano Stabellini <stefano.stabell...@eu.citrix.com> --- Changed since v4: --- xen/arch/arm/hvm.c | 29 - 1 file

[Xen-devel] [PATCH v5 0/2] Vm-events: move monitor vm-events code to common-side.

2016-02-16 Thread Corneliu ZUZU
ollow after review of this patch-series. --- Changed since v4: 1/2: nothing changed 2/2: arch_monitor_domctl_event: replaced !old_status w/ requested_status (equivalent but more readable) Corneliu ZUZU (2): xen/arm: fix file comments xen/vm-events: Move parts of monitor_domctl c

Re: [Xen-devel] [PATCH v4 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-16 Thread Corneliu ZUZU
On 2/16/2016 6:02 PM, Tamas K Lengyel wrote: @@ -143,77 +72,75 @@ int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop) case XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR: { So since we will now have two separate booleans, requested_status and old_status

Re: [Xen-devel] [PATCH v4 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-16 Thread Corneliu ZUZU
On 2/16/2016 2:34 PM, Jan Beulich wrote: On 16.02.16 at 12:20, <cz...@bitdefender.com> wrote: On 2/16/2016 12:45 PM, Jan Beulich wrote: On 16.02.16 at 09:13, <cz...@bitdefender.com> wrote: On 2/16/2016 9:08 AM, Corneliu ZUZU wrote: This patch moves monitor_domctl to common-s

Re: [Xen-devel] [PATCH v4 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-16 Thread Corneliu ZUZU
On 2/16/2016 12:45 PM, Jan Beulich wrote: On 16.02.16 at 09:13, <cz...@bitdefender.com> wrote: On 2/16/2016 9:08 AM, Corneliu ZUZU wrote: This patch moves monitor_domctl to common-side. Purpose: move what's common to common, prepare for implementation of such vm-events on ARM.

Re: [Xen-devel] [PATCH v4 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-16 Thread Corneliu ZUZU
On 2/16/2016 9:08 AM, Corneliu ZUZU wrote: This patch moves monitor_domctl to common-side. Purpose: move what's common to common, prepare for implementation of such vm-events on ARM. * move get_capabilities to arch-side => arch_monitor_get_capabilities. * add arch-side monitor op handl

[Xen-devel] [PATCH v4 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
g. X86-side handles XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP op * add arch-side monitor event handling function => arch_monitor_domctl_event. e.g. X86-side handles XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR event enable/disable * remove status_check Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com&g

[Xen-devel] [PATCH v4 0/2] Vm-events: move monitor vm-events code to common-side.

2016-02-15 Thread Corneliu ZUZU
This patch series is an attempt to move some of the monitor vm-events code to the common-side. Done to make it easier to move additional parts that can be moved to common when ARM-side implementations are to be added. Patches summary: 1. Fix file comment Acked-by: Stefano Stabellini

[Xen-devel] [PATCH v4 1/2] xen/arm: fix file comments

2016-02-15 Thread Corneliu ZUZU
Add file header comment and local variable block @ EOF of xen/arch/arm/hvm.c. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Acked-by: Stefano Stabellini <stefano.stabell...@eu.citrix.com> --- Changed since v2 (mistakenly not included in v3): --- xen/arch/ar

Re: [Xen-devel] [PATCH v3 1/2] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 7:47 PM, Tamas K Lengyel wrote: On Mon, Feb 15, 2016 at 10:40 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: On 2/15/2016 10:30 AM, Razvan Cojocaru wrote: On 02/15/2016 08:35 AM, Corneliu ZUZU wrote: This

Re: [Xen-devel] [PATCH v3 1/2] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 10:30 AM, Razvan Cojocaru wrote: On 02/15/2016 08:35 AM, Corneliu ZUZU wrote: This patch merges almost identical functions hvm_event_int3 and hvm_event_single_step into a single function called hvm_event_breakpoint. Also fixes event.c file header comment in the process. Signed-off

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 6:51 PM, Tamas K Lengyel wrote: On Mon, Feb 15, 2016 at 9:44 AM, Jan Beulich > wrote: >>> On 15.02.16 at 17:28, > wrote: > On 2/15/2016 4:08 PM, Jan Beulich wrote: >>

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 4:08 PM, Jan Beulich wrote: After changing 1 to 1U though, I don't understand why we should also range-check mop->event. I'm imagining when (mop->event > 31): * (1U << mop->event) = 0 or >= (0x1 + 0x) (?) No, it's plain undefined. Weirdo C, didn't know that! I've just

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 2:44 PM, Jan Beulich wrote: switch ( mop->op ) { case XEN_DOMCTL_MONITOR_OP_ENABLE: case XEN_DOMCTL_MONITOR_OP_DISABLE: /* Check if event type is available. */ if ( unlikely(!(arch_monitor_get_capabilities(d) & (1 << mop->event))) )

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 2:25 PM, Stefano Stabellini wrote: On Mon, 15 Feb 2016, Jan Beulich wrote: On 15.02.16 at 07:37, wrote: default: -return -EOPNOTSUPP; +/* + * Should not be reached unless arch_monitor_get_capabilities() is not + *

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 1:41 PM, Jan Beulich wrote: +++ b/xen/include/xen/monitor.h @@ -0,0 +1,30 @@ +/* + * include/xen/monitor.h + * + * Common monitor_op domctl handler. + * + * Copyright (c) 2015 Tamas K Lengyel (ta...@tklengyel.com) + * Copyright (c) 2016, Bitdefender S.R.L. + * + * This program is

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 1:41 PM, Jan Beulich wrote: On 15.02.16 at 07:37, wrote: default: -return -EOPNOTSUPP; +/* + * Should not be reached unless arch_monitor_get_capabilities() is not + * properly implemented. In that case, since reaching

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 8:37 AM, Corneliu ZUZU wrote: diff --git a/xen/common/monitor.c b/xen/common/monitor.c new file mode 100644 index 000..b708cab --- /dev/null +++ b/xen/common/monitor.c +int rc; +bool_t requested_status = 0; + +if ( unlikely(current->domain == d) ) /* no domain_pa

[Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-14 Thread Corneliu ZUZU
g. X86-side handles XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP op * add arch-side monitor event handling function => arch_monitor_domctl_event. e.g. X86-side handles XEN_DOMCTL_MONITOR_EVENT_MOV_TO_MSR event enable/disable * remove status_check Signed-off-by: Corneliu ZUZU <cz...@bit

[Xen-devel] [PATCH v3 1/2] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-14 Thread Corneliu ZUZU
This patch merges almost identical functions hvm_event_int3 and hvm_event_single_step into a single function called hvm_event_breakpoint. Also fixes event.c file header comment in the process. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/event.c

[Xen-devel] [PATCH v3 0/2] Vm-events: move monitor vm-events code to common-side.

2016-02-14 Thread Corneliu ZUZU
This patch series is an attempt to move some of the monitor vm-events code to the common-side. Done to make it easier to move additional parts that can be moved to common when ARM-side implementations are to be added. Patches summary: 1. Merge almost identical functions hvm_event_int3 +

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-12 Thread Corneliu ZUZU
On 2/12/2016 8:05 AM, Corneliu ZUZU wrote: On 2/11/2016 5:44 PM, Tamas K Lengyel wrote: * the #ifdefs make it possible for that code to be put in common => that makes it *clear* that those code parts are NOT architecture specific and their implementation can be safely u

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-11 Thread Corneliu ZUZU
On 2/11/2016 5:44 PM, Tamas K Lengyel wrote: * the #ifdefs make it possible for that code to be put in common => that makes it *clear* that those code parts are NOT architecture specific and their implementation can be safely used for all architectures. The current practice

[Xen-devel] [PATCH v2 0/7] Vm-events: move monitor vm-events code to common-side.

2016-02-10 Thread Corneliu ZUZU
This patch series is an attempt to move (most) of the monitor vm-events code to the common-side. Patches summary: 1. Minor file-comment fix 2. Merge almost identical functions hvm_event_int3 + hvm_event_single_step -> hvm_event_breakpoint. 3. Add Kconfigs: HAS_VM_EVENT_WRITE_CTRLREG,

[Xen-devel] [PATCH v2 1/7] xen/arm: fix file comments

2016-02-10 Thread Corneliu ZUZU
Add file header comment and local variable block @ EOF of xen/arch/arm/hvm.c. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/arm/hvm.c | 29 - 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm

[Xen-devel] [PATCH v2 5/7] xen/vm-events: Move hvm_event_* functions to common-side.

2016-02-10 Thread Corneliu ZUZU
implement: arch_hvm_event_fill_regs, arch_hvm_event_gfn_of_ip and hvm_event_msr (X86 side only) Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/Makefile| 2 +- xen/arch/x86/hvm/event_x86.c | 51 xen/arc

[Xen-devel] [PATCH v2 2/7] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-10 Thread Corneliu ZUZU
This patch merges almost identical functions hvm_event_int3 and hvm_event_single_step into a single function called hvm_event_breakpoint. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/event.c| 76 +++-- xen/arch/x86/h

[Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-10 Thread Corneliu ZUZU
sm-arm/monitor_arch.h (renamed to monitor.h in next commit, reason is the same as @ (3.). # define/implement: arch_monitor_get_capabilities, arch_monitor_domctl_op and arch_monitor_domctl_event Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch

[Xen-devel] [PATCH v2 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h

2016-02-10 Thread Corneliu ZUZU
Rename: - arch/x86/monitor_x86.c -> arch/x86/monitor.c - asm-{x86,arm}/monitor_arch.h -> asm-{x86,arm}/monitor.h (previous commit explains why these renames were necessary) Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/Makefile

Re: [Xen-devel] [PATCH v2 2/7] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:18 PM, Jan Beulich wrote: On 10.02.16 at 16:50, wrote: @@ -151,61 +154,52 @@ void hvm_event_guest_request(void) } } -int hvm_event_int3(unsigned long rip) +static inline +uint64_t gfn_of_rip(unsigned long rip) This should be a single line and

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:26 PM, Jan Beulich wrote: On 10.02.16 at 16:52, wrote: xen/arch/x86/Kconfig | 4 + xen/arch/x86/Makefile | 2 +- xen/arch/x86/hvm/event.c | 2 +-

Re: [Xen-devel] [PATCH v2 7/7] xen/vm-events: move arch_domain.monitor bits to common

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:29 PM, Jan Beulich wrote: On 10.02.16 at 17:00, wrote: +#if CONFIG_HAS_VM_EVENT_GUEST_REQUEST +uint8_t guest_request_enabled : 1; +uint8_t guest_request_sync : 1; +#endif // HAS_VM_EVENT_GUEST_REQUEST +} monitor; };

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:39 PM, Tamas K Lengyel wrote: On Wed, Feb 10, 2016 at 8:52 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: 1. Kconfig: * Added Kconfigs for common monitor vm-events: # see files: common/Kconfig,

[Xen-devel] [PATCH v2 6/7] Rename event_x86.c to event.c and event_arch.h to event.h + minor fixes

2016-02-10 Thread Corneliu ZUZU
h: fix comment & change hvm_event_crX first param name to a more descriptive one Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/Makefile | 2 +- xen/arch/x86/hvm/{event_x86.c => event.c} | 2 +- xen

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:30 PM, Jan Beulich wrote: On 10.02.16 at 17:26, wrote: On 10.02.16 at 16:52, wrote: xen/arch/x86/Kconfig | 4 + xen/arch/x86/Makefile | 2 +- xen/arch/x86/hvm/event.c

[Xen-devel] [PATCH v2 7/7] xen/vm-events: move arch_domain.monitor bits to common

2016-02-10 Thread Corneliu ZUZU
across architectures. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/vmx/vmcs.c | 4 ++-- xen/common/hvm/event.c | 12 ++-- xen/common/monitor.c | 17 +++-- xen/include/asm-x86/domain.h | 16 ++-- xen/include/xen/s

Re: [Xen-devel] [PATCH v2 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 7:16 PM, Jan Beulich wrote: On 10.02.16 at 17:44, <ta...@tklengyel.com> wrote: On Wed, Feb 10, 2016 at 8:54 AM, Corneliu ZUZU <cz...@bitdefender.com> wrote: Rename: - arch/x86/monitor_x86.c -> arch/x86/monitor.c - asm-{x86,arm}/monitor_arch.h -> asm-{

Re: [Xen-devel] [PATCH v2 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:44 PM, Tamas K Lengyel wrote: On Wed, Feb 10, 2016 at 8:54 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: Rename: - arch/x86/monitor_x86.c -> arch/x86/monitor.c - asm-{x86,arm}/monitor_arch.h -> asm-{

Re: [Xen-devel] [PATCH v2 2/7] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 7:11 PM, Jan Beulich wrote: On 10.02.16 at 18:04, wrote: On 2/10/2016 6:18 PM, Jan Beulich wrote: On 10.02.16 at 16:50, wrote: --- a/xen/include/asm-x86/hvm/event.h +++ b/xen/include/asm-x86/hvm/event.h @@ -17,6 +17,12 @@ #ifndef

Re: [Xen-devel] [PATCH v2 2/7] xen/x86: merge 2 hvm_event_... functions into 1

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 7:11 PM, Jan Beulich wrote: On 10.02.16 at 18:04, wrote: On 2/10/2016 6:18 PM, Jan Beulich wrote: On 10.02.16 at 16:50, wrote: --- a/xen/include/asm-x86/hvm/event.h +++ b/xen/include/asm-x86/hvm/event.h @@ -17,6 +17,12 @@ #ifndef

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 7:56 PM, Tamas K Lengyel wrote: On Wed, Feb 10, 2016 at 10:34 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: On 2/10/2016 6:39 PM, Tamas K Lengyel wrote: diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig

Re: [Xen-devel] [PATCH v2 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-10 Thread Corneliu ZUZU
On 2/10/2016 6:39 PM, Tamas K Lengyel wrote: I think it would be better if this function just had a single rc instead of two (not passing one rc as a pointer on input). Good point. Would it be ok if: * I remove the rc param * make return type int * rc = 0 if arch-side didn't handle the event,

Re: [Xen-devel] [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c

2016-02-09 Thread Corneliu ZUZU
On 2/9/2016 7:40 PM, Tamas K Lengyel wrote: On Tue, Feb 9, 2016 at 5:32 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: There are already directories w/ just one/a few files in them, even small (e.g. common/gcov/gcov.c). IMHO no

Re: [Xen-devel] [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c

2016-02-09 Thread Corneliu ZUZU
On 2/9/2016 1:03 PM, Stefano Stabellini wrote: On Mon, 8 Feb 2016, Corneliu ZUZU wrote: X86-side hvm.c is @ arch/x86/hvm/hvm.c. To maintain arm<->x86 symmetry, also move arch/arm/hvm.c to arch/arm/hvm/hvm.c. Why are we doing this? These are not header files, their paths don't necessaril

Re: [Xen-devel] [PATCH 2/7] x86: hvm events: merge 2 functions into 1

2016-02-09 Thread Corneliu ZUZU
On 2/9/2016 1:19 PM, Jan Beulich wrote: On 08.02.16 at 17:57, wrote: This patch merges almost identical functions hvm_event_int3 and hvm_event_single_step into a single function called hvm_event_software_breakpoint. Except that "software breakpoint" is rather

Re: [Xen-devel] [PATCH 2/7] x86: hvm events: merge 2 functions into 1

2016-02-09 Thread Corneliu ZUZU
On 2/9/2016 2:12 PM, Jan Beulich wrote: On 09.02.16 at 12:52, wrote: On 2/9/2016 1:19 PM, Jan Beulich wrote: On 08.02.16 at 17:57, wrote: This patch merges almost identical functions hvm_event_int3 and hvm_event_single_step into a single

Re: [Xen-devel] [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c

2016-02-09 Thread Corneliu ZUZU
On 2/9/2016 1:55 PM, Jan Beulich wrote: On 09.02.16 at 12:28, <cz...@bitdefender.com> wrote: On 2/9/2016 1:03 PM, Stefano Stabellini wrote: On Mon, 8 Feb 2016, Corneliu ZUZU wrote: X86-side hvm.c is @ arch/x86/hvm/hvm.c. To maintain arm<->x86 symmetry, also move arch/arm/hvm.c to

[Xen-devel] [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c

2016-02-08 Thread Corneliu ZUZU
X86-side hvm.c is @ arch/x86/hvm/hvm.c. To maintain arm<->x86 symmetry, also move arch/arm/hvm.c to arch/arm/hvm/hvm.c. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/arm/Makefile | 2 +- xen/arch/arm/hvm.c| 67

[Xen-devel] [PATCH 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-08 Thread Corneliu ZUZU
sm-arm/monitor_arch.h (renamed to monitor.h in next commit, reason is the same as @ (3.). # define/implement: arch_monitor_get_capabilities, arch_monitor_domctl_op and arch_monitor_domctl_event Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/Kconfig | 4

[Xen-devel] [PATCH 5/7] xen/vm-events: Move hvm_event_* functions to common-side.

2016-02-08 Thread Corneliu ZUZU
xt commit, reason is the same as @ (2.). # define/implement: arch_hvm_event_fill_regs, arch_hvm_event_gfn_of_ip, hvm_event_msr (X86 side only) Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/Makefile

[Xen-devel] [PATCH 7/7] arch.monitor: move bits to common (arch_domain to domain)

2016-02-08 Thread Corneliu ZUZU
across architectures. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/vmx/vmcs.c | 4 ++-- xen/common/hvm/event.c | 12 ++-- xen/common/monitor.c | 17 +++-- xen/include/asm-x86/domain.h | 16 ++-- xen/include/xen/s

[Xen-devel] [PATCH 0/7] Vm-events: move monitor vm-events code to common code.

2016-02-08 Thread Corneliu ZUZU
This patch series is an attempt to move (most) of the monitor vm-events code to the common-side. Patches summary: 1. Move xen/arch/arm/hvm.c to xen/arch/arm/hvm/hvm.c 2. Merge almost identical functions hvm_event_int3 + This patch series is an attempt to move (most) of the monitor vm-events

[Xen-devel] [PATCH 6/7] Rename event_x86.c to event.c and event_arch.h to event.h + minor fixes

2016-02-08 Thread Corneliu ZUZU
-changes: xen/common/Makefile, xen/common/hvm/Makefile) * xen/common/hvm/event.c: fix malformed file header comment * xen/hvm/event.h: fix comment & change hvm_event_crX first param name to a more descriptive one Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hv

[Xen-devel] [PATCH 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h

2016-02-08 Thread Corneliu ZUZU
(last commit before this one explains why this was necessary) Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/Makefile | 2 +- xen/arch/x86/monitor.c | 72 + xen/arch/x86/monitor_x86.c

[Xen-devel] [PATCH 2/7] x86: hvm events: merge 2 functions into 1

2016-02-08 Thread Corneliu ZUZU
This patch merges almost identical functions hvm_event_int3 and hvm_event_single_step into a single function called hvm_event_software_breakpoint. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/event.c| 52 ++--- xen/ar

Re: [Xen-devel] [PATCH 7/7] arch.monitor: move bits to common (arch_domain to domain)

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 8:29 PM, Tamas K Lengyel wrote: On Mon, Feb 8, 2016 at 9:58 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: This patch moves bitfield members for single-step, software-breakpoint and guest-request monitor vm-events from t

Re: [Xen-devel] [PATCH 2/7] x86: hvm events: merge 2 functions into 1

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 8:17 PM, Tamas K Lengyel wrote: On Mon, Feb 8, 2016 at 10:49 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: On 2/8/2016 7:15 PM, Andrew Cooper wrote: On 08/02/16 16:57, Corneliu ZUZU wrote: diff --git a/xen

Re: [Xen-devel] [PATCH 1/7] arm: move arch/arm/hvm.c to arch/arm/hvm/hvm.c

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 7:04 PM, Andrew Cooper wrote: On 08/02/16 16:57, Corneliu ZUZU wrote: X86-side hvm.c is @ arch/x86/hvm/hvm.c. To maintain arm<->x86 symmetry, also move arch/arm/hvm.c to arch/arm/hvm/hvm.c. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> For future reference,

Re: [Xen-devel] [PATCH 2/7] x86: hvm events: merge 2 functions into 1

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 7:15 PM, Andrew Cooper wrote: On 08/02/16 16:57, Corneliu ZUZU wrote: diff --git a/xen/include/asm-x86/hvm/event.h b/xen/include/asm-x86/hvm/event.h index 11eb1fe..7c2252b 100644 --- a/xen/include/asm-x86/hvm/event.h +++ b/xen/include/asm-x86/hvm/event.h @@ -27,9 +27,8 @@ bool_t

Re: [Xen-devel] [PATCH 0/7] Vm-events: move monitor vm-events code to common code.

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 6:57 PM, Corneliu ZUZU wrote: This patch series is an attempt to move (most) of the monitor vm-events code to the common-side. Patches summary: 1. Move xen/arch/arm/hvm.c to xen/arch/arm/hvm/hvm.c 2. Merge almost identical functions hvm_event_int3 + hvm_event_single_step

Re: [Xen-devel] [PATCH 3/7] xen/vm-events: Move monitor_domctl to common-side.

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 8:15 PM, Tamas K Lengyel wrote: On Mon, Feb 8, 2016 at 9:57 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: +#if CONFIG_X86 Wouldn't it be safe to include these headers on ARM as well? +#include /* for VM_E

Re: [Xen-devel] [PATCH 4/7] Rename monitor_x86.c to monitor.c and monitor_arch.h to monitor.h

2016-02-08 Thread Corneliu ZUZU
On 2/8/2016 8:18 PM, Tamas K Lengyel wrote: On Mon, Feb 8, 2016 at 9:57 AM, Corneliu ZUZU <cz...@bitdefender.com <mailto:cz...@bitdefender.com>> wrote: (last commit before this one explains why this was necessary) Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com

Re: [Xen-devel] [PATCH V2] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access

2016-02-05 Thread Corneliu ZUZU
On 2/3/2016 2:23 PM, Ian Campbell wrote: On Wed, 2016-02-03 at 13:54 +0200, Corneliu ZUZU wrote: I thought this mail was not sent properly (didn't find it any longer on the web (?)) and I resent it just earlier. I figured it must've been the fact that I forgot to put a "Changed sin

[Xen-devel] [PATCH v2] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access

2016-02-03 Thread Corneliu ZUZU
ookup call from __p2m_get_mem_access with a call to __p2m_lookup and also adds an ASSERT to ensure that the p2m lock is already taken upon __p2m_get_mem_access entry. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- Changed since v1: * added p2m-lock ASSERT --- xen/arch/arm/p2m.c | 4 ++

Re: [Xen-devel] [PATCH v2] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access

2016-02-03 Thread Corneliu ZUZU
On 2/3/2016 1:52 PM, Ian Campbell wrote: On Wed, 2016-02-03 at 13:37 +0200, Corneliu ZUZU wrote: I just now applied a previous v2 which was already in my queue. Was this just an accidental resend of v2 or is there some important change and this is really a v3? When __p2m_get_mem_access gets

Re: [Xen-devel] [PATCH V2] arm: p2m.c bug-fix: hypervisor hang on __p2m_get_mem_access

2016-02-03 Thread Corneliu ZUZU
On 2/3/2016 1:48 PM, Ian Campbell wrote: On Wed, 2016-01-27 at 14:24 +0200, Corneliu ZUZU wrote: When __p2m_get_mem_access gets called, the p2m lock is already taken by either get_page_from_gva or p2m_get_mem_access. Possible code paths: 1) -> get_page_from_

<    1   2   3   4   >