All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 for 4.7] x86/cpuid: fix raw FEATURESET_7d0 reporting
@ 2018-05-15  8:37 Sergey Dyasli
  2018-05-15  9:04 ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Sergey Dyasli @ 2018-05-15  8:37 UTC (permalink / raw)
  To: xen-devel; +Cc: Sergey Dyasli, Jan Beulich, Andrew Cooper

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].

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
---
I see that at least 4.8 also contains this bug, so other releases also
need checking.

CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <Andrew.Cooper3@citrix.com>
---
 xen/arch/x86/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 451952cabe..fffcecd878 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -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],
-- 
2.17.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 for 4.7] x86/cpuid: fix raw FEATURESET_7d0 reporting
  2018-05-15  8:37 [PATCH v1 for 4.7] x86/cpuid: fix raw FEATURESET_7d0 reporting Sergey Dyasli
@ 2018-05-15  9:04 ` Jan Beulich
  2018-05-15 15:36   ` Andrew Cooper
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2018-05-15  9:04 UTC (permalink / raw)
  To: Sergey Dyasli; +Cc: Andrew Cooper, xen-devel

>>> On 15.05.18 at 10:37, <sergey.dyasli@citrix.com> 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].
> 
> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>

Thanks, technically
Acked-by: Jan Beulich <jbeulich@suse.com>

> ---
> 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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 for 4.7] x86/cpuid: fix raw FEATURESET_7d0 reporting
  2018-05-15  9:04 ` Jan Beulich
@ 2018-05-15 15:36   ` Andrew Cooper
  2018-05-16  6:42     ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cooper @ 2018-05-15 15:36 UTC (permalink / raw)
  To: Jan Beulich, Sergey Dyasli; +Cc: xen-devel

On 15/05/18 10:04, Jan Beulich wrote:
>>>> On 15.05.18 at 10:37, <sergey.dyasli@citrix.com> 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].
>>
>> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
> Thanks, technically
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
>> ---
>> 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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 for 4.7] x86/cpuid: fix raw FEATURESET_7d0 reporting
  2018-05-15 15:36   ` Andrew Cooper
@ 2018-05-16  6:42     ` Jan Beulich
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2018-05-16  6:42 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Sergey Dyasli, xen-devel

>>> On 15.05.18 at 17:36, <andrew.cooper3@citrix.com> wrote:
> On 15/05/18 10:04, Jan Beulich wrote:
>>>>> On 15.05.18 at 10:37, <sergey.dyasli@citrix.com> 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].
>>>
>>> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
>> Thanks, technically
>> Acked-by: Jan Beulich <jbeulich@suse.com>
>>
>>> ---
>>> 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 don't follow: PV and HVM feature sets take host_featureset as an input,
not raw_featureset.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-16  6:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15  8:37 [PATCH v1 for 4.7] x86/cpuid: fix raw FEATURESET_7d0 reporting Sergey Dyasli
2018-05-15  9:04 ` Jan Beulich
2018-05-15 15:36   ` Andrew Cooper
2018-05-16  6:42     ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.