qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Dov Murik" <dovmurik@linux.ibm.com>,
	"James Bottomley" <jejb@linux.ibm.com>,
	"Connor Kuehl" <ckuehl@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
	Ashish Kalra <ashish.kalra@amd.com>,
	Brijesh Singh <brijesh.singh@amd.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Tobin Feldman-Fitzthum <tobin@ibm.com>,
	qemu-devel@nongnu.org, Hubertus Franke <frankeh@us.ibm.com>,
	Jim Cadden <jcadden@ibm.com>,
	Tobin Feldman-Fitzthum <tobin@linux.ibm.com>,
	Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline
Date: Mon, 21 Jun 2021 10:44:57 +0200	[thread overview]
Message-ID: <29a0541d-64f2-1c55-ccf2-776d41f09c95@redhat.com> (raw)
In-Reply-To: <649abfe3-e799-3535-c56a-ad55ca5df947@redhat.com>

On 17/06/2021 17.48, Philippe Mathieu-Daudé wrote:
[...]
> This works, but I'd rather use:
> 
>    if (sev_enabled()) {
>        sev_kernel_loader_calc_cmdline_hash(&sev_loader_context,
>                                            kernel_cmdline);
>    }
> 
> And have sev_enabled() defined as:
> 
> #ifdef CONFIG_SEV
> bool sev_enabled(void);
> #else
> #define sev_enabled() false
> #endif
> 
> So the compiler could elide the statement if SEV is disabled,
> and stub is not necessary.
> 
> But that means we'd need to add "#include CONFIG_DEVICES" in
> a sysemu/ header, which looks like an anti-pattern.
> 
> Thomas / Paolo, what do you think?

I'd only do that if you are very, very sure that the header file is  only 
included from target-specific files. Otherwise this will of course cause 
more trouble than benefit.

  Thomas



  reply	other threads:[~2021-06-21  8:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  6:59 [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline Dov Murik
2021-05-25 13:10 ` Dov Murik
2021-06-14  7:08 ` Dov Murik
2021-06-15 15:20 ` Eduardo Habkost
2021-06-15 19:53   ` Philippe Mathieu-Daudé
2021-06-17 12:48     ` Dov Murik
2021-06-17 15:48       ` Philippe Mathieu-Daudé
2021-06-21  8:44         ` Thomas Huth [this message]
2021-06-21  9:15           ` Philippe Mathieu-Daudé
2021-06-21  9:42             ` Philippe Mathieu-Daudé
2021-06-17 17:22       ` Eduardo Habkost
2021-06-17 19:16         ` Dov Murik
2021-06-17 20:35           ` Eduardo Habkost
2021-06-16 12:04   ` Dov Murik
2021-07-03 16:42 ` Michael S. Tsirkin
2021-07-04  6:16   ` Dov Murik
2021-07-04  6:29     ` Michael S. Tsirkin

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=29a0541d-64f2-1c55-ccf2-776d41f09c95@redhat.com \
    --to=thuth@redhat.com \
    --cc=ashish.kalra@amd.com \
    --cc=brijesh.singh@amd.com \
    --cc=ckuehl@redhat.com \
    --cc=dovmurik@linux.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=frankeh@us.ibm.com \
    --cc=jcadden@ibm.com \
    --cc=jejb@linux.ibm.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thomas.lendacky@amd.com \
    --cc=tobin@ibm.com \
    --cc=tobin@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).