[Xen-devel] [PATCH v4 0/2] kexec: Use hypercall_create_continuation to protect KEXEC ops

2017-04-19 Thread Eric DeVolder
#print "Ending unload thread $thr_id\n"; threads->detach(); #End thread. }); } for my $i (0..99) { threaded_task(); } Eric DeVolder (2): kexec: use hypercall_create_continuation to protect KEXEC ops kexec: remove spinlock now that all KEXEC hypercall ops

[Xen-devel] [PATCH v4 1/2] kexec: use hypercall_create_continuation to protect KEXEC ops

2017-04-19 Thread Eric DeVolder
/have made the jump to the crash path. The overloading would lead to failures in existing checks on this flag as the flag would always be set at the top level in do_kexec_op_internal(). For this reason, the new flag KEXEC_FLAG_HC_IN_PROGRESS was introduced. While at it, fixed the #define mismat

[Xen-devel] [PATCH v4 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level

2017-04-19 Thread Eric DeVolder
place of the spin_lock(). Signed-off-by: Eric DeVolder Reviewed-by: Bhavesh Davda Reviewed-by: Konrad Rzeszutek Wilk --- v4: 04/19/2017 - Fix ASSERT to work properly. Tested with Config.mk:debug=y v3: 04/19/2017 - Incorporated feedback from Jan Beulich and Andrew Cooper to leave an ASSERT

Re: [Xen-devel] [PATCH v3 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level

2017-04-19 Thread Eric DeVolder
On 04/19/2017 11:21 AM, Jan Beulich wrote: On 19.04.17 at 17:47, wrote: @@ -832,7 +831,7 @@ static int kexec_swap_images(int type, struct kexec_image *new, if ( kexec_load_get_bits(type, &base, &bit) ) return -EINVAL; -spin_lock(&kexec_lock); +ASSERT( !test_bit(KEXEC_FLA

Re: [Xen-devel] [PATCH v3 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level

2017-04-19 Thread Eric DeVolder
On 04/19/2017 10:47 AM, Eric DeVolder wrote: The spinlock in kexec_swap_images() was removed as this function is only reachable on the kexec hypercall, which is now protected at the top-level in do_kexec_op_internal(), thus the local spinlock is no longer necessary. Per recommendation from Jan

Re: [Xen-devel] [PATCH v2 1/2] kexec: use hypercall_create_continuation to protect KEXEC ops

2017-04-19 Thread Eric DeVolder
On 04/19/2017 06:48 AM, Andrew Cooper wrote: On 19/04/17 12:00, Daniel Kiper wrote: On Tue, Apr 18, 2017 at 04:48:06AM -0600, Jan Beulich wrote: On 17.04.17 at 21:09, wrote: --- a/xen/common/kexec.c +++ b/xen/common/kexec.c @@ -50,9 +50,10 @@ static cpumask_t crash_saved_cpus; static struct

Re: [Xen-devel] [PATCH v2 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level

2017-04-19 Thread Eric DeVolder
On 04/19/2017 08:37 AM, Jan Beulich wrote: On 19.04.17 at 14:13, wrote: On Wed, Apr 19, 2017 at 05:20:50AM -0600, Jan Beulich wrote: On 19.04.17 at 12:56, wrote: On Tue, Apr 18, 2017 at 04:49:48AM -0600, Jan Beulich wrote: On 17.04.17 at 21:09, wrote: The spinlock in kexec_swap_images() w

[Xen-devel] [PATCH v3 0/2] kexec: Use hypercall_create_continuation to protect KEXEC ops

2017-04-19 Thread Eric DeVolder
#print "Ending unload thread $thr_id\n"; threads->detach(); #End thread. }); } for my $i (0..99) { threaded_task(); } Eric DeVolder (2): kexec: use hypercall_create_continuation to protect KEXEC ops kexec: remove spinlock now that all KEXEC hypercall ops

[Xen-devel] [PATCH v3 1/2] kexec: use hypercall_create_continuation to protect KEXEC ops

2017-04-19 Thread Eric DeVolder
/have made the jump to the crash path. The overloading would lead to failures in existing checks on this flag as the flag would always be set at the top level in do_kexec_op_internal(). For this reason, the new flag KEXEC_FLAG_HC_IN_PROGRESS was introduced. While at it, fixed the #define mismat

[Xen-devel] [PATCH v3 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level

2017-04-19 Thread Eric DeVolder
place of the spin_lock(). Signed-off-by: Eric DeVolder Reviewed-by: Bhavesh Davda Reviewed-by: Konrad Rzeszutek Wilk --- v3: - Incorporated feedback from Jan Beulich and Andrew Cooper to leave an ASSERT where spin_lock() once was. v2: 04/17/2017 - Patch titled 'kexec

[Xen-devel] [PATCH v2 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level

2017-04-17 Thread Eric DeVolder
The spinlock in kexec_swap_images() was removed as this function is only reachable on the kexec hypercall, which is now protected at the top-level in do_kexec_op_internal(), thus the local spinlock is no longer necessary. Signed-off-by: Eric DeVolder Reviewed-by: Bhavesh Davda Reviewed-by

[Xen-devel] [PATCH v2 0/2] kexec: Use hypercall_create_continuation to protect KEXEC ops

2017-04-17 Thread Eric DeVolder
#print "Ending unload thread $thr_id\n"; threads->detach(); #End thread. }); } for my $i (0..99) { threaded_task(); } Eric DeVolder (2): kexec: use hypercall_create_continuation to protect KEXEC ops kexec: remove spinlock now that all KEXEC hypercall ops

[Xen-devel] [PATCH v2 1/2] kexec: use hypercall_create_continuation to protect KEXEC ops

2017-04-17 Thread Eric DeVolder
/have made the jump to the crash path. The overloading would lead to failures in existing checks on this flag as the flag would always be set at the top level in do_kexec_op_internal(). For this reason, the new flag KEXEC_FLAG_HC_IN_PROGRESS was introduced. While at it, fixed the #define mismat

[Xen-devel] [PATCH] kexec: Add spinlock for the whole hypercall

2017-04-10 Thread Eric DeVolder
lot when unloading kexec image) to prevent crashes during simultaneous load/unloads. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Eric DeVolder Reviewed-by: Daniel Kiper --- xen/common/kexec.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/xen/common/

[Xen-devel] [PATCH v4] kexec: implemented XEN KEXEC STATUS to determine if an image is loaded

2017-01-25 Thread Eric DeVolder
: Konrad Rzeszutek Wilk Signed-off-by: Eric DeVolder --- CC: ke...@lists.infradead.org CC: xen-de...@lists.xenproject.org CC: Daniel Kiper v0: First version (internal product). v1: Posted on kexec mailing list. Changed -s to -S v2: Incorporated feedback from kexec mailing list, posted on kexec

Re: [Xen-devel] [PATCH v3] kexec: implemented XEN KEXEC STATUS to determine if an image is loaded

2017-01-24 Thread Eric DeVolder
On 01/24/2017 01:16 PM, Daniel Kiper wrote: On Tue, Jan 24, 2017 at 12:55:35PM -0600, Eric DeVolder wrote: Instead of the scripts having to poke at various fields we can provide that functionality via the -S parameter. kexec_loaded/kexec_crash_loaded exposes Linux kernel kexec/crash state. It

Re: [Xen-devel] [PATCH v3] kexec: implemented XEN KEXEC STATUS to determine if an image is loaded

2017-01-24 Thread Eric DeVolder
On 01/24/2017 01:16 PM, Daniel Kiper wrote: On Tue, Jan 24, 2017 at 12:55:35PM -0600, Eric DeVolder wrote: Instead of the scripts having to poke at various fields we can provide that functionality via the -S parameter. kexec_loaded/kexec_crash_loaded exposes Linux kernel kexec/crash state. It

[Xen-devel] [PATCH v3] kexec: implemented XEN KEXEC STATUS to determine if an image is loaded

2017-01-24 Thread Eric DeVolder
: Konrad Rzeszutek Wilk Signed-off-by: Eric DeVolder --- Note: The corresponding Xen changes have been committed to the Xen staging branch. Follow this thread: https://lists.xenproject.org/archives/html/xen-devel/2017-01/msg01570.html CC: Andrew Cooper CC: ke...@lists.infradead.org CC: xen-de

[Xen-devel] [PATCH v2] kexec: implemented XEN KEXEC STATUS to determine if an image is loaded

2017-01-20 Thread Eric DeVolder
Instead of the scripts having to poke at various fields we can provide that functionality via the -S parameter. Returns 0 if the payload is loaded. Can be used in combination with -l or -p to get the state of the proper kexec image. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Eric

[Xen-devel] [PATCH 1/1] kexec: ensure kexec_status() return bit value of 0 or 1

2017-01-19 Thread Eric DeVolder
When checking kexec_flags bit corresponding to the requested image, ensure that 0 or 1 is returned. Signed-off-by: Eric DeVolder --- xen/common/kexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/common/kexec.c b/xen/common/kexec.c index aa808cb..3da27bf 100644

[Xen-devel] [PATCH 0/1] Followup corrections for kexec_status()

2017-01-19 Thread Eric DeVolder
Jan, This corrects the use of test_bit() in kexec_status(). Wei, This patch is against the kexec_status() recently applied to staging. Regards, Eric ___ Xen-devel mailing list Xen-devel@lists.xen.org https://lists.xen.org/xen-devel

[Xen-devel] [PATCH 1/2] Put back blank line for readability purposes.

2017-01-18 Thread Eric DeVolder
This blank line was accidentally removed during the insertion of the kexec_status() declarations. Signed-off-by: Eric DeVolder --- xen/include/public/kexec.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/include/public/kexec.h b/xen/include/public/kexec.h index c200e8c..74ea981 100644

[Xen-devel] [PATCH 2/2] kexec: ensure kexec_status() always returns 0 or 1

2017-01-18 Thread Eric DeVolder
The use of test_bit() can also return EPERM, so the return value from test_bit() must be checked to ensure that kexec_status() always returns 0, 1 or -1, per the public header description. Signed-off-by: Eric DeVolder --- xen/common/kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[Xen-devel] [PATCH] kexec: followup to STATUS patch v3 already in staging

2017-01-18 Thread Eric DeVolder
This contains the two corrections pointed out by Jan Beulich for the kexec STATUS call just introduced. Note: In kexec_status(), the use of test_bit() can also return EPERM, so the return value from test_bit() must be checked to ensure that kexec_status() always returns 0, 1 or -1, per the public

Re: [Xen-devel] [PATCH v4] kexec: implement STATUS hypercall to check if image is loaded

2017-01-18 Thread Eric DeVolder
On 01/18/2017 11:47 AM, Wei Liu wrote: On Wed, Jan 18, 2017 at 11:46:13AM -0600, Eric DeVolder wrote: The tools that use kexec are asynchronous in nature and do not keep state changes. As such provide an hypercall to find out whether an image has been loaded for either type. Note: No need to

[Xen-devel] [PATCH] Put back blank line for readability purposes.

2017-01-18 Thread Eric DeVolder
This blank line was accidentally removed during the insertion of the kexec_status() declarations. --- xen/include/public/kexec.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/include/public/kexec.h b/xen/include/public/kexec.h index c200e8c..74ea981 100644 --- a/xen/include/public/kexec.

[Xen-devel] [PATCH] kexec: ensure kexec_status() always returns 0 or 1

2017-01-18 Thread Eric DeVolder
The use of test_bit() can also return EPERM, so the return value from test_bit() must be checked to ensure that kexec_status() always returns 0, 1 or -1, per the public header description. --- xen/common/kexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/kexec.c

[Xen-devel] Followup corrections to kexec STATUS patch v3

2017-01-18 Thread Eric DeVolder
This contains the two corrections pointed out by Jan Beulich for the kexec STATUS call just introduced. Note: In kexec_status(), the use of test_bit() can also return EPERM, so the return value from test_bit() must be checked to ensure that kexec_status() always returns 0, 1 or -1, per the public

Re: [Xen-devel] [PATCH v3] kexec: implement STATUS hypercall to check if image is loaded

2017-01-18 Thread Eric DeVolder
On 01/18/2017 04:47 AM, Wei Liu wrote: On Wed, Jan 18, 2017 at 03:45:54AM -0700, Jan Beulich wrote: On 18.01.17 at 11:37, wrote: On Wed, Jan 18, 2017 at 03:19:49AM -0700, Jan Beulich wrote: On 17.01.17 at 18:29, wrote: --- a/xen/common/kexec.c +++ b/xen/common/kexec.c @@ -1169,6 +1169,22 @@

[Xen-devel] [PATCH v4] kexec: implement STATUS hypercall to check if image is loaded

2017-01-18 Thread Eric DeVolder
or -1, per the public header description. Note: This is just the Xen side of the hypercall, kexec-tools patch to come separately. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Eric DeVolder --- CC: Andrew Cooper CC: Elena Ufimtseva CC: Daniel Kiper v0: Internal version. v1: Dropped

[Xen-devel] [PATCH v3] kexec: implement STATUS hypercall to check if image is loaded

2017-01-17 Thread Eric DeVolder
KEXEC_FLAG_IN_PROGRESS (and error out of kexec_status()) as this flag is set only once by the first/only cpu on the crash path. Note: This is just the Xen side of the hypercall, kexec-tools patch to come separately. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Eric DeVolder --- CC: Andrew

[Xen-devel] [PATCH v2] kexec: implement STATUS hypercall to check if image is loaded

2017-01-12 Thread Eric DeVolder
, kexec-tools patch to come separately. Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Eric DeVolder Reviewed-by: Daniel Kiper --- CC: Elena Ufimtseva CC: Daniel Kiper v0: Internal version. v1: Dropped Reviewed-by, posting on xen-devel. v2: Incorporated xen-devel feedback --- tools

[Xen-devel] [PATCH] convert tabs into spaces; preserving indentation

2017-01-09 Thread Eric DeVolder
Convert tabs into spaces; preserving indentation No functional changes Signed-off-by: Eric DeVolder --- tools/libxc/xc_kexec.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexec.c index 989e225192..59e2f076f4

[Xen-devel] [replace tabs with spaces] convert tabs into spaces; preserving indentation

2017-01-09 Thread Eric DeVolder
Convert tabs into spaces; preserving indentation No functional changes Signed-off-by: Eric DeVolder --- tools/libxc/xc_kexec.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexec.c index 989e225192..59e2f076f4

[Xen-devel] [XEN KEXEC PATCH] Corrected comment typo "count not" to "could not"

2016-12-21 Thread Eric DeVolder
Fix cut-n-paste typo; changed the words "count not" to "could not". No functional changes Signed-off-by: Eric DeVolder --- tools/libxc/xc_kexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxc/xc_kexec.c b/tools/libxc/xc_kexe