tpm: add longer timeouts for creation commands.
Subsystems (3)
PATCH RESEND 1/3 tpm: add longer timeouts for creation commands.
TPM2_CC_Create(0x153) and TPM2_CC_CreatePrimary (0x131) involve generation of crypto keys which can be a computationally intensive task. The timeout is set to 3min.
--- drivers/char/tpm/tpm-interface.c | 4 ++++ drivers/char/tpm/tpm.h | 27 ++++++++++++++++----------- drivers/char/tpm/tpm2-cmd.c | 8 +++++--- 3 files changed, 25 insertions(+), 14 deletions(-)
drivers/char/tpm/tpm-interface.c +4 -0
@@ -699,6 +699,10 @@ int tpm_get_timeouts(struct tpm_chip *chip)msecs_to_jiffies (TPM2_DURATION_MEDIUM ); chip->duration[TPM_LONG ] =msecs_to_jiffies (TPM2_DURATION_LONG ); + chip->duration[TPM_LONG_LONG ] = +msecs_to_jiffies (TPM2_DURATION_LONG_LONG ); + chip->duration[TPM_UNDEFINED ] = +msecs_to_jiffies (TPM2_DURATION_DEFAULT ); chip->flags |=TPM_CHIP_FLAG_HAVE_TIMEOUTS ;return 0 ;
drivers/char/tpm/tpm.h +16 -11
@@ -67,7 +67,9 @@ enum tpm_duration {TPM_SHORT =0 ,TPM_MEDIUM =1 ,TPM_LONG =2 , - TPM_UNDEFINED, +TPM_LONG_LONG =3 , +TPM_UNDEFINED =4 , + TPM_DURATION_MAX, };#define TPM_WARN_RETRY 0x800
@@ -79,15 +81,17 @@ enum tpm_duration {#define TPM_HEADER_SIZE 10enum tpm2_const { -TPM2_PLATFORM_PCR =24 , -TPM2_PCR_SELECT_MIN = ((TPM2_PLATFORM_PCR +7 ) /8 ), -TPM2_TIMEOUT_A =750 , -TPM2_TIMEOUT_B =2000 , -TPM2_TIMEOUT_C =200 , -TPM2_TIMEOUT_D =30 , -TPM2_DURATION_SHORT =20 , -TPM2_DURATION_MEDIUM =750 , -TPM2_DURATION_LONG =2000 , +TPM2_PLATFORM_PCR =24 , +TPM2_PCR_SELECT_MIN = ((TPM2_PLATFORM_PCR +7 ) /8 ), +TPM2_TIMEOUT_A =750 , +TPM2_TIMEOUT_B =2000 , +TPM2_TIMEOUT_C =200 , +TPM2_TIMEOUT_D =30 , +TPM2_DURATION_SHORT =20 , +TPM2_DURATION_MEDIUM =750 , +TPM2_DURATION_LONG =2000 , +TPM2_DURATION_LONG_LONG =300000 , +TPM2_DURATION_DEFAULT =120000 , };enum tpm2_structures {
@@ -123,6 +127,7 @@ enum tpm2_algorithms {enum tpm2_command_codes {TPM2_CC_FIRST =0x011F , +TPM2_CC_CREATE_PRIMARY =0x0131 ,TPM2_CC_SELF_TEST =0x0143 ,TPM2_CC_STARTUP =0x0144 ,TPM2_CC_SHUTDOWN =0x0145 ,
@@ -227,7 +232,7 @@ struct tpm_chip {unsigned long timeout_c;/* jiffies */ unsigned long timeout_d;/* jiffies */ bool timeout_adjusted; -unsigned long duration[3 ];/* jiffies */ +unsigned long duration[TPM_DURATION_MAX ];/* jiffies */ bool duration_adjusted;struct dentry *bios_dir[TPM_NUM_EVENT_LOG_FILES ];
drivers/char/tpm/tpm2-cmd.c +5 -3
@@ -90,6 +90,8 @@ static struct tpm2_hash tpm2_hash_map[] = {* of time the chip could take to return the result. The values * of the SHORT, MEDIUM, and LONG durations are taken from the * PC Client Profile (PTP) specification. +* LONG_LONG is for commands that generates keys which empirically +* takes longer time on some systems. */ static const u8 tpm2_ordinal_duration[TPM2_CC_LAST -TPM2_CC_FIRST +1 ] = {TPM_UNDEFINED ,/* 11F */
@@ -110,7 +112,7 @@ static const u8 tpm2_ordinal_duration[TPM2_CC_LAST - TPM2_CC_FIRST + 1] = {TPM_UNDEFINED ,/* 12e */ TPM_UNDEFINED ,/* 12f */ TPM_UNDEFINED ,/* 130 */ -TPM_UNDEFINED ,/* 131 */ +TPM_LONG_LONG ,/* 131 */ TPM_UNDEFINED ,/* 132 */ TPM_UNDEFINED ,/* 133 */ TPM_UNDEFINED, /* 134 */
@@ -144,7 +146,7 @@ static const u8 tpm2_ordinal_duration[TPM2_CC_LAST - TPM2_CC_FIRST + 1] = {TPM_UNDEFINED ,/* 150 */ TPM_UNDEFINED ,/* 151 */ TPM_UNDEFINED ,/* 152 */ -TPM_UNDEFINED ,/* 153 */ +TPM_LONG_LONG ,/* 153 */ TPM_UNDEFINED ,/* 154 */ TPM_UNDEFINED ,/* 155 */ TPM_UNDEFINED, /* 156 */
@@ -821,7 +823,7 @@ unsigned long tpm2_calc_ordinal_duration(struct tpm_chip *chip, u32 ordinal) duration = chip->duration[index];if (duration <=0 ) - duration =2 *60 *HZ ; + duration =msecs_to_jiffies (TPM2_DURATION_DEFAULT );return duration; }
Signature · 6 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info@ http://vger.kernel.org/majordomo-info.html
PATCH 2/3 tpm: add new tpm2 commands according to TCG 1.36
1. TPM2_CC_LAST has moved from 182 to 193
2. Convert tpm2_ordinal_duration from an array into a switch statement, as there are not so many commands that require special duration relative to a number of commands.
--- drivers/char/tpm/tpm.h | 41 ++++++---- drivers/char/tpm/tpm2-cmd.c | 188 +++++++++++++++----------------------------- 2 files changed, 90 insertions(+), 139 deletions(-)
drivers/char/tpm/tpm.h +25 -16
@@ -126,22 +126,31 @@ enum tpm2_algorithms { };enum tpm2_command_codes { -TPM2_CC_FIRST =0x011F , -TPM2_CC_CREATE_PRIMARY =0x0131 , -TPM2_CC_SELF_TEST =0x0143 , -TPM2_CC_STARTUP =0x0144 , -TPM2_CC_SHUTDOWN =0x0145 , -TPM2_CC_CREATE =0x0153 , -TPM2_CC_LOAD =0x0157 , -TPM2_CC_UNSEAL =0x015E , -TPM2_CC_CONTEXT_LOAD =0x0161 , -TPM2_CC_CONTEXT_SAVE =0x0162 , -TPM2_CC_FLUSH_CONTEXT =0x0165 , -TPM2_CC_GET_CAPABILITY =0x017A , -TPM2_CC_GET_RANDOM =0x017B , -TPM2_CC_PCR_READ =0x017E , -TPM2_CC_PCR_EXTEND =0x0182 , -TPM2_CC_LAST =0x018F , +TPM2_CC_FIRST =0x011F , +TPM2_CC_HIERARCHY_CONTROL =0x0121 , +TPM2_CC_HIERARCHY_CHANGE_AUTH =0x0129 , +TPM2_CC_CREATE_PRIMARY =0x0131 , +TPM2_CC_SEQUENCE_COMPLETE =0x013E , +TPM2_CC_SELF_TEST =0x0143 , +TPM2_CC_STARTUP =0x0144 , +TPM2_CC_SHUTDOWN =0x0145 , +TPM2_CC_NV_READ =0x014E , +TPM2_CC_CREATE =0x0153 , +TPM2_CC_LOAD =0x0157 , +TPM2_CC_SEQUENCE_UPDATE =0x015C , +TPM2_CC_UNSEAL =0x015E , +TPM2_CC_CONTEXT_LOAD =0x0161 , +TPM2_CC_CONTEXT_SAVE =0x0162 , +TPM2_CC_FLUSH_CONTEXT =0x0165 , +TPM2_CC_VERIFY_SIGNATURE =0x0177 , +TPM2_CC_GET_CAPABILITY =0x017A , +TPM2_CC_GET_RANDOM =0x017B , +TPM2_CC_PCR_READ =0x017E , +TPM2_CC_PCR_EXTEND =0x0182 , +TPM2_CC_EVENT_SEQUENCE_COMPLETE =0x0185 , +TPM2_CC_HASH_SEQUENCE_START =0x0186 , +TPM2_CC_CREATE_LOADED =0x0191 , +TPM2_CC_LAST =0x0193 ,/* Spec 1.36 */ };enum tpm2_permanent_handles {
drivers/char/tpm/tpm2-cmd.c +65 -123
204 lines not on this page · raw message
Signature · 6 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info@ http://vger.kernel.org/majordomo-info.html
PATCH 3/3 tpm_crb: use __le64 annotated variable for response buffer address
In reply to Tomas WinklerThis suppresses sparse warning drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted __le64
--- drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/tpm/tpm_crb.c +3 -2
@@ -489,6 +489,7 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv,u32 pa_high, pa_low;u64 cmd_pa;u32 cmd_size; +__le64 __rsp_pa;u64 rsp_pa;u32 rsp_size;int ret;
@@ -554,8 +555,8 @@ static int crb_map_io(struct acpi_device *device, struct crb_priv *priv, goto out; } -memcpy_fromio (&rsp_pa, &priv->regs_t->ctrl_rsp_pa,8 ); - rsp_pa =le64_to_cpu (rsp_pa); +memcpy_fromio (&__rsp_pa, &priv->regs_t->ctrl_rsp_pa,8 ); + rsp_pa =le64_to_cpu (__rsp_pa); rsp_size =crb_fixup_cmd_size (dev, &io_res, rsp_pa,ioread32 (&priv->regs_t->ctrl_rsp_size));
Signature · 6 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Tomas Winkler
TPM2_CC_Create(0x153)andTPM2_CC_CreatePrimary(0x131) involve generation of crypto keys which can be a computationally intensive task. The timeout is set to 3min.Signed-off-by Tomas Winkler <[email protected]>
Where is the cover letter? Please send separate patches if they are unrelated *or* add a cover letter that describes what they do as a whole.
I will not review the next version if it does not have cover letter describing the high level change and containing the change log.
Quoted 26 lines
--- drivers/char/tpm/tpm-interface.c | 4 ++++ drivers/char/tpm/tpm.h | 27 ++++++++++++++++----------- drivers/char/tpm/tpm2-cmd.c | 8 +++++--- 3 files changed, 25 insertions(+), 14 deletions(-)drivers/char/tpm/tpm-interface.c +4
-0@@ -699,6 +699,10 @@ int tpm_get_timeouts(struct tpm_chip *chip)msecs_to_jiffies (TPM2_DURATION_MEDIUM ); chip->duration[TPM_LONG ] =msecs_to_jiffies (TPM2_DURATION_LONG ); + chip->duration[TPM_LONG_LONG ] = +msecs_to_jiffies (TPM2_DURATION_LONG_LONG ); + chip->duration[TPM_UNDEFINED ] = +msecs_to_jiffies (TPM2_DURATION_DEFAULT ); chip->flags |=TPM_CHIP_FLAG_HAVE_TIMEOUTS ;return 0 ;drivers/char/tpm/tpm.h +0
-0
drivers/char/tpm/tpm.h enum tpm_duration { · line 72
Quoted 7 lines
drivers/char/tpm/tpm.h +3
-1@@ -67,7 +67,9 @@ enum tpm_duration {TPM_SHORT =0 ,TPM_MEDIUM =1 ,TPM_LONG =2 , - TPM_UNDEFINED, +TPM_LONG_LONG =3 , +TPM_UNDEFINED =4 , + TPM_DURATION_MAX,
This is starting to rotten to become unmaintainable.
Here is what I suggest to move forward:
* Have essentially two duration types:
1. Default
2. Long
'default' is the old long duration i.e. two seconds. 'long' is a
We should probably have two durations:
enum tpm_duration {
TPM_DURATION_DEFAULT = 2000,
TPM_DURATION_LONG = 300000,
};These would be both for TPM 1.2 and TPM 2.0. Instead of having table for every ordinal there should be a small tables describing commands that require long timeout.
drivers/char/tpm/tpm.h enum tpm_duration { · line 73
Quoted 2 lines
drivers/char/tpm/tpm.h +1
-1- duration =2 *60 *HZ ; + duration =msecs_to_jiffies (TPM2_DURATION_DEFAULT );
NAK for this change.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/3] tpm: add new tpm2 commands according to TCG 1.36
In reply to Tomas WinklerQuoted 6 lines · Tomas Winkler
1.
TPM2_CC_LASThas moved from 182 to 193
2. Converttpm2_ordinal_durationfrom an array into a switch statement, as there are not so many commands that require special duration relative to a number of commands.Signed-off-by Tomas Winkler <[email protected]>
My previous suggestion applies here.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] tpm_crb: use __le64 annotated variable for response buffer address
In reply to Tomas WinklerQuoted 7 lines · Tomas Winkler
This suppresses sparse warning
drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted__le64Signed-off-by Tomas Winkler <[email protected]>--- drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
The guideline is that you should describe what is wrong rather than copy-paste the sparse message.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 13 lines
-----Original Message-----
From: Jarkko Sakkinen [mailto:jarkko.sakkinen at linux.intel.com]
Sent: Monday, March 05, 2018 14:57
To: Winkler, Tomas <[email protected]>
Cc: Jason Gunthorpe <[email protected]>; Usyskin, Alexander <[email protected]>; linux-integrity at vger.kernel.org; linux- security-module at vger.kernel.org; linux-kernel at vger.kernel.org
Subject: Re: [PATCH 1/3 RESEND] tpm: add longer timeouts for creation commands.On Sun, Mar 04, 2018 at 02:12:03PM +0200, Tomas Winkler wrote:
Quoted 9 lines
Quoted 5 lines
TPM2_CC_Create(0x153)andTPM2_CC_CreatePrimary(0x131) involve generation of crypto keys which can be a computationally intensive task. The timeout is set to 3min.Signed-off-by Tomas Winkler <[email protected]>Where is the cover letter? Please send separate patches if they are unrelated *or* add a cover letter that describes what they do as a whole.
Why you need cover letter? What are u missing in the patch description
Quoted 2 lines
I will not review the next version if it does not have cover letter describing the high level change and containing the change log.
Don't follow.
Quoted 38 lines
Quoted 28 lines
--- drivers/char/tpm/tpm-interface.c | 4 ++++ drivers/char/tpm/tpm.h | 27 ++++++++++++++++----------- drivers/char/tpm/tpm2-cmd.c | 8 +++++--- 3 files changed, 25 insertions(+), 14 deletions(-)drivers/char/tpm/tpm-interface.c +4
-0@@ -699,6 +699,10 @@ int tpm_get_timeouts(struct tpm_chip *chip)msecs_to_jiffies (TPM2_DURATION_MEDIUM ); chip->duration[TPM_LONG ] =msecs_to_jiffies (TPM2_DURATION_LONG ); + chip->duration[TPM_LONG_LONG ] = +msecs_to_jiffies (TPM2_DURATION_LONG_LONG ); + chip->duration[TPM_UNDEFINED ] = +msecs_to_jiffies (TPM2_DURATION_DEFAULT ); chip->flags |=TPM_CHIP_FLAG_HAVE_TIMEOUTS ;return 0 ;drivers/char/tpm/tpm.h index renamed from drivers/char/tpm/tpm.h +0
-0
f895fba4e20d..192ba68b39c2100644drivers/char/tpm/tpm.h enum tpm_duration { · line 72
Quoted 7 lines
drivers/char/tpm/tpm.h +3
-1@@ -67,7 +67,9 @@ enum tpm_duration {TPM_SHORT =0 ,TPM_MEDIUM =1 ,TPM_LONG =2 , - TPM_UNDEFINED, +TPM_LONG_LONG =3 , +TPM_UNDEFINED =4 , + TPM_DURATION_MAX,This is starting to rotten to become unmaintainable.
Quoted 1 line
Here is what I suggest to move forward:
I fixed that in next patch, but this also moves the code to new spec, so I didn't want to make too much noise in this one.
Quoted 6 lines
* Have essentially two duration types:
1. Default
2. Long
'default' is the old long duration i.e. two seconds. 'long' is a
Quoted 7 lines
We should probably have two durations:
enum tpm_duration { TPM_DURATION_DEFAULT = 2000, TPM_DURATION_LONG = 300000, };
How is this aligned with the spec PTP spec?
Quoted 3 lines
These would be both for TPM 1.2 and TPM 2.0. Instead of having table for every ordinal there should be a small tables describing commands that require long timeout.
Yeah I didn't cover the 1.2.
Quoted 5 lines
drivers/char/tpm/tpm.h enum tpm_duration { · line 73
Quoted 3 lines
drivers/char/tpm/tpm.h +1
-1- duration =2 *60 *HZ ; + duration =msecs_to_jiffies (TPM2_DURATION_DEFAULT );NAK for this change.
You should explain your NAKs, .... in general, doesn't look good.
Thanks
Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Tomas
Quoted 5 lines
enum tpm_duration { TPM_DURATION_DEFAULT = 2000, TPM_DURATION_LONG = 300000, };How is this aligned with the spec PTP spec?
For TPM 2.0 that spec only partially defines durations for CCs and thus our look up table is already kind "flakky". In a sense that the default duration is upper limit for spec defined durations.
Quoted 5 lines
Quoted 3 lines
These would be both for TPM 1.2 and TPM 2.0. Instead of having table for every ordinal there should be a small tables describing commands that require long timeout.
Yeah I didn't cover the 1.2.
I could probably help with TPM 1.2 changes if required.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Tomas
Quoted 5 lines
Quoted 5 lines
enum tpm_duration { TPM_DURATION_DEFAULT = 2000, TPM_DURATION_LONG = 300000, };
Quoted 5 lines
Quoted 1 line
How is this aligned with the spec PTP spec?
For TPM 2.0 that spec only partially defines durations for CCs and thus our look up table is already kind "flakky". In a sense that the default duration is upper limit for spec defined durations.
The timeouts for LONG and MEDIUM is defined by the PTP spec, we need to maintain those as those effect the system. The UNDEFINED and LONG LONG is the implementation choice we driver from empirical data we have so far.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
These would be both for TPM 1.2 and TPM 2.0. Instead of having table for every ordinal there should be a small tables describing commands that require long timeout.
Yeah I didn't cover the 1.2.
I could probably help with TPM 1.2 changes if required.
In middle of it, will send for review in few.
Thanks
Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Tomas
Why you need cover letter? What are u missing in the patch description
If you submit a *patch set* I *require* a cover letter, yes.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 7 lines · Tomas
Quoted 7 lines · Tomas
Quoted 5 lines
Quoted 5 lines
enum tpm_duration { TPM_DURATION_DEFAULT = 2000, TPM_DURATION_LONG = 300000, };
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
How is this aligned with the spec PTP spec?
For TPM 2.0 that spec only partially defines durations for CCs and thus our look up table is already kind "flakky". In a sense that the default duration is upper limit for spec defined durations.
The timeouts for LONG and MEDIUM is defined by the PTP spec, we need to maintain those as those effect the system. The UNDEFINED and LONG LONG is the implementation choice we driver from empirical data we have so far.
Where can be get this empirical data?
You are not only adding 30s delay but also turning the 2s delay to 12s delay.
IMHO we could very well use PTP LONG for all commands as the timeout. Why that would not work?
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 6 lines · Tomas
Quoted 1 line
Why you need cover letter? What are u missing in the patch description
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
Thanks
Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 18 lines · Tomas
Quoted 7 lines
Quoted 7 lines · Tomas
Quoted 5 lines
Quoted 5 lines
enum tpm_duration { TPM_DURATION_DEFAULT = 2000, TPM_DURATION_LONG = 300000, };Quoted 7 lines
Quoted 5 lines
Quoted 1 line
How is this aligned with the spec PTP spec?
For TPM 2.0 that spec only partially defines durations for CCs and thus our look up table is already kind "flakky". In a sense that the default duration is upper limit for spec defined durations.
The timeouts for LONG and MEDIUM is defined by the PTP spec, we need
Quoted 8 lines
to maintain those as those effect the system.
Quoted 1 line
The UNDEFINED and LONG LONG is the implementation choice we driver
from empirical data we have so far.
Where can be get this empirical data?
From testing the HW.You are not only adding 30s delay but also turning the 2s delay to 12s delay.
I'm adding 3 min, no other changes. Where is 12s?
Quoted 2 lines
IMHO we could very well use PTP LONG for all commands as the timeout. Why that would not work?
Empirically it doesn't go test it you have the HW.
Thanks
Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] tpm_crb: use __le64 annotated variable for response buffer address
In reply to Jarkko SakkinenQuoted 11 lines · Jarkko Sakkinen
Quoted 7 lines · Tomas Winkler
This suppresses sparse warning
drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted__le64Signed-off-by Tomas Winkler <[email protected]>--- drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)The guideline is that you should describe what is wrong rather than copy-paste the sparse message.
Jason, didn't yo give the feedback to some patch 1-2 years ago that instead of copy-pasting parse error one should write a clear commit msg or is this OK?
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/3] tpm_crb: use __le64 annotated variable for response buffer address
Quoted 12 lines · Jarkko Sakkinen
Quoted 10 lines · Tomas Winkler
Quoted 8 lines
This suppresses sparse warning
drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted__le64Signed-off-by Tomas Winkler <[email protected]>--- drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
The guideline is that you should describe what is wrong rather than copy-paste the sparse message.
Jason, didn't yo give the feedback to some patch 1-2 years ago that instead of copy-pasting parse error one should write a clear commit msg or is this OK?
I think you are reading wrongly the rule, the title explains the issue and in addition I'm adding exact sparse warning. this is usually required.
What is wrong is putting something like 'Fix sparse error' or "Fix warning' into patch subject. So the imperative here is 'adding annotation' and not a 'fixing a sparse message'.
Thanks
Tomas
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe
reviewerRe: [PATCH 3/3] tpm_crb: use __le64 annotated variable for response buffer address
In reply to Jarkko SakkinenQuoted 9 lines · Jarkko Sakkinen
Quoted 8 lines · Jarkko Sakkinen
Quoted 6 lines · Tomas Winkler
This suppresses sparse warning
drivers/char/tpm/tpm_crb.c:558:18: warning: cast to restricted__le64Signed-off-by Tomas Winkler <[email protected]>drivers/char/tpm/tpm_crb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
The guideline is that you should describe what is wrong rather than copy-paste the sparse message.
Jason, didn't yo give the feedback to some patch 1-2 years ago that instead of copy-pasting parse error one should write a clear commit msg or is this OK?
The standard is to give some explaination why the tool complaint is valid and then if suitable include the tool complaint itself.
Eg bad:
Fix sparse warning on resp
Good:
use __le64 annotated variable for response buffer address
IMHO, the subject line sufficiently describes the patch, and it is generally OK to clip the tool warning into the body..
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
James Bottomley
maintainerQuoted 10 lines · Tomas
Quoted 8 lines · Tomas
Quoted 3 lines
Why you need cover letter???What are u missing in the patch description
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
As long as the Maintainer is the gatekeeper, you're not going to get very far with this argument. ?The fact is that a lot of subsystems have varying rules; often undocumented, some of which are even in conflict, like alphabetic vs reverse christmas tree format for includes.
A cover letter is actually one of the more uniform rules. ?It's referred to in submitting patches, but not actually documented there.
James
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 9 lines · Tomas
Quoted 7 lines
Quoted 7 lines · Tomas
Quoted 3 lines
Why you need cover letter?????What are u missing in the patch description
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
As long as the Maintainer is the gatekeeper, you're not going to get very far with this argument. ??The fact is that a lot of subsystems have varying rules; often undocumented, some of which are even in conflict, like alphabetic vs reverse christmas tree format for includes.
Usually I'm trying to stay in convention of the surouding code even if it's agains my personal taste.
I think this particular case was a bit different.
Quoted 2 lines
A cover letter is actually one of the more uniform rules. ??It's referred to in submitting patches, but not actually documented there.
I'm all for cover letters, but for few code line fixes it's more comments then code.
What is most important I think I and Jarkko had found finally a common ground.
Thanks
Tomas
????{.n?+???????+%?????????w??{.n?+????{??????????v?^?)????w*jg??????????j????G?????????j:+v???w?j?m????????w?????f???h?????????
Quoted 12 lines · James Bottomley
Quoted 10 lines · Tomas
Quoted 8 lines · Tomas
Quoted 3 lines
Why you need cover letter???What are u missing in the patch description
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
Quoted 7 lines
As long as the Maintainer is the gatekeeper, you're not going to get very far with this argument. ?The fact is that a lot of subsystems have varying rules; often undocumented, some of which are even in conflict, like alphabetic vs reverse christmas tree format for includes.
A cover letter is actually one of the more uniform rules. ?It's referred to in submitting patches, but not actually documented there.
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost. ?I've seen Andrew Morton cut and paste the cover letter in the first patch description of the patch set.
Mimi
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe
reviewerQuoted 18 lines · Mimi Zohar
Quoted 17 lines · James Bottomley
Quoted 10 lines · Tomas
Quoted 8 lines · Tomas
Quoted 3 lines
Why you need cover letter???What are u missing in the patch description
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
As long as the Maintainer is the gatekeeper, you're not going to get very far with this argument. ?The fact is that a lot of subsystems have varying rules; often undocumented, some of which are even in conflict, like alphabetic vs reverse christmas tree format for includes.
Quoted 7 lines
Quoted 2 lines
A cover letter is actually one of the more uniform rules. ?It's referred to in submitting patches, but not actually documented there.
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost. ?I've seen Andrew Morton cut and paste the cover letter in the first patch description of the patch set.
Andrew has a workflow unlike any other I've seen..
In my view the cover letter should explain why the maintainer should apply the series, and give any guidance to the review process.
Not duplicate information that belongs in the patch comments. It shouldn't explain how/why the patch(es) works, etc.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 22 lines · Jason Gunthorpe
Quoted 21 lines · Mimi Zohar
Quoted 19 lines · James Bottomley
Quoted 10 lines · Tomas
Quoted 8 lines · Tomas
Quoted 3 lines
Why you need cover letter???What are u missing in the patch description
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
As long as the Maintainer is the gatekeeper, you're not going to get very far with this argument. ?The fact is that a lot of subsystems have varying rules; often undocumented, some of which are even in conflict, like alphabetic vs reverse christmas tree format for includes.
A cover letter is actually one of the more uniform rules. ?It's referred to in submitting patches, but not actually documented there.
Quoted 6 lines
Quoted 4 lines
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost. ?I've seen Andrew Morton cut and paste the cover letter in the first patch description of the patch set.
Andrew has a workflow unlike any other I've seen..
Andrew is the only one that actually cut and pasted the cover letter in the first patch description, but I've heard this from others.
Quoted 5 lines
In my view the cover letter should explain why the maintainer should apply the series, and give any guidance to the review process.
Not duplicate information that belongs in the patch comments. It shouldn't explain how/why the patch(es) works, etc.
Patch descriptions should never explain how/why a particular patch works. ?If it is that difficult to understand, then something is wrong with the patch. ?The individual patch descriptions should provide the current status, the motivation for the change, and short summary of the change (eg. new features, configs, etc).
The cover letter is needed for (larger) patch sets in order to explain the overall motivation, instead of having to guess where the patch set is going. ?I wouldn't expect to see a cover letter for a single bug fix or two.
Mimi
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 48 lines · Jason Gunthorpe
Quoted 10 lines · Mimi Zohar
Quoted 9 lines · James Bottomley
Quoted 8 lines · Tomas
Quoted 7 lines
Quoted 7 lines · Tomas
Quoted 3 lines
Why you need cover letter?????What are u missing in the patch description
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
If you submit a *patch set* I *require* a cover letter, yes.
It's good but it is not must, you are inventing your own rules.
As long as the Maintainer is the gatekeeper, you're not going to get very far with this argument. ??The fact is that a lot of subsystems have varying rules; often undocumented, some of which are even in conflict, like alphabetic vs reverse christmas tree format for
includes.
Quoted 10 lines
Quoted 8 lines
Quoted 3 lines
A cover letter is actually one of the more uniform rules. ??It's referred to in submitting patches, but not actually documented there.
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost. ??I've seen Andrew Morton cut and paste the cover letter in the first patch description of the patch set.
Andrew has a workflow unlike any other I've seen..
Andrew is the only one that actually cut and pasted the cover letter in the first patch description, but I've heard this from others.
Quoted 5 lines
In my view the cover letter should explain why the maintainer should apply the series, and give any guidance to the review process.
Not duplicate information that belongs in the patch comments. It shouldn't explain how/why the patch(es) works, etc.
Patch descriptions should never explain how/why a particular patch works. ??If it is that difficult to understand, then something is wrong with the patch. ??The individual patch descriptions should provide the current status, the motivation for the change, and short summary of the change (eg. new features, configs, etc).
Quoted 5 lines
The cover letter is needed for (larger) patch sets in order to explain the overall motivation, instead of having to guess where the patch set is going. ??I wouldn't expect to see a cover letter for a single bug fix or two.
Mimi
I second that.
Tomas.
????{.n?+???????+%?????????w??{.n?+????{??????????v?^?)????w*jg??????????j????G?????????j:+v???w?j?m????????w?????f???h?????????
Quoted 2 lines · On Tue, 06 Mar 2018 13:36:36 -0500 Mimi Zohar <[email protected]> wrote:
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost.
If I get a patch series with a cover letter that should be preserved, I apply the series in a branch then do a no-ff merge; the cover letter can then go into the merge commit. There's no reason why cover letters need to be lost.
jon
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 11 lines
Quoted 2 lines · On Tue, 06 Mar 2018 13:36:36 -0500 Mimi Zohar <[email protected]> wrote:
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost.
If I get a patch series with a cover letter that should be preserved, I apply the series in a branch then do a no-ff merge; the cover letter can then go into the merge commit. There's no reason why cover letters need to be lost.
That's clever, but still it feels like a hack.
I've try to keep cover letters as an empty commits for that but it has to be always forced when rebasing. Not sure git has a real user friendly support for that.
Tomas
Quoted 10 lines · Jonathan Corbet
Quoted 2 lines · On Tue, 06 Mar 2018 13:36:36 -0500 Mimi Zohar <[email protected]> wrote:
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost.
If I get a patch series with a cover letter that should be preserved, I apply the series in a branch then do a no-ff merge; the cover letter can then go into the merge commit. There's no reason why cover letters need to be lost.
Thanks, Jon. That sounds like a really, good idea.
Some maintainers are saying to put the Changelog after the "---" so that it isn't included in the patch description.
One of the reasons for including the Changelog in the patch description, is to credit people with bug fixes, important rework of the patch, etc.
Do you have any thoughts on this?
Mimi
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · On Wed, 07 Mar 2018 11:35:03 -0500 Mimi Zohar <[email protected]> wrote:
Some maintainers are saying to put the Changelog after the "---" so that it isn't included in the patch description.
One of the reasons for including the Changelog in the patch description, is to credit people with bug fixes, important rework of the patch, etc.
Do you have any thoughts on this?
Not sure I have a strong opinion there. We do have various tags meant to ensure proper credit; I would lean toward using those when possible rather than including long change histories that, in the long term, don't help readers to understand why the patch was applied.
Thanks,
jon
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Mimi Zohar
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost. I've seen Andrew Morton cut and paste the cover letter in the first patch description of the patch set.
When I contribute code, the cover letter helps me to do the Right Thing.. Taking the time to write a proper cover letter helps to do a "mental exercise" that
1. The changes make sense in the first place.
2. Only the necessary is done, not more or less.
Even for a small patch set the time used to write the cover letter will pay off because it helps the maitainer to make a fair and educated decision.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Jonathan Corbet
Quoted 2 lines · On Tue, 06 Mar 2018 13:36:36 -0500 Mimi Zohar <[email protected]> wrote:
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost.
If I get a patch series with a cover letter that should be preserved, I apply the series in a branch then do a no-ff merge; the cover letter can then go into the merge commit. There's no reason why cover letters need to be lost.
That is an awesome idea. I'll start using this approach. Thank you.
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 12 lines · Mimi Zohar
Quoted 10 lines · Jonathan Corbet
Quoted 2 lines · On Tue, 06 Mar 2018 13:36:36 -0500 Mimi Zohar <[email protected]> wrote:
I've heard that some maintainers are moving away from cover letters, since they are not include in the git repo and are lost.
If I get a patch series with a cover letter that should be preserved, I apply the series in a branch then do a no-ff merge; the cover letter can then go into the merge commit. There's no reason why cover letters need to be lost.
Quoted 8 lines
Thanks, Jon. That sounds like a really, good idea.
Some maintainers are saying to put the Changelog after the "---" so that it isn't included in the patch description.
One of the reasons for including the Changelog in the patch description, is to credit people with bug fixes, important rework of the patch, etc.
This is a really good point. By adding the cover letter to the GIT history helps to better track people who to thank or blame :-)
/Jarkko
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html