From patchwork Mon Aug 21 12:59:55 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: 1823633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tgh568op; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RTt0X1HWSz1yNm for ; Mon, 21 Aug 2023 23:01:48 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qY4XK-00011r-8W; Mon, 21 Aug 2023 09:01:39 -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 1qY4WH-0000Mr-8n for qemu-devel@nongnu.org; Mon, 21 Aug 2023 09:00:50 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY4WE-0001Cf-HB for qemu-devel@nongnu.org; Mon, 21 Aug 2023 09:00:32 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-31c3726cc45so1192465f8f.0 for ; Mon, 21 Aug 2023 06:00:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692622828; x=1693227628; 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=XkFQ/Hg2hO7EU81YeAwAVpwO++/fptKuH4LuzhRKmho=; b=tgh568op/VZROyOFlStSZYvij2cw8LzXK5O9jwdOJSOS7g7sXEHVAcEOKBc+Pd8n3w 7vz/NdQEPHMWUBRV+tUnSEjaROy1F1KEbc7M1MOQvL7u234PViJiEQixOwHroMwrhlJ8 IHf6Nox3sW2AdPmj7kALFD8+3YGtmRLZFKlxQH6+71Bhofg45QIiSLoS/CuqWOFGbG2Q qtEb+6wLhFycPTBL01Hkr4tLo0cuV5t9Sj15oXU29czVrWbjrLfCAg0YrOLcjI127PE1 AW8CHpsfNFDfvr/iSoQ8EdHvmSqtyxlAuc82LY3iX6kqDs3FjX4WZlipbTaltshzxQum RH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692622828; x=1693227628; 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=XkFQ/Hg2hO7EU81YeAwAVpwO++/fptKuH4LuzhRKmho=; b=QUs3b1PjD/bDbWDICbkVdmizO9Xhx9fe7wo5UqKe+MUvpUcz23zyLPK27WwF2YgGw8 LvGnfeMvul8Ss7JaBEnl0mpJjAPsEgMlTWbuXFpHKR2vnNshTv2bgR6dzXqDzKah3c+3 9jUUGLmI87BrPRxoOeruIKZeYRdHB+b4Sr11pgqC3yyuhnDOkON9GDKwUGDQAfycnIgR bbs25vPmhktdIyVeVqwdq+eRYpvbXFDqc+z8ZOWbT2Z6xA9rleWAuFz8LWdWpSKa+dJt Dcg1xJqytUKjg8skYdWP+nD7XAX1/nCBzZwSnJ5FNcrPauNqfNXWIixMml3DwocMxjFF vMLw== X-Gm-Message-State: AOJu0YxHCa4GjfFzUSkhF1fQ7e+F1modKSkS7xDFbz9QCcm86tXobQIU zqsKKrQcP2NnZJInA9swDXdQge2gKzJ5mo10Fsw= X-Google-Smtp-Source: AGHT+IGSCdh/opmmxJN1U8pTVB8rjixzHfwXlOdOkJvD0pcY1poV5j9WMcvQsRxHK+NWrowPhmQnCg== X-Received: by 2002:adf:ce8f:0:b0:31a:ddb3:32da with SMTP id r15-20020adfce8f000000b0031addb332damr5520091wrn.22.1692622828027; Mon, 21 Aug 2023 06:00:28 -0700 (PDT) Received: from m1x-phil.lan (static-176-182-122-208.ncc.abo.bbox.fr. [176.182.122.208]) by smtp.gmail.com with ESMTPSA id n16-20020a5d4850000000b003179b3fd837sm12464009wrs.33.2023.08.21.06.00.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 21 Aug 2023 06:00:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= , Song Gao , Jiajie Chen , Xiaojuan Yang , Huacai Chen , Richard Henderson Subject: [PATCH v3 4/8] target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU Date: Mon, 21 Aug 2023 14:59:55 +0200 Message-ID: <20230821125959.28666-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230821125959.28666-1-philmd@linaro.org> References: <20230821125959.28666-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org In preparation of introducing TYPE_LOONGARCH32_CPU, introduce an abstract TYPE_LOONGARCH64_CPU. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/loongarch/cpu.h | 1 + target/loongarch/cpu.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index fa371ca8ba..c50b3a5ef3 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -377,6 +377,7 @@ struct ArchCPU { }; #define TYPE_LOONGARCH_CPU "loongarch-cpu" +#define TYPE_LOONGARCH64_CPU "loongarch64-cpu" OBJECT_DECLARE_CPU_TYPE(LoongArchCPU, LoongArchCPUClass, LOONGARCH_CPU) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index a1ebc20330..34d6c5a31d 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -734,9 +734,9 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) #endif } -#define DEFINE_LOONGARCH_CPU_TYPE(model, initfn) \ +#define DEFINE_LOONGARCH_CPU_TYPE(size, model, initfn) \ { \ - .parent = TYPE_LOONGARCH_CPU, \ + .parent = TYPE_LOONGARCH##size##_CPU, \ .instance_init = initfn, \ .name = LOONGARCH_CPU_TYPE_NAME(model), \ } @@ -752,7 +752,13 @@ static const TypeInfo loongarch_cpu_type_infos[] = { .class_size = sizeof(LoongArchCPUClass), .class_init = loongarch_cpu_class_init, }, - DEFINE_LOONGARCH_CPU_TYPE("la464", loongarch_la464_initfn), + { + .name = TYPE_LOONGARCH64_CPU, + .parent = TYPE_LOONGARCH_CPU, + + .abstract = true, + }, + DEFINE_LOONGARCH_CPU_TYPE(64, "la464", loongarch_la464_initfn), }; DEFINE_TYPES(loongarch_cpu_type_infos)