From: Eduardo Habkost Subject: Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes Date: Tue, 1 Dec 2015 13:27:45 -0200 Message-ID: <20151201152745.GL23717@thinpad.lan.raisama.net> References: <1448904887-4977-1-git-send-email-ehabkost@redhat.com> <565D74E7.6070403@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Huaitong Han To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:60247 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbbLAP1r (ORCPT ); Tue, 1 Dec 2015 10:27:47 -0500 Content-Disposition: inline In-Reply-To: <565D74E7.6070403@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Dec 01, 2015 at 11:22:31AM +0100, Paolo Bonzini wrote: > On 30/11/2015 18:34, Eduardo Habkost wrote: > > target-i386/cpu.c:ext_save_area uses magic numbers for the xsave > > area offets and sizes, and target-i386/kvm.c:kvm_{put,get}_xsave() > > uses offset macros and bit manipulation to access the xsave area. > > This series changes both to use C structs for those operations. > > > > I still need to figure out a way to write unit tests for the new > > code. Maybe I will just copy and paste the new and old functions, > > and test them locally (checking if they give the same results > > when translating blobs of random bytes). > > > > Changes v1 -> v2: > > * Use uint8_t[8*n] instead of uint64_t[n] for register data > > * Keep the QEMU_BUILD_BUG_ON lines > > [...] > > > > Eduardo Habkost (3): > > target-i386: Define structs for layout of xsave area > > target-i386: Use xsave structs for ext_save_area > > target-i386: kvm: Use X86XSaveArea struct for xsave save/load > > > > target-i386/cpu.c | 18 +++++++---- > > target-i386/cpu.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ > > target-i386/kvm.c | 96 +++++++++++++++++++++++++++++++++---------------------- > > 3 files changed, 155 insertions(+), 44 deletions(-) > > > > The patches are okay, are you going to rebase them on top of the PKRU > patches? I will probably redo the PKRU patches on top of this, to reduce diff size. -- Eduardo