Project

General

Profile

Actions

Bug #13385

open

revisit rdtscp exclusion on xen

Added by Patrick Mooney 9 months ago.

Status:
New
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When determining the means by which a TSC reading is performed, the i86pc boot logic explicitly prevents Xen systems from using rdtscp:

        /*
...
         *
         * The Xen hypervisor does not correctly report whether rdtscp is
         * supported or not, so we must assume that it is not.
         */
        if ((get_hwenv() & HW_XEN_HVM) == 0 &&
            is_x86_feature(x86_featureset, X86FSET_TSCP))
                patch_tsc_read(TSC_TSCP);
...

Looking at the corresponding logic on Linux and FreeBSD, I see no such exclusion. Some initial searches for bug reports or changes relating to rdtscp on Xen suggests that it did improperly advertise that capability for a period, with some evidence suggesting 2007-2009. Indeed, there is chatter on the xen-devel list in 2009 about adding handling for the TSC_AUX MSR, which would be required for RDTSCP to function properly in a guest. Given its utility, it's likely that RDTSCP is advertised properly and working as desired on modern Xen platforms and is safe to use there. This should be confirmed (testing on AWS, for example) and perhaps we could lift the restriction.

No data to display

Actions

Also available in: Atom PDF