Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4EA7CC00140 for ; Fri, 5 Aug 2022 19:18:17 +0000 (UTC) Received: from localhost ([::1]:55498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK2ps-0006rk-BH for qemu-devel@archiver.kernel.org; Fri, 05 Aug 2022 15:18:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK2ms-0005UQ-Q2; Fri, 05 Aug 2022 15:15:11 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:38316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK2mq-0007FP-4l; Fri, 05 Aug 2022 15:15:10 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id A944574635D; Fri, 5 Aug 2022 21:15:03 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 7307B746335; Fri, 5 Aug 2022 21:15:03 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 707B9745702; Fri, 5 Aug 2022 21:15:03 +0200 (CEST) Date: Fri, 5 Aug 2022 21:15:03 +0200 (CEST) From: BALATON Zoltan To: Peter Maydell cc: =?ISO-8859-15?Q?C=E9dric_Le_Goater?= , Daniel Henrique Barboza , "list@suse.de:PowerPC" , QEMU Developers Subject: Re: [PATCH v2 12/20] ppc/ppc405: QOM'ify EBC In-Reply-To: <27b7eacd-6946-9eb5-5320-7a404de75a7@eik.bme.hu> Message-ID: <94f9440-21de-7ffe-c256-a391a993d295@eik.bme.hu> References: <20220803132844.2370514-1-clg@kaod.org> <20220803132844.2370514-13-clg@kaod.org> <973576c1-deb8-3973-34e7-d038ca2200c2@gmail.com> <4885e6d0-8fff-4712-d032-c5afcac79ff7@kaod.org> <7b97e54b-4d80-6db9-af33-40a539827ddd@eik.bme.hu> <3b1bc6c5-a363-0a42-f0dc-eafc14376fe2@kaod.org> <1e6be2f3-4c7a-2432-5034-fa012c662df@eik.bme.hu> <7ecefd72-b799-8a8c-51fd-28730a12ebf1@kaod.org> <18dcac8a-d5e8-b6e-b9b-838cb1badb7@eik.bme.hu> <743ea55a-915e-5991-5d7c-ef00ee307ee9@kaod.org> <27b7eacd-6946-9eb5-5320-7a404de75a7@eik.bme.hu> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 5 Aug 2022, BALATON Zoltan wrote: > On Fri, 5 Aug 2022, Peter Maydell wrote: >> On Fri, 5 Aug 2022 at 17:50, BALATON Zoltan wrote: >>> This also >>> allows to get the cpu without a link with something like: >>> >>> PPC4XX_MACHINE(current_machine /* or qdev_get_machine() */)->soc.cpu >> >> ...and now you have device code that's making assumptions about >> the machine and SoC it's in. > > Since these devices are strictly part of this SoC making this asumption > should be OK. Making assumption about the machine may be a valid argument > although this series already makes that asumption for 405 machines by > introducing the machine state class. We need a way to share these device > models between 4xx mahines so I think some assumptions will proabbly be > needed. By the way the assumption that we have a machine with a soc object is only there because there seems to be no way to get from an object to its parent which is strange. The soc would simply be OBJECT(dev)->parent as these devices have to be in the soc beacuse they are part of that model but those Object fields are marked private (some places so access it nevertheless).but there's no function to get them. MemoryRegion has its own version. Why do we have these objects in a tree if there's no way to navigate it? Regards, BALATON Zoltan