Skip to contentSkip to conversation

x86: fix incorrect return value for has_if_pschange_mc

PATCH In review Kevin Lampis 3 participants 3 messages Jan 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: fix incorrect return value for has_if_pschange_mc

A return value is missing from this function leading to safe CPUs being marked as vulnerable.

---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/hvm/vmx/vmx.c +1 -0
index 05b59cb8e4..cf474ee5b3 100644
@@ -3117,6 +3117,7 @@ static bool __init has_if_pschange_mc(void)
     case 0x75: /* Lightning Mountain */
     case 0x7a: /* Gemini Lake */
     case 0x86: /* Jacobsville */
+        return false;
 
     default:
         printk("Unrecognised CPU model %#x - assuming vulnerable to IF_PSCHANGE_MC\n",
Signature · 1 line
2.51.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Kevin Lampis

A return value is missing from this function leading to safe CPUs being marked as vulnerable.

It's not really a return value that's missing. It's just that the Atom block used to fall through into the Phi block to get to it's return false, and this was accidentally dropped with the Phi removal.

Fixes 85191cf32180 ("x86: drop Xeon Phi support")
Quoted 1 line

I can tweak the commit message on commit.

~Andrew

#2 lore raw
Quoted 8 lines · Andrew Cooper
Quoted 2 lines · Kevin Lampis

A return value is missing from this function leading to safe CPUs being marked as vulnerable.

It's not really a return value that's missing. It's just that the Atom block used to fall through into the Phi block to get to it's return false, and this was accidentally dropped with the Phi removal.

Fixes 85191cf32180 ("x86: drop Xeon Phi support")

Hmm, I indeed screwed up there. However, the fact that there were two blocks of case labels with a blank line between them made them visually non-fall-through. Hence why I keep asking that blank lines only be inserted for non-fall-through situations. In the case here the comments would already have served as sufficient separation of the two groups.

Jan