From: Keir Fraser Subject: Re: [PATCH] MSR related clean up Date: Wed, 24 Jun 2009 10:27:55 +0100 Message-ID: References: <200906241721.27265.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <200906241721.27265.sheng@linux.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Sheng Yang Cc: "xen-devel@lists.xensource.com" , Eddie Dong List-Id: xen-devel@lists.xenproject.org On 24/06/2009 10:21, "Sheng Yang" wrote: > What we suffered now is, there are some MSRs existed in CPU, but shouldn't be > accessed by guest. And guest should expected a GP fault for accessing, but we > return a real value, which is not desired at all. > > And in general, reading from unknown native MSR is dangerous, and also break > host/guest isolation. I think we at least should control what we read from > native. Maybe add more MSR handling is necessary. I kind of agree with you, up to but not including delivering #GPs that would not be delivered when running the guest OS natively. A middle ground might be to return all zeros for unknown MSRs for which rdmsr_safe() succeeds. That is by far the most popular bodge value we manually use to fix up cases where returning the real MSR value was actually a proven problem. -- Keir