lkml.org 
[lkml]   [2023]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH V3 10/16] x86/hyperv: Add smp support for sev-snp guest
From
On 2/7/2023 4:11 AM, Borislav Petkov wrote:
> On Fri, Feb 03, 2023 at 03:00:44PM +0800, Tianyu Lan wrote:
>>> For the bits definition, use:
>>>
>>>             u64 sev_feature_snp            : 1,
>>>                 sev_feature_vtom            : 1,
>>>                 sev_feature_reflectvc        : 1,
>>>                 ...
>>>
>>
>> Good suggestion. Thanks.
>
> Actually, I'd prefer if you used a named union and drop all this
> "sev_feature_" prefixes everywhere:
>
> union {
> struct {
> u64 snp : 1;
> u64 vtom : 1;
> u64 reflectvc : 1;
> u64 restrict_injection : 1;
> u64 alternate_injection : 1;
> u64 full_debug : 1;
> u64 reserved1 : 1;
> u64 snpbtb_isolation : 1;
> u64 resrved2 : 56;
> };
> u64 val;
> } sev_features;
>
>
>
> so that you can do in code:
>
> struct sev_es_save_area *sev;
>
> ...
>
> sev->sev_features.snp = ...
>
> and so on.

Hi Boris:
Thanks a lot for your suggestion. Will update.

\
 
 \ /
  Last update: 2023-03-27 00:12    [W:0.134 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site