[Xen-devel] [PATCH v1] x86/spec-ctrl: Remove EAGER_FPU when PV/HVM is disabled.

Jin Nan Wang posted 1 patch 4 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190805085350.23309-1-jnwang@suse.com
xen/arch/x86/spec_ctrl.c | 2 ++
1 file changed, 2 insertions(+)
[Xen-devel] [PATCH v1] x86/spec-ctrl: Remove EAGER_FPU when PV/HVM is disabled.
Posted by Jin Nan Wang 4 years, 8 months ago
In commit ac3f9a72141a48d40fabfff561d5a7dc0e1b810d:
    For one, "no-xen" should not imply "no-eager-fpu", as "eager FPU" mode
    is to guard guests, not Xen itself, which is also expressed so by
    print_details().

So when spec-ctrl=pv=off,hvm=off;  EAGER_FPU shouldn't be display in lines:
Current[Wrong]:
(XEN)   Support for HVM VMs: EAGER_FPU MD_CLEAR
(XEN)   Support for PV VMs: EAGER_FPU MD_CLEAR

expectation:
(XEN)   Support for HVM VMs: MD_CLEAR
(XEN)   Support for PV VMs: MD_CLEAR
---
 xen/arch/x86/spec_ctrl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 468a847598..5f519406fb 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -128,12 +128,14 @@ static int __init parse_spec_ctrl(const char *s)
             opt_msr_sc_pv = val;
             opt_rsb_pv = val;
             opt_md_clear_pv = val;
+            opt_eager_fpu = val;
         }
         else if ( (val = parse_boolean("hvm", s, ss)) >= 0 )
         {
             opt_msr_sc_hvm = val;
             opt_rsb_hvm = val;
             opt_md_clear_hvm = val;
+            opt_eager_fpu = val;
         }
         else if ( (val = parse_boolean("msr-sc", s, ss)) >= 0 )
         {
-- 
2.22.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v1] x86/spec-ctrl: Remove EAGER_FPU when PV/HVM is disabled.
Posted by Andrew Cooper 4 years, 8 months ago
On 05/08/2019 09:54, Jin Nan Wang wrote:
> In commit ac3f9a72141a48d40fabfff561d5a7dc0e1b810d:
>     For one, "no-xen" should not imply "no-eager-fpu", as "eager FPU" mode
>     is to guard guests, not Xen itself, which is also expressed so by
>     print_details().
>
> So when spec-ctrl=pv=off,hvm=off;  EAGER_FPU shouldn't be display in lines:
> Current[Wrong]:
> (XEN)   Support for HVM VMs: EAGER_FPU MD_CLEAR
> (XEN)   Support for PV VMs: EAGER_FPU MD_CLEAR
>
> expectation:
> (XEN)   Support for HVM VMs: MD_CLEAR
> (XEN)   Support for PV VMs: MD_CLEAR

Eager FPU is a performance win across the board.  It will become an even
bigger performance win when we follow in Linux's footsteps and remove
the eager option, and associated logic.

I don't see any value in turning it off for speculation related reasons.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH v1] x86/spec-ctrl: Remove EAGER_FPU when PV/HVM is disabled.
Posted by Jin Nan Wang 4 years, 8 months ago
On 8/5/19 5:04 PM, Andrew Cooper wrote:
> On 05/08/2019 09:54, Jin Nan Wang wrote:
>> In commit ac3f9a72141a48d40fabfff561d5a7dc0e1b810d:
>>     For one, "no-xen" should not imply "no-eager-fpu", as "eager FPU" mode
>>     is to guard guests, not Xen itself, which is also expressed so by
>>     print_details().
>>
>> So when spec-ctrl=pv=off,hvm=off;  EAGER_FPU shouldn't be display in lines:
>> Current[Wrong]:
>> (XEN)   Support for HVM VMs: EAGER_FPU MD_CLEAR
>> (XEN)   Support for PV VMs: EAGER_FPU MD_CLEAR
>>
>> expectation:
>> (XEN)   Support for HVM VMs: MD_CLEAR
>> (XEN)   Support for PV VMs: MD_CLEAR
> Eager FPU is a performance win across the board.  It will become an even
> bigger performance win when we follow in Linux's footsteps and remove
> the eager option, and associated logic.
OK.
> I don't see any value in turning it off for speculation related reasons.
Got it.
> ~Andrew
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel