From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Egger, Christoph" Subject: Re: there is no sysret in X86_emulate, why? Date: Thu, 30 Oct 2014 12:22:37 +0200 Message-ID: <5452116D.3060906@amazon.de> References: <1e18867.a8bc.1495ebb4068.Coremail.hanyandong@iie.ac.cn> <54521B4D0200007800043677@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <54521B4D0200007800043677@mail.emea.novell.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: Jan Beulich , hanyandong Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 2014/10/30 12:04, Jan Beulich wrote: >>>> On 30.10.14 at 02:46, wrote: >> (1)In x86_emulate(), there are sysenter/sysexit, syscall. But why no sysret? > > Perhaps on the basis that this already when introduced was only > meant to be usable on 64-bit hypervisors, and 64-bit capable CPUs > always support SYSRET (whereas the scope of support for the > other three varies)? Christoph, you added that code years ago - is > there any other explanation for this? Back at that time I was working on live migration between AMD and Intel forth and back. The sysenter/sysexit emulation covers the case of running 32bit binaries in compat mode in a 64bit DomU. The syscall emulation also covers a case I do not remember anymore. Christoph > >> (2)I want to iuntercept syscall/sysret, so I unset the EFER.SCE, so >> syscall/sysret will trap into Xen, then I emulate syscall/sysret. >> But I only see syscall and did not see one sysret, the guest run as usual. >> any one can give me an hint? > > Assuming you did everything correctly, this seems odd. But in any > event I'd suggest confirming such behavior in a native environment > first. > > Jan >