From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH v2 3/3] KVM: x86 emulator: Allow PM/VM86 switch during task switch Date: Tue, 31 Jan 2012 00:55:40 +0900 Message-ID: <20120131005540.4a44aaadd94794707b122134@gmail.com> References: <1327692216-20450-1-git-send-email-kwolf@redhat.com> <1327692216-20450-4-git-send-email-kwolf@redhat.com> <4F266FCB.3000102@redhat.com> <4F267981.20100@redhat.com> <4F2699CE.4000506@redhat.com> <4F26A2AF.8080108@redhat.com> <4F26A9EB.3000804@redhat.com> <4F26B68E.3030100@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Avi Kivity , kvm@vger.kernel.org, gleb@redhat.com, joerg.roedel@amd.com, yoshikawa.takuya@oss.ntt.co.jp, mtosatti@redhat.com To: Kevin Wolf Return-path: Received: from mail-pw0-f46.google.com ([209.85.160.46]:54374 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752679Ab2A3Pzo (ORCPT ); Mon, 30 Jan 2012 10:55:44 -0500 Received: by pbaa10 with SMTP id a10so3865183pba.19 for ; Mon, 30 Jan 2012 07:55:44 -0800 (PST) In-Reply-To: <4F26B68E.3030100@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, 30 Jan 2012 16:26:06 +0100 Kevin Wolf wrote: > > The other case is what we're looking at, task switch. To actually > > update cpl, set_segment() needs to look at cr0.pe and eflags, but these > > might not have been committed yet. It's all solvable but the solution > > involves knowing exactly what kvm and the emulator depend on, which > > makes it very fragile. I think giving the emulator less complicated > > primitives will make it more readable. > > I think the main problem here is that you have two sets of registers, > one in the vcpu struct and one in the emulator context. > I think we can, partly?, eliminate the usage of the latter by moving the register initialization to the decode/emulation stage, as once talked on kvm ml, and changing the writeback code to use callbacks. But still some refactoring is needed before that. Takuya