From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0BD3C49ED7 for ; Fri, 20 Sep 2019 00:32:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B467C20C01 for ; Fri, 20 Sep 2019 00:32:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BD5lKBcT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B467C20C01 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tu+hlF/svVSEjMptX/IgCrUO1o8iPw+lGnNJIVIpAHI=; b=BD5lKBcTnBJlRjUibYNf2FH01 hlbHhj2HQD1g6Ss7S7KRAWUfWqGK13nEcsS18WGYzOQ35Mrypky6yvF5fkgkz78jucOrYchCdetrx vb5sKWPyR36DC10Wnt+hk6rPyc2IcRVa5tC28kDqY6WsXsleX3PxacWJG7kyTJYNYS4m0vq1DzUAJ i3CEMGqr4U1m6yQs4gq1hjZkMpxzOb8vhZKbqWXQhqw8JD5mPKyejA0xq06TB+mqqi8+Ars5RG+Sy 5G/Dv49M8NvgMkB+Pg1NaBo9veOK/tjrKlrSG8s6eWS4WEix9a5ZSirFpelQhwIcHm9foaARXcuVa 4Pq82aq5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iB6qJ-0002Yr-Es; Fri, 20 Sep 2019 00:32:11 +0000 Received: from linux.microsoft.com ([13.77.154.182]) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iB6qE-0002Xd-Gu; Fri, 20 Sep 2019 00:32:07 +0000 Received: from [10.200.157.35] (unknown [131.107.174.35]) by linux.microsoft.com (Postfix) with ESMTPSA id 021A920B718D; Thu, 19 Sep 2019 17:32:04 -0700 (PDT) Subject: Re: [RFC PATCH v1 1/1] Add support for arm64 to carry ima measurement log in kexec_file_load To: Thiago Jung Bauermann , Mimi Zohar References: <20190913225009.3406-1-prsriva@linux.microsoft.com> <20190913225009.3406-2-prsriva@linux.microsoft.com> <1568816111.16709.68.camel@linux.ibm.com> <1568841696.4733.3.camel@linux.ibm.com> <871rwd2ay8.fsf@morokweng.localdomain> From: Prakhar Srivastava Message-ID: Date: Thu, 19 Sep 2019 17:32:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <871rwd2ay8.fsf@morokweng.localdomain> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190919_173206_586101_C7F13535 X-CRM114-Status: UNSURE ( 9.71 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, jean-philippe@linaro.org, arnd@arndb.de, yamada.masahiro@socionext.com, sboyd@kernel.org, catalin.marinas@arm.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, takahiro.akashi@linaro.org, kristina.martsenko@arm.org, duwe@lst.de, linux-arm-kernel@lists.infradead.org, james.morse@arm.org, linux-integrity@vger.kernel.org, tglx@linutronix.de, allison@lohutok.net Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 9/18/2019 8:59 PM, Thiago Jung Bauermann wrote: > Mimi Zohar 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. I will move to using of_get_property and see if i can reduce the code further. Also address other comments by Mimi in my next iteration. Thanks, Prakhar Srivastava _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel