From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: [PATCH v15 16/19] pvh: Restrict tsc_mode to NEVER_EMULATE for now Date: Mon, 11 Nov 2013 14:57:18 +0000 Message-ID: <1384181841-22739-17-git-send-email-george.dunlap@eu.citrix.com> References: <1384181841-22739-1-git-send-email-george.dunlap@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384181841-22739-1-git-send-email-george.dunlap@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: George Dunlap , Keir Fraser , Tim Deegan , Jan Beulich List-Id: xen-devel@lists.xenproject.org The reason given for this restriction in the first place, given in one of the comments checking for PVH requirements, had to do with additional infrastructure required to allow PV RDTSC emulation for PVH guests. Since we don't use the PV emulation path at all anymore, we may be able to remove this restriction. Experiments show that pvh will boot without apparent issues in "default", "native", and "native_paravirt" mode, but not in "always_emulate" mode. We'll leave this restriction in until we can sort out what's going on. Signed-off-by: George Dunlap Signed-off-by: Mukesh Rathor Acked-by: Tim Deegan --- v15: - Indicate a reason why this mode was disabled in the first place. v13: - Only print a warning if tsc_mode != TSC_MODE_DEFAULT CC: Jan Beulich CC: Tim Deegan CC: Keir Fraser --- xen/arch/x86/time.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index c1bbd50..d7ea2ff 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1827,6 +1827,33 @@ void tsc_set_info(struct domain *d, d->arch.vtsc = 0; return; } + if ( is_pvh_domain(d) ) + { + /* + * PVH fixme: support more tsc modes. + * + * NB: The reason this is disabled here appears to be with + * additional support required to do the PV RDTSC emulation. + * Since we're no longer taking the PV emulation path for + * anything, we may be able to remove this restriction. + * + * pvhfixme: Experiments show that "default" works for PVH, + * but "always_emulate" does not for some reason. Figure out + * why. + */ + switch ( tsc_mode ) + { + case TSC_MODE_NEVER_EMULATE: + break; + default: + printk(XENLOG_WARNING + "PVH currently does not support tsc emulation. Setting timer_mode = never_emulate\n"); + /* FALLTHRU */ + case TSC_MODE_DEFAULT: + tsc_mode = TSC_MODE_NEVER_EMULATE; + break; + } + } switch ( d->arch.tsc_mode = tsc_mode ) { -- 1.7.9.5