The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Dionna Amalie Glaze <dionnaglaze@google.com>
Cc: Peter Gonda <pgonda@google.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Tom Lendacky <Thomas.Lendacky@amd.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Joerg Roedel <jroedel@suse.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH] virt/coco/sev-guest: Initialize err in handle_guest_request
Date: Thu, 27 Oct 2022 11:45:31 +0200	[thread overview]
Message-ID: <Y1pTO+T67EBdlQd9@zn.tnic> (raw)
In-Reply-To: <CAAH4kHbf6HO05bSwcSsqXTYKTn6wz44mivNY6ZpNrCVzgO3jRg@mail.gmail.com>

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, 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. :-)

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  reply	other threads:[~2022-10-27  9:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12  0:23 [PATCH] virt/coco/sev-guest: Initialize err in handle_guest_request Dionna Glaze
2022-10-12 23:31 ` Peter Gonda
2022-10-19 19:58   ` Dionna Amalie Glaze
2022-10-27  9:45     ` Borislav Petkov [this message]
2022-10-27 14:16       ` 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=Y1pTO+T67EBdlQd9@zn.tnic \
    --to=bp@alien8.de \
    --cc=Thomas.Lendacky@amd.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dionnaglaze@google.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pgonda@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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