xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/time: tsc_check_writability() may need to be run a second time
@ 2017-02-10 11:03 Jan Beulich
  2017-02-10 11:05 ` Andrew Cooper
  2017-02-10 11:11 ` Joao Martins
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Beulich @ 2017-02-10 11:03 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Joao Martins

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

While we shouldn't remove its current invocation, we need to re-run it
for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
cleared, in order to avoid using the TSC rendezvous function in case
the TSC can't be written.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1643,6 +1643,14 @@ static int __init verify_tsc_reliability
     }
 
     /*
+     * Re-run the TSC writability check if it didn't run to completion, as
+     * X86_FEATURE_TSC_RELIABLE may have been cleared by now. This is needed
+     * for determining which rendezvous function to use (below).
+     */
+    if ( !disable_tsc_sync )
+        tsc_check_writability();
+
+    /*
      * While with constant-rate TSCs the scale factor can be shared, when TSCs
      * are not marked as 'reliable', re-sync during rendezvous.
      */




[-- Attachment #2: x86-time-rerun-TSC-write-check.patch --]
[-- Type: text/plain, Size: 968 bytes --]

x86/time: tsc_check_writability() may need to be run a second time

While we shouldn't remove its current invocation, we need to re-run it
for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
cleared, in order to avoid using the TSC rendezvous function in case
the TSC can't be written.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1643,6 +1643,14 @@ static int __init verify_tsc_reliability
     }
 
     /*
+     * Re-run the TSC writability check if it didn't run to completion, as
+     * X86_FEATURE_TSC_RELIABLE may have been cleared by now. This is needed
+     * for determining which rendezvous function to use (below).
+     */
+    if ( !disable_tsc_sync )
+        tsc_check_writability();
+
+    /*
      * While with constant-rate TSCs the scale factor can be shared, when TSCs
      * are not marked as 'reliable', re-sync during rendezvous.
      */

[-- Attachment #3: Type: text/plain, Size: 127 bytes --]

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

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

* Re: [PATCH] x86/time: tsc_check_writability() may need to be run a second time
  2017-02-10 11:03 [PATCH] x86/time: tsc_check_writability() may need to be run a second time Jan Beulich
@ 2017-02-10 11:05 ` Andrew Cooper
  2017-02-10 11:11 ` Joao Martins
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Cooper @ 2017-02-10 11:05 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Joao Martins

On 10/02/17 11:03, Jan Beulich wrote:
> While we shouldn't remove its current invocation, we need to re-run it
> for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
> cleared, in order to avoid using the TSC rendezvous function in case
> the TSC can't be written.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

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

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

* Re: [PATCH] x86/time: tsc_check_writability() may need to be run a second time
  2017-02-10 11:03 [PATCH] x86/time: tsc_check_writability() may need to be run a second time Jan Beulich
  2017-02-10 11:05 ` Andrew Cooper
@ 2017-02-10 11:11 ` Joao Martins
  2017-02-10 11:17   ` Andrew Cooper
  1 sibling, 1 reply; 5+ messages in thread
From: Joao Martins @ 2017-02-10 11:11 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Andrew Cooper

On 02/10/2017 11:03 AM, Jan Beulich wrote:
> While we shouldn't remove its current invocation, we need to re-run it
> for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
> cleared, in order to avoid using the TSC rendezvous function in case
> the TSC can't be written.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

FWIW,

Reviewed-by: Joao Martins <joao.m.martins@oracle.com>

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

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

* Re: [PATCH] x86/time: tsc_check_writability() may need to be run a second time
  2017-02-10 11:11 ` Joao Martins
@ 2017-02-10 11:17   ` Andrew Cooper
  2017-02-10 12:08     ` Joao Martins
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2017-02-10 11:17 UTC (permalink / raw)
  To: Joao Martins, Jan Beulich; +Cc: xen-devel

On 10/02/17 11:11, Joao Martins wrote:
> On 02/10/2017 11:03 AM, Jan Beulich wrote:
>> While we shouldn't remove its current invocation, we need to re-run it
>> for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
>> cleared, in order to avoid using the TSC rendezvous function in case
>> the TSC can't be written.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> FWIW,

Independent reviews are always worth it.  Please continue!

~Andrew

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

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

* Re: [PATCH] x86/time: tsc_check_writability() may need to be run a second time
  2017-02-10 11:17   ` Andrew Cooper
@ 2017-02-10 12:08     ` Joao Martins
  0 siblings, 0 replies; 5+ messages in thread
From: Joao Martins @ 2017-02-10 12:08 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Jan Beulich

On 02/10/2017 11:17 AM, Andrew Cooper wrote:
> On 10/02/17 11:11, Joao Martins wrote:
>> On 02/10/2017 11:03 AM, Jan Beulich wrote:
>>> While we shouldn't remove its current invocation, we need to re-run it
>>> for the case that the X86_FEATURE_TSC_RELIABLE feature flag has been
>>> cleared, in order to avoid using the TSC rendezvous function in case
>>> the TSC can't be written.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> FWIW,
> 
> Independent reviews are always worth it.  Please continue!

Nice, Thanks!

Joao

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

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

end of thread, other threads:[~2017-02-10 12:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10 11:03 [PATCH] x86/time: tsc_check_writability() may need to be run a second time Jan Beulich
2017-02-10 11:05 ` Andrew Cooper
2017-02-10 11:11 ` Joao Martins
2017-02-10 11:17   ` Andrew Cooper
2017-02-10 12:08     ` Joao Martins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).