From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: Getting the XSAVE size from userspace Date: Thu, 5 Nov 2015 10:53:38 +0000 Message-ID: <563B3532.2000903@citrix.com> References: <563B26E2.3070208@bitdefender.com> <563B40A202000078000B211F@prv-mh.provo.novell.com> <563B33AC.8000106@bitdefender.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <563B33AC.8000106@bitdefender.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: Razvan Cojocaru , Jan Beulich Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On 05/11/15 10:47, Razvan Cojocaru wrote: > On 11/05/2015 12:42 PM, Jan Beulich wrote: >>>>> On 05.11.15 at 10:52, wrote: >>> I need to get the XSAVE size from userspace. The easiest way seems to be >>> to use the XEN_DOMCTL_getvcpuextstate hypercall, but that hypercall is >>> not public / there's no xenctrl.h wrapper for it. >> Before going into any detail of the rest of your mail - any reason you >> can't just consult CPUID output? > That's because the userspace application doesn't live in dom0, but in a > dedicated privileged domain, and I'm unsure if a CPUID issued there > yields the same results as a CPUID issued in dom0. So I thought the > safest way is to get the information directly from the hypervisor. Is > this assumption incorrect? What purpose are you wanting the information for? Using cpuid (should) get you the information concerning your domain, which is liable to be different to what another domain might see. Currently, the information available through the domain cpuid policy is inaccurate, and *not* migration safe. I am working on fixing this as part 2 of my cpuid levelling fixes. ~Andrew