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: <2b8335a7-4b9b-825-c1b8-84158aaf2c42@linux.intel.com>
Date:   Mon, 30 Oct 2023 11:24:30 +0200 (EET)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Mark Hasemeyer <markhas@...omium.org>,
        Shyam Sundar S K <Shyam-sundar.S-k@....com>
cc:     LKML <linux-kernel@...r.kernel.org>, stable@...r.kernel.org,
        Hans de Goede <hdegoede@...hat.com>,
        Mark Gross <markgross@...nel.org>,
        Sanket Goswami <Sanket.Goswami@....com>,
        platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH v1] platform/x86/amd/pmc: Get smu version before reading
 dram size

On Fri, 27 Oct 2023, Mark Hasemeyer wrote:

> Calls to amd_pmc_get_dram_size can fail because the function assumes smu

Always use () after function names, thank you.

> version information has already been read when it hasn't. The smu
> version is lazily read as opposed to being read at probe because it is
> slow and increases boot time.
> 
> Read the smu version information if it has not been read yet.
> 
> Link: https://lore.kernel.org/all/a3ee6577-d521-6d18-0a15-2f97d6f8ac3a@amd.com/
> Fixes: be8325fb3d8c ("platform/x86/amd: pmc: Get STB DRAM size from PMFW")
> Cc: stable@...r.kernel.org # 6.5.x
> 
> Signed-off-by: Mark Hasemeyer <markhas@...omium.org>
> ---
> 
>  drivers/platform/x86/amd/pmc/pmc.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
> index cd6ac04c1468..f668eddbc5d5 100644
> --- a/drivers/platform/x86/amd/pmc/pmc.c
> +++ b/drivers/platform/x86/amd/pmc/pmc.c
> @@ -970,6 +970,11 @@ static int amd_pmc_get_dram_size(struct amd_pmc_dev *dev)
>  
>  	switch (dev->cpu_id) {
>  	case AMD_CPU_ID_YC:
> +		if (!dev->major) {
> +			ret = amd_pmc_get_smu_version(dev);
> +			if (ret)
> +				goto err_dram_size;
> +		}
>  		if (!(dev->major > 90 || (dev->major == 90 && dev->minor > 39))) {
>  			ret = -EINVAL;
>  			goto err_dram_size;
> 

Hi,

Thank you for your patch. This has already come up but no acceptable patch 
has emerged since. Please see this thread for what needs to be done if you 
want to provide one (or maybe Shyam already has one which has just not 
been sent out yet):

https://lore.kernel.org/platform-driver-x86/3b224c62-a1d8-41bd-aced-5825f5f20e66@amd.com/

(Since this dram size is on an init path that always needs SMU version, 
the SMU version can just be called by the init unconditonally rather than 
adding more of this lazy initialization everywhere).


-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ