[XTF] xenbus: fix xenbus_write() ring overflow

2020-06-03 Thread Pawel Wieczorkiewicz
to the beginning of the ring buffer. Signed-off-by: Pawel Wieczorkiewicz --- common/xenbus.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/xenbus.c b/common/xenbus.c index 59159f2..24fff48 100644 --- a/common/xenbus.c +++ b/common/xenbus.c @@ -31,9 +31,7 @@ static

[XTF v2 v2 4/4] setup: Detect and display Xen version on test startup

2020-04-23 Thread Pawel Wieczorkiewicz
In arch_setup() detect Xen version by issuing xen_version hypercall and optionally pass the version to main_xtf(). Signed-off-by: Pawel Wieczorkiewicz --- Changed since v1: * Do not limit setup_pv_console() to HVM only. It does not crash. It merely panics because the callbacks array wasn't

[XTF v2 v2 2/4] lib: always append CR after LF in vsnprintf()

2020-04-23 Thread Pawel Wieczorkiewicz
The explicit LFCR sequence guarantees proper line by line formatting in the output. The '\n' character alone on some terminals is not automatically converted to LFCR. Signed-off-by: Pawel Wieczorkiewicz --- Changed since v1: * Emit CRLF instead of LFCR common/libc/vsnprintf.c | 10

[XTF v2 v2 3/4] Enabled serial writing for hvm guests

2020-04-23 Thread Pawel Wieczorkiewicz
From: Paul Semel setup.c: PV console writing is not working in Xen 4.2 for hvm guests, so we make xtf write to COM1 serial port to get its output Signed-off-by: Paul Semel Signed-off-by: Pawel Wieczorkiewicz --- Changed since v1: * Increase callbacks array arch/x86/setup.c | 14

[XTF v2 v2 0/4] Small fixes and improvements

2020-04-23 Thread Pawel Wieczorkiewicz
This is the first series of XTF patches I intend to send. It covers some relatively small changes displaying Xen version on test start, as well as adding serial consol support for HVM guests.. Paul Semel (1): Enabled serial writing for hvm guests Pawel Wieczorkiewicz (3): lib: Add XEN_MAJOR

[XTF v2 v2 1/4] lib: Add XEN_MAJOR() and XEN_MINOR() macros

2020-04-23 Thread Pawel Wieczorkiewicz
These are just a simple macros obtaining major, minor values as returned by xen_version hypercall. Signed-off-by: Pawel Wieczorkiewicz --- include/xtf/lib.h| 3 +++ tests/xsa-213/main.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/xtf/lib.h b/include/xtf

[XTF 3/4] libc, strtol: Add FreeBSD libc implementation of strtoul()

2020-04-23 Thread Pawel Wieczorkiewicz
The function was derived from: https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/strtoul.c Sligthly modified to use ctypes helpers and ignore locale. Signed-off-by: Pawel Wieczorkiewicz --- common/libc/strtol.c | 69 include/xtf

[XTF 2/4] libc, strtol: Add isspace(), isdigit(), isxdigit(), isascii()

2020-04-23 Thread Pawel Wieczorkiewicz
These ctype.h derived helper functions simplify strtol() code and will help simplify strtoul(). Signed-off-by: Pawel Wieczorkiewicz --- common/lib.c| 8 common/libc/strtol.c| 9 +++-- common/libc/vsnprintf.c | 8 include/xtf/libc.h | 29

[XTF 1/4] string: add freebds libc implementation of strtol()

2020-04-23 Thread Pawel Wieczorkiewicz
From: Paul Semel Added freebsd libc implementation of the strtol() function. Original can be found here : https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/strtol.c Signed-off-by: Paul Semel --- build/files.mk | 1 + common/libc/strtol.c | 135

[XTF 4/4] libc: add strncmp() function

2020-04-23 Thread Pawel Wieczorkiewicz
Signed-off-by: Pawel Wieczorkiewicz --- common/libc/string.c | 11 +++ include/xtf/libc.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/common/libc/string.c b/common/libc/string.c index 5c25e27..d81e324 100644 --- a/common/libc/string.c +++ b/common/libc/string.c @@ -56,6

[XTF 0/4] Add strncmp(), strtol() and strtoul() functions

2020-04-23 Thread Pawel Wieczorkiewicz
. Also add simple implementation of the strncmp() function. Paul Semel (1): string: add freebds libc implementation of strtol() Pawel Wieczorkiewicz (3): libc, strtol: Add isspace(), isdigit(), isxdigit(), isascii() libc, strtol: Add FreeBSD libc implementation of strtoul() libc: add strncmp

[XTF 4/6] time: Add helper functions and macros to time management

2020-04-17 Thread Pawel Wieczorkiewicz
From: Paul Semel Add the following helper functions: - nspin_sleep() - spin_sleep() - mspin_sleep() Add the following helper macros: - sleep() - msleep() - NOW() Signed-off-by: Paul Semel --- common/time.c | 58 ++

[XTF 6/6] event_channels: Add EVTCHNOP_bind_vcpu hypercall support

2020-04-17 Thread Pawel Wieczorkiewicz
Signed-off-by: Pawel Wieczorkiewicz --- include/xen/event_channel.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/xen/event_channel.h b/include/xen/event_channel.h index 62ee95a..6253b89 100644 --- a/include/xen/event_channel.h +++ b/include/xen/event_channel.h @@ -2,6 +2,7

[XTF 2/6] time: add current_time() function to time management

2020-04-17 Thread Pawel Wieczorkiewicz
From: Paul Semel This function returns the "epoch" time. Signed-off-by: Paul Semel --- common/time.c | 16 include/xtf/time.h | 4 2 files changed, 20 insertions(+) diff --git a/common/time.c b/common/time.c index b9a6531..7decd07 100644 --- a/common/time.c +++

[XTF 3/6] time: add gettimeofday() function to time managment

2020-04-17 Thread Pawel Wieczorkiewicz
From: Paul Semel Signed-off-by: Paul Semel --- common/time.c | 14 ++ include/xtf/time.h | 12 2 files changed, 26 insertions(+) diff --git a/common/time.c b/common/time.c index 7decd07..fffae1c 100644 --- a/common/time.c +++ b/common/time.c @@ -90,6 +90,20 @@

[XTF 5/6] time: Add cycles2{n,u,m}sec functions

2020-04-17 Thread Pawel Wieczorkiewicz
In order to easily translate CPU cycles to time values add the following helpers: - cycles2nsec() - cycles2usec() - cycles2msec() Signed-off-by: Pawel Wieczorkiewicz --- common/time.c | 17 + include/xtf/time.h | 5 - 2 files changed, 21 insertions(+), 1 deletion

[XTF 0/6] Add time management functionality

2020-04-17 Thread Pawel Wieczorkiewicz
Pawel Wieczorkiewicz (2): time: Add cycles2{n,u,m}sec functions event_channels: Add EVTCHNOP_bind_vcpu hypercall support build/files.mk | 1 + common/time.c | 190 include/xen/event_channel.h | 7 ++ include/xtf

[XTF 4/4] setup: Setup PV console for HVM guests on xen >4.2

2020-04-16 Thread Pawel Wieczorkiewicz
the version to main_xtf(). Signed-off-by: Paul Semel Signed-off-by: Pawel Wieczorkiewicz --- arch/x86/setup.c| 20 ++-- common/setup.c | 6 +- include/xtf/framework.h | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/arch/x86/setup.c b/arch/x86

[XTF 3/4] Enabled serial writing for hvm guests

2020-04-16 Thread Pawel Wieczorkiewicz
From: Paul Semel setup.c: PV console writing is not working in Xen 4.2 for hvm guests, so we make xtf write to COM1 serial port to get its output Signed-off-by: Paul Semel Signed-off-by: Pawel Wieczorkiewicz --- arch/x86/setup.c | 14 ++ 1 file changed, 14 insertions(+) diff

[XTF 0/4] Small fixes and improvements

2020-04-16 Thread Pawel Wieczorkiewicz
This is the first series of XTF patches I intend to send. It covers some relatively small fixes to handling of PV console by HVM guests, as well as adding serial consol support. Paul Semel (2): Enabled serial writing for hvm guests setup: Setup PV console for HVM guests on xen >4.2 Pa

[XTF 2/4] lib: always append CR after LF in vsnprintf()

2020-04-16 Thread Pawel Wieczorkiewicz
The explicit LFCR sequence guarantees proper line by line formatting in the output. The '\n' character alone on some terminals is not automatically converted to LFCR. Signed-off-by: Pawel Wieczorkiewicz --- common/libc/vsnprintf.c | 10 ++ 1 file changed, 10 insertions(+) diff --git

[XTF 1/4] lib: Add XEN_MAJOR() and XEN_MINOR() macros

2020-04-16 Thread Pawel Wieczorkiewicz
These are just a simple macros obtaining major, minor values as returned by xen_version hypercall. Signed-off-by: Pawel Wieczorkiewicz --- include/xtf/lib.h| 3 +++ tests/xsa-213/main.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/xtf/lib.h b/include/xtf

[Xen-devel] [PATCH] livepatch: use proper rc variable in livepatch_do_action()

2020-01-06 Thread Pawel Wieczorkiewicz
Fix c bug in the livepatch_do_action() code of LIVEPATCH_ACTION_REPLACE case. The correct variable handling return code of revert action is other->rc in this case. Coverity-ID: 1457467 Fixes: 6047104c3c ("livepatch: Add per-function applied/reverted state tracking marker") Signed-

[Xen-devel] [PATCH] livepatch: Fix typos and other errors in tests Makefile

2019-12-20 Thread Pawel Wieczorkiewicz
There was a bunch of typos (s/actions/action/) as well as one missing config.h target dependency. Also, xen_expectation target has unnecessary cycle dependency. Signed-off-by: Pawel Wieczorkiewicz --- xen/test/livepatch/Makefile | 12 +++- 1 file changed, 7 insertions(+), 5 deletions

[Xen-devel] [PATCH livepatch-build-tools] create-diff-object: Include string sections later

2019-12-02 Thread Pawel Wieczorkiewicz
must be evaluated first. Signed-off-by: Pawel Wieczorkiewicz Reported-by: Sergey Dyasli --- create-diff-object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create-diff-object.c b/create-diff-object.c index 1ce5c09..a516670 100644 --- a/create-diff-object.c +++ b

[Xen-devel] [PATCH livepatch-build-tools] create-diff-object: Ignore .init sections

2019-12-02 Thread Pawel Wieczorkiewicz
The .init sections must not be considered for patching regardless of whether they are CHANGED or NEW. Explicitely detect and ignore all such sections, before marking ignored sections as SAME. Signed-off-by: Pawel Wieczorkiewicz --- common.c | 7 +++ common.h | 1

[Xen-devel] [PATCH v2] MAINTAINERS: Add mandatory V: version identifier

2019-11-26 Thread Pawel Wieczorkiewicz
The livepatch-build-tools MAINTAINERS file is missing V: version identifier. This seems required by the Xen repo's add_maintainers.pl script. Signed-off-by: Pawel Wieczorkiewicz --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index de2aedb..aa04d06

[Xen-devel] [PATCH] MAINTAINERS: Add mandatory V: version identifier

2019-11-26 Thread Pawel Wieczorkiewicz
This seems required by the Xen repo's add_maintainers.pl script. Signed-off-by: Pawel Wieczorkiewicz --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index de2aedb..aa04d06 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9,3 +9,4 @@ L: xen-devel

[Xen-devel] [PATCH v3 7/7] livepatch-build: Strip all metadata symbols from hotpatch modules

2019-11-26 Thread Pawel Wieczorkiewicz
-off-by: Pawel Wieczorkiewicz Reviewed-by: Ross Lagerwall --- livepatch-build | 55 +-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/livepatch-build b/livepatch-build index 9e5bad3..e1715ea 100755 --- a/livepatch-build +++ b

[Xen-devel] [PATCH v3 2/7] create-diff-object: Handle extra pre-|post- hooks

2019-11-26 Thread Pawel Wieczorkiewicz
Include new sections containing optional pre-, post- action hooks. The following new section names are supported: - .livepatch.hooks.preapply - .livepatch.hooks.postapply - .livepatch.hooks.prerevert - .livepatch.hooks.postrevert Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Ross

[Xen-devel] [PATCH v3 3/7] create-diff-object: Handle optional apply|revert hooks

2019-11-26 Thread Pawel Wieczorkiewicz
Include new sections containing optional apply and revert action hooks. The following new section names are supported: - .livepatch.hooks.apply - .livepatch.hooks.revert Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Ross Lagerwall --- create-diff-object.c | 10 ++ 1 file

[Xen-devel] [PATCH v3 5/7] create-diff-object: Add support for expectations

2019-11-26 Thread Pawel Wieczorkiewicz
specified in the patch. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Ross Lagerwall --- Changed since v1: * Do not bump the payload version again. --- common.h | 11 ++- create-diff-object.c | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common.h

[Xen-devel] [PATCH v3 6/7] livepatch-build: Strip transient or unneeded symbols

2019-11-26 Thread Pawel Wieczorkiewicz
linking the transient hooks symbols are not stripped and neither are any unneeded symbols. Strip the transient hooks symbols explicitly from resulting object file. Add a new option '--strip' to additionally strip all unneeded symbols from new object files. Signed-off-by: Pawel Wieczorkiewicz

[Xen-devel] [PATCH v3 1/7] livepatch-build: Embed hypervisor build id into every hotpatch

2019-11-26 Thread Pawel Wieczorkiewicz
as a command line parameter: --xen-depends. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey Reviewed-by: Ross Lagerwall --- livepatch-build | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git

[Xen-devel] [PATCH v3 4/7] create-diff-object: Add support for applied/reverted marker

2019-11-26 Thread Pawel Wieczorkiewicz
. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Ross Lagerwall --- common.h | 2 ++ create-diff-object.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common.h b/common.h index 300e508..9f9cb7b 100644 --- a/common.h +++ b/common.h @@ -124,6 +124,8

[Xen-devel] [PATCH v3 0/7] livepatch-build-tools: new features and fixes

2019-11-26 Thread Pawel Wieczorkiewicz
not create empty .livepatch.funcs section create-diff-object: Extend patchability verification: STN_UNDEF create-diff-object: Strip all undefined entires of known size Pawel Wieczorkiewicz (7): [1] livepatch-build: Embed hypervisor build id into every hotpatch [2] create-diff-object: Handle extra

[Xen-devel] [PATCH v6 08/12] livepatch: Add support for inline asm livepatching expectations

2019-11-26 Thread Pawel Wieczorkiewicz
. That is obviously insecure. Use it with caution and act upon replace errors! Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3

[Xen-devel] [PATCH v6 11/12] livepatch: Add metadata runtime retrieval mechanism

2019-11-26 Thread Pawel Wieczorkiewicz
...key=value\0. The format is modified to the following one: key=value;key=value;...key=value. The new format allows to easily parse the metadata for a given module by a machine. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert

[Xen-devel] [PATCH v6 05/12] livepatch: Add support for apply|revert action replacement hooks

2019-11-26 Thread Pawel Wieczorkiewicz
the alternative function generation move code responsible for payload and livepatch region registration outside of the function. That way it is guaranteed that the registration step occurs even for newly supplied functions. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Petre Eftime Reviewed-by: Martin

[Xen-devel] [PATCH v6 12/12] livepatch: Add python bindings for livepatch operations

2019-11-26 Thread Pawel Wieczorkiewicz
value received from its corresponding libxc function call. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Martin Mazein Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Leonard Foerster Reviewed-by: Norbert Manthey Acked-by: Marek Marczykowski-Górecki Reviewed-by: Ross Lagerwall --- Changed

[Xen-devel] [PATCH v6 06/12] livepatch: Do not enforce ELF_LIVEPATCH_FUNC section presence

2019-11-26 Thread Pawel Wieczorkiewicz
. Check also all extended hooks sections if they are a single, non-empty sections each. At least one of the functions or hooks section must be present in a valid payload. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack

[Xen-devel] [PATCH v6 10/12] livepatch: Handle arbitrary size names with the list operation

2019-11-26 Thread Pawel Wieczorkiewicz
receives the exact number of entries as requested. The xen-livepatch tool has been also modified to handle the name back-to-back transfers correctly. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack Signed-off-by: Konrad

[Xen-devel] [PATCH v6 04/12] livepatch: Implement pre-|post- apply|revert hooks

2019-11-26 Thread Pawel Wieczorkiewicz
-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Petre Eftime Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3: * s/hotpatch/livepatch/g * s/bool_t/bool/g Changed since v1

[Xen-devel] [PATCH v6 02/12] livepatch: Allow to override inter-modules buildid dependency

2019-11-26 Thread Pawel Wieczorkiewicz
: LIVEPATCH_ACTION_APPLY_NODEPS (1 << 0) The userland xen-livepatch tool is modified to support the '--nodeps' flag for apply and load commands. A general mechanism for specifying more flags in the future for apply and other action is however added. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by:

[Xen-devel] [PATCH v6 03/12] livepatch: Export payload structure via livepatch_payload.h

2019-11-26 Thread Pawel Wieczorkiewicz
along with all field definitions needs to be available to the code being patched in. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Eslam Elnikety Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Ross Lagerwall Signed-off-by: Konrad

[Xen-devel] [PATCH v6 07/12] livepatch: Add per-function applied/reverted state tracking marker

2019-11-26 Thread Pawel Wieczorkiewicz
holding the applied/reverted state marker. To reflect the livepatch payload ABI change, bump the version flag LIVEPATCH_PAYLOAD_VERSION up to 2. [And also update the top of the design document] Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel

[Xen-devel] [PATCH v6 09/12] livepatch: Add support for modules .modinfo section metadata

2019-11-26 Thread Pawel Wieczorkiewicz
in the livepatch payload structure and is used to display the content upon livepatch apply operation. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed

[Xen-devel] [PATCH v6 00/12] livepatch: new features and fixes

2019-11-26 Thread Pawel Wieczorkiewicz
information Pawel Wieczorkiewicz (12): livepatch: Always check hypervisor build ID upon livepatch upload livepatch: Allow to override inter-modules buildid dependency livepatch: Export payload structure via livepatch_payload.h livepatch: Implement pre-|post- apply|revert hooks livepatch: Add

[Xen-devel] [PATCH v6 01/12] livepatch: Always check hypervisor build ID upon livepatch upload

2019-11-26 Thread Pawel Wieczorkiewicz
if there is no match. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Eslam Elnikety Reviewed-by: Martin Pohlack Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3: * renamed check_xen_build_id

[Xen-devel] [PATCH v5 11/12] livepatch: Add metadata runtime retrieval mechanism

2019-11-14 Thread Pawel Wieczorkiewicz
...key=value\0. The format is modified to the following one: key=value;key=value;...key=value. The new format allows to easily parse the metadata for a given module by a machine. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert

[Xen-devel] [PATCH v5 09/12] livepatch: Add support for modules .modinfo section metadata

2019-11-14 Thread Pawel Wieczorkiewicz
in the livepatch payload structure and is used to display the content upon livepatch apply operation. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed

[Xen-devel] [PATCH v5 10/12] livepatch: Handle arbitrary size names with the list operation

2019-11-14 Thread Pawel Wieczorkiewicz
receives the exact number of entries as requested. The xen-livepatch tool has been also modified to handle the name back-to-back transfers correctly. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack Signed-off-by: Konrad

[Xen-devel] [PATCH v5 03/12] livepatch: Export payload structure via livepatch_payload.h

2019-11-14 Thread Pawel Wieczorkiewicz
along with all field definitions needs to be available to the code being patched in. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Eslam Elnikety Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Ross Lagerwall Signed-off-by: Konrad

[Xen-devel] [PATCH v5 08/12] livepatch: Add support for inline asm livepatching expectations

2019-11-14 Thread Pawel Wieczorkiewicz
. That is obviously insecure. Use it with caution and act upon replace errors! Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3

[Xen-devel] [PATCH v5 12/12] livepatch: Add python bindings for livepatch operations

2019-11-14 Thread Pawel Wieczorkiewicz
value received from its corresponding libxc function call. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Martin Mazein Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Leonard Foerster Reviewed-by: Norbert Manthey Acked-by: Marek Marczykowski-Górecki --- Changed since v4: * changed flags

[Xen-devel] [PATCH v5 07/12] livepatch: Add per-function applied/reverted state tracking marker

2019-11-14 Thread Pawel Wieczorkiewicz
holding the applied/reverted state marker. To reflect the livepatch payload ABI change, bump the version flag LIVEPATCH_PAYLOAD_VERSION up to 2. [And also update the top of the design document] Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel

[Xen-devel] [PATCH v5 06/12] livepatch: Do not enforce ELF_LIVEPATCH_FUNC section presence

2019-11-14 Thread Pawel Wieczorkiewicz
. Check also all extended hooks sections if they are a single, non-empty sections each. At least one of the functions or hooks section must be present in a valid payload. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack

[Xen-devel] [PATCH v5 04/12] livepatch: Implement pre-|post- apply|revert hooks

2019-11-14 Thread Pawel Wieczorkiewicz
-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Petre Eftime Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3: * s/hotpatch/livepatch/g * s/bool_t/bool/g Changed since v1

[Xen-devel] [PATCH v5 05/12] livepatch: Add support for apply|revert action replacement hooks

2019-11-14 Thread Pawel Wieczorkiewicz
the alternative function generation move code responsible for payload and livepatch region registration outside of the function. That way it is guaranteed that the registration step occurs even for newly supplied functions. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Petre Eftime Reviewed-by: Martin

[Xen-devel] [PATCH v5 02/12] livepatch: Allow to override inter-modules buildid dependency

2019-11-14 Thread Pawel Wieczorkiewicz
: LIVEPATCH_ACTION_APPLY_NODEPS (1 << 0) The userland xen-livepatch tool is modified to support the '--nodeps' flag for apply and load commands. A general mechanism for specifying more flags in the future for apply and other action is however added. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by:

[Xen-devel] [PATCH v5 01/12] livepatch: Always check hypervisor build ID upon livepatch upload

2019-11-14 Thread Pawel Wieczorkiewicz
if there is no match. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Eslam Elnikety Reviewed-by: Martin Pohlack Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3: * renamed check_xen_build_id

[Xen-devel] [PATCH v5 00/12] livepatch: new features and fixes

2019-11-14 Thread Pawel Wieczorkiewicz
/wiki/Design_Sessions_2019#LivePatch_improvements_and_features [b] https://lists.xenproject.org/archives/html/xen-devel/2019-07/msg00846.html Merged in v1: python: Add XC binding for Xen build ID livepatch: always print XENLOG_ERR information Pawel Wieczorkiewicz (12): [1] livepatch: Always

[Xen-devel] [PATCH] create-diff-object: more precisely identify .rodata sections

2019-11-05 Thread Pawel Wieczorkiewicz
symbols to slip through. Detect .rodata section by checking section's type (SHT_PROGBITS), flags (no exec, no write) and finally name prefix. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey --- common.c | 7

[Xen-devel] [PATCH] create-diff-object: do not strip STN_UNDEF symbols from *.fixup

2019-11-05 Thread Pawel Wieczorkiewicz
The rela groups in the *.fixup sections vary in size. That makes it more complex to handle in the livepatch_strip_undefined_elements(). It is also unnecessary as the .fixup sections are unlikely to have any STN_UNDEF symbols anyway. Signed-off-by: Pawel Wieczorkiewicz --- create-diff-object.c

[Xen-devel] [PATCH v4 01/12] livepatch: Always check hypervisor build ID upon livepatch upload

2019-09-28 Thread Pawel Wieczorkiewicz
if there is no match. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Eslam Elnikety Reviewed-by: Martin Pohlack Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3: * renamed check_xen_build_id

[Xen-devel] [PATCH v4 10/12] livepatch: Handle arbitrary size names with the list operation

2019-09-28 Thread Pawel Wieczorkiewicz
receives the exact number of entries as requested. The xen-livepatch tool has been also modified to handle the name back-to-back transfers correctly. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack Signed-off-by: Konrad

[Xen-devel] [PATCH v4 05/12] livepatch: Add support for apply|revert action replacement hooks

2019-09-28 Thread Pawel Wieczorkiewicz
the alternative function generation move code responsible for payload and livepatch region registration outside of the function. That way it is guaranteed that the registration step occurs even for newly supplied functions. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Petre Eftime Reviewed-by: Martin

[Xen-devel] [PATCH v4 07/12] livepatch: Add per-function applied/reverted state tracking marker

2019-09-28 Thread Pawel Wieczorkiewicz
holding the applied/reverted state marker. To reflect the livepatch payload ABI change, bump the version flag LIVEPATCH_PAYLOAD_VERSION up to 2. [And also update the top of the design document] Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel

[Xen-devel] [PATCH v4 12/12] livepatch: Add python bindings for livepatch operations

2019-09-28 Thread Pawel Wieczorkiewicz
value received from its corresponding libxc function call. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Martin Mazein Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Leonard Foerster Reviewed-by: Norbert Manthey Acked-by: Marek Marczykowski-Górecki --- Changed since v3: * return None

[Xen-devel] [PATCH v4 09/12] livepatch: Add support for modules .modinfo section metadata

2019-09-28 Thread Pawel Wieczorkiewicz
in the livepatch payload structure and is used to display the content upon livepatch apply operation. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed

[Xen-devel] [PATCH v4 06/12] livepatch: Do not enforce ELF_LIVEPATCH_FUNC section presence

2019-09-28 Thread Pawel Wieczorkiewicz
. Check also all extended hooks sections if they are a single, non-empty sections each. At least one of the functions or hooks section must be present in a valid payload. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack

[Xen-devel] [PATCH v4 11/12] livepatch: Add metadata runtime retrieval mechanism

2019-09-28 Thread Pawel Wieczorkiewicz
...key=value\0. The format is modified to the following one: key=value;key=value;...key=value. The new format allows to easily parse the metadata for a given module by a machine. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert

[Xen-devel] [PATCH v4 08/12] livepatch: Add support for inline asm livepatching expectations

2019-09-28 Thread Pawel Wieczorkiewicz
. That is obviously insecure. Use it with caution and act upon replace errors! Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Ross Lagerwall --- Changed since v3

[Xen-devel] [PATCH v4 00/12] livepatch: new features and fixes

2019-09-28 Thread Pawel Wieczorkiewicz
/wiki/Design_Sessions_2019#LivePatch_improvements_and_features [b] https://lists.xenproject.org/archives/html/xen-devel/2019-07/msg00846.html Merged in v1: python: Add XC binding for Xen build ID livepatch: always print XENLOG_ERR information Pawel Wieczorkiewicz (12): [1] livepatch: Always

[Xen-devel] [PATCH v4 02/12] livepatch: Allow to override inter-modules buildid dependency

2019-09-28 Thread Pawel Wieczorkiewicz
: LIVEPATCH_ACTION_APPLY_NODEPS (1 << 0) The userland xen-livepatch tool is modified to support the '--nodeps' flag for apply and load commands. A general mechanism for specifying more flags in the future for apply and other action is however added. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by:

[Xen-devel] [PATCH v4 03/12] livepatch: Export payload structure via livepatch_payload.h

2019-09-28 Thread Pawel Wieczorkiewicz
along with all field definitions needs to be available to the code being patched in. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Eslam Elnikety Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Ross Lagerwall Signed-off-by: Konrad

[Xen-devel] [PATCH v4 04/12] livepatch: Implement pre-|post- apply|revert hooks

2019-09-28 Thread Pawel Wieczorkiewicz
-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Petre Eftime Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk --- Changed since v3: * s/hotpatch/livepatch/g * s/bool_t/bool/g Changed since v1: * added corresponding

[Xen-devel] [PATCH] create-diff-object: more precisely identify .rodata sections

2019-09-18 Thread Pawel Wieczorkiewicz
symbols to slip through. Detect .rodata section by checking section's type (SHT_PROGBITS), flags (no exec, no write) and finally name prefix. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey --- common.c | 7

[Xen-devel] [PATCH v3 12/12] livepatch: Add python bindings for livepatch operations

2019-09-16 Thread Pawel Wieczorkiewicz
from its corresponding libxc function call. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Martin Mazein Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Leonard Foerster Reviewed-by: Norbert Manthey Acked-by: Marek Marczykowski-Górecki --- Changed since v1: * changed PyList_Append

[Xen-devel] [PATCH v2 7/7] livepatch-build: Strip all metadata symbols from hotpatch modules

2019-09-16 Thread Pawel Wieczorkiewicz
-off-by: Pawel Wieczorkiewicz --- livepatch-build | 55 +-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/livepatch-build b/livepatch-build index 816064c..be459c9 100755 --- a/livepatch-build +++ b/livepatch-build @@ -111,10

[Xen-devel] [PATCH v2 6/7] livepatch-build: Strip transient or unneeded symbols

2019-09-16 Thread Pawel Wieczorkiewicz
linking the transient hooks symbols are not stripped and neither are any unneeded symbols. Strip them explicitly from resulting object file. Signed-off-by: Pawel Wieczorkiewicz --- livepatch-build | 25 + 1 file changed, 25 insertions(+) diff --git a/livepatch-build b

[Xen-devel] [PATCH v2 1/7] livepatch-build: Embed hypervisor build id into every hotpatch

2019-09-16 Thread Pawel Wieczorkiewicz
as a command line parameter: --xen-depends. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Norbert Manthey --- livepatch-build | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/livepatch-build b

[Xen-devel] [PATCH v2 5/7] create-diff-object: Add support for expectations

2019-09-16 Thread Pawel Wieczorkiewicz
specified in the patch. Signed-off-by: Pawel Wieczorkiewicz --- Changed since v1: * Do not bump the payload version again. common.h | 11 ++- create-diff-object.c | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/common.h b/common.h index d8cde35

[Xen-devel] [PATCH v2 4/7] create-diff-object: Add support for applied/reverted marker

2019-09-16 Thread Pawel Wieczorkiewicz
. Signed-off-by: Pawel Wieczorkiewicz --- common.h | 2 ++ create-diff-object.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common.h b/common.h index 06e19e7..d8cde35 100644 --- a/common.h +++ b/common.h @@ -124,6 +124,8 @@ struct livepatch_patch_func

[Xen-devel] [PATCH v2 3/7] create-diff-object: Handle optional apply|revert hooks

2019-09-16 Thread Pawel Wieczorkiewicz
Include new sections containing optional apply and revert action hooks. The following new section names are supported: - .livepatch.hooks.apply - .livepatch.hooks.revert Signed-off-by: Pawel Wieczorkiewicz --- create-diff-object.c | 10 ++ 1 file changed, 10 insertions(+) diff

[Xen-devel] [PATCH v2 2/7] create-diff-object: Handle extra pre-|post- hooks

2019-09-16 Thread Pawel Wieczorkiewicz
Include new sections containing optional pre-, post- action hooks. The following new section names are supported: - .livepatch.hooks.preapply - .livepatch.hooks.postapply - .livepatch.hooks.prerevert - .livepatch.hooks.postrevert Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Ross

[Xen-devel] [PATCH v2 0/7] livepatch-build-tools: new features and fixes

2019-09-16 Thread Pawel Wieczorkiewicz
not create empty .livepatch.funcs section create-diff-object: Extend patchability verification: STN_UNDEF create-diff-object: Strip all undefined entires of known size Pawel Wieczorkiewicz (7): [1] livepatch-build: Embed hypervisor build id into every hotpatch [2] create-diff-object: Handle extra

[Xen-devel] [PATCH v3 07/12] livepatch: Add per-function applied/reverted state tracking marker

2019-09-16 Thread Pawel Wieczorkiewicz
holding the applied/reverted state marker. To reflect the livepatch payload ABI change, bump the version flag LIVEPATCH_PAYLOAD_VERSION up to 2. [And also update the top of the design document] Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel

[Xen-devel] [PATCH v3 10/12] livepatch: Handle arbitrary size names with the list operation

2019-09-16 Thread Pawel Wieczorkiewicz
receives the exact number of entires as requested. The xen-livepatch tool has been also modified to handle the name back-to-back transfers correctly. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack Signed-off-by: Konrad

[Xen-devel] [PATCH v3 08/12] livepatch: Add support for inline asm hotpatching expectations

2019-09-16 Thread Pawel Wieczorkiewicz
. That is obviously insecure. Use it with caution and act upon replace errors! Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off-by: Konrad Rzeszutek Wilk --- Changed since v2: * Add rsv in the field. Update

[Xen-devel] [PATCH v3 09/12] livepatch: Add support for modules .modinfo section metadata

2019-09-16 Thread Pawel Wieczorkiewicz
in the hotpatch payload structure and is used to display the content upon hotpatch apply operation. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Norbert Manthey Signed-off

[Xen-devel] [PATCH v3 12/12] livepatch: Add python bindings for livepatch operations

2019-09-16 Thread Pawel Wieczorkiewicz
from its corresponding libxc function call. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Martin Mazein Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Leonard Foerster Reviewed-by: Norbert Manthey --- Changed since v1: * changed PyList_Append() with PyList_SetItem() as requested

[Xen-devel] [PATCH v3 01/12] livepatch: Always check hypervisor build ID upon hotpatch upload

2019-09-16 Thread Pawel Wieczorkiewicz
if there is no match. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Eslam Elnikety Reviewed-by: Martin Pohlack Signed-off-by: Konrad Rzeszutek Wilk --- Changed since v1: * always print XENLOG_ERR message from check_xen_build_id

[Xen-devel] [PATCH v3 02/12] livepatch: Allow to override inter-modules buildid dependency

2019-09-16 Thread Pawel Wieczorkiewicz
: LIVEPATCH_ACTION_APPLY_NODEPS (1 << 0) The userland xen-livepatch tool is modified to support the '--nodeps' flag for apply and load commands. A general mechanism for specifying more flags in the future for apply and other action is however added. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra

[Xen-devel] [PATCH v3 00/12] livepatch: new features and fixes

2019-09-16 Thread Pawel Wieczorkiewicz
build ID livepatch: always print XENLOG_ERR information Pawel Wieczorkiewicz (12): [1] livepatch: Always check hypervisor build ID upon hotpatch upload [2] livepatch: Allow to override inter-modules buildid dependency [3] livepatch: Export payload structure via livepatch_payload.h [4

[Xen-devel] [PATCH v3 06/12] livepatch: Do not enforce ELF_LIVEPATCH_FUNC section presence

2019-09-16 Thread Pawel Wieczorkiewicz
. Check also all extended hooks sections if they are a single, non-empty sections each. At least one of the functions or hooks section must be present in a valid payload. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack

[Xen-devel] [PATCH v3 05/12] livepatch: Add support for apply|revert action replacement hooks

2019-09-16 Thread Pawel Wieczorkiewicz
the alternative function generation move code responsible for payload and hotpatch region registration outside of the function. That way it is guaranteed that the registration step occurs even for newly supplied functions. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Petre Eftime Reviewed-by: Martin

[Xen-devel] [PATCH v3 11/12] livepatch: Add metadata runtime retrieval mechanism

2019-09-16 Thread Pawel Wieczorkiewicz
...key=value\0. The format is modified to the following one: key=value;key=value;...key=value. The new format allows to easily parse the metadata for a given module by a machine. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Martin Pohlack Reviewed-by: Norbert

[Xen-devel] [PATCH v3 03/12] livepatch: Export payload structure via livepatch_payload.h

2019-09-16 Thread Pawel Wieczorkiewicz
along with all field definitions needs to be available to the code being patched in. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Eslam Elnikety Reviewed-by: Leonard Foerster Reviewed-by: Martin Pohlack Reviewed-by: Ross Lagerwall Signed-off-by: Konrad

[Xen-devel] [PATCH v2 07/12] livepatch: Add per-function applied/reverted state tracking marker

2019-08-27 Thread Pawel Wieczorkiewicz
holding the applied/reverted state marker. To reflect the livepatch payload ABI change, bump the version flag LIVEPATCH_PAYLOAD_VERSION up to 2. Signed-off-by: Pawel Wieczorkiewicz Reviewed-by: Andra-Irina Paraschiv Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack --- Changed since v1

  1   2   3   >