[PATCH] x86: fix incorrect return value for has_if_pschange_mc

Kevin Lampis posted 1 patch 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260109114330.2361144-1-kevin.lampis@citrix.com
xen/arch/x86/hvm/vmx/vmx.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] x86: fix incorrect return value for has_if_pschange_mc
Posted by Kevin Lampis 1 month ago
A return value is missing from this function leading to safe CPUs being
marked as vulnerable.

Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>
---
 xen/arch/x86/hvm/vmx/vmx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 05b59cb8e4..cf474ee5b3 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -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",
-- 
2.51.1
Re: [PATCH] x86: fix incorrect return value for has_if_pschange_mc
Posted by Andrew Cooper 1 month ago
On 09/01/2026 11:43 am, Kevin Lampis wrote:
> 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")

> Signed-off-by: Kevin Lampis <kevin.lampis@citrix.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

I can tweak the commit message on commit.

~Andrew
Re: [PATCH] x86: fix incorrect return value for has_if_pschange_mc
Posted by Jan Beulich 1 month ago
On 09.01.2026 12:48, Andrew Cooper wrote:
> On 09/01/2026 11:43 am, Kevin Lampis wrote:
>> 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