Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Brijesh Singh
On 10/23/2017 09:10 AM, Borislav Petkov wrote: On Mon, Oct 23, 2017 at 08:32:57AM -0500, Brijesh Singh wrote: If both the command fails then we return status from the last command. IIRC, in my previous patches I was returning status from sev_do_cmd() instead of sev_platform_shutdown() but

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Brijesh Singh
On 10/23/2017 09:10 AM, Borislav Petkov wrote: On Mon, Oct 23, 2017 at 08:32:57AM -0500, Brijesh Singh wrote: If both the command fails then we return status from the last command. IIRC, in my previous patches I was returning status from sev_do_cmd() instead of sev_platform_shutdown() but

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Borislav Petkov
On Mon, Oct 23, 2017 at 08:32:57AM -0500, Brijesh Singh wrote: > If both the command fails then we return status from the last command. > IIRC, in my previous patches I was returning status from sev_do_cmd() > instead of sev_platform_shutdown() but based on our previous > communication I thought

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Borislav Petkov
On Mon, Oct 23, 2017 at 08:32:57AM -0500, Brijesh Singh wrote: > If both the command fails then we return status from the last command. > IIRC, in my previous patches I was returning status from sev_do_cmd() > instead of sev_platform_shutdown() but based on our previous > communication I thought

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Brijesh Singh
On 10/23/17 7:32 AM, Borislav Petkov wrote: > On Mon, Oct 23, 2017 at 07:15:30AM -0500, Brijesh Singh wrote: >> I am not sure if I am able to understand your feedback. The >> sev_platform_shutdown() is called unconditionally. > How's that: > > If sev_do_cmd() fails and

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Brijesh Singh
On 10/23/17 7:32 AM, Borislav Petkov wrote: > On Mon, Oct 23, 2017 at 07:15:30AM -0500, Brijesh Singh wrote: >> I am not sure if I am able to understand your feedback. The >> sev_platform_shutdown() is called unconditionally. > How's that: > > If sev_do_cmd() fails and

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Borislav Petkov
On Mon, Oct 23, 2017 at 07:15:30AM -0500, Brijesh Singh wrote: > I am not sure if I am able to understand your feedback. The > sev_platform_shutdown() is called unconditionally. How's that: If sev_do_cmd() fails and sev_do_cmd(SEV_CMD_SHUTDOWN, ...) in sev_platform_shutdown() fails, then the

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Borislav Petkov
On Mon, Oct 23, 2017 at 07:15:30AM -0500, Brijesh Singh wrote: > I am not sure if I am able to understand your feedback. The > sev_platform_shutdown() is called unconditionally. How's that: If sev_do_cmd() fails and sev_do_cmd(SEV_CMD_SHUTDOWN, ...) in sev_platform_shutdown() fails, then the

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Brijesh Singh
On 10/23/17 4:32 AM, Borislav Petkov wrote: ... >> +static int sev_ioctl_do_pek_pdh_gen(int cmd, struct sev_issue_cmd *argp) >> +{ >> +int ret, err; >> + >> +ret = sev_platform_init(NULL, >error); >> +if (ret) >> +return ret; >> + >> +ret = sev_do_cmd(cmd, 0, >error);

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Brijesh Singh
On 10/23/17 4:32 AM, Borislav Petkov wrote: ... >> +static int sev_ioctl_do_pek_pdh_gen(int cmd, struct sev_issue_cmd *argp) >> +{ >> +int ret, err; >> + >> +ret = sev_platform_init(NULL, >error); >> +if (ret) >> +return ret; >> + >> +ret = sev_do_cmd(cmd, 0, >error);

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Borislav Petkov
On Thu, Oct 19, 2017 at 09:33:51PM -0500, Brijesh Singh wrote: > The SEV_PEK_GEN command is used to generate a new Platform Endorsement > Key (PEK). The command is defined in SEV spec section 5.6. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Borislav

Re: [Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-23 Thread Borislav Petkov
On Thu, Oct 19, 2017 at 09:33:51PM -0500, Brijesh Singh wrote: > The SEV_PEK_GEN command is used to generate a new Platform Endorsement > Key (PEK). The command is defined in SEV spec section 5.6. > > Cc: Paolo Bonzini > Cc: "Radim Krčmář" > Cc: Borislav Petkov > Cc: Herbert Xu > Cc: Gary

[Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-19 Thread Brijesh Singh
The SEV_PEK_GEN command is used to generate a new Platform Endorsement Key (PEK). The command is defined in SEV spec section 5.6. Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc:

[Part2 PATCH v6 16/38] crypto: ccp: Implement SEV_PEK_GEN ioctl command

2017-10-19 Thread Brijesh Singh
The SEV_PEK_GEN command is used to generate a new Platform Endorsement Key (PEK). The command is defined in SEV spec section 5.6. Cc: Paolo Bonzini Cc: "Radim Krčmář" Cc: Borislav Petkov Cc: Herbert Xu Cc: Gary Hook Cc: Tom Lendacky Cc: linux-cry...@vger.kernel.org Cc: k...@vger.kernel.org