From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754930AbbBTQEV (ORCPT ); Fri, 20 Feb 2015 11:04:21 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:34236 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754902AbbBTQET convert rfc822-to-8bit (ORCPT ); Fri, 20 Feb 2015 11:04:19 -0500 Date: Fri, 20 Feb 2015 17:04:08 +0100 From: Michael Mueller To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: Alexander Graf , qemu-devel@nongnu.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Gleb Natapov , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Richard Henderson Subject: Re: [Qemu-devel] [RFC PATCH v2 13/15] cpu-model/s390: Add processor property routines Message-ID: <20150220170408.49db6da5@bee> In-Reply-To: <54E755BD.5000705@suse.de> References: <1424183053-4310-1-git-send-email-mimu@linux.vnet.ibm.com> <1424183053-4310-14-git-send-email-mimu@linux.vnet.ibm.com> <54E73EB2.6050700@suse.de> <20150220163209.4e082e0b@bee> <54E755BD.5000705@suse.de> Organization: IBM X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15022016-0009-0000-0000-00000337530D Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 20 Feb 2015 16:41:49 +0100 Andreas Färber wrote: > Can't you just implement the class-level name-to-ObjectClass callback > that other CPUs have grown for the above use case? If it fulfills the requirements sure. Please point me to an example, sounds that s390_select_cpu_model() is doing something similar to that, just that it hooks in the s390_set_processor_props() call. const char *s390_select_cpu_model(const char *model) { S390ProcessorProps proc; const char *typename; S390CPUClass *cc; /* return already selected cpu typename */ typename = s390_cpu_typename(); if (typename) { goto out; } /* return standard cpu typename when cpu models are unavailable */ typename = TYPE_S390_CPU; if (!s390_cpu_classes_initialized() || !model) { goto out; } cc = S390_CPU_CLASS(s390_cpu_class_by_name(model)); if (!cc) { goto out; } proc.cpuid = cpuid(cc->proc); proc.ibc = cc->proc->ibc; memcpy(proc.fac_list, cc->fac_list, S390_ARCH_FAC_LIST_SIZE_BYTE); if (s390_set_processor_props(&proc)) { goto out; } /* return requested cpu typename in success case */ typename = object_class_get_name((ObjectClass *) cc); out: selected_cpu_typename = typename; trace_select_cpu_model(model, typename); return typename; } > > Also a general comment: cpu-model/ is not an existing directory nor one > you add, so please use "target-s390x: Add foo to S390CPU" or so. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOq3x-00049H-MA for qemu-devel@nongnu.org; Fri, 20 Feb 2015 11:04:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YOq3u-0006e3-Cn for qemu-devel@nongnu.org; Fri, 20 Feb 2015 11:04:21 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:51784) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YOq3u-0006d2-4u for qemu-devel@nongnu.org; Fri, 20 Feb 2015 11:04:18 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Feb 2015 16:04:16 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9C0861B0805F for ; Fri, 20 Feb 2015 16:04:26 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t1KG4DgX7405892 for ; Fri, 20 Feb 2015 16:04:13 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t1KG4B4A026652 for ; Fri, 20 Feb 2015 09:04:12 -0700 Date: Fri, 20 Feb 2015 17:04:08 +0100 From: Michael Mueller Message-ID: <20150220170408.49db6da5@bee> In-Reply-To: <54E755BD.5000705@suse.de> References: <1424183053-4310-1-git-send-email-mimu@linux.vnet.ibm.com> <1424183053-4310-14-git-send-email-mimu@linux.vnet.ibm.com> <54E73EB2.6050700@suse.de> <20150220163209.4e082e0b@bee> <54E755BD.5000705@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v2 13/15] cpu-model/s390: Add processor property routines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?UTF-8?B?RsOkcmJlcg==?= Cc: linux-s390@vger.kernel.org, qemu-devel@nongnu.org, kvm@vger.kernel.org, Gleb Natapov , linux-kernel@vger.kernel.org, Alexander Graf , Christian Borntraeger , "Jason J. Herne" , Cornelia Huck , Paolo Bonzini , Richard Henderson On Fri, 20 Feb 2015 16:41:49 +0100 Andreas F=C3=A4rber wrote: > Can't you just implement the class-level name-to-ObjectClass callback > that other CPUs have grown for the above use case? If it fulfills the requirements sure. Please point me to an example, sounds= that s390_select_cpu_model() is doing something similar to that, just that it ho= oks in the s390_set_processor_props() call. const char *s390_select_cpu_model(const char *model) { S390ProcessorProps proc; const char *typename; S390CPUClass *cc; /* return already selected cpu typename */ typename =3D s390_cpu_typename(); if (typename) { goto out; } /* return standard cpu typename when cpu models are unavailable */ typename =3D TYPE_S390_CPU; if (!s390_cpu_classes_initialized() || !model) { goto out; } cc =3D S390_CPU_CLASS(s390_cpu_class_by_name(model)); if (!cc) { goto out; } proc.cpuid =3D cpuid(cc->proc); proc.ibc =3D cc->proc->ibc; memcpy(proc.fac_list, cc->fac_list, S390_ARCH_FAC_LIST_SIZE_BYTE); if (s390_set_processor_props(&proc)) { goto out; } /* return requested cpu typename in success case */ typename =3D object_class_get_name((ObjectClass *) cc); out: selected_cpu_typename =3D typename; trace_select_cpu_model(model, typename); return typename; } >=20 > Also a general comment: cpu-model/ is not an existing directory nor one > you add, so please use "target-s390x: Add foo to S390CPU" or so.