* Followup corrections to kexec STATUS patch v3
@ 2017-01-18 18:01 Eric DeVolder
2017-01-18 18:01 ` [PATCH] Put back blank line for readability purposes Eric DeVolder
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Eric DeVolder @ 2017-01-18 18:01 UTC (permalink / raw)
To: xen-devel, andrew.cooper3, wei.liu2, ian.jackson
Cc: elena.ufimtseva, daniel.kiper, konrad.wilk
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 header description.
Note: My handling of the test_bit() scenario is to explicitly
check for return value of 1, so any value other than 1 causes
kexec_status to return 0.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH] Put back blank line for readability purposes.
2017-01-18 18:01 Followup corrections to kexec STATUS patch v3 Eric DeVolder
@ 2017-01-18 18:01 ` Eric DeVolder
2017-01-18 18:01 ` [PATCH] kexec: ensure kexec_status() always returns 0 or 1 Eric DeVolder
2017-01-18 20:59 ` Followup corrections to kexec STATUS patch v3 Daniel Kiper
2 siblings, 0 replies; 4+ messages in thread
From: Eric DeVolder @ 2017-01-18 18:01 UTC (permalink / raw)
To: xen-devel, andrew.cooper3, wei.liu2, ian.jackson
Cc: elena.ufimtseva, daniel.kiper, konrad.wilk
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.h
+++ b/xen/include/public/kexec.h
@@ -240,6 +240,7 @@ typedef struct xen_kexec_status {
uint8_t type;
} xen_kexec_status_t;
DEFINE_XEN_GUEST_HANDLE(xen_kexec_status_t);
+
#else /* __XEN_INTERFACE_VERSION__ < 0x00040400 */
#define KEXEC_CMD_kexec_load KEXEC_CMD_kexec_load_v1
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] kexec: ensure kexec_status() always returns 0 or 1
2017-01-18 18:01 Followup corrections to kexec STATUS patch v3 Eric DeVolder
2017-01-18 18:01 ` [PATCH] Put back blank line for readability purposes Eric DeVolder
@ 2017-01-18 18:01 ` Eric DeVolder
2017-01-18 20:59 ` Followup corrections to kexec STATUS patch v3 Daniel Kiper
2 siblings, 0 replies; 4+ messages in thread
From: Eric DeVolder @ 2017-01-18 18:01 UTC (permalink / raw)
To: xen-devel, andrew.cooper3, wei.liu2, ian.jackson
Cc: elena.ufimtseva, daniel.kiper, konrad.wilk
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 b/xen/common/kexec.c
index aa808cb..40b76d5 100644
--- a/xen/common/kexec.c
+++ b/xen/common/kexec.c
@@ -1182,7 +1182,7 @@ static int kexec_status(XEN_GUEST_HANDLE_PARAM(void) uarg)
if ( kexec_load_get_bits(status.type, &base, &bit) )
return -EINVAL;
- return test_bit(bit, &kexec_flags);
+ return (test_bit(bit, &kexec_flags) == 1);
}
static int do_kexec_op_internal(unsigned long op,
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: Followup corrections to kexec STATUS patch v3
2017-01-18 18:01 Followup corrections to kexec STATUS patch v3 Eric DeVolder
2017-01-18 18:01 ` [PATCH] Put back blank line for readability purposes Eric DeVolder
2017-01-18 18:01 ` [PATCH] kexec: ensure kexec_status() always returns 0 or 1 Eric DeVolder
@ 2017-01-18 20:59 ` Daniel Kiper
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Kiper @ 2017-01-18 20:59 UTC (permalink / raw)
To: Eric DeVolder
Cc: elena.ufimtseva, wei.liu2, konrad.wilk, andrew.cooper3,
ian.jackson, xen-devel
On Wed, Jan 18, 2017 at 12:01:06PM -0600, Eric DeVolder wrote:
> 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 header description.
>
> Note: My handling of the test_bit() scenario is to explicitly
> check for return value of 1, so any value other than 1 causes
> kexec_status to return 0.
Great, however:
- please use "git format-patch -n ..." to create patches,
- first patch in the series should have [PATCH 0/3] in the subject,
- both patches lack of your SOB.
Daniel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-18 20:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 18:01 Followup corrections to kexec STATUS patch v3 Eric DeVolder
2017-01-18 18:01 ` [PATCH] Put back blank line for readability purposes Eric DeVolder
2017-01-18 18:01 ` [PATCH] kexec: ensure kexec_status() always returns 0 or 1 Eric DeVolder
2017-01-18 20:59 ` Followup corrections to kexec STATUS patch v3 Daniel Kiper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).