Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932129AbcLLP6U convert rfc822-to-8bit (ORCPT ); Mon, 12 Dec 2016 10:58:20 -0500 Received: from mga04.intel.com ([192.55.52.120]:24120 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752188AbcLLP6S (ORCPT ); Mon, 12 Dec 2016 10:58:18 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,337,1477983600"; d="scan'208";a="41686907" From: "Winkler, Tomas" To: Jarkko Sakkinen CC: Peter Huewe , open list , "linux-security-module@vger.kernel.org" , "moderated list:TPM DEVICE DRIVER" Subject: RE: [tpmdd-devel] [PATCH v3 1/3] tpm_crb: map locality registers Thread-Topic: [tpmdd-devel] [PATCH v3 1/3] tpm_crb: map locality registers Thread-Index: AQHSUIAvAYiuaEwWlkaaNtaLKaA5nqEEYvjAgAAVn+uAAAVzAA== Date: Mon, 12 Dec 2016 15:57:54 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B5433B553@hasmsx108.ger.corp.intel.com> References: <20161207115001.18332-1-jarkko.sakkinen@linux.intel.com> <20161207115001.18332-2-jarkko.sakkinen@linux.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B5433A4BD@hasmsx108.ger.corp.intel.com> <20161212152001.53ewps3jczs4jdld@intel.com> <20161212153108.mc5xf72npprz7wpe@intel.com> In-Reply-To: <20161212153108.mc5xf72npprz7wpe@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDU1ZmNjYWQtMDk2OS00YzY0LTg2MjMtZGQ5MWZmMjBkYTFmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ikpjb3ljZ0RLMGFUak5FQklJbUlibFdqeXJHZlNZZWdDd2hwMkVNdXRFekU9In0= x-originating-ip: [10.184.70.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2938 Lines: 91 > > On Mon, Dec 12, 2016 at 02:25:32PM +0000, Winkler, Tomas wrote: > > > > > > > > In order to provide access to locality registers, this commits > > > > adds mapping of the head of the CRB registers, which are located right > before the control area. > > > > > > > > Signed-off-by: Jarkko Sakkinen > > > > --- > > > > drivers/char/tpm/tpm_crb.c | 89 > > > > +++++++++++++++++++++++++++++------------ > > > > ----- > > > > 1 file changed, 57 insertions(+), 32 deletions(-) > > > > > > > > diff --git a/drivers/char/tpm/tpm_crb.c > > > > b/drivers/char/tpm/tpm_crb.c index > > > > 717b6b4..80b9759 100644 > > > > --- a/drivers/char/tpm/tpm_crb.c > > > > +++ b/drivers/char/tpm/tpm_crb.c > > > > @@ -52,18 +52,28 @@ enum crb_cancel { > > > > CRB_CANCEL_INVOKE = BIT(0), > > > > }; > > > > > > > > -struct crb_control_area { > > > > - u32 req; > > > > - u32 sts; > > > > - u32 cancel; > > > > - u32 start; > > > > - u32 int_enable; > > > > - u32 int_sts; > > > > - u32 cmd_size; > > > > - u32 cmd_pa_low; > > > > - u32 cmd_pa_high; > > > > - u32 rsp_size; > > > > - u64 rsp_pa; > > > > +struct crb_regs_head { > > > > + u32 loc_state; > > > > + u32 reserved1; > > > > + u32 loc_ctrl; > > > > + u32 loc_sts; > > > > + u8 reserved2[32]; > > > > + u64 intf_id; > > > > + u64 ctrl_ext; > > > > +} __packed; > > > > + > > > > > > > +struct crb_regs_tail { > > > Why to change the name this is still control_area > > And how would you name struct crb_regs_h then? Just crb_regs > In my opinion PC it makes a lot of sense to speak about registers here rather > than control area now that it is extended to the full range. The PC Client > Specification also speaks about registers. Right so crb_regs is to be and the nonstandard implementation of the legacy platforms should be even factored out. > > > > > + u32 ctrl_req; > > > > + u32 ctrl_sts; > > > > + u32 ctrl_cancel; > > > > + u32 ctrl_start; > > > > + u32 ctrl_int_enable; > > > > + u32 ctrl_int_sts; > > > > + u32 ctrl_cmd_size; > > > > + u32 ctrl_cmd_pa_low; > > > > + u32 ctrl_cmd_pa_high; > > > > + u32 ctrl_rsp_size; > > > > + u64 ctrl_rsp_pa; > > > > } __packed; > > > > > > > > enum crb_status { > > > > @@ -78,7 +88,8 @@ enum crb_flags { struct crb_priv { > > > > unsigned int flags; > > > > void __iomem *iobase; > > > > - struct crb_control_area __iomem *cca; > > > > + struct crb_regs_head __iomem *regs_h; > > > > + struct crb_regs_tail __iomem *regs_t; > > > > > > Same here, why to change the name, let's keep it cca it will reduce > > > the size of patch and make it more back portable. > > Backportability is a always a secondary priority for new features albeit > something that can be considered if it doesn't get in the way. I think of it as a staged steps. First do the minimal fix then do the overhaul. Anyway you are kind of counterproductive to yourself as you already know this need a back port. Thanks Tomas