mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Pratik R. Sampat" <prsampat@amd.com>
To: Shantanu Sinha <shansinha@google.com>
Cc: Tycho Andersen <tycho@kernel.org>,
	mcgrof@kernel.org, russ.weight@linux.dev, dakr@kernel.org,
	ashish.kalra@amd.com, thomas.lendacky@amd.com,
	herbert@gondor.apana.org.au, davem@davemloft.net,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, rafael@kernel.org,
	chao.gao@intel.com, aik@amd.com, nikunj@amd.com,
	michael.roth@amd.com
Subject: Re: [Patch v4 7/7] crypto/ccp: Implement SNP Download Firmware EX
Date: Fri, 16 Oct 2026 11:39:24 -0400	[thread overview]
Message-ID: <0ca5a165-0b32-4ffe-bf9b-e3ef8e9627ca@amd.com> (raw)
In-Reply-To: <20261016012208.3220126-1-shansinha@google.com>



On 10/15/26 9:22 PM, Shantanu Sinha wrote:
> On Thu, Oct 15, 2026 at 05:09:38PM -0400, Pratik R. Sampat wrote:
>> On 10/15/26 3:38 PM, Tycho Andersen wrote:
>>>> +	/*
>>>> +	 * Firmware either just requested a rollback or a rollback attempt
>>>> +	 * failed. Keep the PSP dead for all other commands, only another
>>>> +	 * DLFW_EX attempt is allowed through.
>>>> +	 */
>>>> +	if (sev->fwl_rollback_required) {
>>>> +		psp_dead = true;
>>>> +		if (fwl_ret != FW_UPLOAD_ERR_HW_ERROR)
>>>> +			fwl_ret = FW_UPLOAD_ERR_RW_ERROR;
>>>
>>> I think this error switcharoo could use a comment (or maybe just be
>>> dropped?). e.g. if the user does something to set
>>> ->fwl_rollback_required and then tries another firmware upload that is
>>> the wrong size, ERR_INVALID_SIZE -> ERR_RW_ERROR, which seems
>>> misleading to me.
>>>
>>> I saw some discussion about all this:
>>> https://lore.kernel.org/lkml/20260924213737.3833625-1-shansinha@google.com/
>>> but it's not clear to me why you need to reset the error code here.
>>>
>>
>> My understanding from that discussion was that userspace errors should
>> fall into clean buckets. read-write-error would mean "roll back",
>> whether it came from the first failure or a later rollback attempt,
>> since a failed rollback still leaves the PSP dead and needing a
>> rollback. dmesg would still log the exact reason for the failure.
>>
>> That said, I see how it can be misleading, and I'm fine with dropping
>> the override or putting a comment and re-spinning this.
> 
> I do see how it can be misleading.
> 
> I think dropping it makes sense. When I suggested the changes for v2,
> psp_ret was only logged via dev_dbg(), so the sysfs error was the only
> clean signal userspace had. Since the error code is reported in dmesg
> now, I think it's fine to keep the original error and have the sysfs
> error reflect what happened on the upload rather than the action
> tooling should take.
> 

Sounds good to me. I'll drop it in the next spin.

Thanks!
--Pratik

      reply	other threads:[~2026-10-16 15:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  2:14 [Patch v4 0/7] Implement SNP live firmware update support Pratik R. Sampat
2026-10-15  2:14 ` [Patch v4 1/7] firmware_loader: Stop pinning modules on registration Pratik R. Sampat
2026-10-15  2:14 ` [Patch v4 2/7] firmware_loader: Stop pinning parent device per workqueue invocation Pratik R. Sampat
2026-10-15  2:14 ` [Patch v4 3/7] treewide: firmware_loader: Drop the unused @module argument Pratik R. Sampat
2026-10-15  2:14 ` [Patch v4 4/7] crypto: ccp - Factor out the release of the SEV firmware buffers Pratik R. Sampat
2026-10-15 17:53   ` Tom Lendacky
2026-10-15  2:14 ` [Patch v4 5/7] crypto: ccp - Allow SNP platform data to be queried after SNP INIT Pratik R. Sampat
2026-10-15 18:02   ` Tom Lendacky
2026-10-15  2:14 ` [Patch v4 6/7] crypto/ccp: Register with fw_uploader and always fail Pratik R. Sampat
2026-10-15  2:14 ` [Patch v4 7/7] crypto/ccp: Implement SNP Download Firmware EX Pratik R. Sampat
2026-10-15 19:38   ` Tycho Andersen
2026-10-15 21:09     ` Pratik R. Sampat
2026-10-16  1:22       ` Shantanu Sinha
2026-10-16 15:39         ` Pratik R. Sampat [this message]

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=0ca5a165-0b32-4ffe-bf9b-e3ef8e9627ca@amd.com \
    --to=prsampat@amd.com \
    --cc=aik@amd.com \
    --cc=ashish.kalra@amd.com \
    --cc=chao.gao@intel.com \
    --cc=dakr@kernel.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=nikunj@amd.com \
    --cc=rafael@kernel.org \
    --cc=russ.weight@linux.dev \
    --cc=shansinha@google.com \
    --cc=thomas.lendacky@amd.com \
    --cc=tycho@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®