[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMkAt6rKAMscBPVegLhBvZ2K+jCP-bOx5z4Wv23X54MTMDzamA@mail.gmail.com>
Date: Thu, 27 Oct 2022 08:16:13 -0600
From: Peter Gonda <pgonda@...gle.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Dionna Amalie Glaze <dionnaglaze@...gle.com>, x86@...nel.org,
linux-kernel@...r.kernel.org,
Tom Lendacky <Thomas.Lendacky@....com>,
Paolo Bonzini <pbonzini@...hat.com>,
Joerg Roedel <jroedel@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Dave Hansen <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH] virt/coco/sev-guest: Initialize err in handle_guest_request
On Thu, Oct 27, 2022 at 3:45 AM Borislav Petkov <bp@...en8.de> wrote:
>
> On Wed, Oct 19, 2022 at 12:58:12PM -0700, Dionna Amalie Glaze wrote:
> > fw_err = 0xff doesn't make sense to me actually. It's not a documented
> > code that the firmware was never called.
> > Still, we can simply pass fw_err to snp_issue_guest_request rather
> > than an unsigned long err, since a null pointer results in an -EINVAL.
Yes this was not what my comments on the patch series intended.
On the host side we have `psp_ret = -1` inside of
__sev_platform_init_locked(). I think defining SEV_RET_NO_FW_CALL as
UINT32_MAX and moving to make all values of psp_ret where the psp is
not yet called would help callers understand errors more clearly.
>
> Yes, pls do that. Such I/O function args are always a PITA anyway.
>
> In retrospect, that handle_guest_request() with gazillion args should
> have been made to take a struct as a single argument and populate it as
> it operates.
>
> The callers then would look at it and decide what to do.
>
> Looking at the callers, they all take members of struct
> snp_guest_request_ioctl and pass them in. A first step in cleaning that
> up could be to simply pass that struct snp_guest_request_ioctl pointer
> instead...
>
> Oh well, in case folks feel bored. :-)
Ah, good idea. If I have some spare cycles.
>
> Thx.
>
> --
> Regards/Gruss,
> Boris.
>
> https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists