Commit 3339914a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'x86_platform_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 platform update from Borislav Petkov:
 "A single x86/platform improvement when the kernel is running as an
  ACRN guest:

   - Get TSC and CPU frequency from CPUID leaf 0x40000010 when the
     kernel is running as a guest on the ACRN hypervisor"

* tag 'x86_platform_for_v6.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/acrn: Set up timekeeping
parents bf767625 81a71f51
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -10,6 +10,15 @@
/* Bit 0 indicates whether guest VM is privileged */
#define	ACRN_FEATURE_PRIVILEGED_VM	BIT(0)

/*
 * Timing Information.
 * This leaf returns the current TSC frequency in kHz.
 *
 * EAX: (Virtual) TSC frequency in kHz.
 * EBX, ECX, EDX: RESERVED (reserved fields are set to zero).
 */
#define ACRN_CPUID_TIMING_INFO		0x40000010

void acrn_setup_intr_handler(void (*handler)(void));
void acrn_remove_intr_handler(void);

@@ -21,6 +30,11 @@ static inline u32 acrn_cpuid_base(void)
	return 0;
}

static inline unsigned long acrn_get_tsc_khz(void)
{
	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
}

/*
 * Hypercalls for ACRN
 *
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ static void __init acrn_init_platform(void)
{
	/* Setup the IDT for ACRN hypervisor callback */
	alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR, asm_sysvec_acrn_hv_callback);

	x86_platform.calibrate_tsc = acrn_get_tsc_khz;
	x86_platform.calibrate_cpu = acrn_get_tsc_khz;
}

static bool acrn_x2apic_available(void)