From: "Jan Beulich" Subject: Re: [PATCH] vmx: last branch recording MSR emulation Date: Thu, 09 Aug 2007 14:05:37 +0100 Message-ID: <46BB2D41.76E4.0078.0@novell.com> References: <46BB28E4.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline 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 Cc: Xin B Li , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org >>> Keir Fraser 09.08.07 14:49 >>> >On 9/8/07 13:47, "Jan Beulich" wrote: > >> Finally, with LBR registers being used in Xen itself (optionally), = you'd >> expose >> hypervisor internal information to HVM's, which is generally considered = a >> security risk. > >Well, that's due to the current rather stupid policy of defaulting HVM = MSR >reads to read the native MSR. MSR handling needs unifying and a big clean >up, just like has now happened to the control registers. Same for CPUID >(which has a similarly stupid policy to that of MSR reads). I've been hearing you say this for quite a while, and from an abstract = point of view I would also agree. However, other than the control registers MSRs = and CPUID really have quite a bit of vendor specifics, and hence I'd be afraid = that unification here would not result in much better code. (An example of = things incorrectly done on both sides is the recent insertion of MSR_K8_* cases = in VMX code - how would an Intel CPU ever have K8-specific MSRs?) The default of reading native registers is of course very questionable, = but it's been that way for so long that I didn't dare to kill this, as I'm = suspecting that booting some, if not all, OSes without this would not work. And the = then likely resulting incrementally adding of emulation for individual MSRs on = an empirical basis is something that I consider, as pointed out on other = similar occasions like the MMIO instruction decoder, very wrong for code that is = no longer in a proof-of-concept state. Jan