From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v3 2/4] KVM: Add unified KVM_GET/SET_VCPU_STATE IOCTL Date: Wed, 04 Nov 2009 12:35:53 +0100 Message-ID: <4AF16719.5050601@siemens.com> References: <20091102162028.19049.34651.stgit@mchn012c.ww002.siemens.net> <20091102162028.19049.64564.stgit@mchn012c.ww002.siemens.net> <4AF16312.4030208@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , "kvm@vger.kernel.org" To: Avi Kivity Return-path: Received: from thoth.sbs.de ([192.35.17.2]:16934 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755508AbZKDLgD (ORCPT ); Wed, 4 Nov 2009 06:36:03 -0500 In-Reply-To: <4AF16312.4030208@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux