From: "Nikunj A. Dadhania" <nikunj@amd.com>
To: Tom Lendacky <thomas.lendacky@amd.com>, Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, bp@alien8.de, x86@kernel.org,
tglx@linutronix.de, mingo@redhat.com,
dave.hansen@linux.intel.com, aik@amd.com, dionnaglaze@google.com,
stable@vger.kernel.org
Subject: Re: [PATCH v2] x86/sev: Use TSC_FACTOR for Secure TSC frequency calculation
Date: Fri, 27 Jun 2025 09:14:33 +0530 [thread overview]
Message-ID: <482239bb-2b71-4175-ad33-772856eb8332@amd.com> (raw)
In-Reply-To: <069049ff-178a-6d94-d161-5a7b90b6245c@amd.com>
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@amd.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
prev parent reply other threads:[~2025-06-27 3:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-26 6:01 [PATCH v2] x86/sev: Use TSC_FACTOR for Secure TSC frequency calculation Nikunj A Dadhania
2025-06-26 8:26 ` Ingo Molnar
2025-06-26 10:01 ` Nikunj A. Dadhania
2025-06-26 13:41 ` Tom Lendacky
2025-06-27 3:44 ` Nikunj A. Dadhania [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=482239bb-2b71-4175-ad33-772856eb8332@amd.com \
--to=nikunj@amd.com \
--cc=aik@amd.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=dionnaglaze@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.