[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH linux-next v2 2/2] x86/xen/time: cleanup xen_tsc_safe_clocksource


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx
  • From: Krister Johansen <kjlx@xxxxxxxxxxxxxxxxxx>
  • Date: Wed, 22 Feb 2023 09:54:56 -0800
  • Arc-authentication-results: i=1; rspamd-9788b98bc-pxv92; auth=pass smtp.auth=dreamhost smtp.mailfrom=kjlx@xxxxxxxxxxxxxxxxxx
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1677088502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SFO62oAKLgPH71Y0Xq/5Q3j7DH6Nq6RDi9wLwjcluGc=; b=h8mVkyZHbUBEALiaIWjXcFZz/KPRxjmuORzreG3ZSTkVSFqX5ixXfASZAtdAy38jhyMvge 3hQqSabRrsfriX5TbsJiSpfAPdpWqCDVvCt4oQqYxintaQL31SdENyaZ2Z/+ge9mx4Bt+X vJ4gDwlb8X6P/P73dYWnWkSmxESDD4bFalo5+TL3t7qEXjw7WJukQKK0YEv1T00eK5gIxd e+FZbjPTUJzycm94qkwU99gXBlMB4eGtFkWLcalDZDGu2nZAXstKR80EF5j/c1Xp5jV3i7 RRicXhz2UReH2NlM7OqBO5gmIKcXWDUKLrxFzGC/ZRGW2SkvMOxgMzoz2VURZQ==
  • Arc-seal: i=1; s=arc-2022; d=mailchannels.net; t=1677088502; a=rsa-sha256; cv=none; b=8Zs+e79PUTur1pKIYqSseh/3YYpctXHHUG3GycmJb7iEdHZwh3xiQDMtSw3iwF/ElWC1jO ommpNiCmt8bdjc7iNnX2CTPHMLCAbdi+LYaKSIxBMDe5HkXDzumqkVrAPXlcv5onCo1Fzf f8LDvD2nu498InMVOz/Z6qo1sTBiDkpazfoI2YHajI+mGWi78Fe5zrwzNIcUOIYdPrZTIY a3cBj+wZwi8xYxHjL8cvLGxwzj0g0Na20M8Ui32qu9qvz329/CZYo3j3CBaqGoTXav3gPc OhL+H6VrfvTq1W9uYyWLriSjXYDEmSyqpTt3h/hELvjchL4kI/KAyyk6nEY1wQ==
  • Cc: Juergen Gross <jgross@xxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, Marcelo Tosatti <mtosatti@xxxxxxxxxx>, Anthony Liguori <aliguori@xxxxxxxxxx>, David Reaver <me@xxxxxxxxxxxxxxx>, Brendan Gregg <brendan@xxxxxxxxx>
  • Delivery-date: Wed, 22 Feb 2023 17:55:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Modifies xen_tsc_safe_clocksource() to use newly defined constants from
arch/x86/include/asm/xen/cpuid.h.  This replaces a numeric value with
XEN_CPUID_TSC_MODE_NEVER_EMULATE, and deletes a comment that is now self
explanatory.

There should be no change in the function's behavior.

Signed-off-by: Krister Johansen <kjlx@xxxxxxxxxxxxxxxxxx>
---
 arch/x86/xen/time.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 95140609c8a8..94056013a2a4 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -20,6 +20,7 @@
 #include <asm/pvclock.h>
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
+#include <asm/xen/cpuid.h>
 
 #include <xen/events.h>
 #include <xen/features.h>
@@ -495,11 +496,7 @@ static int __init xen_tsc_safe_clocksource(void)
        /* Leaf 4, sub-leaf 0 (0x40000x03) */
        cpuid_count(xen_cpuid_base() + 3, 0, &eax, &ebx, &ecx, &edx);
 
-       /* tsc_mode = no_emulate (2) */
-       if (ebx != 2)
-               return 0;
-
-       return 1;
+       return ebx == XEN_CPUID_TSC_MODE_NEVER_EMULATE;
 }
 
 static void __init xen_time_init(void)
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.