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 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 3E7FDEB64D7 for ; Fri, 30 Jun 2023 14:07:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFEls-00047t-5E; Fri, 30 Jun 2023 10:06:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFElq-00047a-Ca; Fri, 30 Jun 2023 10:06:46 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qFElo-00070p-Nq; Fri, 30 Jun 2023 10:06:46 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-6b5d7e60015so1590552a34.0; Fri, 30 Jun 2023 07:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688134003; x=1690726003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=j9IR4FIVUbAv+x8yfcnJjVElayhZLnA0Y9DaA2XuSX8=; b=m2zg4DDXilmM+V9jm8lzd/ncoAbMWPPCHrerUtMptn5iTh4Smci08XG7uluUw6oTmW kGB3iHVE6h1iJIChk95u0I1Eb28hfbkI2zFjRMPJ7XljMY4cqlACaset8IfIgOKh2+XT 78LuEWlcRlY4mORC/6Vkx0ivaId5PbN3vindW96Qp3XsItMPOZbjBsgf/vkh88rOWWEP wkx/dwCG+yJt0BV4HnH/MLiEIdXaPGizIIOsPwZSCnait25lMOS8Q4IcfLQJScEkJw2v MGK0jYxp7c8BiDjVsbUUwGrUuTdB7hodi0UTGsr4YTG8uCJJZmSL3HKHQ3QcJ9W6nqph PsBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688134003; x=1690726003; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j9IR4FIVUbAv+x8yfcnJjVElayhZLnA0Y9DaA2XuSX8=; b=YOcrXuINFbHAHcmQALwgEZiE77jCww+5RjJ9kHFSp2CPG+qxj9lpzjhrvohGZ5Xmty 9aLmmYSvxNkreMtuDDskGE3/+TIVaPzEUEaL4c8InqKwvHD/+NeFKx1lb6GQAE1+++rL WEnzbV+H/oa4PlqfM79te26QuFcbOBm8K0UXNom1kMGPI3y7U+qXMNoWzENrqxp0uAPw uxGPCsseFG1YOOkcK8+fI5+Cm4wBAryqQvI3bnwrbEPgZLTxgJvhNZsvOXiHyygUhpc/ l5jggaeJQo7evCi13hUqjKl3ORRiJXVoMty5xPJnivHy31bLIkyTZpT9tVVsKypBeQHZ RTXg== X-Gm-Message-State: AC+VfDzSlQwjwJPs7+ZO56djBHvx9BLz6ur0j6zUFvMRcd41FnWaUWve 0yRzomWoCEiuu0Ngk58YTHk= X-Google-Smtp-Source: ACHHUZ5otIPUORl1HFPr4bENxruL3BKBpdJEsf8c5fp9mYGeqKNtR22Y1X5M7uapsmfFx33MCjeFBg== X-Received: by 2002:a05:6830:1be6:b0:6b7:38c0:7420 with SMTP id k6-20020a0568301be600b006b738c07420mr3110506otb.9.1688134002500; Fri, 30 Jun 2023 07:06:42 -0700 (PDT) Received: from [192.168.68.107] (201-69-66-110.dial-up.telesp.net.br. [201.69.66.110]) by smtp.gmail.com with ESMTPSA id y1-20020a056830108100b006b71d22be29sm1061386oto.18.2023.06.30.07.06.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jun 2023 07:06:42 -0700 (PDT) Message-ID: Date: Fri, 30 Jun 2023 11:06:38 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v3 3/6] target/ppc: Move CPU QOM definitions to cpu-qom.h Content-Language: en-US To: Greg Kurz , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Cc: qemu-devel@nongnu.org, David Gibson , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , qemu-ppc@nongnu.org, Paolo Bonzini , kvm@vger.kernel.org, Nicholas Piggin References: <20230627115124.19632-1-philmd@linaro.org> <20230627115124.19632-4-philmd@linaro.org> <20230628170531.09d2e648@bahia> From: Daniel Henrique Barboza In-Reply-To: <20230628170531.09d2e648@bahia> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=danielhb413@gmail.com; helo=mail-ot1-x330.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.095, RCVD_IN_DNSWL_NONE=-0.0001, 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-bounces+qemu-devel=archiver.kernel.org@nongnu.org Phil, On 6/28/23 12:05, Greg Kurz wrote: > On Tue, 27 Jun 2023 13:51:21 +0200 > Philippe Mathieu-Daudé wrote: > >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> target/ppc/cpu-qom.h | 5 +++++ >> target/ppc/cpu.h | 6 ------ >> 2 files changed, 5 insertions(+), 6 deletions(-) >> >> diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h >> index 9666f54f65..c2bff349cc 100644 >> --- a/target/ppc/cpu-qom.h >> +++ b/target/ppc/cpu-qom.h >> @@ -31,6 +31,11 @@ >> >> OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) >> >> +#define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU >> +#define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX >> +#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU >> +#define cpu_list ppc_cpu_list >> + >> ObjectClass *ppc_cpu_class_by_name(const char *name); >> >> typedef struct CPUArchState CPUPPCState; >> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h >> index af12c93ebc..e91e1774e5 100644 >> --- a/target/ppc/cpu.h >> +++ b/target/ppc/cpu.h >> @@ -1468,12 +1468,6 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn) >> int ppc_dcr_read(ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp); >> int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val); >> >> -#define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU >> -#define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX >> -#define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU >> - > > These seem appropriate to be moved to "cpu-qom.h". > >> -#define cpu_list ppc_cpu_list > > This one is much older according to git blame : > > c913706581460 target/ppc/cpu.h (Igor Mammedov 2017-08-30 1469) #define POWERPC_CPU_TYPE_SUFFIX "-" TYPE_POWERPC_CPU > c913706581460 target/ppc/cpu.h (Igor Mammedov 2017-08-30 1470) #define POWERPC_CPU_TYPE_NAME(model) model POWERPC_CPU_TYPE_SUFFIX > 0dacec874fa3b target/ppc/cpu.h (Igor Mammedov 2018-02-07 1471) #define CPU_RESOLVING_TYPE TYPE_POWERPC_CPU > c913706581460 target/ppc/cpu.h (Igor Mammedov 2017-08-30 1472) > c732abe222795 target-ppc/cpu.h (Jocelyn Mayer 2007-10-12 1473) #define cpu_list ppc_cpu_list > > It is some plumbing used for `-cpu help`, not exactly QOM stuff. > Maybe keep it in "cpu.h" as all other targets do ? Greg has a point: $ git grep '#define cpu_list' target/alpha/cpu.h:#define cpu_list alpha_cpu_list target/arm/cpu.h:#define cpu_list arm_cpu_list target/avr/cpu.h:#define cpu_list avr_cpu_list target/cris/cpu.h:#define cpu_list cris_cpu_list target/hexagon/cpu.h:#define cpu_list hexagon_cpu_list target/i386/cpu.h:#define cpu_list x86_cpu_list target/loongarch/cpu.h:#define cpu_list loongarch_cpu_list target/m68k/cpu.h:#define cpu_list m68k_cpu_list target/mips/cpu.h:#define cpu_list mips_cpu_list target/openrisc/cpu.h:#define cpu_list cpu_openrisc_list target/ppc/cpu.h:#define cpu_list ppc_cpu_list target/riscv/cpu.h:#define cpu_list riscv_cpu_list target/rx/cpu.h:#define cpu_list rx_cpu_list target/s390x/cpu.h:#define cpu_list s390_cpu_list target/sh4/cpu.h:#define cpu_list sh4_cpu_list target/sparc/cpu.h:#define cpu_list sparc_cpu_list target/tricore/cpu.h:#define cpu_list tricore_cpu_list target/xtensa/cpu.h:#define cpu_list xtensa_cpu_list I'm not against moving this define to cpu-qom.h per se but I believe that, for the sake of consistency, this change should be done in a single swoop across all archs. For now, if you agree with keeping the 'cpu_list' define in cpu.h, I'll queue this up and amend it in-tree. Thanks, Daniel > >> - >> /* MMU modes definitions */ >> #define MMU_USER_IDX 0 >> static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch) > > >