lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+Fe390kWFnAh6gC@zn.tnic>
Date:   Mon, 6 Feb 2023 21:11:11 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Tianyu Lan <ltykernel@...il.com>
Cc:     Tom Lendacky <thomas.lendacky@....com>, luto@...nel.org,
        tglx@...utronix.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
        x86@...nel.org, hpa@...or.com, seanjc@...gle.com,
        pbonzini@...hat.com, jgross@...e.com, tiala@...rosoft.com,
        kirill@...temov.name, jiangshan.ljs@...group.com,
        peterz@...radead.org, ashish.kalra@....com, srutherford@...gle.com,
        akpm@...ux-foundation.org, anshuman.khandual@....com,
        pawan.kumar.gupta@...ux.intel.com, adrian.hunter@...el.com,
        daniel.sneddon@...ux.intel.com, alexander.shishkin@...ux.intel.com,
        sandipan.das@....com, ray.huang@....com, brijesh.singh@....com,
        michael.roth@....com, venu.busireddy@...cle.com,
        sterritt@...gle.com, tony.luck@...el.com, samitolvanen@...gle.com,
        fenghua.yu@...el.com, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, linux-hyperv@...r.kernel.org,
        linux-arch@...r.kernel.org
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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ