From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2lcG-00074Y-Hr for qemu-devel@nongnu.org; Sat, 28 Nov 2015 14:57:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a2lcD-0000oT-CF for qemu-devel@nongnu.org; Sat, 28 Nov 2015 14:57:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a2lcD-0000oK-6l for qemu-devel@nongnu.org; Sat, 28 Nov 2015 14:57:01 -0500 From: Eduardo Habkost Date: Sat, 28 Nov 2015 17:56:48 -0200 Message-Id: <1448740611-3096-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [for-2.6 PATCH 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: qemu-devel@nongnu.org Cc: Paolo Bonzini , kvm@vger.kernel.org, Huaitong Han 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 the same 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). 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 | 121 +++++++++++++++++++++++------------------------------- 3 files changed, 149 insertions(+), 75 deletions(-) -- 2.1.0