From patchwork Thu Aug 24 09:23:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Song Gao X-Patchwork-Id: 716506 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1234718wrp; Thu, 24 Aug 2023 02:25:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFVTFaOnushAAan3U3jlk8khkuA2Ux5G9CF5d9f7KJUvL5n3CnW144cLH2F4Tvtu8gScZU+ X-Received: by 2002:a0c:b31a:0:b0:647:2b16:d154 with SMTP id s26-20020a0cb31a000000b006472b16d154mr15582139qve.1.1692869153089; Thu, 24 Aug 2023 02:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692869153; cv=none; d=google.com; s=arc-20160816; b=GN6LK/YP/uWT/R7xqwchEYEJx8wwCkZPGWTd+qlJxM8l2LE+k9XaQabXA2LVGQJzMs lTgRtbaSIb92P66ycWcW9ZXSXv6sUQV5IFgFeJLZEK8HB1156tvlTa7LItSiNdcVD/VE wxg39xxA22D2U3V+teLZMevKr7MfIPRv9ulOsDZGM9CIVM1gWrNklf8+ujMwMYt9RXYN TIu0EoeEFt59WcSlF13hrj8i2aRhf0+onXQ6sLFCheT7RFX8e84T6Zxxe5hVUA4MxU0h 2VTDRvqJk0b8Dhcg7cijI6CSlKquw64pthEYDT/bCXlgJyARNVJvn1DvWaZJY7bP5OMp LNMw== 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; bh=p9la9lNu/jOCV5YXPYoaFcz3EdNygCBwsPxoxELdFDI=; fh=64Br0Hu6lV8heewipdJI9p0HjLAy9hStM6+wPm6jfNs=; b=mgcn2tmekXsvSjeIa6BjRjbMRbtALOGyysVDd8ehvum68Zs/iMkyxF+XUQBCny0s17 HX8e0K0/YOyECCqVyL2FFmGJ9Gg89Pi8FFQKB7BTjkKRS0A2tIuZmI28psTpzkkrskqt 3fBA3s8o5sGNTM77+HSFUxlZp2AZUFa5yzAwC22VmMPlQRBmBia3dyVJVn+q7q6XpmJ1 diQgLfq/Ii8df6MMbs65lzM71H9avV7E2IUr95TWSFrmviX3SfczA1rRXnk63TqSUS61 75qo3o14y8CTG8jP0pDNejqZDAFgZ3aT1m0QqSwF5FWujZvBfawoZ0khYsOOgFCzdCDp +QbA== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w10-20020a0ca80a000000b006300118fcf3si8096787qva.605.2023.08.24.02.25.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 02:25:53 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zt-0003fE-Iq; Thu, 24 Aug 2023 05:24:33 -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 1qZ6Zq-0003UE-C7 for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:30 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zk-0003Ip-UF for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:29 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8CxtPC+IedkLXkbAA--.56860S3; Thu, 24 Aug 2023 17:24:14 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ826IedkJjhiAA--.40637S3; Thu, 24 Aug 2023 17:24:13 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, richard.henderson@linaro.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 01/31] target/loongarch: Log I/O write accesses to CSR registers Date: Thu, 24 Aug 2023 17:23:39 +0800 Message-Id: <20230824092409.1492470-2-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824092409.1492470-1-gaosong@loongson.cn> References: <20230824092409.1492470-1-gaosong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ826IedkJjhiAA--.40637S3 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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 From: Philippe Mathieu-Daudé Various CSR registers have Read/Write fields. We might want to see guest trying to change such registers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Song Gao Message-Id: <20230821125959.28666-2-philmd@linaro.org> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index ad93ecac92..7107968699 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -544,6 +544,8 @@ static void loongarch_cpu_realizefn(DeviceState *dev, Error **errp) static void loongarch_qemu_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { + qemu_log_mask(LOG_UNIMP, "[%s]: Unimplemented reg 0x%" HWADDR_PRIx "\n", + __func__, addr); } static uint64_t loongarch_qemu_read(void *opaque, hwaddr addr, unsigned size) From patchwork Thu Aug 24 09:23:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Song Gao X-Patchwork-Id: 716503 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1234546wrp; Thu, 24 Aug 2023 02:25:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHedMM2IaF5hom5rQkMvQQjO9St1ZYfMkaBWjDJOEg96cojmtds6UJV7RkDPwGXsXM9mwDr X-Received: by 2002:a05:6214:ac9:b0:64a:a902:2c2d with SMTP id g9-20020a0562140ac900b0064aa9022c2dmr20778251qvi.60.1692869119209; Thu, 24 Aug 2023 02:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692869119; cv=none; d=google.com; s=arc-20160816; b=iiY9vaaWhtZ61qz+TrT7XQCimScpALZe3nqlVyH3utFkcC4HuzhVefPcR+ahsYrFzZ phlQ5NAMjQv3TyUXMNzjEVDQK667F1eHM6r0KCchVfPe8nyfCKD89IyZiz0plOaRvON1 IkFjmkUGzFgw+ZedE6l+UUT1k4oaVKmVx3OzNipzfmciFTPcXU6TWj77dz438tzMTSH/ bPR9o3HVAl+ojIMlQ2nFxCYuQ3LT49CKYmJnlyd0gQtzlS9Qi9V6BHIt3K/gwRm4e3VG x9sb4E8W4DWOd+98WofYMlN2ryHKoTLs3x7YUBzCLHroP2iSVOYpj7NWJXY+DPrOMFWi jKIg== 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; bh=KxoHVjFYNlO21WdPmweLjOJjAeIzGPvfjsFe0d+M7rA=; fh=64Br0Hu6lV8heewipdJI9p0HjLAy9hStM6+wPm6jfNs=; b=GZC5LLsMXbKXp/QJ8wSJvi1vcMxt4iSVSWNVpOAqJX4htaKDFdkt1PYPgx2kgWY6Er 6I5wgHfFNqnFtsGapOCHmyb99otQIdsBA6grP5QgJianPNpNAKo9LiayKnl4GwVqJmWV yV47AYQZMXWjnAzAT7BZgZtCovLlgHflAxg5x+TJ0zvF4FV3/09bCfp7631nTmHJFNrP 1q2Gd3H9BmlpKWRY/k3o5WZr5wRBtqJh96WawESnM+5E7EXyIP2zV9BPjt+nBJZPv2Lh JHHCjj2+2meWD2FLDoJmlGMXPR0NjL0+2Wn2zjzQwGHasYCzFKxdSqBdhlKPTf8GhNS0 aCjg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id z6-20020a0cf006000000b006364e5ef23csi3231625qvk.453.2023.08.24.02.25.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 02:25:19 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zr-0003Xj-MS; Thu, 24 Aug 2023 05:24:31 -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 1qZ6Zn-0003J6-QU for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:27 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zj-0003Kl-UE for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:27 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8Dxl+i+IedkL3kbAA--.19962S3; Thu, 24 Aug 2023 17:24:14 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ826IedkJjhiAA--.40637S4; Thu, 24 Aug 2023 17:24:14 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, richard.henderson@linaro.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 02/31] target/loongarch: Remove duplicated disas_set_info assignment Date: Thu, 24 Aug 2023 17:23:40 +0800 Message-Id: <20230824092409.1492470-3-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824092409.1492470-1-gaosong@loongson.cn> References: <20230824092409.1492470-1-gaosong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ826IedkJjhiAA--.40637S4 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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 From: Philippe Mathieu-Daudé Commit 228021f05e ("target/loongarch: Add core definition") sets disas_set_info to loongarch_cpu_disas_set_info. Probably due to a failed git-rebase, commit ca61e75071 ("target/loongarch: Add gdb support") also sets it to the same value. Remove the duplication. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Song Gao Message-Id: <20230821125959.28666-3-philmd@linaro.org> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 7107968699..dc617be36f 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -723,7 +723,6 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) cc->disas_set_info = loongarch_cpu_disas_set_info; cc->gdb_read_register = loongarch_cpu_gdb_read_register; cc->gdb_write_register = loongarch_cpu_gdb_write_register; - cc->disas_set_info = loongarch_cpu_disas_set_info; cc->gdb_num_core_regs = 35; cc->gdb_core_xml_file = "loongarch-base64.xml"; cc->gdb_stop_before_watchpoint = true; From patchwork Thu Aug 24 09:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Song Gao X-Patchwork-Id: 716504 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1234559wrp; Thu, 24 Aug 2023 02:25:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJQ+syoxGaEUGUN2o/9HShV6KHystlDwE+S96FjpO2r+nmj+oVeqzqgZvPiXsClfKp/Irr X-Received: by 2002:a05:622a:447:b0:3f5:16af:17db with SMTP id o7-20020a05622a044700b003f516af17dbmr19779263qtx.0.1692869122696; Thu, 24 Aug 2023 02:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692869122; cv=none; d=google.com; s=arc-20160816; b=C4JbdpqAhTjLYOG0Sl7mlxs18d1ulTAzAWm9hWCSkYSJBUpfrxjPmYiQS9RlAMb93A 4CbzZufBbEQ9p/C/+YLVm+1tLI0apWqoXIKtq4ZVgzjk7e/sTjWv+a/eYSoCKgxDdxhr dB3xjErUfqraQz7TWAuffkIrewlk7bDvoee79jlHkn0cAO5/u9wY0h6lXmS5moQW0Y+2 YY/ukadyn4LsU/tvenXuCQKDs/uUSitxOoykr0/arELIT9cS1aQrpU+HVG3tFErpz4fc Il995rxCx4sCd+dFQzjq6AKBHA5QdXYSSzUxQ6/CvlxV1DKl1ij5o5T32oYF2DFw0CRE F6Jg== 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; bh=yvJahIhp77M/HY7dMzFletHWlUmkbXj930hizO0bonI=; fh=64Br0Hu6lV8heewipdJI9p0HjLAy9hStM6+wPm6jfNs=; b=paskziv1ZFfAbR4WX7AHH20B8mmBWvwEo/ExFaAVi8adINcrXcV54Cyf5684x87vxa nEY3aGgBi1u/ZfPAgbjCw2PAx9ETJkyTvC9oHXE20X9dAJIvhnN0uU7FFxgbd0x40xSf fE3GuN5uIAhQmHN7OhtHN6wMc19rFiEpQvdpxxdxRTZyAnmgedQAUBdABx2dUmWDPI8S CgAC5gtuZF5EsTE/vSJUEBgjJXYvLpZb7gIul5ib9LdUe1E2lDTxX1gPpu2EXM6CrXoo /LF/So6fokAJP5AO3Rt2oJ5Nnd0PQ+dmVaZm4fI5EoIsfCobTKP2gIqVqQcy7Qo7Rmy9 m7sw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f15-20020ac87f0f000000b0040b4cb9b6f9si8445521qtk.102.2023.08.24.02.25.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 02:25: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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zw-0003pw-0I; Thu, 24 Aug 2023 05:24:36 -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 1qZ6Zr-0003Z6-Ri for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:31 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zl-0003ME-KR for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:31 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxTeu+IedkNnkbAA--.50812S3; Thu, 24 Aug 2023 17:24:14 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ826IedkJjhiAA--.40637S6; Thu, 24 Aug 2023 17:24:14 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, richard.henderson@linaro.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 04/31] target/loongarch: Introduce abstract TYPE_LOONGARCH64_CPU Date: Thu, 24 Aug 2023 17:23:42 +0800 Message-Id: <20230824092409.1492470-5-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824092409.1492470-1-gaosong@loongson.cn> References: <20230824092409.1492470-1-gaosong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ826IedkJjhiAA--.40637S6 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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 From: Philippe Mathieu-Daudé In preparation of introducing TYPE_LOONGARCH32_CPU, introduce an abstract TYPE_LOONGARCH64_CPU. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20230821125959.28666-5-philmd@linaro.org> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 12 +++++++++--- target/loongarch/cpu.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) 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) 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) From patchwork Thu Aug 24 09:23:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Song Gao X-Patchwork-Id: 716505 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1234701wrp; Thu, 24 Aug 2023 02:25:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGoeg6Y++ypnX3mJa4mCGY8WMYcufXiflcpTMFq1dE51ul63aCRV0FCRmvtz3W11VEC9iaW X-Received: by 2002:ac8:7fc9:0:b0:410:60a4:ffbc with SMTP id b9-20020ac87fc9000000b0041060a4ffbcmr20681272qtk.66.1692869150779; Thu, 24 Aug 2023 02:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692869150; cv=none; d=google.com; s=arc-20160816; b=JFOZx4MkwmKmn1NUPLCWYhk96NFkYK2Gqr5vvZoL9y9HB3PrwzYsyMMFKFYqYVJl/0 DAteqPA5l33MjVKN8SDPLW8j5v1gDyrbodQ4L7Ld+Apixj3AcSgGbtgZ08DArai9bDNo JBVD8HKZ222RCF5Ki+8TpoNgs6ZDZW8DiWtJnT16YSNTBTNUVB6dmezE+FFiQCk/32C0 5izuCUd6wo5SoixqVSdRU5jOkYXTuqdqY9RW8Vav2KYbgalHUPU1SKhi6xNf8mi2xEYl 7p4OjTYHwGP+xuLgzUmKRA2F5usMsTvuOmqJZIBc9OYYEZxsuMmirgJm986SCrBWkUNu qWMA== 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; bh=RG53dGIqyIx8W4BovCfejcO3/mEGAYQ8ywaKfAEebW0=; fh=64Br0Hu6lV8heewipdJI9p0HjLAy9hStM6+wPm6jfNs=; b=Wfxmta2UzRxjwLMYXAicgMIZqorQ42EurHAdt+YcqzFt6exr4bnLyfdHMuDYs65u5W D2b2lsMa/0viiCfPXxoGKjn2iwQ0agPMJnHRerohRDq4NLUyVBE2oWf12nUie9rtjg03 L00fXrpvSap9GTw8ft3fyPZcD1YKsnc6T6ot5EaGkGGxZRic64mTXCLKmxA7TO6SlFZM VP4LH6dmNK98qIMppLBxwATglkWWbGb8AKwzTuL/u7bZbzo4nyhxipqEjNEzmTEzSUNY wamHWx00f18rhi+5W0joN7SYAjrufVHCK4V2QOS0sp8GySx4YABNWQan2gBE5qlWu1bs xVpg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bp39-20020a05622a1ba700b00403fc7a84besi3293844qtb.224.2023.08.24.02.25.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Aug 2023 02:25:50 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zt-0003cA-5F; Thu, 24 Aug 2023 05:24:33 -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 1qZ6Zq-0003TP-9Q for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:30 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZ6Zk-0003N4-ME for qemu-devel@nongnu.org; Thu, 24 Aug 2023 05:24:29 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8Cxc_C+IedkOnkbAA--.56248S3; Thu, 24 Aug 2023 17:24:14 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ826IedkJjhiAA--.40637S7; Thu, 24 Aug 2023 17:24:14 +0800 (CST) From: Song Gao To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, richard.henderson@linaro.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 05/31] target/loongarch: Extract 64-bit specifics to loongarch64_cpu_class_init Date: Thu, 24 Aug 2023 17:23:43 +0800 Message-Id: <20230824092409.1492470-6-gaosong@loongson.cn> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230824092409.1492470-1-gaosong@loongson.cn> References: <20230824092409.1492470-1-gaosong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ826IedkJjhiAA--.40637S7 X-CM-SenderInfo: 5jdr20tqj6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=gaosong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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 From: Philippe Mathieu-Daudé Extract loongarch64 specific code from loongarch_cpu_class_init() to a new loongarch64_cpu_class_init(). In preparation of supporting loongarch32 cores, rename these functions using the '64' suffix. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20230821125959.28666-6-philmd@linaro.org> Signed-off-by: Song Gao --- target/loongarch/cpu.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 34d6c5a31d..6384bda1bd 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -695,11 +695,6 @@ static const struct SysemuCPUOps loongarch_sysemu_ops = { }; #endif -static gchar *loongarch_gdb_arch_name(CPUState *cs) -{ - return g_strdup("loongarch64"); -} - static void loongarch_cpu_class_init(ObjectClass *c, void *data) { LoongArchCPUClass *lacc = LOONGARCH_CPU_CLASS(c); @@ -724,16 +719,27 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) cc->disas_set_info = loongarch_cpu_disas_set_info; cc->gdb_read_register = loongarch_cpu_gdb_read_register; cc->gdb_write_register = loongarch_cpu_gdb_write_register; - cc->gdb_num_core_regs = 35; - cc->gdb_core_xml_file = "loongarch-base64.xml"; cc->gdb_stop_before_watchpoint = true; - cc->gdb_arch_name = loongarch_gdb_arch_name; #ifdef CONFIG_TCG cc->tcg_ops = &loongarch_tcg_ops; #endif } +static gchar *loongarch64_gdb_arch_name(CPUState *cs) +{ + return g_strdup("loongarch64"); +} + +static void loongarch64_cpu_class_init(ObjectClass *c, void *data) +{ + CPUClass *cc = CPU_CLASS(c); + + cc->gdb_num_core_regs = 35; + cc->gdb_core_xml_file = "loongarch-base64.xml"; + cc->gdb_arch_name = loongarch64_gdb_arch_name; +} + #define DEFINE_LOONGARCH_CPU_TYPE(size, model, initfn) \ { \ .parent = TYPE_LOONGARCH##size##_CPU, \ @@ -757,6 +763,7 @@ static const TypeInfo loongarch_cpu_type_infos[] = { .parent = TYPE_LOONGARCH_CPU, .abstract = true, + .class_init = loongarch64_cpu_class_init, }, DEFINE_LOONGARCH_CPU_TYPE(64, "la464", loongarch_la464_initfn), };