Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932723AbbD0MT3 (ORCPT ); Mon, 27 Apr 2015 08:19:29 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:59921 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932654AbbD0MTZ (ORCPT ); Mon, 27 Apr 2015 08:19:25 -0400 Date: Mon, 27 Apr 2015 14:19:13 +0200 From: Cornelia Huck To: Michael Mueller Cc: Christian Borntraeger , qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Eduardo Habkost , Gleb Natapov , Alexander Graf , Daniel Hansel , "Jason J. Herne" , Paolo Bonzini , Richard Henderson , Andreas Faerber Subject: Re: [Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute interface for S390 CPU models Message-ID: <20150427141913.7014b017.cornelia.huck@de.ibm.com> In-Reply-To: <20150427130758.5be04a87@bee> References: <1428933396-37887-1-git-send-email-mimu@linux.vnet.ibm.com> <1428933396-37887-12-git-send-email-mimu@linux.vnet.ibm.com> <553DF033.1060405@de.ibm.com> <20150427114353.0386c3eb@bee> <553E1506.5080206@de.ibm.com> <20150427130758.5be04a87@bee> Organization: IBM Deutschland Research & Development GmbH Vorsitzende des Aufsichtsrats: Martina Koederitz =?UTF-8?B?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= Dirk Wittkopp Sitz der Gesellschaft: =?UTF-8?B?QsO2Ymxpbmdlbg==?= Registergericht: Amtsgericht Stuttgart, HRB 243294 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15042712-0029-0000-0000-0000045FB5BB Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2048 Lines: 54 On Mon, 27 Apr 2015 13:07:58 +0200 Michael Mueller wrote: > On Mon, 27 Apr 2015 12:52:54 +0200 > Christian Borntraeger wrote: > > > Am 27.04.2015 um 11:43 schrieb Michael Mueller: > > > On Mon, 27 Apr 2015 10:15:47 +0200 > > > Christian Borntraeger wrote: > > > > > >> 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.... > > > > > > cpu_model_get/set() is used to handle both attributes, > > > KVM_S390_VM_CPU_MACHINE and KVM_S390_VM_CPU_PROCESSOR. > > > Both require a different type in the signature, (S390ProcessorProps*) > > > and (S390MachineProps*). Adding both as parameters seems to be odd > > > and would require additionally logic in the function. > > > Thus I think doing the cast outside is just the right thing to do. > > > > So what about a void pointer then as parameter? > > I prefer a pointer for qemu process memory over uint64_t as part of the > > function interface. This makes it somewhat clearer that this is an > > address within QEMU. Both ways will certainly work, though. > > The interface calls are: > > int kvm_s390_get_machine_props(KVMState *s, S390MachineProps *prop) > int kvm_s390_get_processor_props(S390ProcessorProps *prop) > > cpu_model_get/set() are just static helpers. So this makes them internal calls... > > > > > Conny, I guess you will pick up the patches. Any preference? ...and I'd prefer using a void pointer for them. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/