From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6i1r-0004LF-Aw for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:14:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6i1i-0000jb-Fd for qemu-devel@nongnu.org; Tue, 06 Aug 2013 10:14:27 -0400 Message-ID: <520104B5.8020600@suse.de> Date: Tue, 06 Aug 2013 16:14:13 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1374043057-27208-1-git-send-email-aik@ozlabs.ru> <1374043057-27208-5-git-send-email-aik@ozlabs.ru> <51F96B13.1060201@suse.de> <51F9A855.9000702@ozlabs.ru> <51F9BA0E.6050003@suse.de> <51F9C31C.9060802@ozlabs.ru> <51F9D0DA.40304@suse.de> <51F9D475.9060907@ozlabs.ru> In-Reply-To: <51F9D475.9060907@ozlabs.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/4] xics: Support for in-kernel XICS interrupt controller List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexey Kardashevskiy Cc: Peter Maydell , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf , Paul Mackerras , qemu-ppc@nongnu.org, David Gibson Am 01.08.2013 05:22, schrieb Alexey Kardashevskiy: > On 08/01/2013 01:07 PM, Andreas F=C3=A4rber wrote: >> Am 01.08.2013 04:08, schrieb Alexey Kardashevskiy: >>> On 08/01/2013 11:29 AM, Andreas F=C3=A4rber wrote: >>>> Am 01.08.2013 02:14, schrieb Alexey Kardashevskiy: >>>>> On 08/01/2013 05:52 AM, Andreas F=C3=A4rber wrote: >>>>>> Am 17.07.2013 08:37, schrieb Alexey Kardashevskiy: >>>>>>> +/* >>>>>>> + * XICS-KVM >>>>>>> + */ >>>>>>> +static void xics_kvm_cpu_setup(XICSState *icp, PowerPCCPU *cpu) >>>>>>> +{ >>>>>>> + CPUState *cs; >>>>>>> + ICPState *ss; >>>>>>> + XICSStateKVM *icpkvm =3D (XICSStateKVM *) object_dynamic_cas= t( >>>>>>> + OBJECT(icp), TYPE_XICS_KVM); >>>>>>> + XICSStateClass *xics_info =3D XICS_CLASS(object_class_by_nam= e(TYPE_XICS)); >>>>>> >>>>>> Are you intentionally accessing that class by name rather than usi= ng >>>>>> XICS_GET_CLASS(icp), which allows the KVM variant to overwrite thi= ngs? >>>>> >>>>> >>>>> This is KVM's CPU_setup(). I want to call non-KVM CPU_setup afterwa= rds, >>>>> i.e. "call parent method". XICS_GET_CLASS will return XICS_KVM clas= s but >>>>> not XICS, no? >>>> >>>> OK, then I'll CC you on my upcoming virtio v2 series that introduces= a >>>> more comprehensable macro for this purpose: I would/will recommend t= o >>>> use a local macro KVM_XICS_GET_PARENT_CLASS(obj) - where you could m= ove >>>> your current inline implementation - to make more obvious that it's = not >>>> a mistake. >>> >>> Oh. So. This has to wait till that virtio thing gets to upstream. Cor= rect? >> >> Not quite, there is no dependency on virtio. >> >> a) You could do >> #define KVM_XICS_GET_PARENT_CLASS(obj) \ >> object_class_by_name(TYPE_KVM_XICS) >=20 > TYPE_KVM_XICS or TYPE_XICS? Sorry for late reply: When using object_class_by_name() directly, then TYPE_XICS (or now TYPE_COMMON_XICS); when using object_get_parent() or the wrapping OBJECT_GET_PARENT_CLASS() then TYPE_KVM_XICS, i.e. the QOM type to which the C function belongs. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg