[PATCH] ARM: vfp: fix misspelled identifier in documentation

2021-04-15 Thread Jonas Rabenstein
The documentation comment for vfp_notifier misspelled THREAD_NOTIFY_SWITCH as THREAD_NOFTIFY_SWITCH. Signed-off-by: Jonas Rabenstein --- arch/arm/vfp/vfpmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index

[tip:perf/core] perf doc: Fix documentation of the Flags section in perf.data

2019-02-27 Thread tip-bot for Jonas Rabenstein
Commit-ID: 8c23a522388b34cd7bc8473987eda0c75eb37c0e Gitweb: https://git.kernel.org/tip/8c23a522388b34cd7bc8473987eda0c75eb37c0e Author: Jonas Rabenstein AuthorDate: Tue, 19 Feb 2019 16:45:15 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Feb 2019 13:39:12 -0300 perf doc

[tip:perf/core] perf doc: Fix HEADER_CMDLINE description in perf.data documentation

2019-02-27 Thread tip-bot for Jonas Rabenstein
Commit-ID: 7a663c0ff330a068c088ad46bb0130e651a9fec3 Gitweb: https://git.kernel.org/tip/7a663c0ff330a068c088ad46bb0130e651a9fec3 Author: Jonas Rabenstein AuthorDate: Tue, 19 Feb 2019 16:45:14 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Tue, 19 Feb 2019 13:39:08 -0300 perf doc

Re: [PATCH 3/3] perf machine: add inline symbols to callchains

2019-02-23 Thread Jonas Rabenstein
On Sat, Feb 23, 2019 at 01:21:34PM +0900, Namhyung Kim wrote: > Hello, > > On Fri, Feb 22, 2019 at 1:07 AM Jonas Rabenstein > wrote: > > > > Use map__inlines to resolve inlined functions for every entry with > > an symbol that should be added to a callchain

[PATCH 0/3] Support inline symbols in callchains

2019-02-21 Thread Jonas Rabenstein
nted to main itself but split up for the inlined baz, bar and foo symbols. I'm open to any help as well as feedback, Jonas [1] https://www.spinics.net/lists/linux-perf-users/msg07792.html [2] https://www.spinics.net/lists/linux-perf-users/msg07798.html Jonas Rabenstein (3): perf map: add functi

[PATCH 2/3] perf machine: use map__inlines in append_inlines

2019-02-21 Thread Jonas Rabenstein
The previous patch provides a generic way to lookup the root node of the inlined symbols for a specific address. Reuse that implementation instead of a duplicated version of the required steps. Signed-off-by: Jonas Rabenstein --- tools/perf/util/machine.c | 15 ++- 1 file changed, 2

[PATCH 3/3] perf machine: add inline symbols to callchains

2019-02-21 Thread Jonas Rabenstein
Use map__inlines to resolve inlined functions for every entry with an symbol that should be added to a callchain. Signed-off-by: Jonas Rabenstein --- tools/perf/util/machine.c | 115 -- 1 file changed, 87 insertions(+), 28 deletions(-) diff --git a/tools

[PATCH 1/3] perf map: add function to lookup inline symbols

2019-02-21 Thread Jonas Rabenstein
Inlined symbols should always be added to the dso's inlined_nodes tree in order to reuse them for a later lookup for the same address. Instead of repeating those steps at the different users, provide a central method to lookup and register inline symbols for a map. Signed-off-by: Jonas Rabenstein

Re: [PATCH] perf hist: fix memory leak if histogram entry is reused

2019-02-21 Thread Jonas Rabenstein
On Thu, Feb 21, 2019 at 01:39:09PM +0100, Jiri Olsa wrote: > On Thu, Feb 21, 2019 at 01:23:06PM +0100, Jonas Rabenstein wrote: > > In __hists__add_entry the srcline of the addr_location is duplicated > > for the hist_entry. If hists__findnew_entry returns an already existing

[PATCH] perf hist: fix memory leak if histogram entry is reused

2019-02-21 Thread Jonas Rabenstein
In __hists__add_entry the srcline of the addr_location is duplicated for the hist_entry. If hists__findnew_entry returns an already existing hist_entry the srcline has to be freed again as no further reference to that duplicated srcline would exists anymore. Signed-off-by: Jonas Rabenstein

[PATCHv2 2/2] perf evsel: add inline functions to sample callchain output

2019-02-20 Thread Jonas Rabenstein
Whenever a callchain shall be printed search for each address whether inline information is available and add those symbols to the output if symbol_conf.inline_name is enabled. Signed-off-by: Jonas Rabenstein --- v2: - fix handling of static binaries tools/perf/util/evsel_fprintf.c | 55

Re: [PATCH 2/2] perf evsel: add inline functions to sample callchain output

2019-02-19 Thread Jonas Rabenstein
On Tue, Feb 19, 2019 at 07:38:10PM +0100, Jonas Rabenstein wrote: > Whenever a callchain shall be printed search for each address whether > inline information is available and add those symbols to the output > if symbol_conf.inline_name is enabled. > > Signed-off-by: J

[PATCH 0/2] perf evsel: add support for inlined function in callchains

2019-02-19 Thread Jonas Rabenstein
it into a separate function. I hope to expand my work to perf-report but thought it might be usefull to get already early feedback on those patches. Thank you, Jonas Jonas Rabenstein (2): perf evsel: split sample__fprintf_callchain in output and iteration perf evsel: add inline functions to sample

[PATCH 1/2] perf evsel: split sample__fprintf_callchain in output and iteration

2019-02-19 Thread Jonas Rabenstein
Split the iteration over the callchain and the actual output of an link in the callchain into separate functions. This allows to reuse the output function in a follow up patch to add inline symbols to the output. Signed-off-by: Jonas Rabenstein --- tools/perf/util/evsel_fprintf.c | 111

[PATCH 2/2] perf evsel: add inline functions to sample callchain output

2019-02-19 Thread Jonas Rabenstein
Whenever a callchain shall be printed search for each address whether inline information is available and add those symbols to the output if symbol_conf.inline_name is enabled. Signed-off-by: Jonas Rabenstein --- tools/perf/util/evsel_fprintf.c | 46 + 1 file

[PATCH] perf: fix documentation of the Flags section in perf.data

2019-02-19 Thread Jonas Rabenstein
According to the current documentation the flags section is placed after the file header itself but the code assumes to find the flags section after the data section. This change updates the documentation to that assumption. Acked-by: Jiri Olsa Signed-off-by: Jonas Rabenstein --- tools/perf

[PATCH] perf: fix HEADER_CMDLINE description in perf.data documentation

2019-02-19 Thread Jonas Rabenstein
The content of this feature header is a perf_header_string_list of the argument vector and not a perf_header_string of the commandline. Acked-by: Jiri Olsa Signed-off-by: Jonas Rabenstein --- tools/perf/Documentation/perf.data-file-format.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] perf: fix documentation of the Flags section in perf.data

2019-02-18 Thread Jonas Rabenstein
According to the current documentation the flags section is placed after the file header itself but the code assumes to find the flags section after the data section. This change updates the documentation to that assumption. --- tools/perf/Documentation/perf.data-file-format.txt | 9 - 1

[PATCH] perf: fix HEADER_CMDLINE description in perf.data documentation

2019-02-18 Thread Jonas Rabenstein
The content of this feature header is a perf_header_string_list of the argument vector and not a perf_header_string of the commandline. --- tools/perf/Documentation/perf.data-file-format.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH] perf: update perf.data file format documentation

2019-02-18 Thread Jonas Rabenstein
On Mon, Feb 18, 2019 at 12:22:46AM +0100, Jiri Olsa wrote: > On Fri, Feb 15, 2019 at 07:28:23PM +0100, Jonas Rabenstein wrote: > > I found that the documentation of the flags section is some how > > different from the actual format used and expected by the perf > >

[PATCH] perf: update perf.data file format documentation

2019-02-15 Thread Jonas Rabenstein
I found that the documentation of the flags section is some how different from the actual format used and expected by the perf tools. In this patch the according section of the file format documentation is updated to conform to the expectations of the perf tool suite. Signed-off-by: Jonas

[PATCH 13/16] block: sed-opal: check size of shadow mbr

2019-01-16 Thread Jonas Rabenstein
Check whether the shadow mbr does fit in the provided space on the target. Also a proper firmware should handle this case and return an error we may prevent problems or even damage with crappy firmwares. Signed-off-by: Jonas Rabenstein --- block/opal_proto.h | 16 block/sed

[PATCH 03/16] block: sed-opal: unify space check in add_token_*

2019-01-16 Thread Jonas Rabenstein
All add_token_* functions have a common set of conditions that have to be checked. Use a common function for those checks in order to avoid different behaviour as well as code duplication. Co-authored-by: David Kozub Signed-off-by: Jonas Rabenstein Signed-off-by: David Kozub --- block/sed

[PATCH 12/16] block: sed-opal: unify retrieval of table columns

2019-01-16 Thread Jonas Rabenstein
Instead of having multiple places defining the same argument list to get a specific column of a sed-opal table, provide a generic version and call it from those functions. Signed-off-by: Jonas Rabenstein --- block/opal_proto.h | 2 + block/sed-opal.c | 132

[PATCH 08/16] block: sed-opal: print failed function address

2019-01-16 Thread Jonas Rabenstein
Add function address (and if available its symbol) to the message if a step function fails. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 1332547e5a99..4225f23b2165 100644

[PATCH 10/16] block: sed-opal: add ioctl for done-mark of shadow mbr

2019-01-16 Thread Jonas Rabenstein
to enable the feature if it is already enabled and one only wants to mark the shadow mbr as done. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 33 +++-- include/linux/sed-opal.h | 1 + include/uapi/linux/sed-opal.h | 1 + 3 files changed, 33

[PATCH 02/16] block: sed-opal: use correct macro for method length

2019-01-16 Thread Jonas Rabenstein
Also the values of OPAL_UID_LENGTH and OPAL_METHOD_LENGTH are the same, it is weird to use OPAL_UID_LENGTH for the definition of the methods. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sed-opal.c b/block/sed

[PATCH 09/16] block: sed-opal: split generation of bytestring header and content

2019-01-16 Thread Jonas Rabenstein
Split the header generation from the (normal) memcpy part if a bytestring is copied into the command buffer. This allows in-place generation of the bytestring content. For example, copy_from_user may be used without an intermediate buffer. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c

[PATCH 11/16] block: sed-opal: ioctl for writing to shadow mbr

2019-01-16 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Co-authored-by: David Kozub Signed-off-by: Jonas

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-29 Thread Jonas Rabenstein
Hi, On Wed, Mar 21, 2018 at 02:43:21AM +0100, Jonas Rabenstein wrote: > On Tue, Mar 20, 2018 at 04:09:08PM -0600, Scott Bauer wrote: > > On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote: > > > On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: >

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-29 Thread Jonas Rabenstein
Hi, On Wed, Mar 21, 2018 at 02:43:21AM +0100, Jonas Rabenstein wrote: > On Tue, Mar 20, 2018 at 04:09:08PM -0600, Scott Bauer wrote: > > On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote: > > > On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: >

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-20 Thread Jonas Rabenstein
On Tue, Mar 20, 2018 at 04:09:08PM -0600, Scott Bauer wrote: > On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote: > > On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: > > > On Mon, Mar 19, 2018 at 07:36:50PM +0100, Jonas Rabenstein wrote: > >

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-20 Thread Jonas Rabenstein
On Tue, Mar 20, 2018 at 04:09:08PM -0600, Scott Bauer wrote: > On Tue, Mar 20, 2018 at 10:36:04AM +0100, Jonas Rabenstein wrote: > > On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: > > > On Mon, Mar 19, 2018 at 07:36:50PM +0100, Jonas Rabenstein wrote: > >

Re: [PATCH v2 11/11] block: sed-opal: check size of shadow mbr

2018-03-20 Thread Jonas Rabenstein
On Mon, Mar 19, 2018 at 09:01:51PM +0100, Christoph Hellwig wrote: > On Mon, Mar 19, 2018 at 07:36:53PM +0100, Jonas Rabenstein wrote: > > Check whether the shadow mbr does fit in the provided space on the > > target. Also a proper firmware should handle this case and return an &

Re: [PATCH v2 11/11] block: sed-opal: check size of shadow mbr

2018-03-20 Thread Jonas Rabenstein
On Mon, Mar 19, 2018 at 09:01:51PM +0100, Christoph Hellwig wrote: > On Mon, Mar 19, 2018 at 07:36:53PM +0100, Jonas Rabenstein wrote: > > Check whether the shadow mbr does fit in the provided space on the > > target. Also a proper firmware should handle this case and return an &

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-20 Thread Jonas Rabenstein
On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: > On Mon, Mar 19, 2018 at 07:36:50PM +0100, Jonas Rabenstein wrote: > > Allow modification of the shadow mbr. If the shadow mbr is not marked as > > done, this data will be presented read only as the device content.

Re: [PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-20 Thread Jonas Rabenstein
On Mon, Mar 19, 2018 at 08:52:24PM +0100, Christoph Hellwig wrote: > On Mon, Mar 19, 2018 at 07:36:50PM +0100, Jonas Rabenstein wrote: > > Allow modification of the shadow mbr. If the shadow mbr is not marked as > > done, this data will be presented read only as the device content.

[PATCH v2 02/11] block: sed-opal: unify space check in add_token_*

2018-03-19 Thread Jonas Rabenstein
All add_token_* functions have a common set of conditions that have to be checked. Use a common function for those checks in order to avoid different behaviour as well as code duplication. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/sed-op

[PATCH v2 02/11] block: sed-opal: unify space check in add_token_*

2018-03-19 Thread Jonas Rabenstein
All add_token_* functions have a common set of conditions that have to be checked. Use a common function for those checks in order to avoid different behaviour as well as code duplication. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c b/block/sed-opal.c index 5aa41744b8f1

[PATCH v2 03/11] block: sed-opal: unify cmd start and finalize

2018-03-19 Thread Jonas Rabenstein
functions and thus must not be additionally added. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/sed-opal.c b/block/sed-opal.c index 771b4cfff95c..efe5d2a7f3dc 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -656,6 +656,9 @@ stat

[PATCH v2 03/11] block: sed-opal: unify cmd start and finalize

2018-03-19 Thread Jonas Rabenstein
functions and thus must not be additionally added. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c b/block/sed-opal.c index 771b4cfff95c..efe5d2a7f3dc 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -656,6 +656,9 @@ static int cmd_finalize(struct opal_dev *cmd, u32 hsn, u32

[PATCH v2 04/11] block: sed-opal: unify error handling of responses

2018-03-19 Thread Jonas Rabenstein
Also response_get_token had already been in place, its functionality had been duplicated within response_get_{u64,bytestring} with the same error handling. Unify the handling by reusing response_get_token within the other functions. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.

[PATCH v2 04/11] block: sed-opal: unify error handling of responses

2018-03-19 Thread Jonas Rabenstein
Also response_get_token had already been in place, its functionality had been duplicated within response_get_{u64,bytestring} with the same error handling. Unify the handling by reusing response_get_token within the other functions. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c

[PATCH v2 07/11] block: sed-opal: add ioctl for done-mark of shadow mbr

2018-03-19 Thread Jonas Rabenstein
to enable the feature if it is already enabled and one only wants to mark the shadow mbr as done. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/sed-opal.c b/block/sed-opal.c index fc10f81d4892..2c8baff8bf67 100644 --- a/block/sed-opal.c +++ b/blo

[PATCH v2 07/11] block: sed-opal: add ioctl for done-mark of shadow mbr

2018-03-19 Thread Jonas Rabenstein
to enable the feature if it is already enabled and one only wants to mark the shadow mbr as done. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c b/block/sed-opal.c index fc10f81d4892..2c8baff8bf67 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -1988,13 +1988,39 @@ static int

[PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-19 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Signed-off-by: Jonas Rabenstein <jonas.rabe

[PATCH v2 08/11] block: sed-opal: ioctl for writing to shadow mbr

2018-03-19 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Signed-off-by: Jonas Rabenstein diff --git

[PATCH v2 11/11] block: sed-opal: check size of shadow mbr

2018-03-19 Thread Jonas Rabenstein
Check whether the shadow mbr does fit in the provided space on the target. Also a proper firmware should handle this case and return an error we may prevent problems or even damage with crappy firmwares. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff

[PATCH v2 11/11] block: sed-opal: check size of shadow mbr

2018-03-19 Thread Jonas Rabenstein
Check whether the shadow mbr does fit in the provided space on the target. Also a proper firmware should handle this case and return an error we may prevent problems or even damage with crappy firmwares. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c b/block/sed-opal.c index

[PATCH v2 10/11] block: sed-opal: get metadata about opal-sed tables

2018-03-19 Thread Jonas Rabenstein
Every opal-sed table is described in the OPAL_TABLE_TABLE. Provide a function to get desired metadata information out of that table. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/opal_proto.h b/block/opal_proto.h index b6e352cfe982..5e8df3

[PATCH v2 10/11] block: sed-opal: get metadata about opal-sed tables

2018-03-19 Thread Jonas Rabenstein
Every opal-sed table is described in the OPAL_TABLE_TABLE. Provide a function to get desired metadata information out of that table. Signed-off-by: Jonas Rabenstein diff --git a/block/opal_proto.h b/block/opal_proto.h index b6e352cfe982..5e8df3245eb0 100644 --- a/block/opal_proto.h +++ b/block

[PATCH v2 09/11] block: sed-opal: unify retrieval of table columns

2018-03-19 Thread Jonas Rabenstein
Instead of having multiple places defining the same argument list to get a specific column of a sed-opal table, provide a generic version and call it from those functions. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/opal_proto.h b

[PATCH v2 09/11] block: sed-opal: unify retrieval of table columns

2018-03-19 Thread Jonas Rabenstein
Instead of having multiple places defining the same argument list to get a specific column of a sed-opal table, provide a generic version and call it from those functions. Signed-off-by: Jonas Rabenstein diff --git a/block/opal_proto.h b/block/opal_proto.h index e20be8258854..b6e352cfe982

[PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content

2018-03-19 Thread Jonas Rabenstein
Split the header generation from the (normal) memcpy part if a bytestring is copied into the command buffer. This allows in-place generation of the bytestring content. For example, copy_from_user may be used without an intermediate buffer. Signed-off-by: Jonas Rabenstein <jonas.rabe

[PATCH v2 06/11] block: sed-opal: split generation of bytestring header and content

2018-03-19 Thread Jonas Rabenstein
Split the header generation from the (normal) memcpy part if a bytestring is copied into the command buffer. This allows in-place generation of the bytestring content. For example, copy_from_user may be used without an intermediate buffer. Signed-off-by: Jonas Rabenstein diff --git a/block/sed

[PATCH v2 05/11] block: sed-opal: print failed function address

2018-03-19 Thread Jonas Rabenstein
Add function address (and if available its symbol) to the message if a step function fails. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/sed-opal.c b/block/sed-opal.c index 30f6e46518a6..9b6f14e7aeb1 100644 --- a/block/sed-opal.c +++ b/blo

[PATCH v2 05/11] block: sed-opal: print failed function address

2018-03-19 Thread Jonas Rabenstein
Add function address (and if available its symbol) to the message if a step function fails. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c b/block/sed-opal.c index 30f6e46518a6..9b6f14e7aeb1 100644 --- a/block/sed-opal.c +++ b/block/sed-opal.c @@ -394,8 +394,8 @@ static int next

[PATCH v2 00/11] block: sed-opal support write to shadow mbr

2018-03-19 Thread Jonas Rabenstein
-- Jonas Rabenstein (11): block: sed-opal: use correct macro for method length block: sed-opal: unify space check in add_token_* block: sed-opal: unify cmd start and finalize block: sed-opal: unify error handling of responses block: sed-opal: print failed function address block: sed-opal

[PATCH v2 00/11] block: sed-opal support write to shadow mbr

2018-03-19 Thread Jonas Rabenstein
-- Jonas Rabenstein (11): block: sed-opal: use correct macro for method length block: sed-opal: unify space check in add_token_* block: sed-opal: unify cmd start and finalize block: sed-opal: unify error handling of responses block: sed-opal: print failed function address block: sed-opal

[PATCH v2 01/11] block: sed-opal: use correct macro for method length

2018-03-19 Thread Jonas Rabenstein
Also the values of OPAL_UID_LENGTH and OPAL_METHOD_LENGTH are the same, it is weird to use OPAL_UID_LENGTH for the definition of the methods. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> diff --git a/block/sed-opal.c b/block/sed-opal.c index 945f4b

[PATCH v2 01/11] block: sed-opal: use correct macro for method length

2018-03-19 Thread Jonas Rabenstein
Also the values of OPAL_UID_LENGTH and OPAL_METHOD_LENGTH are the same, it is weird to use OPAL_UID_LENGTH for the definition of the methods. Signed-off-by: Jonas Rabenstein diff --git a/block/sed-opal.c b/block/sed-opal.c index 945f4b8610e0..5aa41744b8f1 100644 --- a/block/sed-opal.c +++ b

[PATCH v2 3/8] block: sed-opal: unify cmd start and finalize

2018-03-14 Thread Jonas Rabenstein
Every step starts with resetting the cmd buffer as well as the comid and constructs the appropriate OPAL_CALL command. Consequently, those actions may be combined into one generic function. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c

[PATCH v2 3/8] block: sed-opal: unify cmd start and finalize

2018-03-14 Thread Jonas Rabenstein
Every step starts with resetting the cmd buffer as well as the comid and constructs the appropriate OPAL_CALL command. Consequently, those actions may be combined into one generic function. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 250

[PATCH v2 8.3/8.4] block: sed-opal: get metadata about opal-sed tables

2018-03-14 Thread Jonas Rabenstein
Every opal-sed table is described in the OPAL_TABLE_TABLE. Provide a function to get desired information out of that table. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/opal_proto.h | 16 block/sed-opal.c

[PATCH v2 8.3/8.4] block: sed-opal: get metadata about opal-sed tables

2018-03-14 Thread Jonas Rabenstein
Every opal-sed table is described in the OPAL_TABLE_TABLE. Provide a function to get desired information out of that table. Signed-off-by: Jonas Rabenstein --- block/opal_proto.h | 16 block/sed-opal.c | 25 + 2 files changed, 41 insertions(+) diff

[PATCH v2 8.4/8.4] block: sed-opal: check size of shadow mbr

2018-03-14 Thread Jonas Rabenstein
Check whether the shadow mbr does fit in the provided space on the target. Also a proper firmware should handle this case and return an error we may prevent problem with crappy firmwares. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.

[PATCH v2 8.4/8.4] block: sed-opal: check size of shadow mbr

2018-03-14 Thread Jonas Rabenstein
Check whether the shadow mbr does fit in the provided space on the target. Also a proper firmware should handle this case and return an error we may prevent problem with crappy firmwares. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 14 ++ 1 file changed, 14 insertions

[PATCH v2 8.2/8.4] block: sed-opal: unify retrieval of table columns

2018-03-14 Thread Jonas Rabenstein
instead of having multiple places defining the same argument list to get a specific column of a sed-opal table, provide a generic version and call it from those functions. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/opal_proto.h | 2 + block/sed-

[PATCH v2 8.0/8.4] block: sed-opal: check size of shadow mbr

2018-03-14 Thread Jonas Rabenstein
practice for such an situation but hope it is okay like this. Also the userspace exported pointer is replaced with an u64 value. Jonas Rabenstein (4): block: sed-opal: ioctl for writing to shadow mbr block: sed-opal: unify retrieval of table columns block: sed-opal: get metadata about opal-sed

[PATCH v2 8.2/8.4] block: sed-opal: unify retrieval of table columns

2018-03-14 Thread Jonas Rabenstein
instead of having multiple places defining the same argument list to get a specific column of a sed-opal table, provide a generic version and call it from those functions. Signed-off-by: Jonas Rabenstein --- block/opal_proto.h | 2 + block/sed-opal.c | 130

[PATCH v2 8.0/8.4] block: sed-opal: check size of shadow mbr

2018-03-14 Thread Jonas Rabenstein
practice for such an situation but hope it is okay like this. Also the userspace exported pointer is replaced with an u64 value. Jonas Rabenstein (4): block: sed-opal: ioctl for writing to shadow mbr block: sed-opal: unify retrieval of table columns block: sed-opal: get metadata about opal-sed

[PATCH v2 8.1/8.4] block: sed-opal: ioctl for writing to shadow mbr

2018-03-14 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Signed-off-by: Jonas Rabenstein <jonas.rabe

[PATCH v2 8.1/8.4] block: sed-opal: ioctl for writing to shadow mbr

2018-03-14 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Signed-off-by: Jonas Rabenstein --- block/sed

[PATCH 2/8] block: sed-opal: unify space check in add_token_*

2018-03-13 Thread Jonas Rabenstein
All add_token_* functions have a common set of conditions that have to be checked. Use a common function for those checks in order to avoid different behaviour. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c | 25 -

[PATCH 2/8] block: sed-opal: unify space check in add_token_*

2018-03-13 Thread Jonas Rabenstein
All add_token_* functions have a common set of conditions that have to be checked. Use a common function for those checks in order to avoid different behaviour. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 25 - 1 file changed, 16 insertions(+), 9 deletions

[PATCH 5/8] block: sed-opal: print failed function address

2018-03-13 Thread Jonas Rabenstein
add function address (and if available its symbol) to the message if a step function fails. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/sed-opal.c b/block/sed-

[PATCH 5/8] block: sed-opal: print failed function address

2018-03-13 Thread Jonas Rabenstein
add function address (and if available its symbol) to the message if a step function fails. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 5a448a3ba1df..f7925e6f607c 100644

[PATCH 8/8] block: sed-opal: ioctl for writing to shadow mbr

2018-03-13 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Signed-off-by: Jonas Rabenstein <jonas.rabe

[PATCH 1/8] block: sed-opal: use correct macro for method length

2018-03-13 Thread Jonas Rabenstein
also the values of OPAL_UID_LENGTH and OPAL_METHOD_LENGTH are the same, it is weird to use OPAL_UID_LENGTH for the definition of the methods. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 8/8] block: sed-opal: ioctl for writing to shadow mbr

2018-03-13 Thread Jonas Rabenstein
Allow modification of the shadow mbr. If the shadow mbr is not marked as done, this data will be presented read only as the device content. Only after marking the shadow mbr as done and unlocking a locking range the actual content is accessible. Signed-off-by: Jonas Rabenstein --- block/sed

[PATCH 1/8] block: sed-opal: use correct macro for method length

2018-03-13 Thread Jonas Rabenstein
also the values of OPAL_UID_LENGTH and OPAL_METHOD_LENGTH are the same, it is weird to use OPAL_UID_LENGTH for the definition of the methods. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sed-opal.c b/block/sed

[PATCH 7/8] block: sed-opal: add ioctl for done-mark of shadow mbr

2018-03-13 Thread Jonas Rabenstein
to enable the feature if it is already enabled and one only wants to mark the shadow mbr as done. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c | 33 +++-- include/linux/sed-opal.h | 1 + includ

[PATCH 4/8] block: sed-opal: unify error handling of responses

2018-03-13 Thread Jonas Rabenstein
Also response_get_token had already been in place, its functionality had been duplicated within response_get_{u64,bytestring} with the same error handling. Unify the handling by reusing response_get_token within the other functions. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.

[PATCH 7/8] block: sed-opal: add ioctl for done-mark of shadow mbr

2018-03-13 Thread Jonas Rabenstein
to enable the feature if it is already enabled and one only wants to mark the shadow mbr as done. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 33 +++-- include/linux/sed-opal.h | 1 + include/uapi/linux/sed-opal.h | 1 + 3 files changed, 33

[PATCH 4/8] block: sed-opal: unify error handling of responses

2018-03-13 Thread Jonas Rabenstein
Also response_get_token had already been in place, its functionality had been duplicated within response_get_{u64,bytestring} with the same error handling. Unify the handling by reusing response_get_token within the other functions. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 28

[PATCH 3/8] block: sed-opal: unify cmd start and finalize

2018-03-13 Thread Jonas Rabenstein
Every step starts with resetting the cmd buffer as well as the comid and constructs the appropriate OPAL_CALL command. Consequently, those actions may be combined into one generic function. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c

[PATCH 3/8] block: sed-opal: unify cmd start and finalize

2018-03-13 Thread Jonas Rabenstein
Every step starts with resetting the cmd buffer as well as the comid and constructs the appropriate OPAL_CALL command. Consequently, those actions may be combined into one generic function. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 243

[PATCH 6/8] block: sed-opal: split generation of bytestring header and content

2018-03-13 Thread Jonas Rabenstein
Split the header generation from the (normal) memcpy part if a bytestring is copied into the command buffer. This allows in-place generation of the bytestring content. For example, copy_from_user may be used without an intermediate buffer. Signed-off-by: Jonas Rabenstein <jonas.rabe

[PATCH 6/8] block: sed-opal: split generation of bytestring header and content

2018-03-13 Thread Jonas Rabenstein
Split the header generation from the (normal) memcpy part if a bytestring is copied into the command buffer. This allows in-place generation of the bytestring content. For example, copy_from_user may be used without an intermediate buffer. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c

[PATCH 0/8] block: sed-opal: support write to shadow mbr

2018-03-13 Thread Jonas Rabenstein
, Jonas [0] https://lkml.org/lkml/2018/3/7/534 [1] https://github.com/ghostav/sed-opal-temp Jonas Rabenstein (8): block: sed-opal: use correct macro for method length block: sed-opal: unify space check in add_token_* block: sed-opal: unify cmd start and finalize block: sed-opal: unify error

[PATCH 0/8] block: sed-opal: support write to shadow mbr

2018-03-13 Thread Jonas Rabenstein
, Jonas [0] https://lkml.org/lkml/2018/3/7/534 [1] https://github.com/ghostav/sed-opal-temp Jonas Rabenstein (8): block: sed-opal: use correct macro for method length block: sed-opal: unify space check in add_token_* block: sed-opal: unify cmd start and finalize block: sed-opal: unify error

Re: [PATCH v2] block: sed-opal: fix u64 short atom length

2018-03-07 Thread Jonas Rabenstein
On Wed, Mar 07, 2018 at 04:24:29PM -0700, Scott Bauer wrote: > On Wed, Mar 07, 2018 at 05:55:56PM +0100, Jonas Rabenstein wrote: > > The length must be given as bytes and not as 4 bit tuples. > > > > Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erl

Re: [PATCH v2] block: sed-opal: fix u64 short atom length

2018-03-07 Thread Jonas Rabenstein
On Wed, Mar 07, 2018 at 04:24:29PM -0700, Scott Bauer wrote: > On Wed, Mar 07, 2018 at 05:55:56PM +0100, Jonas Rabenstein wrote: > > The length must be given as bytes and not as 4 bit tuples. > > > > Signed-off-by: Jonas Rabenstein > > --- > > v2: > >

[PATCH v2] block: sed-opal: fix u64 short atom length

2018-03-07 Thread Jonas Rabenstein
The length must be given as bytes and not as 4 bit tuples. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- v2: - use fls64 - shorten loop body --- block/sed-opal.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/block/sed-

[PATCH v2] block: sed-opal: fix u64 short atom length

2018-03-07 Thread Jonas Rabenstein
The length must be given as bytes and not as 4 bit tuples. Signed-off-by: Jonas Rabenstein --- v2: - use fls64 - shorten loop body --- block/sed-opal.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 36842bfa572e

[PATCH][RESEND] block: sed-opal: fix response string extraction

2018-03-01 Thread Jonas Rabenstein
Tokens are prefixed by a variable length of bytes. If a bytestring is not stored in an tiny or short atom, we have to skip more than one byte in order to have the actual bytes not prefixed by the bytes describing the actual length of the string. Signed-off-by: Jonas Rabenstein <jonas.rabe

[PATCH][RESEND] block: sed-opal: fix response string extraction

2018-03-01 Thread Jonas Rabenstein
Tokens are prefixed by a variable length of bytes. If a bytestring is not stored in an tiny or short atom, we have to skip more than one byte in order to have the actual bytes not prefixed by the bytes describing the actual length of the string. Signed-off-by: Jonas Rabenstein --- block/sed

[PATCH][RESEND] block: sed-opal: fix u64 short atom length

2018-03-01 Thread Jonas Rabenstein
The length must be given as bytes and not as 4 bit tuples. Signed-off-by: Jonas Rabenstein <jonas.rabenst...@studium.uni-erlangen.de> --- block/sed-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 36842bfa572e..d5f565

[PATCH][RESEND] block: sed-opal: fix u64 short atom length

2018-03-01 Thread Jonas Rabenstein
The length must be given as bytes and not as 4 bit tuples. Signed-off-by: Jonas Rabenstein --- block/sed-opal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/sed-opal.c b/block/sed-opal.c index 36842bfa572e..d5f565e1557a 100644 --- a/block/sed-opal.c +++ b/block/sed

[PATCH] block: sed-opal: fix response string extraction

2018-02-20 Thread Jonas Rabenstein
Tokens are prefixed by a variable length of bytes. If a bytestring is not stored in an tiny or short atom, we have to skip more than one byte in order to have the actual bytes not prefixed by the bytes describing the actual length of the string. Signed-off-by: Jonas Rabenstein <jonas.rabe

  1   2   >