From: Dan Magenheimer Subject: RE: write_tsc in a PV domain? Date: Wed, 26 Aug 2009 08:42:05 -0700 (PDT) Message-ID: <6eb624ce-7d03-425b-afa4-2d97325b096c@default> References: Mime-Version: 1.0 Content-Type: text/plain; charset=Windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Jeremy Fitzhardinge Cc: "Xen-Devel (E-mail)" List-Id: xen-devel@lists.xenproject.org > >> arch/x86/traps.c:emulate_privileged_op(), case 0x30. It looks like > >> writing to 0x10 would be silently ignored. > >=20 > > Hmmm... maybe I am misreading the code but it looks like the > > default case will end up with "goto fail" which will not > > update IP and so will infinite loop trapping on that instruction. > >=20 > > It appears that write_tsc calls are made in linux-2.6.18 (though > > apparently never get executed) but disappear somewhere before > > 2.6.24 and don't exist in 2.6.30 either. So perhaps write_tsc > > has never been executed in a PV guest and just doesn't work. >=20 > Jeremy is correct. The TSC MSR cannot be written. Most that=20 > will happen is > that Xen will print a warning message, but the WRMSR=20 > instruction will always > be skipped over. OK, I see, wrmsr_hypervisor_regs(0x10) and mce_wrmsr(0x10) and rdmsr_safe(0x10) all return 0, so the code at "invalid:" is executed and a warning is printk'd. So in the current implementation, write_tsc is skipped over. But ARCHITECTURALLY does Xen consider write_tsc to be a no-op for PV domains, or is this just a case that's never been encountered before? In other words, if a future PV OS had a good reason to write_tsc, would we implement it (and make the necessary adjustments to Xen's usages of tsc) or just say, sorry, not allowed?