From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 1/5] KVM: x86: introduce ISA specific SMM entry/exit callbacks Date: Thu, 14 Sep 2017 11:47:43 +0200 Message-ID: References: <20170913140628.7787-1-lprosek@redhat.com> <20170913140628.7787-2-lprosek@redhat.com> <89091967-4ffe-9e26-88aa-f6f716f0e0a8@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: KVM list , Radim Krcmar To: Ladi Prosek Return-path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:34348 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbdINJru (ORCPT ); Thu, 14 Sep 2017 05:47:50 -0400 Received: by mail-wm0-f65.google.com with SMTP id i131so2754177wma.1 for ; Thu, 14 Sep 2017 02:47:50 -0700 (PDT) In-Reply-To: Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 14/09/2017 09:14, Ladi Prosek wrote: > I would have to reorder some of the calls under "if (writeback)" in > x86_emulate_instruction to make it work. The hook needs to be called > after all vcpu state has been synced. For example now kvm_rip_write > runs after kvm_set_hflags so it would overwrite the rip restored by > the hook. > > The left_smm field is indeed not necessary though. What if I leave it > as a separate statement in x86_emulate_instruction to make the > ordering requirement explicit, but use hflags to detect that we've > left SMM? That'd be even better, yes. Paolo