From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v3 2/4] KVM: Add unified KVM_GET/SET_VCPU_STATE IOCTL Date: Wed, 04 Nov 2009 14:52:32 +0200 Message-ID: <4AF17910.4000401@redhat.com> References: <20091102162028.19049.34651.stgit@mchn012c.ww002.siemens.net> <20091102162028.19049.64564.stgit@mchn012c.ww002.siemens.net> <4AF16312.4030208@redhat.com> <4AF16719.5050601@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , "kvm@vger.kernel.org" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:26139 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755743AbZKDMwb (ORCPT ); Wed, 4 Nov 2009 07:52:31 -0500 In-Reply-To: <4AF16719.5050601@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/04/2009 01:35 PM, Jan Kiszka wrote: > Avi Kivity wrote: > >> On 11/02/2009 06:20 PM, Jan Kiszka wrote: >> >>> Add a new IOCTL pair to retrieve or set the VCPU state in one chunk. >>> More precisely, the IOCTL is able to process a list of substates to be >>> read or written. This list is easily extensible without breaking the >>> existing ABI, thus we will no longer have to add new IOCTLs when we >>> discover a missing VCPU state field or want to support new hardware >>> features. >>> >>> This patch establishes the generic infrastructure for KVM_GET/ >>> SET_VCPU_STATE, introduces KVM_CHECK_VCPU_STATES to query supported >>> substates, and adds support for the generic substates REGS, SREGS, FPU, >>> and MP. To avoid code duplication, the entry point for the corresponding >>> original IOCTLs are converted to make use of the new infrastructure >>> internally, too. >>> >>> + >>> +struct kvm_vcpu_substate { >>> + __u32 type; /* KVM_VCPU_STATE_* or KVM_$(ARCH)_VCPU_STATE_* */ >>> + __u32 pad; >>> + __s64 offset; /* payload offset to kvm_vcpu_state in bytes */ >>> +}; >>> >>> >> 64-bit offset is a bit too much, and can't be made to work on 32-bit >> hosts. Also, why signed? it's begging for trouble. >> > Please elaborate what troubles you see precisely. The offset is supposed > to make the whole user's address space reachable relative to the > header's base address. Therefore 64 bit, therefore signed. > Misread the code; patch is fine. -- error compiling committee.c: too many arguments to function