From patchwork Fri Oct 13 12:56:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733196 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448303wrv; Fri, 13 Oct 2023 05:57:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVfYTnBB6Y+zoR61jfrx+bxZHfFm5RX4J6LBMAZeNfwQcszDLXiLClA4LNoZsE5JQ/iBMK X-Received: by 2002:a05:622a:453:b0:412:6e6:b45b with SMTP id o19-20020a05622a045300b0041206e6b45bmr33127965qtx.38.1697201829504; Fri, 13 Oct 2023 05:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201829; cv=none; d=google.com; s=arc-20160816; b=WSn6zzx4E7sWFoXDBQwQAZ85bVUJWxwgiJVJP4dUzEvBipaP1WRiLzbTqLCq0f3TPU llc1Wt+jdnMEUNEdpyfQjiuQo9o9uOk3PX9eH06HhvH2PsIUQw/RyYyYEofGUZgPYgI9 G+RrojMLYNxlKi6E9PZafbUS82x0+O8SSBk5MBJhPcxQf8Fo5ETZcZih+6wUWg4z0Cix TUpvhj4n8SKeCTQz8bLdAuEcQGW6ZFrUZCHS6Mzipr9pkqfM1++YCdMbMRC+TLdY8uHf 6LTlu1gr7nTo//++iNa1oUlDnyg7voziPpsIOyxs1ICAbXR/o1EIW5aSwpfr5jBI0pgH WArQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aJG9hKwu+wpRvVwz3i5zPTfZu546zhwzoj0NQVluILM=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=cXemx2Ym+iFij2/YpgfONh2WEFqY8pNEpuMgQCxbwNU9Qgp3MXsg0oJMkAUvMtIpWO x2uocfJow2LKa9hiQ4XWsPvbjxrS3uFlvAFF99jtY3Qsx69GGxi99do13GCxWsPdtQD3 YIAyvKNR9wc2cIHqXppy2+viMWxpxsU3q6SbMRXwCv8vjvbAMWJwC1qP0Sh+Kk830ehI Q2Rsjdn9cR6ctFAakyc4NnfjPO1LJzZkaJbsVHKQgFoXPYbT1SGCTFeFLdtKv2Ia1URd OziBxxd3vIKG7Bi8c4o5L/FO2RTpJE/5BjlRyzWxWw0mzCDL6vB+wkl/ufvSVy8zN2fH 2PnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kgzeKRoZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c1-20020ac87dc1000000b004199342839dsi1126649qte.234.2023.10.13.05.57.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:57:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kgzeKRoZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHih-00035E-I5; Fri, 13 Oct 2023 08:56:47 -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 1qrHie-0002rq-Hl for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:56:44 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHic-0002YQ-AH for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:56:44 -0400 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-53dd752685fso3686898a12.3 for ; Fri, 13 Oct 2023 05:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201800; x=1697806600; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aJG9hKwu+wpRvVwz3i5zPTfZu546zhwzoj0NQVluILM=; b=kgzeKRoZ1mvc42qI+U/KAu1/G1eNQwordEIAeW3ChGXYDGAZXGo0akFh6Iu4HTHz8g XYYHtdT4HHhaOYrmRjIMVSNWvT2717cJqi5iyKONvym2pHPkaqUly7YquVZN04Mfpklh LB+JgxzZYviZ/OyouOUcTKRbXowZXXqhQA3tl390p897OTbBhmIY08KBbF8DM5CPEwJT ZXeQhvRcyA/cXE1BzUfm1vVkbB2IvRLHhb2mWQ3yogvQbefeZXFfCkO2QXfFDBAAPB2f MOheE6A07XtDcoPEKLww7i2mxQWpGLEh/dMZ0ZnHsUVGR0UV1xXDcdcDq+AipJDtk8Dy ZD7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201800; x=1697806600; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aJG9hKwu+wpRvVwz3i5zPTfZu546zhwzoj0NQVluILM=; b=T2PwJowxjYvmwlUpoaoPn4OEg/BYhKn85bp6g0Rp0K8SkdLaslOX8q7WRP7bL6XWbQ Kn/naV4/rkmod3u4MWw4u9N8M+0GtcBjobVlPwBj55dTeENLqXQJbsz4vKVyLkXDI3qN 37zxsndVhDDiPmH0DsTSG0Hs0ImWCDi5P7pD6oGaEN/n/0njGpYZKdT4602e8ElcdyQU lI2tdEqrc1pEQkSoqKl8JLjGRyrU/BeoGVGiYbH/Gpx1B1ryxIFZ8D69yt3Qq6UgvHT4 CVUGMmSusL8AYN2YQQKOLhFsEZMy80/de81oAA1GZAUvcjvokmbCj/ZMZQ4HTZRtRA6p iXxw== X-Gm-Message-State: AOJu0YwtwDTHtLm2x/57cOSKqz4t/h6ABT2ratcyk9p+hF0VxOF97yYQ 9GTQNBYv4OpjFPm0w6UMiSz5rrho8QNSLsEEK48= X-Received: by 2002:a05:6402:150d:b0:523:bfec:4915 with SMTP id f13-20020a056402150d00b00523bfec4915mr25184247edw.0.1697201800089; Fri, 13 Oct 2023 05:56:40 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id da6-20020a056402176600b0053dfd3519f4sm2439193edb.22.2023.10.13.05.56.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:56:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 1/7] hw/ppc/spapr: Restrict PPCTimebase structure declaration to sPAPR Date: Fri, 13 Oct 2023 14:56:24 +0200 Message-ID: <20231013125630.95116-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=philmd@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The PPCTimebase structure is only used by the sPAPR machine. Move its declaration to "hw/ppc/spapr.h". Move vmstate_ppc_timebase and the VMSTATE_PPC_TIMEBASE_V() macro to hw/ppc/spapr.c, along with the timebase_foo() migration helpers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- include/hw/ppc/spapr.h | 6 +++ target/ppc/cpu-qom.h | 22 -------- hw/ppc/ppc.c | 107 ------------------------------------- hw/ppc/spapr.c | 116 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 122 insertions(+), 129 deletions(-) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index e91791a1a9..3cf9978cba 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -163,6 +163,12 @@ struct SpaprMachineClass { SpaprIrq *irq; }; +typedef struct PPCTimebase { + uint64_t guest_timebase; + int64_t time_of_the_day_ns; + bool runstate_paused; +} PPCTimebase; + #define WDT_MAX_WATCHDOGS 4 /* Maximum number of watchdog devices */ #define TYPE_SPAPR_WDT "spapr-wdt" diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index be33786bd8..b5deef5ca5 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -197,26 +197,4 @@ struct PowerPCCPUClass { int (*check_pow)(CPUPPCState *env); }; -#ifndef CONFIG_USER_ONLY -typedef struct PPCTimebase { - uint64_t guest_timebase; - int64_t time_of_the_day_ns; - bool runstate_paused; -} PPCTimebase; - -extern const VMStateDescription vmstate_ppc_timebase; - -#define VMSTATE_PPC_TIMEBASE_V(_field, _state, _version) { \ - .name = (stringify(_field)), \ - .version_id = (_version), \ - .size = sizeof(PPCTimebase), \ - .vmsd = &vmstate_ppc_timebase, \ - .flags = VMS_STRUCT, \ - .offset = vmstate_offset_value(_state, _field, PPCTimebase), \ -} - -void cpu_ppc_clock_vm_state_change(void *opaque, bool running, - RunState state); -#endif - #endif diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index be167710a3..340cd6192f 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -32,7 +32,6 @@ #include "qemu/main-loop.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" -#include "sysemu/replay.h" #include "sysemu/runstate.h" #include "kvm_ppc.h" #include "migration/vmstate.h" @@ -967,112 +966,6 @@ void cpu_ppc_store_purr(CPUPPCState *env, uint64_t value) _cpu_ppc_store_purr(env, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), value); } -static void timebase_save(PPCTimebase *tb) -{ - uint64_t ticks = cpu_get_host_ticks(); - PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu); - - if (!first_ppc_cpu->env.tb_env) { - error_report("No timebase object"); - return; - } - - if (replay_mode == REPLAY_MODE_NONE) { - /* not used anymore, we keep it for compatibility */ - tb->time_of_the_day_ns = qemu_clock_get_ns(QEMU_CLOCK_HOST); - } else { - /* simpler for record-replay to avoid this event, compat not needed */ - tb->time_of_the_day_ns = 0; - } - - /* - * tb_offset is only expected to be changed by QEMU so - * there is no need to update it from KVM here - */ - tb->guest_timebase = ticks + first_ppc_cpu->env.tb_env->tb_offset; - - tb->runstate_paused = - runstate_check(RUN_STATE_PAUSED) || runstate_check(RUN_STATE_SAVE_VM); -} - -static void timebase_load(PPCTimebase *tb) -{ - CPUState *cpu; - PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu); - int64_t tb_off_adj, tb_off; - unsigned long freq; - - if (!first_ppc_cpu->env.tb_env) { - error_report("No timebase object"); - return; - } - - freq = first_ppc_cpu->env.tb_env->tb_freq; - - tb_off_adj = tb->guest_timebase - cpu_get_host_ticks(); - - tb_off = first_ppc_cpu->env.tb_env->tb_offset; - trace_ppc_tb_adjust(tb_off, tb_off_adj, tb_off_adj - tb_off, - (tb_off_adj - tb_off) / freq); - - /* Set new offset to all CPUs */ - CPU_FOREACH(cpu) { - PowerPCCPU *pcpu = POWERPC_CPU(cpu); - pcpu->env.tb_env->tb_offset = tb_off_adj; - kvmppc_set_reg_tb_offset(pcpu, pcpu->env.tb_env->tb_offset); - } -} - -void cpu_ppc_clock_vm_state_change(void *opaque, bool running, - RunState state) -{ - PPCTimebase *tb = opaque; - - if (running) { - timebase_load(tb); - } else { - timebase_save(tb); - } -} - -/* - * When migrating a running guest, read the clock just - * before migration, so that the guest clock counts - * during the events between: - * - * * vm_stop() - * * - * * pre_save() - * - * This reduces clock difference on migration from 5s - * to 0.1s (when max_downtime == 5s), because sending the - * final pages of memory (which happens between vm_stop() - * and pre_save()) takes max_downtime. - */ -static int timebase_pre_save(void *opaque) -{ - PPCTimebase *tb = opaque; - - /* guest_timebase won't be overridden in case of paused guest or savevm */ - if (!tb->runstate_paused) { - timebase_save(tb); - } - - return 0; -} - -const VMStateDescription vmstate_ppc_timebase = { - .name = "timebase", - .version_id = 1, - .minimum_version_id = 1, - .pre_save = timebase_pre_save, - .fields = (VMStateField []) { - VMSTATE_UINT64(guest_timebase, PPCTimebase), - VMSTATE_INT64(time_of_the_day_ns, PPCTimebase), - VMSTATE_END_OF_LIST() - }, -}; - /* Set up (once) timebase frequency (in Hz) */ void cpu_ppc_tb_init(CPUPPCState *env, uint32_t freq) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index cb840676d3..fe8b425ffd 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -37,6 +37,7 @@ #include "sysemu/numa.h" #include "sysemu/qtest.h" #include "sysemu/reset.h" +#include "sysemu/replay.h" #include "sysemu/runstate.h" #include "qemu/log.h" #include "hw/fw-path-provider.h" @@ -1809,6 +1810,100 @@ static bool spapr_vga_init(PCIBus *pci_bus, Error **errp) } } +static void timebase_save(PPCTimebase *tb) +{ + uint64_t ticks = cpu_get_host_ticks(); + PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu); + + if (!first_ppc_cpu->env.tb_env) { + error_report("No timebase object"); + return; + } + + if (replay_mode == REPLAY_MODE_NONE) { + /* not used anymore, we keep it for compatibility */ + tb->time_of_the_day_ns = qemu_clock_get_ns(QEMU_CLOCK_HOST); + } else { + /* simpler for record-replay to avoid this event, compat not needed */ + tb->time_of_the_day_ns = 0; + } + + /* + * tb_offset is only expected to be changed by QEMU so + * there is no need to update it from KVM here + */ + tb->guest_timebase = ticks + first_ppc_cpu->env.tb_env->tb_offset; + + tb->runstate_paused = + runstate_check(RUN_STATE_PAUSED) || runstate_check(RUN_STATE_SAVE_VM); +} + +static void timebase_load(PPCTimebase *tb) +{ + CPUState *cpu; + PowerPCCPU *first_ppc_cpu = POWERPC_CPU(first_cpu); + int64_t tb_off_adj, tb_off; + unsigned long freq; + + if (!first_ppc_cpu->env.tb_env) { + error_report("No timebase object"); + return; + } + + freq = first_ppc_cpu->env.tb_env->tb_freq; + + tb_off_adj = tb->guest_timebase - cpu_get_host_ticks(); + + tb_off = first_ppc_cpu->env.tb_env->tb_offset; + trace_ppc_tb_adjust(tb_off, tb_off_adj, tb_off_adj - tb_off, + (tb_off_adj - tb_off) / freq); + + /* Set new offset to all CPUs */ + CPU_FOREACH(cpu) { + PowerPCCPU *pcpu = POWERPC_CPU(cpu); + pcpu->env.tb_env->tb_offset = tb_off_adj; + kvmppc_set_reg_tb_offset(pcpu, pcpu->env.tb_env->tb_offset); + } +} + +static void cpu_ppc_clock_vm_state_change(void *opaque, bool running, + RunState state) +{ + PPCTimebase *tb = opaque; + + if (running) { + timebase_load(tb); + } else { + timebase_save(tb); + } +} + +/* + * When migrating a running guest, read the clock just + * before migration, so that the guest clock counts + * during the events between: + * + * * vm_stop() + * * + * * pre_save() + * + * This reduces clock difference on migration from 5s + * to 0.1s (when max_downtime == 5s), because sending the + * final pages of memory (which happens between vm_stop() + * and pre_save()) takes max_downtime. + */ +static int timebase_pre_save(void *opaque) +{ + PPCTimebase *tb = opaque; + + /* guest_timebase won't be overridden in case of paused guest or savevm */ + if (!tb->runstate_paused) { + timebase_save(tb); + } + + return 0; +} + static int spapr_pre_load(void *opaque) { int rc; @@ -2081,6 +2176,27 @@ static const VMStateDescription vmstate_spapr_fwnmi = { }, }; +static const VMStateDescription vmstate_spapr_timebase = { + .name = "timebase", + .version_id = 1, + .minimum_version_id = 1, + .pre_save = timebase_pre_save, + .fields = (VMStateField []) { + VMSTATE_UINT64(guest_timebase, PPCTimebase), + VMSTATE_INT64(time_of_the_day_ns, PPCTimebase), + VMSTATE_END_OF_LIST() + }, +}; + +#define VMSTATE_PPC_TIMEBASE_V(_field, _state, _version) { \ + .name = (stringify(_field)), \ + .version_id = (_version), \ + .size = sizeof(PPCTimebase), \ + .vmsd = &vmstate_spapr_timebase, \ + .flags = VMS_STRUCT, \ + .offset = vmstate_offset_value(_state, _field, PPCTimebase), \ +} + static const VMStateDescription vmstate_spapr = { .name = "spapr", .version_id = 3, From patchwork Fri Oct 13 12:56:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733201 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448676wrv; Fri, 13 Oct 2023 05:58:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHg/oH5axfYRZqmEVenWgfUs4+k9bMYi8f7IpSy9RDVWkb4oOhEDqRqwn9Qbgt+XbzZ3+L X-Received: by 2002:a05:622a:105:b0:418:14ee:ac55 with SMTP id u5-20020a05622a010500b0041814eeac55mr26064033qtw.25.1697201885128; Fri, 13 Oct 2023 05:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201885; cv=none; d=google.com; s=arc-20160816; b=Texab6FoCLaUsYOwdfJssWb3YJb/yjpgcGy7d/VyvBDHyWBZIBEKFeBDEk8pHpIx2H dajG0k9BOb1kcC4VksHuHr01fqhsNSjLx2bje0ugIH0MSp2B3y88ei9ztD4+zRnRWbsA pvEmL/fL7dV5r3/UeGzb7gYcdgJh2KfRfaElCq1mrg8SjpXm/fLt7kK5fQwQBnFdhL56 3whMQ8S7UafCd6F2Kjz2c0nqSx3Jn16yPgQnBnnr9XKzwvEtaJeo+XoLdxeVeYT117fS fXTCfUIJOl5aAYooBeWyuVEGWGoGGmpDnAV+fVgzoGInWKMHhiIYOHvuphrZKPcJBqur 5CAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UKmgf4fJPI4uE5NPSl+oCRC22RI7AomCq3WOdsU22V0=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=Dr0Fy3+AgPN8rAo1dublAzFQ79lIeuPybBUJ1s8T2zUVmqi1oXH9OfkiiKl0fs/ifj vnoIwbpQyEN7QFNbF7tecfeKL1HZi5Bg9AOtkPAUhooqD/CIIVAGGgdfrn3b1Svb8KsP P/PjV8xI+Fbx3iRGqM0Oe806JLz7GEiqbz9IXNop3MUHPSYsXJGE+I/xtYIqmtBJzXLm QHDk7bDeFr9P7/Z91CVCfRhomexukRl6E3UVAcjIeicVg7uKMJtiDq5tQddsMAWNEPGM pi0/KqPCrhci6KKbNQ+DrFvRPlA0RDct2kkt+B1wQav0vcx3b30LY4HALu/gfk+cTD0R U3OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tPRA2lcG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 14-20020ac8574e000000b00413150183dbsi1120655qtx.737.2023.10.13.05.58.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:58:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tPRA2lcG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHil-0003Md-Pl; Fri, 13 Oct 2023 08:56:52 -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 1qrHij-0003B4-JT for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:56:50 -0400 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHii-0002ZI-5A for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:56:49 -0400 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-9b96c3b4be4so314559466b.1 for ; Fri, 13 Oct 2023 05:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201806; x=1697806606; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UKmgf4fJPI4uE5NPSl+oCRC22RI7AomCq3WOdsU22V0=; b=tPRA2lcGPUZciHEhAjuia5nsna6na5q+CaKt8HajFiZvNR8UQIbjVCUPF5w5U5fEFO 8hMJMVxiYUm4qyLI8pCmhH9iGWBKDbpbSMn8fLFt/ag9ibjVbtQIAuSEqyBIsfkJZk0f OQpsa8u9yUx3lxbb1hVS2bFUJTaMs/rmMs2/VKsE091y7ep8QYQfgMhIpAfruAdLkIa4 xWoz2Af0XaxyBYIecUWp8VmZIJ9yfCu6jsX395/k/NL1KKefTgUcdCi+0GUbNhEvYLs7 2JR3K1DIr2e+YfJ7gn8pyrMKFthjPZXarWYuz7Tnp82ny26GJmypnkBwMPyvc559XLV6 /Pmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201806; x=1697806606; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UKmgf4fJPI4uE5NPSl+oCRC22RI7AomCq3WOdsU22V0=; b=cWiob/+IIsJja8cQq8FPNgU15N+s2wwo9/YuGe4rQHstFwjDdvCouTdfe3FJT/ns4G aNZS9K14jF2jU5wxmLTk6+TqjZj3imvzD/9rIRm0rD1vL4uOM90GSZ3A7QBrR49yw+15 dqqNibkAQByM3TGHUNIda71AIYUHa/tcI35ESYd2DkRedH1mSUa03h/knGuo1atRLuQN pQrsILuvt+gxVztIed4zXy/tyIR4ce9fHG40Zu5544QK+S1fEMw+kYGZbIUnIR5qNqEa YeepKA6tatG/mYltIH0cJVnqUOmjMfXB+RM35SN3GGFqizxDVXYWaXJ5dfZLBm9gNq/t YHCg== X-Gm-Message-State: AOJu0YxpwelxS00QNVaVmnCo8BtYziahnhTViCXpIWe6BJIKeHNl/A/P SDixiLZ/0jPehoqyGbhdLu0lO8hiuUTL3M7A6KQ= X-Received: by 2002:a17:907:1dd8:b0:9ba:3434:482b with SMTP id og24-20020a1709071dd800b009ba3434482bmr9424526ejc.26.1697201806373; Fri, 13 Oct 2023 05:56:46 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id k26-20020a17090627da00b0099b7276235esm12540897ejc.93.2023.10.13.05.56.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:56:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 2/7] target/ppc: Define powerpc_pm_insn_t in 'internal.h' Date: Fri, 13 Oct 2023 14:56:25 +0200 Message-ID: <20231013125630.95116-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=philmd@linaro.org; helo=mail-ej1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org PM instructions are only used by TCG helpers. No need to expose to other hardware. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 10 ---------- target/ppc/internal.h | 9 +++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index b5deef5ca5..b86fd46d25 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -115,16 +115,6 @@ enum powerpc_excp_t { POWERPC_EXCP_POWER10, }; -/*****************************************************************************/ -/* PM instructions */ -typedef enum { - PPC_PM_DOZE, - PPC_PM_NAP, - PPC_PM_SLEEP, - PPC_PM_RVWINKLE, - PPC_PM_STOP, -} powerpc_pm_insn_t; - /*****************************************************************************/ /* Input pins model */ typedef enum powerpc_input_t powerpc_input_t; diff --git a/target/ppc/internal.h b/target/ppc/internal.h index c881c67a8b..5b20ecbd33 100644 --- a/target/ppc/internal.h +++ b/target/ppc/internal.h @@ -20,6 +20,15 @@ #include "hw/registerfields.h" +/* PM instructions */ +typedef enum { + PPC_PM_DOZE, + PPC_PM_NAP, + PPC_PM_SLEEP, + PPC_PM_RVWINKLE, + PPC_PM_STOP, +} powerpc_pm_insn_t; + #define FUNC_MASK(name, ret_type, size, max_val) \ static inline ret_type name(uint##size##_t start, \ uint##size##_t end) \ From patchwork Fri Oct 13 12:56:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733198 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448490wrv; Fri, 13 Oct 2023 05:57:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtWevKtESVX6asc+WvKXfvtI/DV5YLTPBx3qZReaTyf6tM0WRQ8EhWxYo9POIF6w4S8Kp8 X-Received: by 2002:ac8:5e0d:0:b0:418:a364:c4ea with SMTP id h13-20020ac85e0d000000b00418a364c4eamr31379967qtx.30.1697201858359; Fri, 13 Oct 2023 05:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201858; cv=none; d=google.com; s=arc-20160816; b=B06PHriJ4WxVZpDzfAhv0Vayra3NzJhKshweD81RhhRhLr5/XSeKsCln2IryB7XXVg /OMaFb7c9xYxyCAxJCQPmCz/57fwl/eavpNXSypwF5tdXlowF/BFr2s0yWjxxvzU+rlq Xi3AkLrhT6U+EUMcn8eeRHSB7n3CRkeYEFOYSc6zMs/QZTuuU+D1yogn4kZQ58HEF0M7 X6Ta9qN84pv+yku9gdhhxvOxRxWNFWaoGHeRpqLe74VOZ/qYSUe+76mWo/iLyppYcjJO I31lI6vUBqpm57dXtpdaOzOK8Q4EeVDj5ec71IUqcWu+SF7HhZ3AGADhhr258K1nmqYa aKgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wIq+NNnPEjjdwEwMuihsIXkhuw1xh2LZ59h0H7TW924=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=qG9coTbxftf1SmZ3YdjDh4REqesDlYbphQbTJ8wbkX3vw3XHtkZul+EKLzm1fM9Ft3 5lye6h0vCVUCXWKJn6fdE9Fgm+qbDoSS0RtYJqKtj5Z57cN1jYof7cRN8VrFMqeiO28N tI6TIOqfda02sxrujhQshZ4h7baGMfdqKuqV9yOzkPJEzG6ERmHOSNnqD7OuLVXc12xr G6PjxBdqfigic/mtydAJURhBCa3tFZibUlxsO2GwWEDWQeqQAm+QsLnZO0BEsxp0dvQb 6tnsUlIP/evesebo3PLK87DCioZ6pY77zJiY24THmnVHmlQJxtsfhZcX4vZjs7Ih5fUP fUFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qpHZEqDD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h17-20020ac87d51000000b004199212c359si1154227qtb.72.2023.10.13.05.57.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qpHZEqDD; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHiv-0003sS-UC; Fri, 13 Oct 2023 08:57:01 -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 1qrHis-0003mM-2Y for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:56:58 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHip-0002aD-1B for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:56:57 -0400 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-53dd752685fso3687360a12.3 for ; Fri, 13 Oct 2023 05:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201813; x=1697806613; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wIq+NNnPEjjdwEwMuihsIXkhuw1xh2LZ59h0H7TW924=; b=qpHZEqDD8+sy8g+WKUBGBSCaGmY+eN9DpjF7YxSX89z6mp5VEYSiPn7YqY1HbxFTuz tao8UQ6IkaMk8q6Ubl8ddnoM/f04ivYKVHAFOIzckXG1R+fYmSckvWeOF4F7fWZswtYp r402UtyXYQ+M8wBkF/WByKgBGxJQWPSVIidTqoa6LRl3s7fYD3IwiX/LcmHmh2QKWjyc sVp0BNYD2cqXfL3gvzZy42EH31XtaZyLc/DqFhEyijvVTpOAgSdOxxpYS2PiO9QkVErr 4SH3DoDsLK49d/ybKnFwv1mMncZTnbFKbvI58luA4zui0qOonh9ZyO+8LGjaUzREy0Hb a6Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201813; x=1697806613; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wIq+NNnPEjjdwEwMuihsIXkhuw1xh2LZ59h0H7TW924=; b=R/yXnn3ZRHlR/1qy/vT/QgP2p2lUJFCFG/Pai8nzft46udTsk+1rZ2NGzCoJVDdk3V WmqnuK5q0wd0feUT3MSC2l/JD+qVL1daZSF/vf5QjVka4/SANjfqo1YdgxQoE83diDFY ZxniuYgMU3Q5WZf3nW7mFt33iFN/UBVlqJ116Pi7ms8qpiTSgD0shhe6i8Xrqm1qryra bkCz1QN5gxV/QkfqXfbcFi4rVefxUGSFokQ+RT3R0iL06y/pOYFFC4hD1Xs7lM4Soi/V 2MclP7IX6IWAWwqn3xNsxr4249yekse556g+dykMM4/iONQ8RPgcA9Y5+ZsZoku7Al+R kXAw== X-Gm-Message-State: AOJu0YzncaL5yH7lQfpqwNBZWg0oM6d4JesERDKeBZxXGqpKcQSwvY61 ISQgGx9nr4JP2R73LD66Oe0LauKGvc//Sf8QJd0= X-Received: by 2002:a05:6402:518a:b0:53e:4a78:e281 with SMTP id q10-20020a056402518a00b0053e4a78e281mr1134348edd.27.1697201812921; Fri, 13 Oct 2023 05:56:52 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id g22-20020a50d0d6000000b0053e3d8f1d9fsm922774edf.67.2023.10.13.05.56.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:56:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 3/7] target/ppc: Move ppc_cpu_class_by_name() declaration to 'cpu.h' Date: Fri, 13 Oct 2023 14:56:26 +0200 Message-ID: <20231013125630.95116-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=philmd@linaro.org; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org ppc_cpu_class_by_name() is only called in target/ppc/, no need to expose outside (in particular to hw/). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 2 -- target/ppc/cpu.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index b86fd46d25..3dc92a852e 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -37,8 +37,6 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") -ObjectClass *ppc_cpu_class_by_name(const char *name); - typedef struct CPUArchState CPUPPCState; typedef struct ppc_tb_t ppc_tb_t; typedef struct ppc_dcr_t ppc_dcr_t; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 30392ebeee..8bb66fbea4 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1342,6 +1342,7 @@ struct ArchCPU { }; +ObjectClass *ppc_cpu_class_by_name(const char *name); PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr); PowerPCCPUClass *ppc_cpu_class_by_pvr_mask(uint32_t pvr); PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc); From patchwork Fri Oct 13 12:56:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733197 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448383wrv; Fri, 13 Oct 2023 05:57:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IECoQ8lc11PaOwItO3heRWnzu+8u9iMbim30ld3jwvU2rXV8V0KgUKf0HG55ViqL1TjEi6V X-Received: by 2002:a05:620a:4153:b0:775:d492:64e9 with SMTP id k19-20020a05620a415300b00775d49264e9mr28413608qko.41.1697201842561; Fri, 13 Oct 2023 05:57:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201842; cv=none; d=google.com; s=arc-20160816; b=M70PwMbOTEVU9o+mYSI+9r+cVRnOcMoP3p6ATmczQ6LnuWx1lL10Vy+SZH991I8dp8 xT3CaD5vmsXQYOfrt04nzMMrNuc8Zh5QiqNN1CrtqAJehA9JeJjyCHfGCw7p9Me857eQ gWmJr0e4oDqPaJgr1BfbkR0FaSaP5JEjhLflG3kk2TP/KHcbsswsXhKbiY4pgTvN8Q5q Fr4gb1SfMBwa7hQOV4Un6sPCx6/EN6ofpHlC9z9sYLzIlnCYDmgE4DuYyz3Sr7x9dXqn /6KmtVLiiLaF9p0Hxb7vgpYlc54e2DnDUO60+1aZ2O9aP6ylR2PqeIaGX/U4XPxvi3pm DOwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZMHL7SlFgEKR/BV5pB4UE16riBf0bBquF0WSFLpL7CU=; fh=bF9CLhGeCayiIC6by1s7jvRHVI95KR8clmyJb+VW8UU=; b=ZXS13wkDlzzqu3+8TFNOBFdRYLv98E6cUILXHUnvxv9FEPbVrIDYYNCEWn408ElZ78 R3BBTTHi2y6C0MRkjlnL48q/fefXXlDlJEkKLRXj84yQNe11xX0AiIpshcyc/FrQOCn7 NVdKHEwgvAP8tx8AO1JbgBx+EiMFe4Dd2XwmqR3DBafgx203hozfKZLv1esLOpCvdLOF +FqFsxgsIE4zeo5itopKZJbe+hSdV6LbIViiHBl6TMAynatRolM68zent87l/BRGJ1rb +Mo2Mpz3GMfDT/NxVfbzbgEnGjaI1S/0RDHRsoF7Hx0EhZg0NI+Sy/qKiV6KpmSKGdE+ UQDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lsGUCWnB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f17-20020ae9ea11000000b00773ddf2c8f4si1080769qkg.638.2023.10.13.05.57.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:57:22 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lsGUCWnB; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHj1-000476-IX; Fri, 13 Oct 2023 08:57:07 -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 1qrHiy-0003tC-RL for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:05 -0400 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHiu-0002au-O5 for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:04 -0400 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-53df747cfe5so3851686a12.2 for ; Fri, 13 Oct 2023 05:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201819; x=1697806619; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZMHL7SlFgEKR/BV5pB4UE16riBf0bBquF0WSFLpL7CU=; b=lsGUCWnBQzgeVzvpEM80AK15HsCBc86I9+U//ZAYfiSPd/FkFfgGLN4O6n9p1qAHFo qcr06dFVvSxZ31O0J/VTQZ0nd+w7m6OeSfQv4M6CwgKhd3fM2KxoZWxBASGpyjGVxLF6 7u7As1dkIO9+p8VFclBUBYRyfItEv1X/ETLDnH57w6k6dORL9mOvzzL5ci3Xuejd4jQ9 K2yDnMVYsbzdbuy4hfyFyQFKYhRYjBQ3jwx26bzaMUBh9zkCKFVKTSpRZRR8SxQ93MoK 3YDZ5+SHjggW6FgmpdJSUxrBwfDd4+M+Bzxn6WLR74hXHPJH5v4A4RbckfhmEl2JD9Ua pUJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201819; x=1697806619; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZMHL7SlFgEKR/BV5pB4UE16riBf0bBquF0WSFLpL7CU=; b=rkOMH6cb21dQPMSjJeBz2tRie1KbN9QtayKYiFsdT4rXdK5L3hVXX6S28nkTIUCsen +4lzV0dUoCzUb/IAj/JOY6D0P2gyH8/s4AFBjpI0KQvUtBp0G6K+f0MKbKDQEbs30FPI 6+MPPNII0Hes+BUJI/ZAXJKths3CD2MHs+sF3EwXKb7eF7FXeoe0V7T8caB3TQd+oldI 6jD2cnU4dUH0kisnuo0YbpDJQ4NYbvhiJ6SXVMlOwGOs/LyiIgdnqcIdT3YGdkx5V5cY xLJUMx8IE3mQqZfAStqxAJ7Wsp8TD5p4S2mptTqeSQ9YcOwOrDU5L2MxXwf2Zw2crjZ8 C/5w== X-Gm-Message-State: AOJu0YwXXr6YFGlHAy98zhbKLwTsdZSWGgR/rjTq18BUgYhDENaS1Zg9 uZQAojje0dClsldWVQ0sk1rkNYkU9oyjmxfP6A8= X-Received: by 2002:a05:6402:1777:b0:53d:bf95:5402 with SMTP id da23-20020a056402177700b0053dbf955402mr5089943edb.42.1697201819212; Fri, 13 Oct 2023 05:56:59 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id h14-20020aa7de0e000000b00532eba07773sm11554780edv.25.2023.10.13.05.56.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:56:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= , Richard Henderson Subject: [PATCH 4/7] target/ppc: Move PowerPCCPUClass definition to 'cpu.h' Date: Fri, 13 Oct 2023 14:56:27 +0200 Message-ID: <20231013125630.95116-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=philmd@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The OBJECT_DECLARE_CPU_TYPE() macro forward-declares the PowerPCCPUClass type. This forward declaration is sufficient for code in hw/ to use the QOM definitions. No need to expose the structure definition. Keep it local to target/ppc/ by moving it to target/ppc/cpu.h. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/ppc/ppc.h | 2 +- target/ppc/cpu-qom.h | 56 -------------------------------------------- target/ppc/cpu.h | 51 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 57 deletions(-) diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h index 17a8dfc107..d5d119ea7f 100644 --- a/include/hw/ppc/ppc.h +++ b/include/hw/ppc/ppc.h @@ -1,7 +1,7 @@ #ifndef HW_PPC_H #define HW_PPC_H -#include "target/ppc/cpu-qom.h" +#include "target/ppc/cpu.h" void ppc_set_irq(PowerPCCPU *cpu, int n_IRQ, int level); PowerPCCPU *ppc_get_vcpu_by_pir(int pir); diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 3dc92a852e..41e97a0ea1 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -21,7 +21,6 @@ #define QEMU_PPC_CPU_QOM_H #include "hw/core/cpu.h" -#include "qom/object.h" #ifdef TARGET_PPC64 #define TYPE_POWERPC_CPU "powerpc64-cpu" @@ -37,10 +36,6 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") -typedef struct CPUArchState CPUPPCState; -typedef struct ppc_tb_t ppc_tb_t; -typedef struct ppc_dcr_t ppc_dcr_t; - /*****************************************************************************/ /* MMU model */ typedef enum powerpc_mmu_t powerpc_mmu_t; @@ -134,55 +129,4 @@ enum powerpc_input_t { PPC_FLAGS_INPUT_RCPU, }; -typedef struct PPCHash64Options PPCHash64Options; - -/** - * PowerPCCPUClass: - * @parent_realize: The parent class' realize handler. - * @parent_phases: The parent class' reset phase handlers. - * - * A PowerPC CPU model. - */ -struct PowerPCCPUClass { - /*< private >*/ - CPUClass parent_class; - /*< public >*/ - - DeviceRealize parent_realize; - DeviceUnrealize parent_unrealize; - ResettablePhases parent_phases; - void (*parent_parse_features)(const char *type, char *str, Error **errp); - - uint32_t pvr; - /* - * If @best is false, match if pcc is in the family of pvr - * Else match only if pcc is the best match for pvr in this family. - */ - bool (*pvr_match)(struct PowerPCCPUClass *pcc, uint32_t pvr, bool best); - uint64_t pcr_mask; /* Available bits in PCR register */ - uint64_t pcr_supported; /* Bits for supported PowerISA versions */ - uint32_t svr; - uint64_t insns_flags; - uint64_t insns_flags2; - uint64_t msr_mask; - uint64_t lpcr_mask; /* Available bits in the LPCR */ - uint64_t lpcr_pm; /* Power-saving mode Exit Cause Enable bits */ - powerpc_mmu_t mmu_model; - powerpc_excp_t excp_model; - powerpc_input_t bus_model; - uint32_t flags; - int bfd_mach; - uint32_t l1_dcache_size, l1_icache_size; -#ifndef CONFIG_USER_ONLY - unsigned int gdb_num_sprs; - const char *gdb_spr_xml; -#endif - const PPCHash64Options *hash64_opts; - struct ppc_radix_page_info *radix_page_info; - uint32_t lrg_decr_bits; - int n_host_threads; - void (*init_proc)(CPUPPCState *env); - int (*check_pow)(CPUPPCState *env); -}; - #endif diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 8bb66fbea4..d521ee97bb 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -198,9 +198,14 @@ typedef struct opc_handler_t opc_handler_t; /*****************************************************************************/ /* Types used to describe some PowerPC registers etc. */ typedef struct DisasContext DisasContext; +typedef struct ppc_dcr_t ppc_dcr_t; typedef struct ppc_spr_t ppc_spr_t; +typedef struct ppc_tb_t ppc_tb_t; typedef union ppc_tlb_t ppc_tlb_t; typedef struct ppc_hash_pte64 ppc_hash_pte64_t; +typedef struct PPCHash64Options PPCHash64Options; + +typedef struct CPUArchState CPUPPCState; /* SPR access micro-ops generations callbacks */ struct ppc_spr_t { @@ -1341,6 +1346,52 @@ struct ArchCPU { int32_t mig_slb_nr; }; +/** + * PowerPCCPUClass: + * @parent_realize: The parent class' realize handler. + * @parent_phases: The parent class' reset phase handlers. + * + * A PowerPC CPU model. + */ +struct PowerPCCPUClass { + CPUClass parent_class; + + DeviceRealize parent_realize; + DeviceUnrealize parent_unrealize; + ResettablePhases parent_phases; + void (*parent_parse_features)(const char *type, char *str, Error **errp); + + uint32_t pvr; + /* + * If @best is false, match if pcc is in the family of pvr + * Else match only if pcc is the best match for pvr in this family. + */ + bool (*pvr_match)(struct PowerPCCPUClass *pcc, uint32_t pvr, bool best); + uint64_t pcr_mask; /* Available bits in PCR register */ + uint64_t pcr_supported; /* Bits for supported PowerISA versions */ + uint32_t svr; + uint64_t insns_flags; + uint64_t insns_flags2; + uint64_t msr_mask; + uint64_t lpcr_mask; /* Available bits in the LPCR */ + uint64_t lpcr_pm; /* Power-saving mode Exit Cause Enable bits */ + powerpc_mmu_t mmu_model; + powerpc_excp_t excp_model; + powerpc_input_t bus_model; + uint32_t flags; + int bfd_mach; + uint32_t l1_dcache_size, l1_icache_size; +#ifndef CONFIG_USER_ONLY + unsigned int gdb_num_sprs; + const char *gdb_spr_xml; +#endif + const PPCHash64Options *hash64_opts; + struct ppc_radix_page_info *radix_page_info; + uint32_t lrg_decr_bits; + int n_host_threads; + void (*init_proc)(CPUPPCState *env); + int (*check_pow)(CPUPPCState *env); +}; ObjectClass *ppc_cpu_class_by_name(const char *name); PowerPCCPUClass *ppc_cpu_class_by_pvr(uint32_t pvr); From patchwork Fri Oct 13 12:56:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733203 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448743wrv; Fri, 13 Oct 2023 05:58:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/5mFopu81OcP3pU9wdoEk31JZnk0QB1sO3KZWUx3BcZl/0ICuxs21vMxgYGqjJPAsaEee X-Received: by 2002:a05:6214:130e:b0:66d:237d:8f75 with SMTP id pn14-20020a056214130e00b0066d237d8f75mr2963770qvb.35.1697201892520; Fri, 13 Oct 2023 05:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201892; cv=none; d=google.com; s=arc-20160816; b=uceCS54W8uNgnp0P9v3KJl1kSnx0Zhlv9NHJLkSq3W2MRtiUTy287naW9aKN922joE QpQvuP20psUA/DkaXKdh7/1Z8aE/t6jg+Kq0W7LlBhhEZ+Mqr0JAHOfNc/mCYGcA55M3 lHWXfkA3l+csS1aDETvHYO6IPRxcMoT/PWlA3Llk0yb7RUyjQbNqMqP9ERp6Sdztomru iOIVLiR8rZitJ/QFh97XTLyLMZ7WiIXxwilEtn+R4tfKSr9FSgGRLI1BRsAA3BzUZ2CC 6U8vRZDJEwVRKTqdEozZShmhsbiDksVVHu74YOtlcNqMBt4fVizLZwCEz4G5OfRWdkrN beag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EnGehjCRe7N5NlcitFMO+yrUN4cOF8jWvzxKACAW5h8=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=Y0ZKkA++4dupSBKGlu4PDTxxD+Y/H614lwcyCHCh6QJo9g91v/TvkIGR3HcaMOyRL2 ZIUyS3ELc/k9/G2DXpXWIvzshUWFJ7U4nqlkaWy8Nn7+4cAa3ZUjVw1fY0ZicX0Lj+CG CIDjdeXlk3IpvRjFoWM7TrhpTh3E/PNxjp83lhC4Q5E7kk+/F90WdsKBPOlIOgjQzAr/ 9sD9nM+Bry2HzVLZ1eO+d1hTgRP3UKr4vWnPwv0ek+NqRdHlR+9ZO6ARvSvIR+3iPHS4 5hSuU+vF/Yy439lxbBOYQWczEouTtAmorvk1/jldZQuJ3Q619sVabOpKOxE2RqFCAYMT 1KMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AVEkOjIy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id eu2-20020ad44f42000000b0066d029450afsi1106779qvb.305.2023.10.13.05.58.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AVEkOjIy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHj4-0004CR-8h; Fri, 13 Oct 2023 08:57:10 -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 1qrHj2-00048P-Tm for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:08 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHj1-0002d9-6l for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:08 -0400 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-53e08b60febso2997068a12.1 for ; Fri, 13 Oct 2023 05:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201825; x=1697806625; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EnGehjCRe7N5NlcitFMO+yrUN4cOF8jWvzxKACAW5h8=; b=AVEkOjIyt4nNmvF/1K+YRfQQigF1vcv06TgapS74Hq/EgVTcZUtD+wx3rpRtFABAHV JMX8GynDx0MRaNxaLSn2+SS03XPWhmAivAjE04VRanlYe4QLZxcmuvF/r3DlnC+M0aca 9EUjkxTgMCS1oI3RV+0/6TmHayH22n6nDJOFdEAhUob3daOK089zyDHAWeaej7T+maXy V1c2aMjcOdnWBonXEhnu/ZB0Zcz8luxoEX7FyGLwRaVu/uJYf38Njk8NyYeLyn9C1jzb tKiRMrS5ByojiTnC4AcNb5E7KARJ+ImSjOqBMeYSv8OTFHg6wNGsKLn2BziTkWQJtqr1 boHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201825; x=1697806625; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EnGehjCRe7N5NlcitFMO+yrUN4cOF8jWvzxKACAW5h8=; b=M9sJhhqdq7hvsml1ejMx8H1TF81HmTdCHS2DkvI+VFI2IsHVhBVCWOA5OucWuWmCDw khkj2nVhZx7uyvBURNTmKwH4C5eN8pNZFlRNKeWERQGeRDeQ4SV/6CZ1rl0RKLO5foWi GQ6KSmWheyO0+MDtKBHA/ZCPlYJu3WS5G88X647HhxBJObknbSGOE31QVyToohWjEzGK VgioMlfiFaHmTgZ+wyUBAZvwlNSCUj9Vp6aGv8u9VkRqbHwIgWr8P5CoC3Ay26KxhR72 kZzp/Lsaa/1EaYPbIn5HrofBWlfW8Fo+K+cXY2yYc8SXP0j3/1vDL3yHMR/g8gZlae5N d9lA== X-Gm-Message-State: AOJu0YzjqiBVYF3X/g+SsaSVKQ0Z8lXZ5mHV1eemsmTNe9IVNaiAUhhY 0dCil/CyM5Etg/p6BItr2euplnCPp/Lykn4o7rI= X-Received: by 2002:a05:6402:14c7:b0:51d:f5bd:5a88 with SMTP id f7-20020a05640214c700b0051df5bd5a88mr23977902edx.38.1697201825324; Fri, 13 Oct 2023 05:57:05 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id j18-20020a508a92000000b0053deb97e8e6sm3069380edj.28.2023.10.13.05.57.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:57:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 5/7] target/ppc: Move powerpc_excp_t definition to 'cpu.h' Date: Fri, 13 Oct 2023 14:56:28 +0200 Message-ID: <20231013125630.95116-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The powerpc_excp_t definition is only used by target/ppc/, no need to expose it. Restrict it by moving it to "target/ppc/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 29 ----------------------------- target/ppc/cpu.h | 27 +++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 29 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 41e97a0ea1..b2e42c2996 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -79,35 +79,6 @@ static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model) return mmu_model & POWERPC_MMU_64; } -/*****************************************************************************/ -/* Exception model */ -typedef enum powerpc_excp_t powerpc_excp_t; -enum powerpc_excp_t { - POWERPC_EXCP_UNKNOWN = 0, - /* Standard PowerPC exception model */ - POWERPC_EXCP_STD, - /* PowerPC 40x exception model */ - POWERPC_EXCP_40x, - /* PowerPC 603/604/G2 exception model */ - POWERPC_EXCP_6xx, - /* PowerPC 7xx exception model */ - POWERPC_EXCP_7xx, - /* PowerPC 74xx exception model */ - POWERPC_EXCP_74xx, - /* BookE exception model */ - POWERPC_EXCP_BOOKE, - /* PowerPC 970 exception model */ - POWERPC_EXCP_970, - /* POWER7 exception model */ - POWERPC_EXCP_POWER7, - /* POWER8 exception model */ - POWERPC_EXCP_POWER8, - /* POWER9 exception model */ - POWERPC_EXCP_POWER9, - /* POWER10 exception model */ - POWERPC_EXCP_POWER10, -}; - /*****************************************************************************/ /* Input pins model */ typedef enum powerpc_input_t powerpc_input_t; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index d521ee97bb..d8cf4c03bf 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -190,6 +190,33 @@ enum { POWERPC_EXCP_TRAP = 0x40, }; +/* Exception model */ +typedef enum powerpc_excp_t { + POWERPC_EXCP_UNKNOWN = 0, + /* Standard PowerPC exception model */ + POWERPC_EXCP_STD, + /* PowerPC 40x exception model */ + POWERPC_EXCP_40x, + /* PowerPC 603/604/G2 exception model */ + POWERPC_EXCP_6xx, + /* PowerPC 7xx exception model */ + POWERPC_EXCP_7xx, + /* PowerPC 74xx exception model */ + POWERPC_EXCP_74xx, + /* BookE exception model */ + POWERPC_EXCP_BOOKE, + /* PowerPC 970 exception model */ + POWERPC_EXCP_970, + /* POWER7 exception model */ + POWERPC_EXCP_POWER7, + /* POWER8 exception model */ + POWERPC_EXCP_POWER8, + /* POWER9 exception model */ + POWERPC_EXCP_POWER9, + /* POWER10 exception model */ + POWERPC_EXCP_POWER10, +} powerpc_excp_t; + #define PPC_INPUT(env) ((env)->bus_model) /*****************************************************************************/ From patchwork Fri Oct 13 12:56:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733200 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448531wrv; Fri, 13 Oct 2023 05:57:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaQxk9iE3smMvoJ670TNFl8VrZW422PxbRsgaAJaI3hN+PsBbZfUqR4gnJStvrski7o3fJ X-Received: by 2002:a67:e004:0:b0:457:cb7b:c878 with SMTP id c4-20020a67e004000000b00457cb7bc878mr532639vsl.29.1697201862075; Fri, 13 Oct 2023 05:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201862; cv=none; d=google.com; s=arc-20160816; b=sSb7FeeILGoZ/2bAcbGAktIY1DKQGKWeZX/yeCy0eSFIKBUJE4kvWJld7IG4IQOzzz XSXkQWi/LYKcXdJe/1cyEPEnIVClwZIER3gQEWg6cv5+wPwvLHIFj9jQizBQJjxWUDSa YoZPPXHkqiXmKILI5+WxFfrcA5TtDYRRBlcgO5JFgMq5o4LZ0o4Pzz9S7ThXfuzxpxmz WC67VU5lfHc7JARR2KtQKFXhMNCCbW6HseqsH6qfkN9q8iMa0B1t3o+NucQh9Xpc6dHv 8bSO3w461nRdOlwW3EEvmZ2zF6cjQ2kyAPHiHgg4WO7iUE5C3wu1ETL92fPO6J8I5RnU dzGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8yYXPRc/xEWiPRWLkGZcxqQvValoM9UBry2nkc5FvzM=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=FzJfzQNuOAb6wPW4+/+YQ4wdTwBfCIZCjL5vAqkNIZ+rAUn83sgsAhAKGGx3dGPmCU dsmIPMVT6exX8niz90CC4gXPCFRov2rGWFOkQZj3m8BJOS/U7x07zzkNA529BBAka8b7 cr5YqEZXXX8cSaj2Bc87PGY2S80jBis27Pyi46DbkNlwHt0fCLvtHuDKL2xDC0vJPT77 p0cVNLDQoRHL/Kp1tLzVIss6xgNfI/vJcR9dqMGuziElcUrr/H2lapG69Uvl75GvyA07 9l4E/rptV0BMmXkVb2TqvDPEdSLpybF6Hqeai5BABEhb5rjfe26Q8n0x79bCi/u679U9 8Qtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SJiBlll7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b12-20020ac87fcc000000b0041820a6d5f2si1119246qtk.714.2023.10.13.05.57.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:57:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SJiBlll7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHjB-0004Nr-D7; Fri, 13 Oct 2023 08:57:17 -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 1qrHj9-0004Mh-7p for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:15 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHj7-0002ee-CZ for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:14 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-53df747cfe5so3852066a12.2 for ; Fri, 13 Oct 2023 05:57:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201831; x=1697806631; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8yYXPRc/xEWiPRWLkGZcxqQvValoM9UBry2nkc5FvzM=; b=SJiBlll7cxNYFVHVlldeMQRzkpD6odpAXKkzpfGBYqfIn9lln1O0b9a31e6ZVEl/RI jC6CFh/j0YlCHqwts7kTVcoCvQwzkyGSQ3BPL3kn/8LgoLGIkpjsN/KZ+kG72s2R3W0s BW1K5JCRUe2FyUhZUn/W8qwb9kPBN/tRx7gsba61FZc+cFfKv9Zh5pw1NQkGoCbTZKCE cxK9ef2GU7epKs23aWxb0zny6zUNn0aKs50ATfBB/dtaoRO2oBOunYy0O8WvSxvlYwiu KWIDkeKjNN+WAgwLWuPPoe192sgiLweJj/vwNqf8F16BBlBOgjUzCTZxXJ8mdGWNZEoD bW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201831; x=1697806631; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8yYXPRc/xEWiPRWLkGZcxqQvValoM9UBry2nkc5FvzM=; b=O/7JdOz0SOHjbluD/nP68UIfnz4PS8+I7Px5Jh7GIDDYxVb/iY18tnLoYOieOSV27/ sq/o0RL8iyw0+lzziiTg9OR2LWEPqBYfB74Y2Y/B9fJKjaO+r5VzX+R2GeR1W3aBpGO8 Zjim56iT+v3lBdR9FYjgPguNotDlr3kCt4XXt2Q7y/pM/bcAA940a2Q1UVVect9fqE+f xVBxbtfkOcfkSkRaWr4V04CPNn2uNlgsI/OZnmlkeYjHn5yE2l8gUXKcEvqYIGDHorC0 hqnJ6f4gXtGZUtLY6XQreb5zqSWclFckP/tdAI6xE6qrsbTCbPWV8YGQaDPHFlbLO1nA 2g2A== X-Gm-Message-State: AOJu0YxFGYtKO9XRJCc6vMxktf5xxrjAOsHnotiDZGiHOi+rR3KDJLmF kUWuvXDdVM8xup3vUyPBonGuV+khVWo77g46xHc= X-Received: by 2002:a17:907:7711:b0:9ae:82b4:e309 with SMTP id kw17-20020a170907771100b009ae82b4e309mr24106310ejc.0.1697201831561; Fri, 13 Oct 2023 05:57:11 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id f5-20020a170906560500b009b8dbdd5203sm12337668ejq.107.2023.10.13.05.57.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:57:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 6/7] target/ppc: Move powerpc_mmu_t definition to 'cpu.h' Date: Fri, 13 Oct 2023 14:56:29 +0200 Message-ID: <20231013125630.95116-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The powerpc_mmu_t definition is only used by target/ppc/, no need to expose it. Restrict it by moving it to "target/ppc/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 43 ------------------------------------------- target/ppc/cpu.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index b2e42c2996..5bdca472be 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -36,49 +36,6 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") -/*****************************************************************************/ -/* MMU model */ -typedef enum powerpc_mmu_t powerpc_mmu_t; -enum powerpc_mmu_t { - POWERPC_MMU_UNKNOWN = 0x00000000, - /* Standard 32 bits PowerPC MMU */ - POWERPC_MMU_32B = 0x00000001, - /* PowerPC 6xx MMU with software TLB */ - POWERPC_MMU_SOFT_6xx = 0x00000002, - /* - * PowerPC 74xx MMU with software TLB (this has been - * disabled, see git history for more information. - * keywords: tlbld tlbli TLBMISS PTEHI PTELO) - */ - POWERPC_MMU_SOFT_74xx = 0x00000003, - /* PowerPC 4xx MMU with software TLB */ - POWERPC_MMU_SOFT_4xx = 0x00000004, - /* PowerPC MMU in real mode only */ - POWERPC_MMU_REAL = 0x00000006, - /* Freescale MPC8xx MMU model */ - POWERPC_MMU_MPC8xx = 0x00000007, - /* BookE MMU model */ - POWERPC_MMU_BOOKE = 0x00000008, - /* BookE 2.06 MMU model */ - POWERPC_MMU_BOOKE206 = 0x00000009, -#define POWERPC_MMU_64 0x00010000 - /* 64 bits PowerPC MMU */ - POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001, - /* Architecture 2.03 and later (has LPCR) */ - POWERPC_MMU_2_03 = POWERPC_MMU_64 | 0x00000002, - /* Architecture 2.06 variant */ - POWERPC_MMU_2_06 = POWERPC_MMU_64 | 0x00000003, - /* Architecture 2.07 variant */ - POWERPC_MMU_2_07 = POWERPC_MMU_64 | 0x00000004, - /* Architecture 3.00 variant */ - POWERPC_MMU_3_00 = POWERPC_MMU_64 | 0x00000005, -}; - -static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model) -{ - return mmu_model & POWERPC_MMU_64; -} - /*****************************************************************************/ /* Input pins model */ typedef enum powerpc_input_t powerpc_input_t; diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index d8cf4c03bf..c2cd069095 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -217,6 +217,48 @@ typedef enum powerpc_excp_t { POWERPC_EXCP_POWER10, } powerpc_excp_t; +/*****************************************************************************/ +/* MMU model */ +typedef enum powerpc_mmu_t { + POWERPC_MMU_UNKNOWN = 0x00000000, + /* Standard 32 bits PowerPC MMU */ + POWERPC_MMU_32B = 0x00000001, + /* PowerPC 6xx MMU with software TLB */ + POWERPC_MMU_SOFT_6xx = 0x00000002, + /* + * PowerPC 74xx MMU with software TLB (this has been + * disabled, see git history for more information. + * keywords: tlbld tlbli TLBMISS PTEHI PTELO) + */ + POWERPC_MMU_SOFT_74xx = 0x00000003, + /* PowerPC 4xx MMU with software TLB */ + POWERPC_MMU_SOFT_4xx = 0x00000004, + /* PowerPC MMU in real mode only */ + POWERPC_MMU_REAL = 0x00000006, + /* Freescale MPC8xx MMU model */ + POWERPC_MMU_MPC8xx = 0x00000007, + /* BookE MMU model */ + POWERPC_MMU_BOOKE = 0x00000008, + /* BookE 2.06 MMU model */ + POWERPC_MMU_BOOKE206 = 0x00000009, +#define POWERPC_MMU_64 0x00010000 + /* 64 bits PowerPC MMU */ + POWERPC_MMU_64B = POWERPC_MMU_64 | 0x00000001, + /* Architecture 2.03 and later (has LPCR) */ + POWERPC_MMU_2_03 = POWERPC_MMU_64 | 0x00000002, + /* Architecture 2.06 variant */ + POWERPC_MMU_2_06 = POWERPC_MMU_64 | 0x00000003, + /* Architecture 2.07 variant */ + POWERPC_MMU_2_07 = POWERPC_MMU_64 | 0x00000004, + /* Architecture 3.00 variant */ + POWERPC_MMU_3_00 = POWERPC_MMU_64 | 0x00000005, +} powerpc_mmu_t; + +static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model) +{ + return mmu_model & POWERPC_MMU_64; +} + #define PPC_INPUT(env) ((env)->bus_model) /*****************************************************************************/ From patchwork Fri Oct 13 12:56:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 733199 Delivered-To: patch@linaro.org Received: by 2002:a5d:54d1:0:b0:31d:da82:a3b4 with SMTP id x17csp1448491wrv; Fri, 13 Oct 2023 05:57:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHtmBnE0X0jv1/YTcgLYywHqDgJe7j56TNJVI8/6BcVOT7tu7HPIYLv+w9213Q4tFd8SiL9 X-Received: by 2002:a05:6214:2dc4:b0:65b:821:58c1 with SMTP id nc4-20020a0562142dc400b0065b082158c1mr28137632qvb.57.1697201858402; Fri, 13 Oct 2023 05:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201858; cv=none; d=google.com; s=arc-20160816; b=jauEmD0zAOj/rEGWmPwlGwXOkbdLch+F4lrcKtexVGSvW04vai/hYjQNpLMQ1hedMa DzW+x9hnkLXAnRbZCEF+XeQwchLNocI+G3lU/f/TKxLhmezXEcX/Bs9KoAqG5+AqprXe gVqvljZ0Xj5m9g5MEC21btzHiNt/nmV4ql9fSU9/j+qmLcshCaYeHUG6MoHxzan9WxBi B5TX6llTS68IyeMQVz0R8BLKNLsfzZavz8pX4flMcMkd5zTPV+RqRN8Vx+WJDfmuqkD4 z2fN7hENEiqV8o9EqRr2ybn1aPEPIQnMctzmVK13U/7Snaxup5ncsLYk5UkYzUi/XCF1 lYug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cGRDbNMY2n5Kz87q0HF9aXN56DMXen4g7m78MIw8aHE=; fh=VA6j7lkwZBpc1StxpFljCA0aH/klDdhOAPrIIfLw9Rk=; b=VfsqbSYXuOqD5Kq7W3SxQc60yfNYpbUXPzFM9bewiP76nu9+DWdLckeAg4fNqUxoCK JDL4E0/+suvfjeLd0QrmHP3iqV4ZEMgMlRE1TjUpovmI4rypowik4CnwBYiFo7tH5Qs4 W1qq+MNLITeJoz9k5oNkP1ffJ0o845W+2O24yHbtSl1HNQNPKhue+re4jccXrJVwB6+H ZZsKBB9Encngbxs+Yik3KdHX6f2UaQhiqm5C0mgf48m0nbX2yoJoEL/x9q9+Yfad7an3 GLkEwmlSv5qDOU+awH+KbjCwpEWyO8wFQ0H31KX87WuNK777udW8ncgHgFSDxc4OzCkJ ZZIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lhcKCGoo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bp7-20020a05620a458700b00774345ad4b4si1139702qkb.304.2023.10.13.05.57.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Oct 2023 05:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lhcKCGoo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrHjR-0004uo-3T; Fri, 13 Oct 2023 08:57:34 -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 1qrHjE-0004Vh-Rn for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:21 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrHjD-0002gC-6d for qemu-devel@nongnu.org; Fri, 13 Oct 2023 08:57:20 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-53da72739c3so3589869a12.3 for ; Fri, 13 Oct 2023 05:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697201837; x=1697806637; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cGRDbNMY2n5Kz87q0HF9aXN56DMXen4g7m78MIw8aHE=; b=lhcKCGooGJrBtjITWM0vjZRURdJA4A9AvdfPrGFvkn0up8s2oritGNBNa3dAg2wX6C MtaVCWoyTq3O7r4tdxtcCiXLQd1VUtos88LdZ6qlnrkGEJLW1wkX3qkxfPMY9TCtQZ+X 4Rf9ZHmAz9xUDQslEaXZFgrW8Ow0R3X6ik9PAvo+EGu2Vpf6ZERd+FehQALeMrivZC5p 79hqJsbAc3q0V3cjtJcoFq8wMfJucmK5XPRlhCR0JRQlBVL6d5zfOrNZp3d67cPGIwKn XrPxfbjyWRjZUmyXkXinW+ZYjI3NRBLhTgPO+YAiPHCYTDzUKOR/zgvKpY8kRg+RsXZy v6Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697201837; x=1697806637; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cGRDbNMY2n5Kz87q0HF9aXN56DMXen4g7m78MIw8aHE=; b=tpeOu4Xjvv8TsqhXG/Hja+C/+SWA4l94H/zbAEXNmFnY3exP/Y9zjieOo57FKWQrLZ 6twpuznLsr+wlT9BVrrRyHpknDBV4UVNHMsmUVdxnpGU4hxsJFUZCRiiGIdZn99tysi3 QL2Zca6b66gvpxRRfeCdAsa3qwbsKVMeFiz+JoZ4KJhL2xJ6CYTlYMteFz1f6lbZqW07 3lzTVdiB8sbm96unurMV/Y1Rfk35Em9BJxfGJfSR0J2P6QnO2TaQGJLaUXWBcRuhHrnl Z+wOQLJL6j5+e3NGw9zjvliH6QYyMHa9i8DNbLUdQmTIcqvqNoNBDpL4I1v3l8cKmOXr Rt6Q== X-Gm-Message-State: AOJu0YyP6LaKTWcONxkSpL7WWk9bFX4ea3Zwb3H8BGHziae2ZywEgJZN Emb2qgHGJwfF3etmhFDgqFm0INk/cZ2ag9YEHHg= X-Received: by 2002:a17:906:6a01:b0:9bd:ac0f:83dc with SMTP id qw1-20020a1709066a0100b009bdac0f83dcmr1246237ejc.54.1697201837451; Fri, 13 Oct 2023 05:57:17 -0700 (PDT) Received: from m1x-phil.lan ([176.172.118.168]) by smtp.gmail.com with ESMTPSA id h13-20020a17090619cd00b009ae587ce135sm12309552ejd.223.2023.10.13.05.57.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 13 Oct 2023 05:57:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: David Gibson , qemu-ppc@nongnu.org, Nicholas Piggin , Harsh Prateek Bora , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Daniel Henrique Barboza , =?utf-8?q?Philippe_Mathieu?= =?utf-8?q?-Daud=C3=A9?= Subject: [PATCH 7/7] target/ppc: Move powerpc_input_t definition to 'cpu.h' Date: Fri, 13 Oct 2023 14:56:30 +0200 Message-ID: <20231013125630.95116-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231013125630.95116-1-philmd@linaro.org> References: <20231013125630.95116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The powerpc_input_t definition is only used by target/ppc/, no need to expose it. Restrict it by moving it to "target/ppc/cpu.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Cédric Le Goater --- target/ppc/cpu-qom.h | 21 --------------------- target/ppc/cpu.h | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 5bdca472be..6d39ad451c 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -36,25 +36,4 @@ OBJECT_DECLARE_CPU_TYPE(PowerPCCPU, PowerPCCPUClass, POWERPC_CPU) #define TYPE_HOST_POWERPC_CPU POWERPC_CPU_TYPE_NAME("host") -/*****************************************************************************/ -/* Input pins model */ -typedef enum powerpc_input_t powerpc_input_t; -enum powerpc_input_t { - PPC_FLAGS_INPUT_UNKNOWN = 0, - /* PowerPC 6xx bus */ - PPC_FLAGS_INPUT_6xx, - /* BookE bus */ - PPC_FLAGS_INPUT_BookE, - /* PowerPC 405 bus */ - PPC_FLAGS_INPUT_405, - /* PowerPC 970 bus */ - PPC_FLAGS_INPUT_970, - /* PowerPC POWER7 bus */ - PPC_FLAGS_INPUT_POWER7, - /* PowerPC POWER9 bus */ - PPC_FLAGS_INPUT_POWER9, - /* Freescale RCPU bus */ - PPC_FLAGS_INPUT_RCPU, -}; - #endif diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index c2cd069095..4b8b5d3d3e 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -259,6 +259,26 @@ static inline bool mmu_is_64bit(powerpc_mmu_t mmu_model) return mmu_model & POWERPC_MMU_64; } +/*****************************************************************************/ +/* Input pins model */ +typedef enum powerpc_input_t { + PPC_FLAGS_INPUT_UNKNOWN = 0, + /* PowerPC 6xx bus */ + PPC_FLAGS_INPUT_6xx, + /* BookE bus */ + PPC_FLAGS_INPUT_BookE, + /* PowerPC 405 bus */ + PPC_FLAGS_INPUT_405, + /* PowerPC 970 bus */ + PPC_FLAGS_INPUT_970, + /* PowerPC POWER7 bus */ + PPC_FLAGS_INPUT_POWER7, + /* PowerPC POWER9 bus */ + PPC_FLAGS_INPUT_POWER9, + /* Freescale RCPU bus */ + PPC_FLAGS_INPUT_RCPU, +} powerpc_input_t; + #define PPC_INPUT(env) ((env)->bus_model) /*****************************************************************************/