Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964965AbbELX4V (ORCPT ); Tue, 12 May 2015 19:56:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47133 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964885AbbELX4T (ORCPT ); Tue, 12 May 2015 19:56:19 -0400 From: Bandan Das To: Paolo Bonzini 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 09/13] KVM: x86: save/load state on SMM switch References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-10-git-send-email-pbonzini@redhat.com> <5549EF71.4080207@redhat.com> <554A6DC2.3010903@redhat.com> Date: Tue, 12 May 2015 19:56:15 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1463 Lines: 35 Paolo Bonzini writes: > On 06/05/2015 19:55, Bandan Das wrote: >> Valid point. But I would say cryptic names will always be better then >> hex offsets. It's a one time pain in the neck to get the defines >> right. >> >> I found this header - >> ftp://ftp.xskernel.org/soft/linux-src/bochs-20080511/cpu/smm.h >> >> Maybe we can pick it up ? I can sanity check the list and >> make sure the offsets are correct if you prefer. > > Thanks, I like that header. :) No need to sanity check yourself. > > I'll have to adjust to define both 32-bit and 64-bit offsets. Ok to use > just SMRAM32_OFS_xyz and SMRAM64_OFS_xyz? No need for LO32 and HI32, in > particular. Agreed, that sounds like the right thing to do. > The one problem is that I am doing math on the offsets in some places. > It would suck to save/restore 16 registers manually. Any suggestions? > I will probably send v1 for review without the offsets. I think it's ok just to replace the offset number with a name. If you are concerned about readability, we could probably wrap the "for loops" in the math calculations with a more serious sounding macro eg. "#define foreach_smm_offset(val, start_offset, jump, count)" :) > Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/