diff mbox series

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

Message ID 20190805085350.23309-1-jnwang@suse.com (mailing list archive)
State New, archived
Headers show
Series [v1] x86/spec-ctrl: Remove EAGER_FPU when PV/HVM is disabled. | expand

Commit Message

Jin Nan Wang Aug. 5, 2019, 8:54 a.m. UTC
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(+)

Comments

Andrew Cooper Aug. 5, 2019, 9:04 a.m. UTC | #1
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
Jin Nan Wang Aug. 5, 2019, 9:05 a.m. UTC | #2
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
>
diff mbox series

Patch

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 )
         {