From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH, RFC] x86-64: properly handle FPU code/data selectors Date: Thu, 17 Oct 2013 12:27:27 +0300 Message-ID: <20131017092727.GN15657@redhat.com> References: <525E9BFF02000078000FB74E@nat28.tlf.novell.com> <525ECEA102000078000FB906@nat28.tlf.novell.com> <525ED75402000078000FB95B@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Ingo Molnar , Thomas Gleixner , KVM list , Linux Kernel Mailing List , Peter Anvin To: Jan Beulich Return-path: Content-Disposition: inline In-Reply-To: <525ED75402000078000FB95B@nat28.tlf.novell.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Wed, Oct 16, 2013 at 05:13:40PM +0100, Jan Beulich wrote: > > It preserves *less* state, because the upper 32 bits of rip are now > > corrupted. Any 64-bit application that actually looks at the FP > > rip/rdp fields now get the WRONG VALUES. > > But again - this isn't being done for ordinary 64-bit applications, > this is only happening for KVM guests. And there not being a > protocol for telling the caller whether a certain context hold > 64-bit offsets or selector/offset pairs shouldn't be a reason to > think of a solution to the problem. > KVM knows what mode guest vcpu is in. is_long_mode(vcpu) will tell you if it is in long mode or not. No need to guess it. -- Gleb.