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] [day] [month] [year] [list]
Message-ID: <482239bb-2b71-4175-ad33-772856eb8332@amd.com>
Date: Fri, 27 Jun 2025 09:14:33 +0530
From: "Nikunj A. Dadhania" <nikunj@....com>
To: Tom Lendacky <thomas.lendacky@....com>, Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, bp@...en8.de, x86@...nel.org,
 tglx@...utronix.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
 aik@....com, dionnaglaze@...gle.com, stable@...r.kernel.org
Subject: Re: [PATCH v2] x86/sev: Use TSC_FACTOR for Secure TSC frequency
 calculation



On 6/26/2025 7:11 PM, Tom Lendacky wrote:
> On 6/26/25 05:01, Nikunj A. Dadhania wrote:
>> On 6/26/2025 1:56 PM, Ingo Molnar wrote:
>>> * Nikunj A Dadhania <nikunj@....com> wrote:

>>>> +#define SNP_SCALE_TSC_FREQ(freq, factor) ((freq) - ((freq) * (factor)) / 100000)
>>>
>>> Nit: there's really no need to use parentheses in this expression,
>>> 'x * y / z' is equivalent and fine.
>>
>> It will give wrong scale if I call with freq as "tsc + 1000000" 
>> without the parentheses?
> 
> I think Ingo is saying this can be ((freq) - (freq) * (factor) / 100000)
> 
> in other words, getting rid of the parentheses around the multiplication.

Ak ok, that should be fine.

Regards
Nikunj

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ