Skip to contentSkip to conversation

i386/cpu: Fix unexpected initializer override in CPU model definition for Diamond Rapids

PATCH In review Aidan Khoury 2 participants 2 messages Jan 13 – Jan 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386/cpu: Fix unexpected initializer override in CPU model definition for Diamond Rapids

The new Diamond Rapids x86 cpu model definition that was added in 7a6dd8bde159 has an unexpected comma in the .features[FEAT_VMX_EXIT_CTLS] subobject initializer causing the prior initialization to be overridden, meaning that VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_SIZE is not included.

Fix this by replacing the comma with the missing bitwise OR to properly combine all the flags into a single bitmask value.

Fixes 7a6dd8bde159 ("i386/cpu: Add CPU model for Diamond Rapids")
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/cpu.c +1 -1
index 37803cd724..917b37d128 100644
@@ -5589,7 +5589,7 @@ static const X86CPUDefinition builtin_x86_defs[] = {
             MSR_VMX_EPT_INVVPID_ALL_CONTEXT |
             MSR_VMX_EPT_INVVPID_SINGLE_CONTEXT_NOGLOBALS,
         .features[FEAT_VMX_EXIT_CTLS] =
-            VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_SIZE,
+            VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_SIZE |
             VMX_VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL |
             VMX_VM_EXIT_ACK_INTR_ON_EXIT | VMX_VM_EXIT_SAVE_IA32_PAT |
             VMX_VM_EXIT_LOAD_IA32_PAT | VMX_VM_EXIT_SAVE_IA32_EFER |
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw

(Cc Maintainer Paolo)

Quoted 10 lines · Aidan Khoury

Date: Tue, 13 Jan 2026 12:43:56 -0400
From: Aidan Khoury <[email protected]>
Subject: [PATCH] i386/cpu: Fix unexpected initializer override in CPU model
definition for Diamond Rapids
X-Mailer: git-send-email 2.43.0

The new Diamond Rapids x86 cpu model definition that was added in 7a6dd8bde159 has an unexpected comma in the .features[FEAT_VMX_EXIT_CTLS] subobject initializer causing the prior initialization to be overridden, meaning that VMX_VM_EXIT_SAVE_DEBUG_CONTROLS | VMX_VM_EXIT_HOST_ADDR_SPACE_SIZE is not included.

Quoted 8 lines

Fix this by replacing the comma with the missing bitwise OR to properly combine all the flags into a single bitmask value.

Fixes 7a6dd8bde159 ("i386/cpu: Add CPU model for Diamond Rapids")
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thank you and my bad,

BTW, just curious, what warning did you meet? I can make some improvements.

Thanks,
Zhao