From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [RFH]: AMD CR intercept for lmsw/clts Date: Tue, 5 Aug 2014 15:22:10 -0700 Message-ID: <20140805152210.38d7de5d@mantra.us.oracle.com> References: <20140804183337.2bb1b680@mantra.us.oracle.com> <53E0A7EC02000078000294FF@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XEn7h-0000iu-1q for xen-devel@lists.xenproject.org; Tue, 05 Aug 2014 22:22:25 +0000 In-Reply-To: <53E0A7EC02000078000294FF@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 Cc: xen-devel , boris.ostrovsky@oracle.com, Aravind.Gopalakrishnan@amd.com, suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org On Tue, 05 Aug 2014 08:46:20 +0100 "Jan Beulich" wrote: > >>> On 05.08.14 at 03:33, wrote: > > Hi, > > > > On AMD, clts/lmsw will cause "mov cr" vmexit, but unlike intel, they > > can't be handled via svm_vmexit_do_cr_access and are emulated thru > > handle_mmio() which is a problem for pvh because of: > > ..... > > Or, should I just create a new function for clts/lmsw and call it > > directly from vmexit switch itself? > > I'd prefer this - it seems pretty ugly to me that handle_mmio()/ > x86_emulate() gets used for this purpose - but am not certain this > will actually work out nicely for other than CLTS: All the > instructions currently handled specially are ones with fixed > operands, and only CLTS fits that. > > You'll btw have the same problem with SMSW and DRx accesses, > string I/O instructions, as well as (on older CPUs) with moves to/from > CRx and INVLPG. I see, I'd be duplicating from x86_emulate more than just couple cases, so I think the best thing would be to just call x86_emulate directly, which is what should've been done in the first place for the CR intercepts. BTW, as regards INVLPG, I'm *requiring* svm decode for pvh. thanks, Mukesh