From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Heads up: More user-unaccessible x86 states? Date: Mon, 05 Oct 2009 14:55:20 +0200 Message-ID: <4AC9ECB8.2070609@redhat.com> References: <4AC86404.3090209@web.de> <4AC87299.4040508@redhat.com> <4AC87E08.5070908@web.de> <4AC88BF2.7080200@redhat.com> <4AC8F282.3090307@web.de> <4AC98FBC.3030509@redhat.com> <4AC9A395.5010609@web.de> <4AC9B490.5020502@redhat.com> <4AC9D608.2000205@siemens.com> <4AC9E118.8030304@redhat.com> <4AC9E431.2050800@siemens.com> <4AC9E7BC.2060803@redhat.com> <4AC9E9AA.7090603@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:22029 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932413AbZJEMzv (ORCPT ); Mon, 5 Oct 2009 08:55:51 -0400 In-Reply-To: <4AC9E9AA.7090603@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 10/05/2009 02:42 PM, Jan Kiszka wrote: > >> Yes, for big-endian 32/64 and s390. There are some patches floating around. >> > Well, that's for fixing up the endianess of the bitmap itself. But the > problem with void * in compat code are their different sizes. And > GET_DIRTY_LOG solves this via padding: > > union { > void __user *dirty_bitmap; > __u64 padding2; > }; > > So this should not make pointers a no-go, should it? > No, it doesn't work. Big-endian will place the pointer at offset zero which is the high-end word when read by the host; and 31-bit s390 needs something unsurprisingly strange to be done to the pointer. The patches I mentioned involve creating a compat_ioctl callback, something which I tried to avoid but failed, not having considered big-endian and s390. >>> We'll probably have to deal with both. Therefore, I'm looking for a >>> unified solution. >>> >>> >>> >> array of >> >> struct { >> __u16 type; >> __u16 offset; >> } ? >> >> > For sure possible, just the setup of such data structure in user space > gets a bit, well, unhandy. > Yes. Fixed-offset substructures are a lot easier and less error-prone. -- error compiling committee.c: too many arguments to function