From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmeCt-00030l-El for qemu-devel@nongnu.org; Mon, 27 Apr 2015 04:16:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmeCo-0007kv-Dn for qemu-devel@nongnu.org; Mon, 27 Apr 2015 04:15:59 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:50492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmeCn-0007kW-TA for qemu-devel@nongnu.org; Mon, 27 Apr 2015 04:15:54 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 27 Apr 2015 09:15:52 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id DA2C51B08070 for ; Mon, 27 Apr 2015 09:16:28 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3R8FoRo61276376 for ; Mon, 27 Apr 2015 08:15:50 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3R8Fmkv010348 for ; Mon, 27 Apr 2015 02:15:49 -0600 Message-ID: <553DF033.1060405@de.ibm.com> Date: Mon, 27 Apr 2015 10:15:47 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1428933396-37887-1-git-send-email-mimu@linux.vnet.ibm.com> <1428933396-37887-12-git-send-email-mimu@linux.vnet.ibm.com> In-Reply-To: <1428933396-37887-12-git-send-email-mimu@linux.vnet.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute interface for S390 CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Mueller , qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eduardo Habkost , Gleb Natapov , Alexander Graf , Cornelia Huck , "Jason J. Herne" , Daniel Hansel , Paolo Bonzini , Andreas Faerber , Richard Henderson Am 13.04.2015 um 15:56 schrieb Michael Mueller: [...] > +static int cpu_model_get(KVMState *s, uint64_t attr, uint64_t addr) > +{ > + int rc = -ENOSYS; > + struct kvm_device_attr dev_attr = { > + .group = KVM_S390_VM_CPU_MODEL, > + .attr = attr, > + .addr = addr, Would it make sense to do the cast here.... > + }; > + > + if (kvm_vm_check_attr(s, dev_attr.group, dev_attr.attr)) { > + rc = kvm_vm_ioctl(s, KVM_GET_DEVICE_ATTR, &dev_attr); > + } > + > + return rc; > +} > + > +static int cpu_model_set(KVMState *s, uint64_t attr, uint64_t addr) > +{ > + int rc = -ENOSYS; > + struct kvm_device_attr dev_attr = { > + .group = KVM_S390_VM_CPU_MODEL, > + .attr = attr, > + .addr = addr, ...and here... > + }; > + > + if (kvm_vm_check_attr(s, dev_attr.group, dev_attr.attr)) { > + rc = kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &dev_attr); > + } > + > + return rc; > +} > + > +static int kvm_s390_get_machine_props(KVMState *s, S390MachineProps *prop) > +{ > + int rc = -EFAULT; > + > + if (s) { > + rc = cpu_model_get(s, KVM_S390_VM_CPU_MACHINE, (uint64_t) prop); and pass S390MachineProps as 3rd parameter? > +int kvm_s390_get_processor_props(S390ProcessorProps *prop) > +{ > + int rc; > + > + rc = cpu_model_get(kvm_state, KVM_S390_VM_CPU_PROCESSOR, (uint64_t) prop); dito > + trace_kvm_get_processor_props(rc, prop->cpuid, prop->ibc); > + return rc; > +} > + > +int kvm_s390_set_processor_props(S390ProcessorProps *prop) > +{ > + int rc; > + > + rc = cpu_model_set(kvm_state, KVM_S390_VM_CPU_PROCESSOR, (uint64_t) prop); dito