From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.9 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFA8CC433F5 for ; Fri, 3 Sep 2021 21:03:49 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8540A60EE3 for ; Fri, 3 Sep 2021 21:03:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8540A60EE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:32768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMGLk-0001Bu-Jk for qemu-devel@archiver.kernel.org; Fri, 03 Sep 2021 17:03:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMG0r-0007Dt-Vt for qemu-devel@nongnu.org; Fri, 03 Sep 2021 16:42:17 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39528) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMG0p-0001nV-0X for qemu-devel@nongnu.org; Fri, 03 Sep 2021 16:42:13 -0400 Received: by mail-wm1-x32d.google.com with SMTP id u26-20020a05600c441a00b002f66b2d8603so338099wmn.4 for ; Fri, 03 Sep 2021 13:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KO1an/5CmjrwEhdc2mhCZ+S9p7TgIYwX9ZNZ9M9TFAE=; b=cu2bS4up1KUaZFvfqZzOd2qoAgEXmB9czyJg7Ld9C9RhrRFPlF7SwFqEwPUxttKJHP I1xS+ex3bHbMetfNUUCLVWvrfESiUFlOEywVjEsNBviabapOnUNOdhvyN9zKTl2NKPkI oFLzpz1YOXk4f6pHR/sY67Y1o2wn+XVbP1qwIi2sdi5BDgf0tM7J6FGdCmto3LcLIaIX PKJGhIKO37mpf5Ce+QN4EnowFcFFR+4AUTl4t3FVeWIkVZSObVUv39QZ23RCI1PJPmoc scHBKkHA2wztn0q+7QOHwGhnRETaGgrejgdp9/upgRUBCHz7lFrOigJB0pB0zh/LJOTn XY+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KO1an/5CmjrwEhdc2mhCZ+S9p7TgIYwX9ZNZ9M9TFAE=; b=DRXskdw3Vh39SpGP1ta464jxh5kaD9rJLzGnGV/VEuHCIr0/5FTwVVM28hU05vd3Q/ z5ctbhZQRq7EitPf6/G/5cD1j6HNqZOPSOSdXIzcrty55+oJhYt+KrLYNDK+WzqgErSj iqHJXKHlLi/4C3pW9UBG5yo/aVoUEED7FPgNpx0l201YbrDe7YbpogKx0r5NjM5a6H2P jewcVotmbhRFCbBAWyxcSqh8G8vepL6veO2oMeXu4SXDDcwXH9pve76WKY/p1u2Rp+a3 mc2cdUfLyi6EbCtkRfGxzv4mI0O5dHyYiex4/RuOZ7IeUYaKVhe+uOM8C9TKYpRlq2Jx cvoA== X-Gm-Message-State: AOAM532DRwblfCSd/WLmL1Jk5vBDxVvmrz2nlZN/5rdLBgQTlMXy5eVa HC4fidTg1rYQDDeAqqJ+qCPZQg== X-Google-Smtp-Source: ABdhPJwceVbbv7hWOXS37awGetSIGUJik1eFEfP7Dd+3VwgeGBrwgNpP3UDG2KidWTsBePHMk6Y+ng== X-Received: by 2002:a05:600c:a08:: with SMTP id z8mr522391wmp.165.1630701729599; Fri, 03 Sep 2021 13:42:09 -0700 (PDT) Received: from [192.168.8.107] (190.red-2-142-216.dynamicip.rima-tde.net. [2.142.216.190]) by smtp.gmail.com with ESMTPSA id y15sm462739wmi.18.2021.09.03.13.42.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Sep 2021 13:42:09 -0700 (PDT) Subject: Re: [PATCH v3 21/30] target/ppc: Introduce PowerPCCPUClass::has_work() To: David Gibson , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= References: <20210902161543.417092-1-f4bug@amsat.org> <20210902161543.417092-22-f4bug@amsat.org> From: Richard Henderson Message-ID: Date: Fri, 3 Sep 2021 22:42:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.888, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Cornelia Huck , kvm@vger.kernel.org, David Hildenbrand , Bin Meng , Mark Cave-Ayland , qemu-devel@nongnu.org, Laurent Vivier , Max Filippov , Taylor Simpson , haxm-team@intel.com, Colin Xu , "Edgar E. Iglesias" , Stafford Horne , Marek Vasut , Stefano Stabellini , Yoshinori Sato , Paul Durrant , Kamil Rytarowski , Reinoud Zandijk , Claudio Fontana , Anthony Perard , xen-devel@lists.xenproject.org, Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Greg Kurz , Cameron Esfahani , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Michael Rolnik , Sunil Muthuswamy , Palmer Dabbelt , qemu-riscv@nongnu.org, Bastian Koppelmann , Chris Wulff , Roman Bolshakov , qemu-ppc@nongnu.org, Wenchao Wang , Alistair Francis , Paolo Bonzini , Aleksandar Rikalo , Aurelien Jarno Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/3/21 2:50 AM, David Gibson wrote: > On Thu, Sep 02, 2021 at 06:15:34PM +0200, Philippe Mathieu-Daudé wrote: >> Each POWER cpu has its own has_work() implementation. Instead of >> overloading CPUClass on each PowerPCCPUClass init, register the >> generic ppc_cpu_has_work() handler, and have it call the POWER >> specific has_work(). > > I don't quite see the rationale for introducing a second layer of > indirection here. What's wrong with switching the base has_work for > each cpu variant? We're moving the hook from CPUState to TCGCPUOps. Phil was trying to avoid creating N versions of static const struct TCGCPUOps ppc_tcg_ops = { ... }; A plausible alternative is to remove the const from this struct and modify it, just as we do for CPUState, on the assumption that we cannot mix and match ppc cpu types in any one machine. r~