Re: [PATCH v2] x86/sev: Use TSC_FACTOR for Secure TSC frequency calculation
From: Nikunj A. Dadhania
Date: Thu Jun 26 2025 - 23:45:03 EST
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@xxxxxxx> 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