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 before you d

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

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.

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

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 d

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 of

[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 XEN_DOMCTL_MONITO

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 wrote: On 7/9/2016 9:10 PM, Tamas K Lengyel wrote: On Fri, Jul 8, 2016

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 Changed: * remove paragraph(s) from README.LinuxPrimitives file * no

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

2016-07-15 Thread Corneliu ZUZU
On 7/12/2016 11:07 AM, Corneliu ZUZU wrote: 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

[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 Reviewed-by: Andrew Cooper Acked-by: Julien Grall --- Changed since v4: --- xen/include/asm-arm/atomic.h | 5 + xen/include/asm-x86/atomic.h | 27 +++ xen/include/xen/atomic.h | 36

[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 Reviewed-by: Stefano Stabellini --- Changed since v4: * README.LinuxPrimitives not updated anymore --- xen/include/asm-arm/atomic.h | 13 ++--- 1 file changed, 10 insertions

[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 Reviewed-by: Andrew Cooper Reviewed-by: Stefano Stabellini Reviewed-by: Julien Grall --- Changed since v4: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.

[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 Suggested-by: Andrew Cooper Reviewed-by: Andrew Cooper Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- Changed since v4: * removed paragraph(s) in README.LinuxPrimitives file --- xen/include/a

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

2016-07-15 Thread Corneliu ZUZU
Reorder macro definitions to match x86-side. Signed-off-by: Corneliu ZUZU Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- Changed since v4: --- xen/include/asm-arm/atomic.h | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xen/include/asm-arm

[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 Reviewed-by: Andrew Cooper --- Changed since v4: --- xen/include/asm-x86/atomic.h | 39 +++ 1 file changed, 19 insertions(+), 20 deletions

[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 Reviewed-by: Stefano Stabellini --- Changed since v4: * remove paragraph(s) from README.LinuxPrimitives file * no empty line additions --- xen/arch/arm

[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 Changed: * remove paragraph(s) from README.LinuxPrimitives file * no empty line additions 2/7: asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement

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 to

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 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 README.LinuxPrimitives in the process. Also empty line fixes. Why do you add empty

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

2016-07-15 Thread Corneliu ZUZU
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 wrote: On 7/9/2016 9:10 PM, Tamas K Lengyel wrote: On Fri, Jul 8, 2016 at 10:13 PM, Corneliu ZUZU wrote: Arch-specific vm-event functions in x86/vm_event.h

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

2016-07-14 Thread Corneliu ZUZU
On 7/15/2016 9:51 AM, Corneliu ZUZU wrote: Turn atomic_inc_return and atomic_dec_return atomic.h macros to inline functions. Adjust README.LinuxPrimitives in the process. Signed-off-by: Corneliu ZUZU Reviewed-by: Stefano Stabellini --- Changed since v3: * update README.LinuxPrimitives file

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

2016-07-14 Thread Corneliu ZUZU
implemented X86 functions in common Signed-off-by: Corneliu ZUZU Reviewed-by: Andrew Cooper --- Changed since v3: * add wrapper over arm-side __atomic_add_unless() instead of removing the leading underscores --- xen/include/asm-arm/atomic.h | 5 + xen/include/asm-x86/atomic.h | 27

[Xen-devel] [PATCH v4 6/7] 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. Adjust README.LinuxPrimitives in the process. Signed-off-by: Corneliu ZUZU Reviewed-by: Stefano Stabellini --- Changed since v3: * update README.LinuxPrimitives file --- xen/arch/arm/README.LinuxPrimitives | 18

[Xen-devel] [PATCH v4 5/7] xen/atomic.h: 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 Reviewed-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- Changed since v3: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h | 2 +- xen/include/xen/ato

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

2016-07-14 Thread Corneliu ZUZU
(also updated README.LinuxPrimitives file). Removed outdated comment ("NB. I've [...]"). Signed-off-by: Corneliu ZUZU Suggested-by: Andrew Cooper Reviewed-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- Changed since v3: * update README.LinuxPrimitives file --

[Xen-devel] [PATCH v4 2/7] 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 Reviewed-by: Andrew Cooper --- Changed since v3: --- xen/include/asm-x86/atomic.h | 39 +++ 1 file changed, 19 insertions(+), 20 deletions

[Xen-devel] [PATCH v4 3/7] 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 Reviewed-by: Stefano Stabellini --- Changed since v3: --- 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

[Xen-devel] [PATCH v4 1/7] 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. Adjust README.LinuxPrimitives in the process. Also empty line fixes. Signed-off-by: Corneliu ZUZU Reviewed-by: Stefano Stabellini --- Changed since v3: * update README.LinuxPrimitives file

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

2016-07-14 Thread Corneliu ZUZU
Corneliu ZUZU (7): 1/7: asm-arm/atomic.h: fix arm32|arm64 macros duplication Reviewed-by: Stefano Stabellini Changed: * update README.LinuxPrimitives file 2/7: asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement Reviewed-by: Andrew Cooper Changed: 3/7

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 1:14 PM, Julien Grall wrote: On 14/07/16 11:11, Corneliu ZUZU wrote: 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

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 deci

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 Reviewed-by: Andrew Cooper You have dropped a Reviewed-by: Stefano Stabellini from v2. ~A

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 Reviewed-by: Andrew Cooper You have dropped a Reviewed-by: Stefano Stabellini from v2. ~A

[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 --- xen/include/asm-x86/atomic.h | 27 +++ xen/include/xen/atomic.h

[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 --- xen/include/asm-arm/arm32/atomic.h | 2 +- xen/include/asm-arm/arm64/atomic.h | 2 +- 2 files changed, 2 insertions(+), 2

[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 --- 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/include/asm-arm/atomic.h index

[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 Reviewed-by: Andrew Cooper --- Changed since v2: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h | 2 +- xen/include/xen/atomic.h | 2 +- 3 files chang

[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 Suggested-by: Andrew Cooper Reviewed-by: Andrew Cooper --- Changed since v2: * sample code for atomic_cmpxchg() (doc-comment in ) updated to use atomic_read() instead of directly accessing v.counter -

[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 Reviewed-by: Stefano Stabellini --- Changed since v2: --- 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

[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 --- Changed since v2: arm empty line fixes moved from here --- xen/include/asm-x86/atomic.h | 39 +++ 1 file changed, 19 insertions(+), 20

[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 Reviewed-by: Stefano Stabellini --- Changed since v2: * also moved mistakenly omitted atomic_xchg() * arm empty line fixes moved here

[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 Changed: * also moved mistakenly omitted atomic_xchg() * arm empty line fixes moved here 2/8: asm-x86/atomic.h: minor: proper atomic_inc_and_test() placement

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

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 to

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 di

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 Suggested-by: Andrew Cooper Reviewed-by: Andrew Cooper --- Changed since v1: * removed comments that were duplicate between asm-x86/atomic.h and xen/atomic.h * remove outdated comment ("

[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 Reviewed-by: Andrew Cooper --- Changed since v1: --- xen/include/asm-arm/atomic.h | 2 +- xen/include/asm-x86/atomic.h | 2 +- xen/include/xen/atomic.h | 2 +- 3 files chang

[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 --- 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 19a87a5..e8f7340 100644 --- a/xen

[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 --- xen/include/asm-arm/atomic.h | 1 + xen/include/asm-x86/atomic.h | 39 +++ 2 files changed, 20 insertions

[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 --- xen/include/asm-arm/arm32/atomic.h | 11 --- xen/include/asm-arm/arm64/atomic.h | 11 --- xen/include/asm-arm/atomic.h | 11 +++ 3

[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 introd

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 he

[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 --- 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 deletions(-) diff --git

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

2016-07-13 Thread Corneliu ZUZU
urned 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 --- xen/include/asm-arm/arm32/atomic.h | 11 --- xen/include/asm-arm/arm64/atomic.h | 11 --- xen/include/as

[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

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-11 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 wrote: On 7/9/2016 9:10 PM, Tamas K Lengyel wrote: On Fri, Jul 8, 2016 at 10:13 PM, Corneliu ZUZU wrote: Arch-specific vm-event functions in x86/vm_event.h -e.g. vm_event_init_domain()- don't ha

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 This is a good improvement, but you must make an identical adjustment to the arm

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 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] I keep seeing '[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 m

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

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

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

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

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:

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 #d

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 wrote: vm_event_register_write_resume is part of the monitor subsystem, relocate and rename appropriately. Signed-off-by: Corneliu ZUZU --- xen/arch/x86/monitor.c | 38

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 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 - originally the only two mo

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));" @ hvm_set_c

[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 --- xen/arch/x86/monitor.c

[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 ZUZU

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

2016-07-08 Thread Corneliu ZUZU
/vm_event.h and asm-x86/monitor.h. Signed-off-by: Corneliu ZUZU --- xen/arch/x86/hvm/emulate.c | 8 +++--- xen/arch/x86/hvm/hvm.c | 31 xen/arch/x86/mm/p2m.c | 7 -- xen/arch/x86/monitor.c | 55 --

[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 --- xen/arch/x86/monitor.c | 3 +++ xen/include/asm-x86/domain.h | 17

[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 --- xen/arch/x86/monitor.c | 3 +++ xen/arch/x86/vm_event.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git

[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
applies. Signed-off-by: Corneliu ZUZU --- 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/monitor.h | 11 +++-

[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 --- xen/arch/x86/domain.c | 4 ++-- xen/arch/x86/vm_event.c| 5 + xen/include/asm-x86/vm_event.h | 10 ++ 3 files changed, 13

[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 --- 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/include/asm-arm/monitor.h b/xen/incl

[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 --- xen/arch/x86/monitor.c | 5 + xen/arch/x86/vm_event.c| 15 --- xen/com

[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 --- xen/arc

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

2016-07-08 Thread Corneliu ZUZU
y accordingly. Signed-off-by: Corneliu ZUZU --- 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/monitor.c @@

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

2016-07-08 Thread Corneliu ZUZU
: Corneliu ZUZU --- 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/vmx.h | 1 + xen/include/asm

[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 --- xen/arch/x86/monitor.c | 38 ++ xen/arch/x86/vm_event.c| 37 - xen/common

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

2016-07-08 Thread Corneliu ZUZU
't have a counterpart in common-code (all but those 2 aforementioned). Signed-off-by: Corneliu ZUZU --- 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-x8

[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 --- 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/atomic.h index d246b70..0b

[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 --- xen/arch/x86/hvm/vmx/vmx.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xen/arch/

[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 ZU

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 --- Changed since v2: --- xen/arch/x86/hvm/vmx/vmx.c | 5 -

  1   2   3   4   >