Skip to contentSkip to conversation

x86/sev: Fix __reserved field in sev_config

PATCH Applied Pavan Kumar Paluri 4 participants 6 messages Jul 29, 2024 – Jul 30, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/sev: Fix __reserved field in sev_config

sev_config currently has debug, ghcbs_initialized, and use_cas fields. However, __reserved count has not been updated. Fix this.

Fixes 34ff65901735 ("x86/sev: Use kernel provided SVSM Calling Areas")
---
 arch/x86/coco/sev/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/coco/sev/core.c +1 -1
index 082d61d85dfc..de1df0cb45da 100644
@@ -163,7 +163,7 @@ struct sev_config {
 	       */
 	      use_cas		: 1,
 
-	      __reserved	: 62;
+	      __reserved	: 61;
 };
 
 static struct sev_config sev_cfg __read_mostly;
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 5 lines · Pavan Kumar Paluri

sev_config currently has debug, ghcbs_initialized, and use_cas fields. However, __reserved count has not been updated. Fix this.

Fixes 34ff65901735 ("x86/sev: Use kernel provided SVSM Calling Areas")

stable because?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw

Hi Boris,

Quoted 9 lines · Borislav Petkov
Quoted 5 lines · Pavan Kumar Paluri

sev_config currently has debug, ghcbs_initialized, and use_cas fields. However, __reserved count has not been updated. Fix this.

Fixes 34ff65901735 ("x86/sev: Use kernel provided SVSM Calling Areas")

stable because?

Thanks for noticing this.

I shall remove Cc tag since:
1. The commit that introduced the bug is only part of 6.11-rc1. So there is no stable kernel fix needed here.
2. An incorrect __reserved field did not cause any hang/data corruption or a build-error.

I will re-spin a v2.

Thanks,
Pavan

Quoted 1 line
maintainer
#3 lore raw
Quoted 1 line · PavanKumar

I will re-spin a v2.

You don't have to - I'll fix it up.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#4 lore raw
In reply to Pavan Kumar Paluri
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     c14e4114582c20276467226387d5bae7310a849e
Gitweb:        https://git.kernel.org/tip/c14e4114582c20276467226387d5bae7310a849e
Author:        Pavan Kumar Paluri <[email protected]>
AuthorDate:    Mon, 29 Jul 2024 13:08:08 -05:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Tue, 30 Jul 2024 10:07:26 +02:00

x86/sev: Fix __reserved field in sev_config

sev_config currently has debug, ghcbs_initialized, and use_cas fields. However, __reserved count has not been updated. Fix this.

Fixes 34ff65901735 ("x86/sev: Use kernel provided SVSM Calling Areas")
---
 arch/x86/coco/sev/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/coco/sev/core.c +1 -1
index 082d61d..de1df0c 100644
@@ -163,7 +163,7 @@ struct sev_config {
 	       */
 	      use_cas		: 1,
 
-	      __reserved	: 62;
+	      __reserved	: 61;
 };
 
 static struct sev_config sev_cfg __read_mostly;
Reviewed-by on v1 1/1
#5 lore raw
In reply to Pavan Kumar Paluri
Quoted 6 lines · Pavan Kumar Paluri

sev_config currently has debug, ghcbs_initialized, and use_cas fields. However, __reserved count has not been updated. Fix this.

Fixes 34ff65901735 ("x86/sev: Use kernel provided SVSM Calling Areas")

You'd think the compiler would spit out some kind of warning when this happens, but I guess it just happily adds another u64 to the struct.

Thanks,
Tom

Quoted 17 lines
---
 arch/x86/coco/sev/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/coco/sev/core.c +1 -1
index 082d61d85dfc..de1df0cb45da 100644
@@ -163,7 +163,7 @@ struct sev_config {
 	       */
 	      use_cas		: 1,
 
-	      __reserved	: 62;
+	      __reserved	: 61;
 };
 
 static struct sev_config sev_cfg __read_mostly;