All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Peter Gonda <pgonda@google.com>
Cc: Sean Christopherson <seanjc@google.com>,
	Marc Orr <marcorr@google.com>,
	David Rientjes <rientjes@google.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Joerg Roedel <jroedel@suse.de>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	John Allen <john.allen@amd.com>,
	"David S. Miller" <davem@davemloft.net>,
	Paolo Bonzini <pbonzini@redhat.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH V3 1/4] crypto: ccp - Fix SEV_INIT error logging on init
Date: Thu, 11 Nov 2021 08:10:36 -0600	[thread overview]
Message-ID: <a6823579-c4af-6506-ba13-d6391b42d4ec@amd.com> (raw)
In-Reply-To: <CAMkAt6pivYG=nV_EhP9Uj2gB8kBQB4dAnTcSeGd9249KuWzsyg@mail.gmail.com>

On 11/10/21 11:29 AM, Peter Gonda wrote:
> On Tue, Nov 9, 2021 at 12:25 PM Tom Lendacky <thomas.lendacky@amd.com> wrote:
>> On 11/9/21 10:46 AM, Peter Gonda wrote:
>>> On Tue, Nov 9, 2021 at 9:27 AM Sean Christopherson <seanjc@google.com> wrote:
>>>> On Tue, Nov 02, 2021, Peter Gonda wrote:
>>

...

>>
>> That's one of those things we've wanted to get around to improving but
>> just haven't had the time. So, yes, if you wish to refactor the 'error'
>> related area, that would be great.
> 
> OK so when I actually sat down to work on this. I realized this is
> bigger than I thought. If we want to have error == -1 for all return
> from psp-sev.h functions where the PSP isn't called yet there are a
> lot of changes. For example if CONFIG_CRYPTO_DEV_SP_PSP is not defined
> all these stubs need to be to set `*errror == -`, basically all these
> functions need to be updated.
> 
> So to keep this series more targeted. I think I'll drop the error
> here. And just have this patch print the rc value. If what I said

In that case, I think you should keep the error value and initialize it to 
0. That is consistent with the other paths. Then, if you take on the 
fixups, it can be changed then.

> above seems reasonable I'll do those error refactors. Are people
> envisioning something else for the error fixups?

The main refactoring I wanted was to make sure the caller didn't have to 
initialize the error variable. Whether to initialize it to 0 or -1 wasn't 
part of my original thoughts. But I do like the -1 value because, 
theoretically, we shouldn't get such a value back from the PSP. So if the 
value printed is not -1, that is an indication that the PSP API was called 
no matter the value of rc.

Thanks,
Tom

> 
>>
>> Thanks,
>> Tom
>>
>>>

  reply	other threads:[~2021-11-11 14:10 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 14:23 [PATCH V3 0/4] Add SEV_INIT_EX support Peter Gonda
2021-11-02 14:23 ` [PATCH V3 1/4] crypto: ccp - Fix SEV_INIT error logging on init Peter Gonda
2021-11-09 16:26   ` Sean Christopherson
2021-11-09 16:46     ` Peter Gonda
2021-11-09 19:25       ` Tom Lendacky
2021-11-10 17:29         ` Peter Gonda
2021-11-11 14:10           ` Tom Lendacky [this message]
2021-11-02 14:23 ` [PATCH V3 2/4] crypto: ccp - Move SEV_INIT retry for corrupted data Peter Gonda
2021-11-09 16:31   ` Sean Christopherson
2021-11-09 16:56     ` Peter Gonda
2021-11-09 17:30       ` Sean Christopherson
2021-11-09 18:42         ` Peter Gonda
2021-11-02 14:23 ` [PATCH V3 3/4] crypto: ccp - Refactor out sev_fw_alloc() Peter Gonda
2021-11-02 14:23 ` [PATCH V3 4/4] crypto: ccp - Add SEV_INIT_EX support Peter Gonda
2021-11-02 15:38   ` Tom Lendacky
2021-11-02 16:28     ` Peter Gonda
2021-11-09 17:21   ` Sean Christopherson
2021-11-09 20:09     ` Peter Gonda
2021-11-09 20:26       ` Sean Christopherson
2021-11-09 20:46         ` Peter Gonda
2021-11-09 22:19           ` Brijesh Singh
2021-11-10 15:32             ` Peter Gonda
2021-11-12 16:55               ` Peter Gonda
2021-11-12 17:46                 ` Marc Orr
2021-11-12 17:49                   ` Peter Gonda
2021-11-12 18:28                     ` Marc Orr
2021-11-12 23:39                 ` Brijesh Singh
2021-11-12 23:44                   ` Peter Gonda
2021-11-12 23:50                     ` Brijesh Singh
2021-11-15 17:42                       ` Peter Gonda
2021-11-02 16:05 ` [PATCH V3 0/4] " Sean Christopherson
2021-11-02 16:25   ` Peter Gonda

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=a6823579-c4af-6506-ba13-d6391b42d4ec@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=brijesh.singh@amd.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=john.allen@amd.com \
    --cc=jroedel@suse.de \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcorr@google.com \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.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.