From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: One question on xen_cpuid in pv guest Date: Wed, 29 Jul 2009 09:54:55 -0700 Message-ID: <4A707EDF.1030104@goop.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: "Jiang, Yunhong" Cc: "xen-devel@lists.xensource.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 07/28/09 20:19, Jiang, Yunhong wrote: > I have a question to xen_cpuid() in pv_ops guest. Currently the cpuid will be trapped to xen HV for emulation. So why do we still use cpuid_leaf1_edx_mask/cpuid_leaf1_ecx_mask to do mask in guest side? Havn't that been achieved in hypervisor already? > Not entirely, or consistently. In general Xen masks features which are outright forbidden for the guest to use, but leaves things that might possibly be useful - we still need to mask those out. It also fails to mask some newer features which are not usable in guests (like GByte pages and XSAVE), so we need to mask those anyway. For domU, the set of mask flags is under the control of the domain config file; a misconfiguration could enable flags that the kernel can simply not use. J