qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline


From: Thomas Huth
Subject: Re: [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline
Date: Mon, 21 Jun 2021 10:44:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

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 via email to

[Prev in Thread] Current Thread [Next in Thread]