* [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init()
@ 2026-07-07 7:34 Thorsten Blum
2026-07-07 7:34 ` [PATCH 2/2] x86/sev: Fix CONFIG_SYSFS endif comment style Thorsten Blum
2026-07-07 16:16 ` [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init() Tom Lendacky
0 siblings, 2 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-07-07 7:34 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Tom Lendacky, Neeraj Upadhyay, Tianyu Lan,
Kishon Vijay Abraham I, Ard Biesheuvel
Cc: Thorsten Blum, linux-kernel
Replace the hard-coded conversion factor with KHZ_PER_MHZ to convert
tsc_freq_mhz from MHz to kHz.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/x86/coco/sev/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index ecd77d3217f3..b7be9a8ab484 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -15,6 +15,7 @@
#include <linux/printk.h>
#include <linux/mm_types.h>
#include <linux/set_memory.h>
+#include <linux/units.h>
#include <linux/memblock.h>
#include <linux/kernel.h>
#include <linux/mm.h>
@@ -2042,7 +2043,8 @@ void __init snp_secure_tsc_init(void)
/* Extract the GUEST TSC MHZ from BIT[17:0], rest is reserved space */
tsc_freq_mhz &= GENMASK_ULL(17, 0);
- snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * 1000, secrets->tsc_factor);
+ snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * KHZ_PER_MHZ,
+ secrets->tsc_factor);
x86_platform.calibrate_cpu = securetsc_get_tsc_khz;
x86_platform.calibrate_tsc = securetsc_get_tsc_khz;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] x86/sev: Fix CONFIG_SYSFS endif comment style
2026-07-07 7:34 [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init() Thorsten Blum
@ 2026-07-07 7:34 ` Thorsten Blum
2026-07-07 16:16 ` [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init() Tom Lendacky
1 sibling, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-07-07 7:34 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86,
H. Peter Anvin, Tom Lendacky, Neeraj Upadhyay, Tianyu Lan,
Ard Biesheuvel, Kishon Vijay Abraham I
Cc: Thorsten Blum, linux-kernel
Fix the CONFIG_SYSFS endif comment style.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/x86/coco/sev/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index b7be9a8ab484..32c005315db3 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -1469,7 +1469,7 @@ static int __init sev_sysfs_init(void)
return ret;
}
arch_initcall(sev_sysfs_init);
-#endif // CONFIG_SYSFS
+#endif /* CONFIG_SYSFS */
static void free_shared_pages(void *buf, size_t sz)
{
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init()
2026-07-07 7:34 [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init() Thorsten Blum
2026-07-07 7:34 ` [PATCH 2/2] x86/sev: Fix CONFIG_SYSFS endif comment style Thorsten Blum
@ 2026-07-07 16:16 ` Tom Lendacky
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lendacky @ 2026-07-07 16:16 UTC (permalink / raw)
To: Thorsten Blum, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, Neeraj Upadhyay, Tianyu Lan,
Kishon Vijay Abraham I, Ard Biesheuvel
Cc: linux-kernel
On 7/7/26 02:34, Thorsten Blum wrote:
> Replace the hard-coded conversion factor with KHZ_PER_MHZ to convert
> tsc_freq_mhz from MHz to kHz.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Could/should keep it as a single line, but otherwise:
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> arch/x86/coco/sev/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index ecd77d3217f3..b7be9a8ab484 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -15,6 +15,7 @@
> #include <linux/printk.h>
> #include <linux/mm_types.h>
> #include <linux/set_memory.h>
> +#include <linux/units.h>
> #include <linux/memblock.h>
> #include <linux/kernel.h>
> #include <linux/mm.h>
> @@ -2042,7 +2043,8 @@ void __init snp_secure_tsc_init(void)
> /* Extract the GUEST TSC MHZ from BIT[17:0], rest is reserved space */
> tsc_freq_mhz &= GENMASK_ULL(17, 0);
>
> - snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * 1000, secrets->tsc_factor);
> + snp_tsc_freq_khz = SNP_SCALE_TSC_FREQ(tsc_freq_mhz * KHZ_PER_MHZ,
> + secrets->tsc_factor);
>
> x86_platform.calibrate_cpu = securetsc_get_tsc_khz;
> x86_platform.calibrate_tsc = securetsc_get_tsc_khz;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-07 16:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 7:34 [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init() Thorsten Blum
2026-07-07 7:34 ` [PATCH 2/2] x86/sev: Fix CONFIG_SYSFS endif comment style Thorsten Blum
2026-07-07 16:16 ` [PATCH 1/2] x86/sev: Use KHZ_PER_MHZ in snp_secure_tsc_init() Tom Lendacky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox