Re: [Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
On 7/22/2016 4:00 PM, Razvan Cojocaru wrote: On 07/22/2016 03:32 PM, Corneliu ZUZU wrote: Look @ hvm_do_resume(): 1. If you, as a toolstack user, get at sane step no. 6: "Uninitialize everything (no events are possible here because of steps 4-5)." 2. But just bef

Re: [Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
On 7/22/2016 3:10 PM, Razvan Cojocaru wrote: On 07/22/2016 02:39 PM, Corneliu ZUZU wrote: On 7/22/2016 1:29 PM, Razvan Cojocaru wrote: On 07/22/2016 01:17 PM, Corneliu ZUZU wrote: On 7/22/2016 12:55 PM, Razvan Cojocaru wrote: On 07/22/2016 12:27 PM, Corneliu ZUZU wrote: Hi, I've been

Re: [Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
On 7/22/2016 2:13 PM, Andrew Cooper wrote: On 22/07/16 11:31, Corneliu ZUZU wrote: On 7/22/2016 12:51 PM, Andrew Cooper wrote: On 22/07/16 10:27, Corneliu ZUZU wrote: Hi, I've been inspecting vm-event code parts to try and understand when and why domain pausing/locking is done. If I

Re: [Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
On 7/22/2016 1:29 PM, Razvan Cojocaru wrote: On 07/22/2016 01:17 PM, Corneliu ZUZU wrote: On 7/22/2016 12:55 PM, Razvan Cojocaru wrote: On 07/22/2016 12:27 PM, Corneliu ZUZU wrote: Hi, I've been inspecting vm-event code parts to try and understand when and why domain pausing/locking is done

Re: [Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
On 7/22/2016 12:51 PM, Andrew Cooper wrote: On 22/07/16 10:27, Corneliu ZUZU wrote: Hi, I've been inspecting vm-event code parts to try and understand when and why domain pausing/locking is done. If I understood correctly, domain pausing is done solely to force all the vCPUs of that domain

Re: [Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
On 7/22/2016 12:55 PM, Razvan Cojocaru wrote: On 07/22/2016 12:27 PM, Corneliu ZUZU wrote: Hi, I've been inspecting vm-event code parts to try and understand when and why domain pausing/locking is done. If I understood correctly, domain pausing is done solely to force all the vCPUs

[Xen-devel] Locking on vm-event operations (monitor)

2016-07-22 Thread Corneliu ZUZU
Hi, I've been inspecting vm-event code parts to try and understand when and why domain pausing/locking is done. If I understood correctly, domain pausing is done solely to force all the vCPUs of that domain to see a configuration update and act upon it (e.g. in the case of a

Re: [Xen-devel] [PATCH 03/16] x86/monitor: mechanical renames

2016-07-19 Thread Corneliu ZUZU
On 7/18/2016 9:07 PM, Andrew Cooper wrote: On 15/07/16 08:18, Corneliu ZUZU wrote: On 7/12/2016 9:10 AM, Corneliu ZUZU wrote: On 7/11/2016 7:43 PM, Tamas K Lengyel wrote: On Sat, Jul 9, 2016 at 12:46 PM, Corneliu ZUZU <cz...@bitdefender.com> wrote: On 7/9/2016 9:10 PM, Tamas K Lengyel

Re: [Xen-devel] [PATCH v5 0/7] adjustments

2016-07-15 Thread Corneliu ZUZU
On 7/15/2016 4:05 PM, Andrew Cooper wrote: On 15/07/16 11:41, Corneliu ZUZU wrote: Corneliu ZUZU (7): 1/7: asm-arm/atomic.h: fix arm32|arm64 macros duplication Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Changed: * remove paragraph(s

[Xen-devel] [PATCH v5 7/7] asm/atomic.h: implement missing and add common prototypes

2016-07-15 Thread Corneliu ZUZU
implemented X86 functions in common Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Acked-by: Julien Grall <julien.gr...@arm.com> --- Changed since v4: --- xen/include/asm-arm/atomic.h | 5 + xen/include/asm

[Xen-devel] [PATCH v5 6/7] asm-arm/atomic.h: atomic_{inc, dec}_return: macros to inline functions

2016-07-15 Thread Corneliu ZUZU
Turn atomic_inc_return and atomic_dec_return atomic.h macros to inline functions. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- Changed since v4: * README.LinuxPrimitives not updated anymore --- xen/include/asm-

[Xen-devel] [PATCH v5 5/7] xen/atomic.h: fix: make atomic_read() param const

2016-07-15 Thread Corneliu ZUZU
This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Reviewed-by: Julien Grall <

[Xen-devel] [PATCH v5 4/7] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-15 Thread Corneliu ZUZU
. Removed outdated comment ("NB. I've [...]"). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Suggested-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org>

[Xen-devel] [PATCH v5 2/7] asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement

2016-07-15 Thread Corneliu ZUZU
Place atomic_inc_and_test() implementation after atomic_inc(). Also empty line fix. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v4: --- xen/include/asm-x86/atomic.h | 39 +++---

[Xen-devel] [PATCH v5 1/7] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-15 Thread Corneliu ZUZU
Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- Changed since v4: * remove paragraph(s) from README.LinuxPri

[Xen-devel] [PATCH v5 0/7] adjustments

2016-07-15 Thread Corneliu ZUZU
Corneliu ZUZU (7): 1/7: asm-arm/atomic.h: fix arm32|arm64 macros duplication Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Changed: * remove paragraph(s) from README.LinuxPrimitives file * no empty line additions 2/7: asm-x86/atomic.h: minor:

Re: [Xen-devel] [PATCH v4 1/7] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-15 Thread Corneliu ZUZU
On 7/15/2016 1:06 PM, Julien Grall wrote: On 15/07/16 10:55, Corneliu ZUZU wrote: On 7/15/2016 12:28 PM, Julien Grall wrote: Hi Corneliu, On 15/07/16 07:48, Corneliu ZUZU wrote: Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. Adjust

Re: [Xen-devel] [PATCH v4 4/7] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-15 Thread Corneliu ZUZU
On 7/15/2016 12:30 PM, Julien Grall wrote: On 15/07/16 07:50, Corneliu ZUZU wrote: Create a common-side to establish, among others, prototypes of atomic functions called from common-code. Done to avoid introducing inconsistencies between arch-side headers when we make subtle changes

[Xen-devel] [PATCH v4 7/7] asm/atomic.h: implement missing and add common prototypes

2016-07-15 Thread Corneliu ZUZU
implemented X86 functions in common Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v3: * add wrapper over arm-side __atomic_add_unless() instead of removing the leading underscores --- xen/include/asm-

[Xen-devel] [PATCH v4 5/7] xen/atomic.h: fix: make atomic_read() param const

2016-07-15 Thread Corneliu ZUZU
This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- Changed since v3: --- x

[Xen-devel] [PATCH v4 4/7] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-15 Thread Corneliu ZUZU
(also updated README.LinuxPrimitives file). Removed outdated comment ("NB. I've [...]"). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Suggested-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by:

[Xen-devel] [PATCH v4 2/7] asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement

2016-07-15 Thread Corneliu ZUZU
Place atomic_inc_and_test() implementation after atomic_inc(). Also empty line fix. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v3: --- xen/include/asm-x86/atomic.h | 39 +++---

[Xen-devel] [PATCH v4 1/7] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-15 Thread Corneliu ZUZU
Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. Adjust README.LinuxPrimitives in the process. Also empty line fixes. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- C

[Xen-devel] [PATCH v4 0/7] adjustments

2016-07-15 Thread Corneliu ZUZU
Corneliu ZUZU (7): 1/7: asm-arm/atomic.h: fix arm32|arm64 macros duplication Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Changed: * update README.LinuxPrimitives file 2/7: asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement Reviewed-by:

Re: [Xen-devel] [PATCH v2 1/5] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-14 Thread Corneliu ZUZU
On 7/14/2016 12:26 PM, Julien Grall wrote: On 14/07/16 06:11, Corneliu ZUZU wrote: On 7/13/2016 10:12 PM, Julien Grall wrote: Hi Corneliu, On 13/07/2016 15:18, Corneliu ZUZU wrote: Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. asm

Re: [Xen-devel] [PATCH v3 7/8] arm/atomic.h: remove '__' prefix for __atomic_add_unless()

2016-07-14 Thread Corneliu ZUZU
On 7/14/2016 1:00 PM, Julien Grall wrote: Hi Corneliu, On 14/07/16 10:14, Corneliu ZUZU wrote: The built-in leading underscores ('__') don't serve any purpose, so rename __atomic_add_unless() -> atomic_add_unless(). The leading underscores are from the Linux code. We decided to keep th

Re: [Xen-devel] [PATCH v3 8/8] asm-x86/atomic.h: implement missing, add common prototypes

2016-07-14 Thread Corneliu ZUZU
On 7/14/2016 12:44 PM, Andrew Cooper wrote: On 14/07/16 10:39, Corneliu ZUZU wrote: On 7/14/2016 12:29 PM, Andrew Cooper wrote: On 14/07/16 10:14, Corneliu ZUZU wrote: - implement missing functions atomic_{sub,inc,dec}_return(), atomic_add_unless() on X86 and also add prototypes for them

Re: [Xen-devel] [PATCH v3 8/8] asm-x86/atomic.h: implement missing, add common prototypes

2016-07-14 Thread Corneliu ZUZU
On 7/14/2016 12:29 PM, Andrew Cooper wrote: On 14/07/16 10:14, Corneliu ZUZU wrote: - implement missing functions atomic_{sub,inc,dec}_return(), atomic_add_unless() on X86 and also add prototypes for them in common - add missing macro atomic_xchg for X86 Signed-off-by: Corneliu ZUZU<

Re: [Xen-devel] [PATCH v3 5/8] fix: make atomic_read() param const

2016-07-14 Thread Corneliu ZUZU
On 7/14/2016 12:26 PM, Andrew Cooper wrote: On 14/07/16 10:13, Corneliu ZUZU wrote: This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> You

Re: [Xen-devel] [PATCH v3 5/8] fix: make atomic_read() param const

2016-07-14 Thread Corneliu ZUZU
On 7/14/2016 12:26 PM, Andrew Cooper wrote: On 14/07/16 10:13, Corneliu ZUZU wrote: This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> You

[Xen-devel] [PATCH v3 8/8] asm-x86/atomic.h: implement missing, add common prototypes

2016-07-14 Thread Corneliu ZUZU
- implement missing functions atomic_{sub,inc,dec}_return(), atomic_add_unless() on X86 and also add prototypes for them in common - add missing macro atomic_xchg for X86 Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-x86/atomic.

[Xen-devel] [PATCH v3 7/8] arm/atomic.h: remove '__' prefix for __atomic_add_unless()

2016-07-14 Thread Corneliu ZUZU
The built-in leading underscores ('__') don't serve any purpose, so rename __atomic_add_unless() -> atomic_add_unless(). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/arm32/atomic.h | 2 +- xen/include/asm-arm/arm64/atomic.h | 2 +- 2 files changed, 2 i

[Xen-devel] [PATCH v3 6/8] asm-arm/atomic.h: atomic_{inc, dec}_return: macros to inline functions

2016-07-14 Thread Corneliu ZUZU
Turn atomic_inc_return and atomic_dec_return atomic.h macros to inline functions. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/atomic.h | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-arm/atomic.h b/xen/i

[Xen-devel] [PATCH v3 5/8] fix: make atomic_read() param const

2016-07-14 Thread Corneliu ZUZU
This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v2: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h

[Xen-devel] [PATCH v3 4/8] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-14 Thread Corneliu ZUZU
. Removed outdated comment ("NB. I've [...]"). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Suggested-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v2: * sample code for atomic_cmpxchg

[Xen-devel] [PATCH v3 3/8] asm-arm/atomic.h: reorder macros to match x86-side

2016-07-14 Thread Corneliu ZUZU
Reorder macro definitions to match x86-side. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- Changed since v2: --- xen/include/asm-arm/atomic.h | 19 +-- 1 file changed, 9 insertions(+), 10 deleti

[Xen-devel] [PATCH v3 2/8] asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement

2016-07-14 Thread Corneliu ZUZU
Place atomic_inc_and_test() implementation after atomic_inc(). Also empty line fix. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- Changed since v2: arm empty line fixes moved from here --- xen/include/asm-x86/atomic.h | 39 +++ 1 file chang

[Xen-devel] [PATCH v3 1/8] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-14 Thread Corneliu ZUZU
Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. Also empty line fixes. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> --- Changed since v2: * also moved mistak

[Xen-devel] [PATCH v3 0/8] adjustments

2016-07-14 Thread Corneliu ZUZU
Corneliu ZUZU (8): 1/8: asm-arm/atomic.h: fix arm32|arm64 macros duplication Reviewed-by: Stefano Stabellini <sstabell...@kernel.org> Changed: * also moved mistakenly omitted atomic_xchg() * arm empty line fixes moved here 2/8: asm-x86/atomic.h: minor:

Re: [Xen-devel] [PATCH v2 1/5] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-13 Thread Corneliu ZUZU
On 7/13/2016 10:12 PM, Julien Grall wrote: Hi Corneliu, On 13/07/2016 15:18, Corneliu ZUZU wrote: Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. asm-arm/arm*/atomic.h were a copy from Linux. I don't mind if we diverge, however the file

Re: [Xen-devel] [PATCH v2 4/5] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
On 7/13/2016 10:49 PM, Andrew Cooper wrote: On 13/07/16 20:33, Corneliu ZUZU wrote: On 7/13/2016 10:01 PM, Stefano Stabellini wrote: On Wed, 13 Jul 2016, Corneliu ZUZU wrote: Create a common-side to establish, among others, prototypes of atomic functions called from common-code. Done

Re: [Xen-devel] [PATCH v2 1/5] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-13 Thread Corneliu ZUZU
Hi Julien, On 7/13/2016 10:12 PM, Julien Grall wrote: Hi Corneliu, On 13/07/2016 15:18, Corneliu ZUZU wrote: Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. asm-arm/arm*/atomic.h were a copy from Linux. I don't mind if we diverge

Re: [Xen-devel] [PATCH v2 4/5] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
On 7/13/2016 10:01 PM, Stefano Stabellini wrote: On Wed, 13 Jul 2016, Corneliu ZUZU wrote: Create a common-side to establish, among others, prototypes of atomic functions called from common-code. Done to avoid introducing inconsistencies between arch-side headers when we make subtle changes

[Xen-devel] [PATCH v2 4/5] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
. Removed outdated comment ("NB. I've [...]"). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Suggested-by: Andrew Cooper <andrew.coop...@citrix.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v1: * removed comments that were duplic

[Xen-devel] [PATCH v2 5/5] fix: make atomic_read() param const

2016-07-13 Thread Corneliu ZUZU
This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com> --- Changed since v1: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h

[Xen-devel] [PATCH v2 3/5] asm-arm/atomic.h: reorder macros to match x86-side

2016-07-13 Thread Corneliu ZUZU
Reorder macro definitions to match x86-side. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/atomic.h | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xen/include/asm-arm/atomic.h b/xen/include/asm-arm/atomic.h index 1

[Xen-devel] [PATCH v2 2/5] asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement

2016-07-13 Thread Corneliu ZUZU
Place atomic_inc_and_test() implementation after atomic_inc(). Also remove unneeded empty line and add a needed one. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/atomic.h | 1 + xen/include/asm-x86/atomic.h | 39 +++ 2

[Xen-devel] [PATCH v2 1/5] asm-arm/atomic.h: fix arm32|arm64 macros duplication

2016-07-13 Thread Corneliu ZUZU
Move duplicate macros between asm-arm/arm32/atomic.h and asm-arm/arm64/atomic.h to asm-arm/atomic.h. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/arm32/atomic.h | 11 --- xen/include/asm-arm/arm64/atomic.h | 11 --- xen/include/asm-arm/at

[Xen-devel] [PATCH v2 0/5] adjustments

2016-07-13 Thread Corneliu ZUZU
Corneliu ZUZU (5): asm-arm/atomic.h: fix arm32|arm64 macros duplication asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement asm-arm/atomic.h: reorder macros to match x86-side asm/atomic.h: common prototyping (add xen/atomic.h) fix: make atomic_read() param const xen/include

Re: [Xen-devel] [PATCH 1/2] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
On 7/13/2016 3:12 PM, Andrew Cooper wrote: On 13/07/16 12:23, Corneliu ZUZU wrote: +typedef struct { int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +/** + * atomic_read - read atomic variable + * @v: pointer of type atomic_t + * + * Atomically reads the value of @v. + */ +static

Re: [Xen-devel] [PATCH 1/2] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
Hi Julien, On 7/13/2016 3:14 PM, Julien Grall wrote: Hi Corneliu, On 13/07/2016 12:23, Corneliu ZUZU wrote: Following Andrew Cooper's suggestion, create a common-side to establish, among others, prototypes of atomic functions called from common-code. Done to avoid introducing

Re: [Xen-devel] [PATCH 1/2] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
On 7/13/2016 3:12 PM, Andrew Cooper wrote: On 13/07/16 12:23, Corneliu ZUZU wrote: Following Andrew Cooper's suggestion, create a common-side to establish, among others, prototypes of atomic functions called from common-code. Done to avoid introducing inconsistencies between arch-side headers

[Xen-devel] [PATCH 2/2] fix: make atomic_read() param const

2016-07-13 Thread Corneliu ZUZU
This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h | 2 +- xen/include/xen/atomic.h | 2 +- 3 files changed, 3 insertions(+), 3 del

[Xen-devel] [PATCH 1/2] asm/atomic.h: common prototyping (add xen/atomic.h)

2016-07-13 Thread Corneliu ZUZU
into inline functions in the process. Also includes a minor adjustment asm-x86/atomic.h: reorder atomic_inc_and_test() to follow after atomic_inc(). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/arm32/atomic.h | 11 --- xen/include/asm-arm/arm64/atomic.h

[Xen-devel] [PATCH 0/2] adjustments

2016-07-13 Thread Corneliu ZUZU
Corneliu ZUZU (2): asm/atomic.h: common prototyping (add xen/atomic.h) fix: make atomic_read() param const xen/include/asm-arm/arm32/atomic.h | 11 --- xen/include/asm-arm/arm64/atomic.h | 11 --- xen/include/asm-arm/atomic.h | 91 +++--- xen/include/asm-x86/atomic.h

Re: [Xen-devel] [PATCH 14/16] x86/monitor: clarify separation between monitor subsys and vm-event as a whole

2016-07-12 Thread Corneliu ZUZU
On 7/9/2016 9:57 PM, Corneliu ZUZU wrote: On 7/9/2016 9:26 PM, Tamas K Lengyel wrote: diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index ae1dcb4..7663da2 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -9,6 +9,7 @@ #include

Re: [Xen-devel] [PATCH 02/16] x86: fix: make atomic_read() param const

2016-07-12 Thread Corneliu ZUZU
On 7/12/2016 3:49 PM, Andrew Cooper wrote: On 12/07/16 11:38, Corneliu ZUZU wrote: On 7/12/2016 1:22 PM, Andrew Cooper wrote: On 12/07/16 11:11, Corneliu ZUZU wrote: If you are really feeling up to it, having a common xen/atomic.h with typedef struct { int counter; } atomic_t; #define

Re: [Xen-devel] [PATCH 02/16] x86: fix: make atomic_read() param const

2016-07-12 Thread Corneliu ZUZU
On 7/12/2016 1:22 PM, Andrew Cooper wrote: On 12/07/16 11:11, Corneliu ZUZU wrote: If you are really feeling up to it, having a common xen/atomic.h with typedef struct { int counter; } atomic_t; #define ATOMIC_INIT(i) { (i) } and some prototypes such as: static inline int atomic_read(const

Re: [Xen-devel] [PATCH 02/16] x86: fix: make atomic_read() param const

2016-07-12 Thread Corneliu ZUZU
On 7/12/2016 1:22 PM, Andrew Cooper wrote: On 12/07/16 11:11, Corneliu ZUZU wrote: If you are really feeling up to it, having a common xen/atomic.h with typedef struct { int counter; } atomic_t; #define ATOMIC_INIT(i) { (i) } and some prototypes such as: static inline int atomic_read(const

Re: [Xen-devel] [PATCH 02/16] x86: fix: make atomic_read() param const

2016-07-12 Thread Corneliu ZUZU
On 7/12/2016 12:42 PM, Andrew Cooper wrote: On 12/07/16 06:11, Corneliu ZUZU wrote: Hi Andrew, On 7/11/2016 6:18 PM, Andrew Cooper wrote: On 09/07/16 05:12, Corneliu ZUZU wrote: This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <

Re: [Xen-devel] [PATCH 05/16] x86/monitor: relocate code more appropriately

2016-07-12 Thread Corneliu ZUZU
On 7/12/2016 10:45 AM, Tian, Kevin wrote: From: Corneliu ZUZU [mailto:cz...@bitdefender.com] Sent: Monday, July 11, 2016 2:19 PM +static inline +void monitor_ctrlreg_adjust_traps(struct domain *d, unsigned int index) +{ +/* For now, VMX only. */ +ASSERT(cpu_has_vmx); + +/* Other CRs

Re: [Xen-devel] [PATCH 03/16] x86/monitor: mechanical renames

2016-07-12 Thread Corneliu ZUZU
On 7/11/2016 7:43 PM, Tamas K Lengyel wrote: On Sat, Jul 9, 2016 at 12:46 PM, Corneliu ZUZU <cz...@bitdefender.com> wrote: On 7/9/2016 9:10 PM, Tamas K Lengyel wrote: On Fri, Jul 8, 2016 at 10:13 PM, Corneliu ZUZU <cz...@bitdefender.com> wrote: Arch-specific vm-event func

Re: [Xen-devel] [PATCH 02/16] x86: fix: make atomic_read() param const

2016-07-11 Thread Corneliu ZUZU
Hi Andrew, On 7/11/2016 6:18 PM, Andrew Cooper wrote: On 09/07/16 05:12, Corneliu ZUZU wrote: This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> This is a good improvement, but you must make an ide

Re: [Xen-devel] [PATCH 11/16] x86/monitor: fix: treat -monitor- properly, as a subsys of the vm-event subsys

2016-07-11 Thread Corneliu ZUZU
On 7/12/2016 12:27 AM, Tamas K Lengyel wrote: On Mon, Jul 11, 2016 at 2:20 PM, Corneliu ZUZU <cz...@bitdefender.com> wrote: On 7/11/2016 7:38 PM, Tamas K Lengyel wrote: diff --git a/xen/include/asm-arm/monitor.h b/xen/include/asm-arm/monitor.h index 9a9734a..7ef30f1 100644 [snip]

Re: [Xen-devel] [PATCH 11/16] x86/monitor: fix: treat -monitor- properly, as a subsys of the vm-event subsys

2016-07-11 Thread Corneliu ZUZU
On 7/11/2016 7:38 PM, Tamas K Lengyel wrote: diff --git a/xen/include/asm-arm/monitor.h b/xen/include/asm-arm/monitor.h index 9a9734a..7ef30f1 100644 [snip] I keep seeing '[snip]' lately but I don't know what it means. Placeholder for "I've cut some of your patch content here to shorten the

Re: [Xen-devel] [PATCH 01/16] x86/vmx_update_guest_cr: minor optimization

2016-07-11 Thread Corneliu ZUZU
This was 1/8 in the old v3-series "x86/vm-event: Adjustments & fixes". Transferring code-review from "Tian, Kevin <kevin.t...@intel.com>" (July 11, 2016). On 7/9/2016 7:12 AM, Corneliu ZUZU wrote: Minor optimization @ vmx_update_guest_cr: checks if v->arch.

Re: [Xen-devel] [PATCH 05/16] x86/monitor: relocate code more appropriately

2016-07-11 Thread Corneliu ZUZU
This was 2/8 in the old v3-series "x86/vm-event: Adjustments & fixes". Transferring code-review from "Tian, Kevin <kevin.t...@intel.com>" (July 11, 2016) and responding... On 7/9/2016 7:15 AM, Corneliu ZUZU wrote: For readability: * Add function monito

Re: [Xen-devel] [PATCH 00/16] x86/vm-event: numerous adjustments & fixes

2016-07-10 Thread Corneliu ZUZU
On 7/11/2016 5:54 AM, Tian, Kevin wrote: what's the difference between this series and earlier one? [PATCH v3 0/8] x86/vm-event: Adjustments & fixes looks you have some patches cross-posted (e.g. 1/16)... Corneliu ZUZU (16): x86/vmx_update_guest_cr: minor optimization x86: fix:

Re: [Xen-devel] [PATCH 14/16] x86/monitor: clarify separation between monitor subsys and vm-event as a whole

2016-07-09 Thread Corneliu ZUZU
On 7/9/2016 9:26 PM, Tamas K Lengyel wrote: diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h index ae1dcb4..7663da2 100644 --- a/xen/include/asm-x86/domain.h +++ b/xen/include/asm-x86/domain.h @@ -9,6 +9,7 @@ #include #include #include +#include #include

Re: [Xen-devel] [PATCH 04/16] x86/monitor: relocate vm_event_register_write_resume() function to monitor code

2016-07-09 Thread Corneliu ZUZU
On 7/9/2016 9:14 PM, Tamas K Lengyel wrote: On Fri, Jul 8, 2016 at 10:14 PM, Corneliu ZUZU <cz...@bitdefender.com> wrote: vm_event_register_write_resume is part of the monitor subsystem, relocate and rename appropriately. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> ---

Re: [Xen-devel] [PATCH 03/16] x86/monitor: mechanical renames

2016-07-09 Thread Corneliu ZUZU
On 7/9/2016 9:10 PM, Tamas K Lengyel wrote: On Fri, Jul 8, 2016 at 10:13 PM, Corneliu ZUZU <cz...@bitdefender.com> wrote: Arch-specific vm-event functions in x86/vm_event.h -e.g. vm_event_init_domain()- don't have an 'arch_' prefix. Apply the same rule for monitor functions - orig

Re: [Xen-devel] [PATCH 11/16] x86/monitor: fix: treat -monitor- properly, as a subsys of the vm-event subsys

2016-07-09 Thread Corneliu ZUZU
On 7/9/2016 8:34 PM, Tamas K Lengyel wrote: diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c index aeee435..4a29cad 100644 --- a/xen/arch/x86/monitor.c +++ b/xen/arch/x86/monitor.c @@ -62,6 +62,8 @@ int monitor_init_domain(struct domain *d) return -ENOMEM; } +

Re: [Xen-devel] [PATCH 16/16] x86/monitor: fix: xc_monitor _write_ctrlreg w/o previous _enable must fail

2016-07-08 Thread Corneliu ZUZU
On 7/9/2016 7:23 AM, Corneliu ZUZU wrote: Enforce presence of a monitor vm-event subscriber when the toolstack user calls xc_monitor_write_ctrlreg() (XEN_DOMCTL_MONITOR_EVENT_WRITE_CTRLREG domctl). Without this change, "ASSERT(monitor_domain_initialised(v->domain));"

[Xen-devel] [PATCH 16/16] x86/monitor: fix: xc_monitor _write_ctrlreg w/o previous _enable must fail

2016-07-08 Thread Corneliu ZUZU
ck user calls xc_monitor_write_ctrlreg(...) w/ enable = true, without first calling xc_monitor_enable(). Also adjust returned error code for similar check from -EINVAL to more descriptive -ENODEV (XEN_DOMCTL_MONITOR_OP_EMULATE_EACH_REP). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen

[Xen-devel] [PATCH 15/16] x86/monitor: fix: don't compromise a monitor_write_data with pending CR writes

2016-07-08 Thread Corneliu ZUZU
up_domain() was called, arch_vm_event.monitor will eventually be freed either after the CR-writes are committed (monitor_ctrlreg_write_data()) or when the domain/vcpu is destroyed * calls monitor_ctrlreg_write_data() even if the monitor subsystem is not initialized Signed-off-by: Corneliu

[Xen-devel] [PATCH 14/16] x86/monitor: clarify separation between monitor subsys and vm-event as a whole

2016-07-08 Thread Corneliu ZUZU
h and asm-x86/monitor.h. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/emulate.c | 8 +++--- xen/arch/x86/hvm/hvm.c | 31 xen/arch/x86/mm/p2m.c | 7 -- xen/arch/x86/mon

[Xen-devel] [PATCH 13/16] x86/monitor: introduce writes_pending field in monitor_write_data

2016-07-08 Thread Corneliu ZUZU
Introduce writes_pending field in monitor_write_data structure to slightly optimize code @ monitor_write_data(): avoid having to check each bit when -all- bits are zero (which is likely). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/monitor.c | 3 +++ xen/i

[Xen-devel] [PATCH 12/16] x86/vm-event: fix: move cleanup of mem_access_emulate_each_rep to monitor stub

2016-07-08 Thread Corneliu ZUZU
Move cleanup of mem_access_emulate_each_rep to monitor_cleanup_domain() as the field is part of the monitor subsystem's resources. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/monitor.c | 3 +++ xen/arch/x86/vm_event.c | 2 -- 2 files changed, 3 insertions

[Xen-devel] [PATCH 11/16] x86/monitor: fix: treat -monitor- properly, as a subsys of the vm-event subsys

2016-07-08 Thread Corneliu ZUZU
Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/emulate.c| 3 ++- xen/arch/x86/hvm/hvm.c| 10 +- xen/arch/x86/monitor.c| 3 +++ xen/include/asm-arm/monitor.h | 3 ++- xen/include/asm-x86/monitor.h | 9 - xen/include/xen/monito

[Xen-devel] [PATCH 10/16] x86/vm-event: centralize vcpu-destroy cleanup in vm-events code

2016-07-08 Thread Corneliu ZUZU
Move vm-event cleanup sequence on vcpu destroyal to vm_event.h along with the other vm-event functions. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/domain.c | 4 ++-- xen/arch/x86/vm_event.c| 5 + xen/include/asm-x86/vm_event.h | 10 +++

[Xen-devel] [PATCH 09/16] arm/monitor: move d->monitor cleanup to monitor_cleanup_domain()

2016-07-08 Thread Corneliu ZUZU
d->monitor is a monitor subsystem resource, clean it up in the proper stub. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-arm/monitor.h | 2 +- xen/include/asm-arm/vm_event.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/xen/includ

[Xen-devel] [PATCH 08/16] x86/vm-event: call monitor init & cleanup funcs from respective vm_event funcs

2016-07-08 Thread Corneliu ZUZU
relying on the ved param in vm_event_init,cleanup_domain() to determine the target vm-event subsystem when we already had vec->mode in vm_event_enable(). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/monitor.c | 5 + xen/arch/x86/vm_event.c

[Xen-devel] [PATCH 07/16] x86/vm-event: fix: call cleanup when init fails, to free partial allocs

2016-07-08 Thread Corneliu ZUZU
From vm_event_init_domain(d), call vm_event_cleanup_domain(d) if per-vcpu allocations failed -at some point- to cleanup partial allocations, if any were done along the way. Also minor adjustments: add unlikely in if's and add some comments. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.

[Xen-devel] [PATCH 06/16] x86/monitor: fix: set msr_bitmap to NULL after xfree

2016-07-08 Thread Corneliu ZUZU
gly. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/monitor.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c index 29188e5..8f41f21 100644 --- a/xen/arch/x86/monitor.c +++ b/xen/arch/x86/

[Xen-devel] [PATCH 05/16] x86/monitor: relocate code more appropriately

2016-07-08 Thread Corneliu ZUZU
-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/hvm.c| 46 ++ xen/arch/x86/hvm/vmx/vmx.c| 59 ++--- xen/arch/x86/monitor.c| 68 +++ xen/include/asm-x86/hvm/vmx

[Xen-devel] [PATCH 04/16] x86/monitor: relocate vm_event_register_write_resume() function to monitor code

2016-07-08 Thread Corneliu ZUZU
vm_event_register_write_resume is part of the monitor subsystem, relocate and rename appropriately. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/monitor.c | 38 ++ xen/arch/x86/vm_event.c

[Xen-devel] [PATCH 03/16] x86/monitor: mechanical renames

2016-07-08 Thread Corneliu ZUZU
but those 2 aforementioned). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/monitor.c| 4 ++-- xen/common/monitor.c | 4 ++-- xen/common/vm_event.c | 4 ++-- xen/include/asm-arm/monitor.h | 8 +++- xen/include/asm-x86/monitor.h | 12 ++---

[Xen-devel] [PATCH 02/16] x86: fix: make atomic_read() param const

2016-07-08 Thread Corneliu ZUZU
This wouldn't let me make a param of a function that used atomic_read() const. Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/include/asm-x86/atomic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-x86/atomic.h b/xen/include/asm-x86/at

[Xen-devel] [PATCH 01/16] x86/vmx_update_guest_cr: minor optimization

2016-07-08 Thread Corneliu ZUZU
Minor optimization @ vmx_update_guest_cr: checks if v->arch.hvm_vmx.exec_control was modified before actually calling vmx_update_cpu_exec_control(v). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- xen/arch/x86/hvm/vmx/vmx.c | 5 - 1 file changed, 4 insertions(+), 1

[Xen-devel] [PATCH 00/16] x86/vm-event: numerous adjustments & fixes

2016-07-08 Thread Corneliu ZUZU
Adjustments & fixes to the vm-events code, mostly monitor-related. As I hadn't got the time/proper context to test these changes on a real machine, for now please consider them only for review, I'll let you know when and how actual testing went. Thanks, Corneliu ZUZU (16):

Re: [Xen-devel] [PATCH v3 2/8] x86/vm-event/monitor: relocate code-motion more appropriately

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 6:50 PM, Tamas K Lengyel wrote: diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c index 205df41..42f31bf 100644 --- a/xen/arch/x86/monitor.c +++ b/xen/arch/x86/monitor.c [snip] So with this code-portion appropriately being relocated here I think we should also rename..

[Xen-devel] Ping: [PATCH v3 1/8] x86/vmx_update_guest_cr: minor optimization

2016-07-08 Thread Corneliu ZUZU
On 7/6/2016 6:49 PM, Corneliu ZUZU wrote: Minor optimization @ vmx_update_guest_cr: checks if v->arch.hvm_vmx.exec_control was modified before actually calling vmx_update_cpu_exec_control(v). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- Changed since v2: --- xen/arch/x8

Re: [Xen-devel] [PATCH v3 2/8] x86/vm-event/monitor: relocate code-motion more appropriately

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 2:53 PM, Jan Beulich wrote: On 08.07.16 at 13:33, wrote: On 7/8/2016 1:37 PM, Jan Beulich wrote: On 08.07.16 at 12:22, wrote: On 7/8/2016 10:21 AM, Jan Beulich wrote: On 06.07.16 at 17:50, wrote: +/*

Re: [Xen-devel] [PATCH v3 1/8] x86/vmx_update_guest_cr: minor optimization

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 2:48 PM, Jan Beulich wrote: On 08.07.16 at 13:39, <cz...@bitdefender.com> wrote: On 7/6/2016 6:49 PM, Corneliu ZUZU wrote: Minor optimization @ vmx_update_guest_cr: checks if v->arch.hvm_vmx.exec_control was modified before actually calling vmx_update_cpu_exec_control(v)

Re: [Xen-devel] [PATCH v3 1/8] x86/vmx_update_guest_cr: minor optimization

2016-07-08 Thread Corneliu ZUZU
On 7/6/2016 6:49 PM, Corneliu ZUZU wrote: Minor optimization @ vmx_update_guest_cr: checks if v->arch.hvm_vmx.exec_control was modified before actually calling vmx_update_cpu_exec_control(v). Signed-off-by: Corneliu ZUZU <cz...@bitdefender.com> --- Changed since v2: --- xen/arch/x8

Re: [Xen-devel] [PATCH v3 2/8] x86/vm-event/monitor: relocate code-motion more appropriately

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 1:37 PM, Jan Beulich wrote: On 08.07.16 at 12:22, wrote: On 7/8/2016 10:21 AM, Jan Beulich wrote: On 06.07.16 at 17:50, wrote: The title of this patch keeps confusing me - which code motion is being relocated here? As the commit

Re: [Xen-devel] [PATCH v3 7/8] minor fixes (formatting, comments, unused includes etc.)

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 10:56 AM, Jan Beulich wrote: On 06.07.16 at 17:55, wrote: --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -63,11 +62,9 @@ #include #include

Re: [Xen-devel] [PATCH v3 3/8] x86/vm-event/monitor: don't compromise monitor_write_data on domain cleanup

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 10:35 AM, Jan Beulich wrote: On 06.07.16 at 17:51, wrote: @@ -492,8 +493,12 @@ int vcpu_initialise(struct vcpu *v) void vcpu_destroy(struct vcpu *v) { -xfree(v->arch.vm_event); -v->arch.vm_event = NULL; +if ( unlikely(v->arch.vm_event) ) +

Re: [Xen-devel] [PATCH v3 2/8] x86/vm-event/monitor: relocate code-motion more appropriately

2016-07-08 Thread Corneliu ZUZU
On 7/8/2016 10:21 AM, Jan Beulich wrote: On 06.07.16 at 17:50, wrote: The title of this patch keeps confusing me - which code motion is being relocated here? As the commit message clearly states, the code motions that are being relocated are: 1) handling of

Re: [Xen-devel] [PATCH v3 6/8] x86/vm-event: minor ASSERT fix, add 'unlikely'

2016-07-07 Thread Corneliu ZUZU
On 7/7/2016 11:27 AM, Jan Beulich wrote: On 06.07.16 at 17:54, wrote: --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -475,7 +475,7 @@ void hvm_do_resume(struct vcpu *v) if ( unlikely(v->arch.vm_event) ) { -if (

  1   2   3   4   >