Skip to contentSkip to conversation

x86/cpuid: fix raw FEATURESET_7d0 reporting

PATCH In review Sergey Dyasli 3 participants 4 messages May 15, 2018 – May 16, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/cpuid: fix raw FEATURESET_7d0 reporting

Commit 62b1879693e0 ("x86: further CPUID handling adjustments") added FEATURESET_7d0 reporting but forgot to update calculate_raw_featureset() function. As result, the value reported by xen-cpuid contains 0.

Fix that by properly filling raw_featureset[FEATURESET_7d0].

---
I see that at least 4.8 also contains this bug, so other releases also need checking.

CC Jan Beulich <[email protected]>
CC Andrew Cooper <[email protected]>
---
 xen/arch/x86/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/cpuid.c +1 -1
index 451952cabe..fffcecd878 100644
@@ -113,7 +113,7 @@ static void __init calculate_raw_featureset(void)
         cpuid_count(0x7, 0, &tmp,
                     &raw_featureset[FEATURESET_7b0],
                     &raw_featureset[FEATURESET_7c0],
-                    &tmp);
+                    &raw_featureset[FEATURESET_7d0]);
     if ( max >= 0xd )
         cpuid_count(0xd, 1,
                     &raw_featureset[FEATURESET_Da1],
Signature · 7 lines
2.17.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.05.18 at 10:37, <[email protected]> wrote:

Commit 62b1879693e0 ("x86: further CPUID handling adjustments") added FEATURESET_7d0 reporting but forgot to update calculate_raw_featureset() function. As result, the value reported by xen-cpuid contains 0.

Fix that by properly filling raw_featureset[FEATURESET_7d0].

Thanks, technically

Quoted 3 lines

---
I see that at least 4.8 also contains this bug, so other releases also need checking.

The commit in question being only on the two branches, I think no other one would need the change.

I'm certainly going to apply this to 4.8; I'm uncertain about 4.7 though, if it's really only xen-cpuid output which is now wrong. I wasn't really planning on putting there any further non-security changes (severe regression fixes for earlier security patches perhaps being the only possible exception). Otoh osstest continues to be unhappy with the branch (albeit that's mostly environmental issues iirc, i.e. "broken" rather than "failed" tests), so us being able to push out 4.7.6 continues to be delayed.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 11 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.05.18 at 10:37, <[email protected]> wrote:

Commit 62b1879693e0 ("x86: further CPUID handling adjustments") added FEATURESET_7d0 reporting but forgot to update calculate_raw_featureset() function. As result, the value reported by xen-cpuid contains 0.

Fix that by properly filling raw_featureset[FEATURESET_7d0].

Thanks, technically

Quoted 7 lines
Quoted 3 lines

---
I see that at least 4.8 also contains this bug, so other releases also need checking.

The commit in question being only on the two branches, I think no other one would need the change.

I'm certainly going to apply this to 4.8; I'm uncertain about 4.7 though <snip>

The entirety of that changeset is broken in feature levelling scenarios, which is a consequence of missing this hunk which Sergey identified.

The result is that, when trying to level STIBP/IBPB out of guests view, the CPUID bits remain visible, but attempts to use the MSR bits will fail.

I'm rewriting the change from scratch.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
Quoted 19 lines
Quoted 1 line
Quoted 1 line · On 15.05.18 at 17:36, <[email protected]> wrote:
Quoted 17 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 15.05.18 at 10:37, <[email protected]> wrote:

Commit 62b1879693e0 ("x86: further CPUID handling adjustments") added FEATURESET_7d0 reporting but forgot to update calculate_raw_featureset() function. As result, the value reported by xen-cpuid contains 0.

Fix that by properly filling raw_featureset[FEATURESET_7d0].

Thanks, technically

Quoted 3 lines

---
I see that at least 4.8 also contains this bug, so other releases also need checking.

The commit in question being only on the two branches, I think no other one would need the change.

Quoted 8 lines
Quoted 1 line

I'm certainly going to apply this to 4.8; I'm uncertain about 4.7 though

<snip>

The entirety of that changeset is broken in feature levelling scenarios, which is a consequence of missing this hunk which Sergey identified.

The result is that, when trying to level STIBP/IBPB out of guests view, the CPUID bits remain visible, but attempts to use the MSR bits will fail.

I don't follow: PV and HVM feature sets take host_featureset as an input, not raw_featureset.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel