Messages in this thread | | | Date | Mon, 6 Feb 2023 21:11:11 +0100 | From | Borislav Petkov <> | Subject | Re: [RFC PATCH V3 10/16] x86/hyperv: Add smp support for sev-snp guest |
| |
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.
Thx.
-- Regards/Gruss, Boris.
https://people.kernel.org/tglx/notes-about-netiquette
| |