[PATCH] libxl/x86: use public interface TSC mode definitions

Jan Beulich posted 1 patch 1 year, 2 months ago
Failed in applying to current master (apply log)
[PATCH] libxl/x86: use public interface TSC mode definitions
Posted by Jan Beulich 1 year, 2 months ago
Now that they're properly represented in the public interface, stop
using literal numbers.

No functional change intended.

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

--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -1,5 +1,6 @@
 #include "libxl_internal.h"
 #include "libxl_arch.h"
+#include <xen/arch-x86/cpuid.h>
 
 int libxl__arch_domain_prepare_config(libxl__gc *gc,
                                       libxl_domain_config *d_config,
@@ -486,13 +487,13 @@ int libxl__arch_domain_create(libxl__gc
 
     switch (d_config->b_info.tsc_mode) {
     case LIBXL_TSC_MODE_DEFAULT:
-        tsc_mode = 0;
+        tsc_mode = XEN_CPUID_TSC_MODE_DEFAULT;
         break;
     case LIBXL_TSC_MODE_ALWAYS_EMULATE:
-        tsc_mode = 1;
+        tsc_mode = XEN_CPUID_TSC_MODE_ALWAYS_EMULATE;
         break;
     case LIBXL_TSC_MODE_NATIVE:
-        tsc_mode = 2;
+        tsc_mode = XEN_CPUID_TSC_MODE_NEVER_EMULATE;
         break;
     case LIBXL_TSC_MODE_NATIVE_PARAVIRT:
         LOGD(ERROR, domid, "TSC Mode native_paravirt (a.k.a PVRDTSCP) has been removed");
Re: [PATCH] libxl/x86: use public interface TSC mode definitions
Posted by Anthony PERARD 1 year, 2 months ago
On Mon, Feb 06, 2023 at 01:33:03PM +0100, Jan Beulich wrote:
> Now that they're properly represented in the public interface, stop
> using literal numbers.
> 
> No functional change intended.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD
Re: [PATCH] libxl/x86: use public interface TSC mode definitions
Posted by Juergen Gross 1 year, 2 months ago
On 06.02.23 13:33, Jan Beulich wrote:
> Now that they're properly represented in the public interface, stop
> using literal numbers.
> 
> No functional change intended.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

Re: [PATCH] libxl/x86: use public interface TSC mode definitions
Posted by Andrew Cooper 1 year, 2 months ago
On 06/02/2023 12:33 pm, Jan Beulich wrote:
> Now that they're properly represented in the public interface, stop
> using literal numbers.
>
> No functional change intended.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

(Take 2, trying to sort out my email aliases properly.)
Re: [PATCH] libxl/x86: use public interface TSC mode definitions
Posted by Andrew Cooper 1 year, 2 months ago
On 06/02/2023 12:33 pm, Jan Beulich wrote:
> Now that they're properly represented in the public interface, stop
> using literal numbers.
>
> No functional change intended.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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