From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753133AbbEEQQz (ORCPT ); Tue, 5 May 2015 12:16:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38388 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752636AbbEEQQw (ORCPT ); Tue, 5 May 2015 12:16:52 -0400 Message-ID: <5548ECEB.3090900@redhat.com> Date: Tue, 05 May 2015 18:16:43 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Bandan Das CC: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, rkrcmar@redhat.com, guangrong.xiao@linux.intel.com, Yang Zhang , wanpeng.li@linux.intel.com Subject: Re: [PATCH 06/13] KVM: x86: pass the whole hflags field to emulator and back References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-7-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/05/2015 17:47, Bandan Das wrote: > > The hflags field will contain information about system management mode > > and will be useful for the emulator. Pass the entire field rather than > > just the guest-mode information. > > With respect to maintaining maximum isolation between vcpu internals and > the emulator, Isolation is maintained. hflags are simply parts of the processor state that are not visible to the guest, you can choose to include them as separate flags or in a single one. Bundling them in a single flag makes it a bit faster to pass around many of them. While we do not need all of them in the emulator, that's in some cases a limitation of the emulator. For example, if we wanted to emulate CLGI/STGI we would need either HF_GIF_MASK or another . Likewise, HF_NMI_MASK could replace emulator_set_nmi_mask (especially in v2 of the series, which will add kvm_set_hflags). However, if you prefer, I can change it to "bool smm_mode" + a new smm_exit emulator callback. Paolo > why not just "bool smm_mode" ? >