From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: Prakhar Srivastava <prsriva@linux.microsoft.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-integrity@vger.kernel.org, kexec@lists.infradead.org,
arnd@arndb.de, jean-philippe@linaro.org, allison@lohutok.net,
kristina.martsenko@arm.org, yamada.masahiro@socionext.com,
duwe@lst.de, mark.rutland@arm.com, tglx@linutronix.de,
takahiro.akashi@linaro.org, james.morse@arm.org,
catalin.marinas@arm.com, sboyd@kernel.org
Subject: Re: [RFC PATCH v1 1/1] Add support for arm64 to carry ima measurement log in kexec_file_load
Date: Thu, 19 Sep 2019 00:59:11 -0300 [thread overview]
Message-ID: <871rwd2ay8.fsf@morokweng.localdomain> (raw)
In-Reply-To: <1568841696.4733.3.camel@linux.ibm.com>
Mimi Zohar <zohar@linux.ibm.com> writes:
> On Wed, 2019-09-18 at 10:15 -0400, Mimi Zohar wrote:
>
>> > + uint64_t tmp_start, tmp_end;
>> > +
>> > + propStart = of_find_property(of_chosen, "linux,ima-kexec-buffer",
>> > + NULL);
>> > + if (propStart) {
>> > + tmp_start = fdt64_to_cpu(*((const fdt64_t *) propStart));
>> > + ret = of_remove_property(of_chosen, propStart);
>> > + if (!ret) {
>> > + return ret;
>> > + }
>> > +
>> > + propEnd = of_find_property(of_chosen,
>> > + "linux,ima-kexec-buffer-end", NULL);
>> > + if (!propEnd) {
>> > + return -EINVAL;
>> > + }
>> > +
>> > + tmp_end = fdt64_to_cpu(*((const fdt64_t *) propEnd));
>> > +
>> > + ret = of_remove_property(of_chosen, propEnd);
>> > + if (!ret) {
>> > + return ret;
>> > + }
>>
>> There seems to be quite a bit of code duplication in this function and
>> in ima_get_kexec_buffer(). It could probably be cleaned up with some
>> refactoring.
>
> Sorry, my mistake. One calls of_get_property(), while the other calls
> of_find_property().
of_get_property() is a thin wrapper around of_find_property(), so if
that's the only difference I think they can still be merged.
--
Thiago Jung Bauermann
IBM Linux Technology Center
WARNING: multiple messages have this Message-ID (diff)
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: mark.rutland@arm.com, jean-philippe@linaro.org, arnd@arndb.de,
takahiro.akashi@linaro.org, sboyd@kernel.org,
catalin.marinas@arm.com, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org,
Prakhar Srivastava <prsriva@linux.microsoft.com>,
yamada.masahiro@socionext.com, kristina.martsenko@arm.org,
duwe@lst.de, allison@lohutok.net, james.morse@arm.org,
linux-integrity@vger.kernel.org, tglx@linutronix.de,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH v1 1/1] Add support for arm64 to carry ima measurement log in kexec_file_load
Date: Thu, 19 Sep 2019 00:59:11 -0300 [thread overview]
Message-ID: <871rwd2ay8.fsf@morokweng.localdomain> (raw)
In-Reply-To: <1568841696.4733.3.camel@linux.ibm.com>
Mimi Zohar <zohar@linux.ibm.com> writes:
> On Wed, 2019-09-18 at 10:15 -0400, Mimi Zohar wrote:
>
>> > + uint64_t tmp_start, tmp_end;
>> > +
>> > + propStart = of_find_property(of_chosen, "linux,ima-kexec-buffer",
>> > + NULL);
>> > + if (propStart) {
>> > + tmp_start = fdt64_to_cpu(*((const fdt64_t *) propStart));
>> > + ret = of_remove_property(of_chosen, propStart);
>> > + if (!ret) {
>> > + return ret;
>> > + }
>> > +
>> > + propEnd = of_find_property(of_chosen,
>> > + "linux,ima-kexec-buffer-end", NULL);
>> > + if (!propEnd) {
>> > + return -EINVAL;
>> > + }
>> > +
>> > + tmp_end = fdt64_to_cpu(*((const fdt64_t *) propEnd));
>> > +
>> > + ret = of_remove_property(of_chosen, propEnd);
>> > + if (!ret) {
>> > + return ret;
>> > + }
>>
>> There seems to be quite a bit of code duplication in this function and
>> in ima_get_kexec_buffer(). It could probably be cleaned up with some
>> refactoring.
>
> Sorry, my mistake. One calls of_get_property(), while the other calls
> of_find_property().
of_get_property() is a thin wrapper around of_find_property(), so if
that's the only difference I think they can still be merged.
--
Thiago Jung Bauermann
IBM Linux Technology Center
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Thiago Jung Bauermann <bauerman@linux.ibm.com>
To: Mimi Zohar <zohar@linux.ibm.com>
Cc: mark.rutland@arm.com, jean-philippe@linaro.org, arnd@arndb.de,
takahiro.akashi@linaro.org, sboyd@kernel.org,
catalin.marinas@arm.com, kexec@lists.infradead.org,
linux-kernel@vger.kernel.org,
Prakhar Srivastava <prsriva@linux.microsoft.com>,
yamada.masahiro@socionext.com, kristina.martsenko@arm.org,
duwe@lst.de, allison@lohutok.net, james.morse@arm.org,
linux-integrity@vger.kernel.org, tglx@linutronix.de,
linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH v1 1/1] Add support for arm64 to carry ima measurement log in kexec_file_load
Date: Thu, 19 Sep 2019 00:59:11 -0300 [thread overview]
Message-ID: <871rwd2ay8.fsf@morokweng.localdomain> (raw)
In-Reply-To: <1568841696.4733.3.camel@linux.ibm.com>
Mimi Zohar <zohar@linux.ibm.com> writes:
> On Wed, 2019-09-18 at 10:15 -0400, Mimi Zohar wrote:
>
>> > + uint64_t tmp_start, tmp_end;
>> > +
>> > + propStart = of_find_property(of_chosen, "linux,ima-kexec-buffer",
>> > + NULL);
>> > + if (propStart) {
>> > + tmp_start = fdt64_to_cpu(*((const fdt64_t *) propStart));
>> > + ret = of_remove_property(of_chosen, propStart);
>> > + if (!ret) {
>> > + return ret;
>> > + }
>> > +
>> > + propEnd = of_find_property(of_chosen,
>> > + "linux,ima-kexec-buffer-end", NULL);
>> > + if (!propEnd) {
>> > + return -EINVAL;
>> > + }
>> > +
>> > + tmp_end = fdt64_to_cpu(*((const fdt64_t *) propEnd));
>> > +
>> > + ret = of_remove_property(of_chosen, propEnd);
>> > + if (!ret) {
>> > + return ret;
>> > + }
>>
>> There seems to be quite a bit of code duplication in this function and
>> in ima_get_kexec_buffer(). It could probably be cleaned up with some
>> refactoring.
>
> Sorry, my mistake. One calls of_get_property(), while the other calls
> of_find_property().
of_get_property() is a thin wrapper around of_find_property(), so if
that's the only difference I think they can still be merged.
--
Thiago Jung Bauermann
IBM Linux Technology Center
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2019-09-19 4:00 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-13 22:50 [RFC PATCH v1 0/1] Add support for arm64 to carry ima measurement log in kexec_file_load Prakhar Srivastava
2019-09-13 22:50 ` Prakhar Srivastava
2019-09-13 22:50 ` Prakhar Srivastava
2019-09-13 22:50 ` [RFC PATCH v1 1/1] " Prakhar Srivastava
2019-09-13 22:50 ` Prakhar Srivastava
2019-09-13 22:50 ` Prakhar Srivastava
2019-09-18 14:15 ` Mimi Zohar
2019-09-18 14:15 ` Mimi Zohar
2019-09-18 14:15 ` Mimi Zohar
2019-09-18 21:21 ` Mimi Zohar
2019-09-18 21:21 ` Mimi Zohar
2019-09-18 21:21 ` Mimi Zohar
2019-09-19 3:59 ` Thiago Jung Bauermann [this message]
2019-09-19 3:59 ` Thiago Jung Bauermann
2019-09-19 3:59 ` Thiago Jung Bauermann
2019-09-20 0:32 ` Prakhar Srivastava
2019-09-20 0:32 ` Prakhar Srivastava
2019-09-20 0:32 ` Prakhar Srivastava
2019-09-20 3:07 ` Thiago Jung Bauermann
2019-09-20 3:07 ` Thiago Jung Bauermann
2019-09-20 3:07 ` Thiago Jung Bauermann
2019-09-24 19:54 ` prsriva
2019-09-24 19:54 ` prsriva
2019-09-24 19:54 ` prsriva
2019-09-24 20:25 ` Thiago Jung Bauermann
2019-09-24 20:25 ` Thiago Jung Bauermann
2019-09-24 20:25 ` Thiago Jung Bauermann
2019-09-24 20:27 ` prsriva
2019-09-24 20:27 ` prsriva
2019-09-24 20:27 ` prsriva
-- strict thread matches above, loose matches on Subject: below --
2019-09-09 23:14 [RFC PATCH v1 0/1] " Prakhar Srivastava
2019-09-09 23:14 ` [RFC PATCH v1 1/1] " Prakhar Srivastava
2019-09-09 23:14 ` Prakhar Srivastava
2019-09-06 23:51 [RFC][PATCH v1 0/1] " Prakhar Srivastava
2019-09-06 23:51 ` [RFC][PATCH v1 1/1] " Prakhar Srivastava
2019-09-06 23:51 ` Prakhar Srivastava
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871rwd2ay8.fsf@morokweng.localdomain \
--to=bauerman@linux.ibm.com \
--cc=allison@lohutok.net \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=duwe@lst.de \
--cc=james.morse@arm.org \
--cc=jean-philippe@linaro.org \
--cc=kexec@lists.infradead.org \
--cc=kristina.martsenko@arm.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=prsriva@linux.microsoft.com \
--cc=sboyd@kernel.org \
--cc=takahiro.akashi@linaro.org \
--cc=tglx@linutronix.de \
--cc=yamada.masahiro@socionext.com \
--cc=zohar@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.