[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: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline |
Date: |
Mon, 21 Jun 2021 11:15:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 6/21/21 10:44 AM, Thomas Huth wrote:
> 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.
Hmm it could be clearer to rearrange the target-specific sysemu/
headers. For this example, eventually sysemu/i386/sev.h?
Phil.
Re: [PATCH] x86: add SEV hashing to fw_cfg for kernel/initrd/cmdline, Dov Murik, 2021/06/16