From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes Date: Tue, 1 Dec 2015 16:09:44 +0100 Message-ID: <565DB838.5010005@redhat.com> References: <1448904887-4977-1-git-send-email-ehabkost@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: kvm@vger.kernel.org, Huaitong Han To: Eduardo Habkost , qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36701 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755789AbbLAPJr (ORCPT ); Tue, 1 Dec 2015 10:09:47 -0500 In-Reply-To: <1448904887-4977-1-git-send-email-ehabkost@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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). I think it's easier to use small guests (i.e. kvm-unit-tests) to test this code. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3mYv-0006Xp-59 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 10:09:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3mYu-0000Nn-6v for qemu-devel@nongnu.org; Tue, 01 Dec 2015 10:09:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3mYu-0000Ni-23 for qemu-devel@nongnu.org; Tue, 01 Dec 2015 10:09:48 -0500 References: <1448904887-4977-1-git-send-email-ehabkost@redhat.com> From: Paolo Bonzini Message-ID: <565DB838.5010005@redhat.com> Date: Tue, 1 Dec 2015 16:09:44 +0100 MIME-Version: 1.0 In-Reply-To: <1448904887-4977-1-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 0/3] target-i386: Use C struct for xsave area layout, offsets & sizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Huaitong Han , kvm@vger.kernel.org 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. >=20 > 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). I think it's easier to use small guests (i.e. kvm-unit-tests) to test this code. Paolo