From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: Heads up: More user-unaccessible x86 states? Date: Mon, 05 Oct 2009 14:42:18 +0200 Message-ID: <4AC9E9AA.7090603@siemens.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> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Avi Kivity Return-path: Received: from thoth.sbs.de ([192.35.17.2]:15338 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbZJEMnJ (ORCPT ); Mon, 5 Oct 2009 08:43:09 -0400 In-Reply-To: <4AC9E7BC.2060803@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 10/05/2009 02:18 PM, Jan Kiszka wrote: >>> True pointers are no go since we have to deal with compat code (31/32 >>> bit userspace calling into a 64 bit kernel). Offsets into the state >>> structure are easier. >>> >> So current KVM_GET_DIRTY_LOG is broken in the compat case... >> >> > > 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? > >> 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. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux