From nobody Wed Nov 27 20:50:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1697835112; cv=none; d=zohomail.com; s=zohoarc; b=PIGnw/EZDHEd63LYVjV2av4PWQm9FEF8VtafgPzEi4egcF1DqqCRsr2ektdDDy1elfCM7p8qo4P3sjuinxw7xxtSGn0eSY8SMrN5J/o1asJpvdHa2dZ7Dggy189gJ0AwQDKVDmBmQigDnoDItk3Gj+T4hQf36ke1Ur1ncBmGFJc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1697835112; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3+gAls5QIov6whAU2ymHpvhxd4z68DFwK7+v+pcFR8U=; b=PhGEJPtGumtFqTxJqTZV3CczOH6B7tGZI8MVNIfCVrRtQDlzsOFGGztgS8Fhil85eHx5NbrxFUOmoWajfGgtB8ZapyufaPIgHvR3+Z5P3ilpu9svqIO9m6htcRH+VdGogU2cBlWj+U1WpdEoENaqwDOEQRQIIiCVkfOXVWzNyaU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1697835112689892.1471173737956; Fri, 20 Oct 2023 13:51:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtwLt-0007pd-IC; Fri, 20 Oct 2023 16:44:13 -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 1qtwLW-0007jR-GE for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:54 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtwLS-0008AP-Mz for qemu-devel@nongnu.org; Fri, 20 Oct 2023 16:43:49 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6b497c8575aso1217919b3a.1 for ; Fri, 20 Oct 2023 13:43:45 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id k15-20020aa7998f000000b00688965c5227sm1944975pfh.120.2023.10.20.13.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 13:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697834625; x=1698439425; 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=3+gAls5QIov6whAU2ymHpvhxd4z68DFwK7+v+pcFR8U=; b=UC1E1T0QoBTZaYUaS/aVXB1qWv4b6R559A+euFUfEW1Ukygv+BpAxtlgjfc0QmV7oS 4ZenXhxFLs2bw/7NhNcMFQJboU+xirzc943ZkJJOhuLYK9UwPhefWMkfxxHsmvPIzWpg H95HCBYx9Pouh5K9QDFere82+g2tvXUyhPvovPzFDS034JnPEzjlDN/WUwfuezuyrqNg 4ttYpZEPAuhCKH9aIMj6IuYAss3Q6GSrnBsymOC1P6v7VH/NWZtLk29d+99wcRagwn/T HlP3cEC/BBE8MM0M3Qa4piFWK55IeLlY/WGItkWRpWjJr8xucjnZHb/UKb32mMezjU6V OpmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697834625; x=1698439425; 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=3+gAls5QIov6whAU2ymHpvhxd4z68DFwK7+v+pcFR8U=; b=JbTJtJyLhcO9zxfl43jNxuyk6b2N39NRAd5KE92wTDG3Hs/9g/X3HWaJtpHV5mMnP+ 61g6m69ySQf2dpeRKd4lMJ/UosLDQt4nRHrm89ppaHDaGI8sNKZRv5K5LsCER8P/u1AL KHjFxAGYOSvztogSbBkeLSqbZhZA8Dc15u7RCjv5X/3iy3dUqbQPm4iFS7X9YwQiXV5b skEOPJ8V1efppo0FSsTuMYwXwdOuIoM4784F1y1TDzHfMs5VnqOVUfTWZsSbp83PInjr zCD+DEMsCxVViad6jde3aO4I0ILa5MImRd6bC/CjdKIRSH/7PgQ8Lq8BKvy16Det2+z6 /AUg== X-Gm-Message-State: AOJu0YxI24rOnuA8Pw+dtRVKmuXIwzapTGqKl2kUL8FSOpX07Y5uqV4b MnAGvhuQhcR9ntQth9cML96tKj9KA3M88nd0vbE= X-Google-Smtp-Source: AGHT+IE01Q9dMV3mRB2iqWgjHRyHUerWOS5i7FmtpEE73CEgg/wnWe3rZEozr/q7gAeGVi7C6dHk7A== X-Received: by 2002:a05:6a20:3950:b0:17c:d4f0:87e0 with SMTP id r16-20020a056a20395000b0017cd4f087e0mr733413pzg.53.1697834625141; Fri, 20 Oct 2023 13:43:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: deller@gmx.de Subject: [PATCH v2 13/65] target/hppa: Introduce TYPE_HPPA64_CPU Date: Fri, 20 Oct 2023 13:42:39 -0700 Message-Id: <20231020204331.139847-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020204331.139847-1-richard.henderson@linaro.org> References: <20231020204331.139847-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1697835113280100011 Content-Type: text/plain; charset="utf-8" Prepare for the qemu binary supporting both pa10 and pa20 at the same time. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/hppa/cpu-qom.h | 1 + target/hppa/cpu.h | 5 +++++ target/hppa/cpu.c | 34 +++++++++++++++++++--------------- target/hppa/translate.c | 2 ++ 4 files changed, 27 insertions(+), 15 deletions(-) diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h index b96e0318c7..4a85ebf5e0 100644 --- a/target/hppa/cpu-qom.h +++ b/target/hppa/cpu-qom.h @@ -24,6 +24,7 @@ #include "qom/object.h" =20 #define TYPE_HPPA_CPU "hppa-cpu" +#define TYPE_HPPA64_CPU "hppa64-cpu" =20 OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU) =20 diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h index 798d0c26d7..6995eb69ef 100644 --- a/target/hppa/cpu.h +++ b/target/hppa/cpu.h @@ -243,6 +243,11 @@ struct ArchCPU { =20 #include "exec/cpu-all.h" =20 +static inline bool hppa_is_pa20(CPUHPPAState *env) +{ + return object_dynamic_cast(OBJECT(env_cpu(env)), TYPE_HPPA64_CPU) !=3D= NULL; +} + static inline int cpu_mmu_index(CPUHPPAState *env, bool ifetch) { #ifdef CONFIG_USER_ONLY diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 1644297bf8..192aae268d 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -207,20 +207,24 @@ static void hppa_cpu_class_init(ObjectClass *oc, void= *data) cc->tcg_ops =3D &hppa_tcg_ops; } =20 -static const TypeInfo hppa_cpu_type_info =3D { - .name =3D TYPE_HPPA_CPU, - .parent =3D TYPE_CPU, - .instance_size =3D sizeof(HPPACPU), - .instance_align =3D __alignof(HPPACPU), - .instance_init =3D hppa_cpu_initfn, - .abstract =3D false, - .class_size =3D sizeof(HPPACPUClass), - .class_init =3D hppa_cpu_class_init, +static const TypeInfo hppa_cpu_type_infos[] =3D { + { + .name =3D TYPE_HPPA_CPU, + .parent =3D TYPE_CPU, + .instance_size =3D sizeof(HPPACPU), + .instance_align =3D __alignof(HPPACPU), + .instance_init =3D hppa_cpu_initfn, + .abstract =3D false, + .class_size =3D sizeof(HPPACPUClass), + .class_init =3D hppa_cpu_class_init, + }, +#ifdef TARGET_HPPA64 + { + .name =3D TYPE_HPPA64_CPU, + .parent =3D TYPE_HPPA_CPU, + .instance_init =3D hppa64_cpu_initfn, + }, +#endif }; =20 -static void hppa_cpu_register_types(void) -{ - type_register_static(&hppa_cpu_type_info); -} - -type_init(hppa_cpu_register_types) +DEFINE_TYPES(hppa_cpu_type_infos) diff --git a/target/hppa/translate.c b/target/hppa/translate.c index f86ea9b9ca..83115c944b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -262,6 +262,7 @@ typedef struct DisasContext { int mmu_idx; int privilege; bool psw_n_nonzero; + bool is_pa20; =20 #ifdef CONFIG_USER_ONLY MemOp unalign; @@ -4091,6 +4092,7 @@ static void hppa_tr_init_disas_context(DisasContextBa= se *dcbase, CPUState *cs) =20 ctx->cs =3D cs; ctx->tb_flags =3D ctx->base.tb->flags; + ctx->is_pa20 =3D hppa_is_pa20(cpu_env(cs)); =20 #ifdef CONFIG_USER_ONLY ctx->privilege =3D MMU_IDX_TO_PRIV(MMU_USER_IDX); --=20 2.34.1