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: <20220208135009.7rfrau33kxivx5h3@amd.com>
Date:   Tue, 8 Feb 2022 07:50:09 -0600
From:   Michael Roth <michael.roth@....com>
To:     Borislav Petkov <bp@...en8.de>
CC:     Brijesh Singh <brijesh.singh@....com>, <x86@...nel.org>,
        <linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>,
        <linux-efi@...r.kernel.org>, <platform-driver-x86@...r.kernel.org>,
        <linux-coco@...ts.linux.dev>, <linux-mm@...ck.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Joerg Roedel <jroedel@...e.de>,
        Tom Lendacky <thomas.lendacky@....com>,
        "H. Peter Anvin" <hpa@...or.com>, Ard Biesheuvel <ardb@...nel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>,
        "Vitaly Kuznetsov" <vkuznets@...hat.com>,
        Jim Mattson <jmattson@...gle.com>,
        "Andy Lutomirski" <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Sergio Lopez <slp@...hat.com>, Peter Gonda <pgonda@...gle.com>,
        "Peter Zijlstra" <peterz@...radead.org>,
        Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
        David Rientjes <rientjes@...gle.com>,
        Dov Murik <dovmurik@...ux.ibm.com>,
        Tobin Feldman-Fitzthum <tobin@....com>,
        Vlastimil Babka <vbabka@...e.cz>,
        "Kirill A . Shutemov" <kirill@...temov.name>,
        Andi Kleen <ak@...ux.intel.com>,
        "Dr . David Alan Gilbert" <dgilbert@...hat.com>,
        <brijesh.ksingh@...il.com>, <tony.luck@...el.com>,
        <marcorr@...gle.com>, <sathyanarayanan.kuppuswamy@...ux.intel.com>
Subject: Re: [PATCH v9 33/43] x86/compressed: Add SEV-SNP feature
 detection/setup

On Sun, Feb 06, 2022 at 05:41:26PM +0100, Borislav Petkov wrote:
> On Fri, Jan 28, 2022 at 11:17:54AM -0600, Brijesh Singh wrote:
> > +static struct cc_setup_data *get_cc_setup_data(struct boot_params *bp)
> > +{
> > +	struct setup_data *hdr = (struct setup_data *)bp->hdr.setup_data;
> > +
> > +	while (hdr) {
> > +		if (hdr->type == SETUP_CC_BLOB)
> > +			return (struct cc_setup_data *)hdr;
> > +		hdr = (struct setup_data *)hdr->next;
> > +	}
> > +
> > +	return NULL;
> > +}
> 
> Merge that function into its only caller.
> 
> ...
> 
> > +static struct cc_blob_sev_info *snp_find_cc_blob(struct boot_params *bp)
> 
> static function, no need for the "snp_" prefix. Please audit all your
> patches for that and remove that prefix from all static functions.
> 

I'm a little unsure how to handle some of these others cases:

We have this which is defined in sev-shared.c and used "externally"
by kernel/sev.c or boot/compressed/sev.c:

  snp_setup_cpuid_table()

I'm assuming that would be considered 'non-static' since it would need
to be exported if sev-shared.c was compiled separately instead of
directly #include'd.

And then there's also these which are static helpers that are only used
within sev-shared.c:

  snp_cpuid_info_get_ptr()
  snp_cpuid_calc_xsave_size()
  snp_cpuid_get_validated_func()
  snp_cpuid_check_range()
  snp_cpuid_hv()
  snp_cpuid_postprocess()
  snp_cpuid()

but in those cases it seems useful to keep them grouped under the
snp_cpuid_* prefix since they become ambiguous otherwise, and
just using cpuid_* as a prefix (or suffix/etc) makes it unclear
that they are only used for SNP and not for general CPUID handling.
Should we leave those as-is?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ