From nobody Fri Apr 19 22:01:00 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=1659729489; cv=none; d=zohomail.com; s=zohoarc; b=CP15DD9rtJ2dV11wA6EldGipqEsw93ZiugfVVuC8do0mnhCnFKseISTUEf98jSjAYg7uHQxtPw3q5DoMsjeQZntorBCFFqAg0iHCuPQxRXMEKoy+doBvnpWTe/PvU0zONxI1nCcW3i4ybrlMSYvzpAuVG5T3Oa9GDonKb8mpx04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659729489; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XoU1ivq664BvtVyoqP3w9U5Cy8Z2Wrd2UTjf3IBy+og=; b=RisFV7OHVBZOngdsUjnQtUhmpkH0EFRKjc/CM1a41FGoJYs2bhHiw/85+sZnjYEZJ9rw+Xhy8viT+4NrCaK5T0dNSmzHrZaQApS8Af8NWMjUfJPc0SuJbnwfjCWuguO+0g2B3o3nbA+KK0E8y7WC0FMLsszF/jD/AwcIQn4Lm9U= 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 1659729489735816.022373800834; Fri, 5 Aug 2022 12:58:09 -0700 (PDT) Received: from localhost ([::1]:43278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK3SS-0003X4-Ot for importer@patchew.org; Fri, 05 Aug 2022 15:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK3Pl-0006O1-89 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:21 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:56281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oK3Pj-0004VJ-PK for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:20 -0400 Received: by mail-pj1-x1029.google.com with SMTP id a8so3657685pjg.5 for ; Fri, 05 Aug 2022 12:55:19 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:abf8:e436:f4c:9089]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f70d00b0016f0c2ea158sm3393048plo.157.2022.08.05.12.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 12:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XoU1ivq664BvtVyoqP3w9U5Cy8Z2Wrd2UTjf3IBy+og=; b=FkgaMo+C+6HJ7MZqb7CEjwD5SBayfdFuUK2Scu2quYO3o4FKx3jXcYa9ud0WAgCSin ySmjj6lMnALnumdmlEALj2IwyIZajl53PSrIqnlV0Wyy1BQpWvdjLVRGMipxLOQwH92q KzKtJMluVe3x/4NwQKX/9jpeMlI7kU2p2NbX6oZqFqR4J6n8X97gZbMH0gZddhUAXZKy HYkyIzgUH0Qj9+1BucFb7pj3dFHvoUOPDsO4CXNHAYi5bO26z1Dfze2A+MlsAlVgtuhg Y1PDhYCCH5wbuteTn4xLZGeCUsweXExqwMYPxaQsUv+FD8K7gDR8OjD0XDJurCAEJJ7U C8BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XoU1ivq664BvtVyoqP3w9U5Cy8Z2Wrd2UTjf3IBy+og=; b=pT8JXNMTs/AoAhltQhS6covNN8lE5fSPjYX8RICcisNSmjEBP0iXb7VMM75+o8adNb MaEVJjO0cg3KNDSEvxodieCnXKV/kKbod4iRs4Bb/dkxeq50aEFXh7Ur7ZjxFLcGoSX0 yZIllzExIV46WpC27QWOrDotMNmp8y7AaX+SwVtgEcLNqyS8YFub9Wst1dK8v5URHXbT QOz2bhPQv6RGdfnKh5cZyI0M73TFUthSi6uMMgiXu/y8Dz/FccVCnsgFpTzLKUZegrYg dnBtanCgMKSMvNT2zN4p46av4y1D0kQQEw32qtPd8hEHfaR9/4lG9WuHtaqe6OusMqOw pVbg== X-Gm-Message-State: ACgBeo1Ts/sf1/bp5McZ6hc7KSeoPMjhnjJm7PuSSbqfDSseaiUkUG6I CcxXlT6otC+IfBs0AVrK7TNX3pC4C0hTHA== X-Google-Smtp-Source: AA6agR6HGWlkXQjYCp4wVYVTWW8rzrS9pS9gmbzfqZevMwJp6SIOtHv6Q5s8w1PuGbx2CGIGLCII2w== X-Received: by 2002:a17:90b:4f42:b0:1f5:6976:7021 with SMTP id pj2-20020a17090b4f4200b001f569767021mr9472482pjb.30.1659729318421; Fri, 05 Aug 2022 12:55:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Qi Hu , Song Gao Subject: [PULL 1/7] target/loongarch: Fix macros SET_FPU_* in cpu.h Date: Fri, 5 Aug 2022 12:55:09 -0700 Message-Id: <20220805195515.349768-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805195515.349768-1-richard.henderson@linaro.org> References: <20220805195515.349768-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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659729492079100001 Content-Type: text/plain; charset="utf-8" From: Qi Hu The macros SET_FPU_* are used to set corresponding bits of fcsr. Unfortunately it forgets to set the result and it causes fcsr's "CAUSE" never being updated. This patch is to fix this bug. Signed-off-by: Qi Hu Reviewed-by: Song Gao Message-Id: <20220804132450.314329-1-huqi@loongson.cn> Signed-off-by: Richard Henderson --- target/loongarch/cpu.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/target/loongarch/cpu.h b/target/loongarch/cpu.h index a36349df83..dce999aaac 100644 --- a/target/loongarch/cpu.h +++ b/target/loongarch/cpu.h @@ -47,11 +47,23 @@ FIELD(FCSR0, FLAGS, 16, 5) FIELD(FCSR0, CAUSE, 24, 5) =20 #define GET_FP_CAUSE(REG) FIELD_EX32(REG, FCSR0, CAUSE) -#define SET_FP_CAUSE(REG, V) FIELD_DP32(REG, FCSR0, CAUSE, V) +#define SET_FP_CAUSE(REG, V) \ + do { \ + (REG) =3D FIELD_DP32(REG, FCSR0, CAUSE, V); \ + } while (0) + #define GET_FP_ENABLES(REG) FIELD_EX32(REG, FCSR0, ENABLES) -#define SET_FP_ENABLES(REG, V) FIELD_DP32(REG, FCSR0, ENABLES, V) +#define SET_FP_ENABLES(REG, V) \ + do { \ + (REG) =3D FIELD_DP32(REG, FCSR0, ENABLES, V); \ + } while (0) + #define GET_FP_FLAGS(REG) FIELD_EX32(REG, FCSR0, FLAGS) -#define SET_FP_FLAGS(REG, V) FIELD_DP32(REG, FCSR0, FLAGS, V) +#define SET_FP_FLAGS(REG, V) \ + do { \ + (REG) =3D FIELD_DP32(REG, FCSR0, FLAGS, V); \ + } while (0) + #define UPDATE_FP_FLAGS(REG, V) \ do { \ (REG) |=3D FIELD_DP32(0, FCSR0, FLAGS, V); \ --=20 2.34.1 From nobody Fri Apr 19 22:01:00 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=1659729434; cv=none; d=zohomail.com; s=zohoarc; b=EqPU27LjbggdVoU6IXhKDhNQ1Zx4fahlOcQjY8eSrnX3gWi+C5NRw98D6H+6bskVdJVxZA0dC9yxK4tvuJeWVj0w4qU86RlJUFEI67g5m/t5hl53zxoVjKPMQO2a1ObZkiUYjtlOlbuQBQ5A2dygcWEuqRBaweYsxqOtmWsIkDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659729434; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4MB0kNBsKeqajf853oKvTERPcRFUevz8GQAfrSDwCPo=; b=LWPB7g7o6nB1gC4L80AJfNoGnwEiMliQUkbvJCYIzvzN/xQixWakQAsXsSzCmqtqmucq9vrkTFr9QQx+IhxTopVppHbevx0syd6VeTCtvPz+JW46DBABWMqkyLuWj40rNyKssVCSCaa+yGr4xuGcCIQhNo69JrEakchw7OFuSDQ= 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 1659729434520711.565269720081; Fri, 5 Aug 2022 12:57:14 -0700 (PDT) Received: from localhost ([::1]:39282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK3RZ-0000sI-BE for importer@patchew.org; Fri, 05 Aug 2022 15:57:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK3Pn-0006R2-9F for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:23 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:46850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oK3Pl-0004Ve-J3 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:23 -0400 Received: by mail-pj1-x1029.google.com with SMTP id q7-20020a17090a7a8700b001f300db8677so3810894pjf.5 for ; Fri, 05 Aug 2022 12:55:21 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:abf8:e436:f4c:9089]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f70d00b0016f0c2ea158sm3393048plo.157.2022.08.05.12.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 12:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4MB0kNBsKeqajf853oKvTERPcRFUevz8GQAfrSDwCPo=; b=Y+AanmjielSl7eeqmq/xQF2T/QH4R/aFHpTlJlyy4/xn4BcOhrgliBjFgNPMvPVNM4 Zf9lT4w/ZpKWZHWfe3JQ02Chd7T8nNM+nuKYYntdKYNTTHsIzffcRG0w9Atrq1UoxwdB TjnH+NAxQm4SBntvpOjpoF5q/5hzdHJWlVY6y+YVOBuQPIUOEn3aUd3f6wg+xJglwlmO 65+dg/m8A2FgGq13W6PvLvomrjhBFHuydq8yNAMyrFx1ywZWy1dSeyyZEmtGUjIwz9MA Wc+nC1M4fiKmQk+N6+yaZl2SIGwq4FCESNZHLZlgcyAK2x16eM+P5d677v7aIvnzN9br TIOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4MB0kNBsKeqajf853oKvTERPcRFUevz8GQAfrSDwCPo=; b=rMoa5+ZU6BO0z/4zUPP+RymIs9J9uAA1U+9PAdZA19v7LC2rrOC1DaglpjM/cuMrQH I75ZI2gXI9CbubE2a4eDzC/cwCiwtsaY2s3xkEYLcUOBNkGlClU7bSEkj/uJQ4EphfuC tuf5hAh8lntVCyxHbvXyDtd/eEoL7Jyq8YZF0edZhYgswtSdexVLkN9zYP5ixob+0nBs /PvPP60PEBQBMDso340aWz/MmuXg6P0ak2ln87GzrA8bMJW7lp5UIALtaU4CgtdkCGyd DLLtHhpQF+WExXLeBoz8usCC1E942VTCmBagf5/wA+i6SUloraSsIRsw30TBUlcplgNA /Ofw== X-Gm-Message-State: ACgBeo02L/jB0E6Gj8eetAijU21mUJD48lYvX/LQTofFQ0ooyFf1kcoV xktI7IxKG9AI+1pg/ex6qtWaOJWOuBVCEQ== X-Google-Smtp-Source: AA6agR6TFuy2T5aLJkLN74un+YmMFEDuAZwW3Eyqs/Aev1sgz2qBJlx7z2AZxqYFQ9/l1OSzwMIzBg== X-Received: by 2002:a17:902:aa98:b0:16c:d74d:fe6c with SMTP id d24-20020a170902aa9800b0016cd74dfe6cmr8527868plr.134.1659729320002; Fri, 05 Aug 2022 12:55:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , Peter Maydell Subject: [PULL 2/7] hw/loongarch: remove acpi-build.c unused variable 'aml_len' Date: Fri, 5 Aug 2022 12:55:10 -0700 Message-Id: <20220805195515.349768-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805195515.349768-1-richard.henderson@linaro.org> References: <20220805195515.349768-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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659729435502100003 Content-Type: text/plain; charset="utf-8" From: Song Gao Fix a compiler warning on openbsd: ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len' set but not used [-Wunused-but-set-variable] size_t aml_len =3D 0; ^ Reported-by: Peter Maydell Signed-off-by: Song Gao Reviewed-by: Richard Henderson Message-Id: <20220721040046.3985609-1-gaosong@loongson.cn> [rth: Removing aml_len in turn makes fadt set but not used.] Signed-off-by: Richard Henderson --- hw/loongarch/acpi-build.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/hw/loongarch/acpi-build.c b/hw/loongarch/acpi-build.c index 4b4529a3fb..d0f01a6485 100644 --- a/hw/loongarch/acpi-build.c +++ b/hw/loongarch/acpi-build.c @@ -411,9 +411,8 @@ static void acpi_build(AcpiBuildTables *tables, Machine= State *machine) LoongArchMachineState *lams =3D LOONGARCH_MACHINE(machine); GArray *table_offsets; AcpiFadtData fadt_data; - unsigned facs, rsdt, fadt, dsdt; + unsigned facs, rsdt, dsdt; uint8_t *u; - size_t aml_len =3D 0; GArray *tables_blob =3D tables->table_data; =20 init_common_fadt_data(&fadt_data); @@ -437,21 +436,13 @@ static void acpi_build(AcpiBuildTables *tables, Machi= neState *machine) dsdt =3D tables_blob->len; build_dsdt(tables_blob, tables->linker, machine); =20 - /* - * Count the size of the DSDT, we will need it for - * legacy sizing of ACPI tables. - */ - aml_len +=3D tables_blob->len - dsdt; - /* ACPI tables pointed to by RSDT */ - fadt =3D tables_blob->len; acpi_add_table(table_offsets, tables_blob); fadt_data.facs_tbl_offset =3D &facs; fadt_data.dsdt_tbl_offset =3D &dsdt; fadt_data.xdsdt_tbl_offset =3D &dsdt; build_fadt(tables_blob, tables->linker, &fadt_data, lams->oem_id, lams->oem_table_id); - aml_len +=3D tables_blob->len - fadt; =20 acpi_add_table(table_offsets, tables_blob); build_madt(tables_blob, tables->linker, lams); --=20 2.34.1 From nobody Fri Apr 19 22:01:00 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=1659729602; cv=none; d=zohomail.com; s=zohoarc; b=cxIxrbCdrEUnSS3aAi4hrT/I+Fwy5LfARrUUqTx7kVZE0oZUbMENf1pDLd6fE6b6859xVmXGhlnmMRTDHW9sytWtqqCXuWkjxQol8dofDl7I9/Wj6OGZDLckQP5Lr1vg2TcYLSDqRWR50dM6cgJRkx5SwmB7FYAFKeOkg3MI7Cg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659729602; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IDbgFIeEevSSdSTdjElX+eMs94p5XOKIDT8YgfUxWj8=; b=f4sBJwkDo4bwBjGxyS0mI8YXjD0bjOxXCIT3Y43vbzydoaFb21qh33Bbcp8jLr91+Lh/1RuLQEhVVPL7l3Wts/yJOqC+WlJVu65BS/81sS4LsvAKuNn6QlXwYOZmx6GnQX48wrmWbVZ3/9kNQ1DQYwlyykPFAA3215kPjqZU3b8= 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 1659729602235617.0230004238265; Fri, 5 Aug 2022 13:00:02 -0700 (PDT) Received: from localhost ([::1]:47986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK3UH-0006sL-8I for importer@patchew.org; Fri, 05 Aug 2022 16:00:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK3Po-0006Ue-IS for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:24 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:40893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oK3Pm-0004Vy-R8 for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:24 -0400 Received: by mail-pj1-x1035.google.com with SMTP id s5-20020a17090a13c500b001f4da9ffe5fso9184950pjf.5 for ; Fri, 05 Aug 2022 12:55:22 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:abf8:e436:f4c:9089]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f70d00b0016f0c2ea158sm3393048plo.157.2022.08.05.12.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 12:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IDbgFIeEevSSdSTdjElX+eMs94p5XOKIDT8YgfUxWj8=; b=FuER+dFB+hNh+OwvWV/DAyxCJ40PNyEhfYQs1+zFLHBtDvW/j3QWy/sRhvT4bSf24T 0j/EBgMPPSHP2R6GtaVytn9jHvJBrbbaM/F+irAGNVyl1AmD5KRR8lFGtM0UVDxe7POF MG0DJjtkRI2yKZ9y6WqXOXhFmTDNZZhNppCmOP9boJz3JSiHBhcs1IVZmF8dg2O9agCU aNWkKVBrlAE9ztcKpQ7HZdHcoicGgCMP4VZqPyIqjoyOC96NibchdGCDq6GykYA2JNcF Ab+vtvvDlbcCVWo7e7t0LdIWGHf9raHc+PUhR5MRyjyc2LRqsDvDbyxQvEoyAHeliEY5 fvXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IDbgFIeEevSSdSTdjElX+eMs94p5XOKIDT8YgfUxWj8=; b=6nGcSn2vTakr36iz1CRyUZZg5D/jumBknYNJi6GAdNqhyuCGwn5RLHOAqMEoH1WVFC fCKrCbDkMka+ivJjm7X49GAFHABX/HQfSHePCBC2wxpABeKL8hvpPn4wMrLt9COwaGk6 EkejAXyAtH3O7J8XHfFFMa3eCe4JjrSgMea6Z2xp4rsafLsDdLFai0WLh/J46y5V2ya1 AkH3ZKdEaWXA2jyhDTJWufGKDpQtgwNMbhc+sVYqcgmuJaw9tIVjhAI/lRUt3R08paW3 /RWQg0feUdEvuKbYgsfATAGpu1gjk4aMnUblTOnsMb+lLgTOa/5rTa6HVZAs86eF7NXA A2Rw== X-Gm-Message-State: ACgBeo2EffwLQsqaE9jVIqTQtAnC9w6uTFygR9xukzOGx5N2Lse8vEIx bQrWGqltNLPCyrDMbwrwB9bJdLGXNDWkJg== X-Google-Smtp-Source: AA6agR5y3HdUBTpC22kuKCpkVWeZqqUAlrQmYgo0Ykqr3472aUAo7D4KloU6SVDJLAGwe17WYA0WSw== X-Received: by 2002:a17:902:e548:b0:16f:8df8:90d3 with SMTP id n8-20020a170902e54800b0016f8df890d3mr6138794plf.90.1659729321572; Fri, 05 Aug 2022 12:55:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 3/7] target/loongarch: Fix GDB get the wrong pc Date: Fri, 5 Aug 2022 12:55:11 -0700 Message-Id: <20220805195515.349768-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805195515.349768-1-richard.henderson@linaro.org> References: <20220805195515.349768-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659729602646100001 From: Song Gao GDB LoongArch add a register orig_a0, see the base64.xml [1]. We should add the orig_a0 to match the upstream GDB. [1]: https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loonga= rch/base64.xml Signed-off-by: Song Gao Reviewed-by: Richard Henderson Acked-by: Alex Benn=C3=A9e Message-Id: <20220805033523.1416837-2-gaosong@loongson.cn> --- target/loongarch/cpu.c | 2 +- target/loongarch/gdbstub.c | 7 +++++-- gdb-xml/loongarch-base64.xml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 1c69a76f2b..d84ec38cf7 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -683,7 +683,7 @@ static void loongarch_cpu_class_init(ObjectClass *c, vo= id *data) cc->gdb_read_register =3D loongarch_cpu_gdb_read_register; cc->gdb_write_register =3D loongarch_cpu_gdb_write_register; cc->disas_set_info =3D loongarch_cpu_disas_set_info; - cc->gdb_num_core_regs =3D 34; + cc->gdb_num_core_regs =3D 35; cc->gdb_core_xml_file =3D "loongarch-base64.xml"; cc->gdb_stop_before_watchpoint =3D true; =20 diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c index 24e126fb2d..5feb43445f 100644 --- a/target/loongarch/gdbstub.c +++ b/target/loongarch/gdbstub.c @@ -19,8 +19,11 @@ int loongarch_cpu_gdb_read_register(CPUState *cs, GByteA= rray *mem_buf, int n) if (0 <=3D n && n < 32) { return gdb_get_regl(mem_buf, env->gpr[n]); } else if (n =3D=3D 32) { - return gdb_get_regl(mem_buf, env->pc); + /* orig_a0 */ + return gdb_get_regl(mem_buf, 0); } else if (n =3D=3D 33) { + return gdb_get_regl(mem_buf, env->pc); + } else if (n =3D=3D 34) { return gdb_get_regl(mem_buf, env->CSR_BADV); } return 0; @@ -36,7 +39,7 @@ int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_= t *mem_buf, int n) if (0 <=3D n && n < 32) { env->gpr[n] =3D tmp; length =3D sizeof(target_ulong); - } else if (n =3D=3D 32) { + } else if (n =3D=3D 33) { env->pc =3D tmp; length =3D sizeof(target_ulong); } diff --git a/gdb-xml/loongarch-base64.xml b/gdb-xml/loongarch-base64.xml index 4962bdbd28..a1dd4f2208 100644 --- a/gdb-xml/loongarch-base64.xml +++ b/gdb-xml/loongarch-base64.xml @@ -39,6 +39,7 @@ + --=20 2.34.1 From nobody Fri Apr 19 22:01:00 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=1659729775; cv=none; d=zohomail.com; s=zohoarc; b=IPTKXQRPRjSgu1KOeWdxQlUCYzYS9+aZdzVz5rywII0/UduPdpoilZaxUxuHxWw9ygGeUh9s5ss+nNn9jDwB8Ud1bIGaHMtmRO5JTE3aYL5Xd+n+ksKOwZx+wykOq7jRSkGGmOUxbSj8mMcEgOPJ1/7r0WY0hLyLCbjpkY45y6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659729775; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GXhVqFyj2uRqAwlXF7c/Ivc+Hg/JsHzuWch+Fk+p75k=; b=gVv5mSTEpXaalMbUt0DEaEHVqMrbE0BdoUKtFdUMclMoKn54DQe4VLIX0bvmmv+IC8JDca14BsPtuqimYoi2ic5IfZLg4CxHtJ9BtPye5rJmUdzeEbkZB2T6vaK6PJRXoKvJMlhGSpye1fLD8/TgPnApK3oXYjSEbWNjwVgTLnY= 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 1659729775008871.7538411833237; Fri, 5 Aug 2022 13:02:55 -0700 (PDT) Received: from localhost ([::1]:50406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK3X3-0000ba-BP for importer@patchew.org; Fri, 05 Aug 2022 16:02:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK3Pq-0006ay-Si for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:26 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:42789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oK3Po-0004WL-8l for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:26 -0400 Received: by mail-pj1-x1032.google.com with SMTP id d65-20020a17090a6f4700b001f303a97b14so3856495pjk.1 for ; Fri, 05 Aug 2022 12:55:23 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:abf8:e436:f4c:9089]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f70d00b0016f0c2ea158sm3393048plo.157.2022.08.05.12.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 12:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GXhVqFyj2uRqAwlXF7c/Ivc+Hg/JsHzuWch+Fk+p75k=; b=EBGvIJfA5Gyfc+E07cUyhypCHOY9RQOGqe3CrVFR855uUXSgeU94U9Tbai2TloGVP/ K6wA5lZ6S+IeqlUe6TdLDQi0MGuZcbWwmbSZPmFQVCXq5julbuxqa94Yci+LTebphWW0 0zCrbO/YsGL2bT4nZTaytu7FFTYwRd+TB99B0Fh5AM3QutoeSJ5OyUgaoxsRqeFxhlQu RgPYDeZHiudGlj1sRnU8hRJLY9RPekpvWLd6gRWb/LZ/e7ZzaP7bGA57a1VnStbe5cWj SEOT8tHEMezDIlgiFQCJk04VYzuGUa1m8r3v4j6p6zGswLNlH9UOVzIKcmMWL1GV4PLs Ocfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GXhVqFyj2uRqAwlXF7c/Ivc+Hg/JsHzuWch+Fk+p75k=; b=0akCeIOe1CSkvjchbUWHDo81hrQFcBFg/tlJYznqDpeSfmQUcaY8esiQu62+QeghsO x5F3CkakixKvGeBE/8Ux3lJBqUf8gY0Lu1hFBnXcYHJJUfVLJ0wAOw4BWDsbQsnWeE6W jt4r1tdxOOQ1Pqb2ZA1ioIFcwsMFGNR7I7q8adNjTI/WK8C8LTavI9yHSfN/6ESZHLlw SUg4L07JEx+Hs8xdUI58/3tfKOdUfta+HDkQ0QEnyG+liEwFnrHRJ+pYTOUUH5WJdHmY Ao0hijvYPhzgCYryluxY5OWyrqbSCpfb7Ddy4sSKYkTMHEL/U4Ill9lir+luAiAp/LJQ p+Wg== X-Gm-Message-State: ACgBeo1yKFTpe/pZspDhYQpAUoCi/3gsGbXPImhCUs9LubHacqGBtRfb xMEFTazi0WrpBf4SgnEK1Jm3BYBC08jt1Q== X-Google-Smtp-Source: AA6agR4eErTt67grIFYsXaRaeFM9kIOWRYYK8ak20SDXfxdwArkzvGv5dQWV4DFw/OBwHWlJEVNpfA== X-Received: by 2002:a17:902:8f91:b0:16c:151d:3e1b with SMTP id z17-20020a1709028f9100b0016c151d3e1bmr7976125plo.37.1659729322842; Fri, 05 Aug 2022 12:55:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 4/7] target/loongarch: add gdb_arch_name() Date: Fri, 5 Aug 2022 12:55:12 -0700 Message-Id: <20220805195515.349768-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805195515.349768-1-richard.henderson@linaro.org> References: <20220805195515.349768-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659729776033100001 From: Song Gao Matches bfd/cpu-loongarch.c, bfd_loongarch_arch. Reviewed-by: Richard Henderson Signed-off-by: Song Gao Acked-by: Alex Benn=C3=A9e Message-Id: <20220805033523.1416837-3-gaosong@loongson.cn> --- target/loongarch/cpu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index d84ec38cf7..941e2772bc 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -661,6 +661,11 @@ static const struct SysemuCPUOps loongarch_sysemu_ops = =3D { }; #endif =20 +static gchar *loongarch_gdb_arch_name(CPUState *cs) +{ + return g_strdup("loongarch64"); +} + static void loongarch_cpu_class_init(ObjectClass *c, void *data) { LoongArchCPUClass *lacc =3D LOONGARCH_CPU_CLASS(c); @@ -686,6 +691,7 @@ static void loongarch_cpu_class_init(ObjectClass *c, vo= id *data) cc->gdb_num_core_regs =3D 35; cc->gdb_core_xml_file =3D "loongarch-base64.xml"; cc->gdb_stop_before_watchpoint =3D true; + cc->gdb_arch_name =3D loongarch_gdb_arch_name; =20 #ifdef CONFIG_TCG cc->tcg_ops =3D &loongarch_tcg_ops; --=20 2.34.1 From nobody Fri Apr 19 22:01:00 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=1659729435; cv=none; d=zohomail.com; s=zohoarc; b=lcEi3GO5r8/sW8IcoLRnX0b2VeO398PCq3eW1b+ntNRCGnsvJCrI6EbP8nADnMk4Rnedufkq/eoaZgQ9xODh78kKv+XgN20KUmHE1qOZuveY6/9+sOyNpZ1TRUullEbWQyVqyH9wZ+EqYdLBHDK7ryA5svcZc5siebVky98N9ME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659729435; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OYksRbozJz/8hpYBfMoGN+EQkbHN1ocDywW1SbrIXTg=; b=WhOdDWkqUmAGvWvQHKKJf4bODLKK5p+1m7X078I4J9kM1fvfQHB0tGm8J7D/lRalblkI/xtzfgx2sLhEILvs6uZq/GlbhltBzOpYtksNSZ3ZbaWEwp0cn8Pv9C9eOTgwm67vOI5FIABt7LL1AHyKy4/VmnDK81PFDs19Ok2o6AE= 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 1659729435509309.0985287947376; Fri, 5 Aug 2022 12:57:15 -0700 (PDT) Received: from localhost ([::1]:39388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK3Ra-0000wy-GJ for importer@patchew.org; Fri, 05 Aug 2022 15:57:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK3Pq-0006aA-HN for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:26 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]:38411) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oK3Po-0004V6-Vv for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:26 -0400 Received: by mail-pl1-x62b.google.com with SMTP id o3so3517708ple.5 for ; Fri, 05 Aug 2022 12:55:24 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:abf8:e436:f4c:9089]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f70d00b0016f0c2ea158sm3393048plo.157.2022.08.05.12.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 12:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OYksRbozJz/8hpYBfMoGN+EQkbHN1ocDywW1SbrIXTg=; b=tJX4ZaOcVG9la5ThSfcF3f59T05kNoCjjvlfQVvxd627cVTFIsZ4k7gVVOkvKne9I4 AAUHcJy1YFi/wOOTiUZ/T2paWW7wzzOE9HI/TBdyvF7X6TgyEkt9o8cGiALATCND+iBf tIiV7a8S4A+RJWgLzfj1V0j5nLy/8kje0/zS3DCDVWpdN/fPU15lWLs22CUqKfWNQOkO VYmRlGnyEz2zyTXZQFJ9dSVWAff1HT86jJ/CjsZs7eWSksVq+rgaUADBga7EYNUKVkpS BvUXK7iFoVccQJKSRXzNZ7uObYpgOwAF0LE07jtHecD9/MPrchWr5K+JzjhBxcUIJI0L RZ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OYksRbozJz/8hpYBfMoGN+EQkbHN1ocDywW1SbrIXTg=; b=IHKacgm+ZJMPtiLjGc2o2bwzMkM90lgtvW0i63qmQkayg/GWFaV0xnj/N+VuMUn96Q b881g3t3JGR7UdSFywAflgYzZDt4+jYljrzZ/EOTcNjfwfjx1zQM2OtjwtmgyoOPGWCO ZEmLahEfYDCY7/nioQB1dahbBb6diL4SbHeUjd0Vxd/kKpIkvetbSNA11zuVVaI4r7bR WXkYlQBLJ0ZRzzftgqTZtOlpQkh1aWuT2H3BxMJbstGmHaTYOeJos+utbcNubem05ePh eo7zQrne3oAcIJkpN1mTFg3/LeRnVmFo1d8lztbl6V7BL5jv3J3QYr4wwUzi/rrug7CA vQKQ== X-Gm-Message-State: ACgBeo0MtJR1SZ42TIC8HOpL/xGkQ4naLkujCvHhw7Kj9U+X+rWTXmtm jReGV9BWNkTyBMfrkF8f05KdjNhIAECJ3A== X-Google-Smtp-Source: AA6agR7GecYv7QXGtJwZqI7TSJrI8tmAus0YHB6m/JHtDEy5THoYPb2gPPqqlXBUwoM7zEIsAxK7tQ== X-Received: by 2002:a17:902:d50e:b0:16f:eb61:157e with SMTP id b14-20020a170902d50e00b0016feb61157emr2542213plg.3.1659729324158; Fri, 05 Aug 2022 12:55:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 5/7] target/loongarch: update loongarch-base64.xml Date: Fri, 5 Aug 2022 12:55:13 -0700 Message-Id: <20220805195515.349768-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805195515.349768-1-richard.henderson@linaro.org> References: <20220805195515.349768-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659729437481100005 From: Song Gao Update loongarch-base64.xml to match the upstream GDB [1]. [1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongar= ch/base64.xml Reviewed-by: Richard Henderson Signed-off-by: Song Gao Acked-by: Alex Benn=C3=A9e Message-Id: <20220805033523.1416837-4-gaosong@loongson.cn> --- gdb-xml/loongarch-base64.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb-xml/loongarch-base64.xml b/gdb-xml/loongarch-base64.xml index a1dd4f2208..2d8a1f6b73 100644 --- a/gdb-xml/loongarch-base64.xml +++ b/gdb-xml/loongarch-base64.xml @@ -1,5 +1,5 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gdb-xml/loongarch-fpu64.xml b/gdb-xml/loongarch-fpu64.xml deleted file mode 100644 index e52cf89fbc..0000000000 --- a/gdb-xml/loongarch-fpu64.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --=20 2.34.1 From nobody Fri Apr 19 22:01:00 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=1659729942; cv=none; d=zohomail.com; s=zohoarc; b=MyOeYhwofighC+Gh9HjeKQ2/Lb+R9UwI7G98N4iX8U5+GrZ1rFMlYP0s3/3X8Ck63Qe4p7GiCeg42OfJQrPYRGa6Uiy3Kxv74y1Dm55HolOnYYUT2UWEnT1j0mcHBktEh52sC8p84qSZvp2X8r4QFp6iecpRH2PJ/dm9UVq7wrU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659729942; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Kfx1lrx4WNwVLD4+SbP89f5w4riUSjZqaLsw6gR72p0=; b=VNnAQj2ZXWL0sxnAu2sArsb/EB+10/wprm8uTM2gPELcLE3heFpBCPPHzdqfddbQH12aYItTNa7zG6QwdCvuk0hog6C/0CTWNZvxBAnVrEaRzmGfRlNCcRv/FET9FMUYoJ8PdQ35T4hZWxj9qmOw4NwVD4qcK9PvTEYwBOCRxNM= 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 1659729942719552.737408734879; Fri, 5 Aug 2022 13:05:42 -0700 (PDT) Received: from localhost ([::1]:53122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oK3Zk-0002VM-UD for importer@patchew.org; Fri, 05 Aug 2022 16:05:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oK3Pu-0006mH-Mg for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:30 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:38701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oK3Ps-0004aZ-UV for qemu-devel@nongnu.org; Fri, 05 Aug 2022 15:55:30 -0400 Received: by mail-pj1-x1036.google.com with SMTP id q9-20020a17090a2dc900b001f58bcaca95so2402186pjm.3 for ; Fri, 05 Aug 2022 12:55:27 -0700 (PDT) Received: from stoup.. ([2602:ae:154e:e201:abf8:e436:f4c:9089]) by smtp.gmail.com with ESMTPSA id h13-20020a170902f70d00b0016f0c2ea158sm3393048plo.157.2022.08.05.12.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 12:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kfx1lrx4WNwVLD4+SbP89f5w4riUSjZqaLsw6gR72p0=; b=PRh5MD0k/nf8AFAs/zr4u6mkWsG07CBW9ok3jiW8PCxqEVHPwRAnMdDy9A312Hh473 DqmPzkKLW5RuWbRjsc8PmlQyVkImnUriqDuEcsDOFh1ZOpF1g2s4ZkX3hIVUZfvvuLod jc/spj1unRcS/JFxLOTcaD9Ih66V8/BKl0FlNvDe9TT/i+GC61qAQx0XWywWWW1YBoNS 3yn9ksUvXmflbRNCZaqBWW/439JTOzURQwb92Bth8ZHkmmHcT7AsptNBxYUhe9Bgkq2X Ybj8gRg7mgOdc4VYdD7RkG7ISzLvdb6vhPSW5eeedImVD8vw2Qu0IoEVLjhZc2Yigc09 HzJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Kfx1lrx4WNwVLD4+SbP89f5w4riUSjZqaLsw6gR72p0=; b=CsXpZvJdgmGG16P8yUQ/R+P4VKcmR0r7xuP7tPx+JI/Uf7IFgM0rlVJ+d7cASyiWwc run62/ZO6y/LposWkB9qR+5TDaxX8NkBVKr2hcdtFmt6zGM23xouKIjXqjRpiF930355 8RogKLOxpCmv4xEMZtw0UlHPXgNGXAnZSWs5rHK6BJek4yxIExY9fZxgCgBNrTHg3SoP 6YUeaAOuyuMi3FUnfoxiFDw9kEua2dd9Svw7Ce7Otcwxe6R6zgINCHHg1/2vLArIOtRU ZzdGb2MwU3e2ldDb2RV2OQHbicVkZRgQlkr6QhuHFUs9ywoF1vbcLdQhGZPhXhV2yHo5 b2SA== X-Gm-Message-State: ACgBeo2EDQ9nFUrRhr3hiSkw4BWieTGJhHRG5KWvncovw8rgdaEXMVdB Wbk6pcWmJKKUsVK8vXeo9FcupXwzguPN+Q== X-Google-Smtp-Source: AA6agR5OUwjVPlR1W3LT7Fw8886T8ZYygkPgPRDLjwJ5rjMdgXTUaNURNNzcd3uWr5df5yxhxGPnjA== X-Received: by 2002:a17:902:e849:b0:16e:81c6:2cb7 with SMTP id t9-20020a170902e84900b0016e81c62cb7mr8457121plg.110.1659729326532; Fri, 05 Aug 2022 12:55:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Song Gao , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 7/7] target/loongarch: Update gdb_set_fpu() and gdb_get_fpu() Date: Fri, 5 Aug 2022 12:55:15 -0700 Message-Id: <20220805195515.349768-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220805195515.349768-1-richard.henderson@linaro.org> References: <20220805195515.349768-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1659729944749100001 From: Song Gao GDB LoongArch fpu use fcc register, update gdb_set_fpu() and gdb_get_fpu() to match it. Signed-off-by: Song Gao Reviewed-by: Richard Henderson Acked-by: Alex Benn=C3=A9e Message-Id: <20220805033523.1416837-6-gaosong@loongson.cn> --- target/loongarch/internals.h | 3 +++ linux-user/loongarch64/signal.c | 24 ++--------------------- target/loongarch/gdbstub.c | 34 ++++++++++++++++++++++++++------- 3 files changed, 32 insertions(+), 29 deletions(-) diff --git a/target/loongarch/internals.h b/target/loongarch/internals.h index ea227362b6..f01635aed6 100644 --- a/target/loongarch/internals.h +++ b/target/loongarch/internals.h @@ -51,6 +51,9 @@ bool loongarch_cpu_tlb_fill(CPUState *cs, vaddr address, = int size, hwaddr loongarch_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); #endif /* !CONFIG_USER_ONLY */ =20 +uint64_t read_fcc(CPULoongArchState *env); +void write_fcc(CPULoongArchState *env, uint64_t val); + int loongarch_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int= n); int loongarch_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n= ); void loongarch_cpu_register_gdb_regs_for_features(CPUState *cs); diff --git a/linux-user/loongarch64/signal.c b/linux-user/loongarch64/signa= l.c index 65fd5f3857..7c7afb652e 100644 --- a/linux-user/loongarch64/signal.c +++ b/linux-user/loongarch64/signal.c @@ -71,26 +71,6 @@ struct extctx_layout { struct ctx_layout end; }; =20 -/* The kernel's sc_save_fcc macro is a sequence of MOVCF2GR+BSTRINS. */ -static uint64_t read_all_fcc(CPULoongArchState *env) -{ - uint64_t ret =3D 0; - - for (int i =3D 0; i < 8; ++i) { - ret |=3D (uint64_t)env->cf[i] << (i * 8); - } - - return ret; -} - -/* The kernel's sc_restore_fcc macro is a sequence of BSTRPICK+MOVGR2CF. */ -static void write_all_fcc(CPULoongArchState *env, uint64_t val) -{ - for (int i =3D 0; i < 8; ++i) { - env->cf[i] =3D (val >> (i * 8)) & 1; - } -} - static abi_ptr extframe_alloc(struct extctx_layout *extctx, struct ctx_layout *sctx, unsigned size, unsigned align, abi_ptr orig_sp) @@ -150,7 +130,7 @@ static void setup_sigframe(CPULoongArchState *env, for (i =3D 0; i < 32; ++i) { __put_user(env->fpr[i], &fpu_ctx->regs[i]); } - __put_user(read_all_fcc(env), &fpu_ctx->fcc); + __put_user(read_fcc(env), &fpu_ctx->fcc); __put_user(env->fcsr0, &fpu_ctx->fcsr); =20 /* @@ -216,7 +196,7 @@ static void restore_sigframe(CPULoongArchState *env, __get_user(env->fpr[i], &fpu_ctx->regs[i]); } __get_user(fcc, &fpu_ctx->fcc); - write_all_fcc(env, fcc); + write_fcc(env, fcc); __get_user(env->fcsr0, &fpu_ctx->fcsr); restore_fp_status(env); } diff --git a/target/loongarch/gdbstub.c b/target/loongarch/gdbstub.c index d3a5e404b0..a4d1e28e36 100644 --- a/target/loongarch/gdbstub.c +++ b/target/loongarch/gdbstub.c @@ -11,6 +11,24 @@ #include "internals.h" #include "exec/gdbstub.h" =20 +uint64_t read_fcc(CPULoongArchState *env) +{ + uint64_t ret =3D 0; + + for (int i =3D 0; i < 8; ++i) { + ret |=3D (uint64_t)env->cf[i] << (i * 8); + } + + return ret; +} + +void write_fcc(CPULoongArchState *env, uint64_t val) +{ + for (int i =3D 0; i < 8; ++i) { + env->cf[i] =3D (val >> (i * 8)) & 1; + } +} + int loongarch_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int= n) { LoongArchCPU *cpu =3D LOONGARCH_CPU(cs); @@ -51,9 +69,10 @@ static int loongarch_gdb_get_fpu(CPULoongArchState *env, { if (0 <=3D n && n < 32) { return gdb_get_reg64(mem_buf, env->fpr[n]); - } else if (32 <=3D n && n < 40) { - return gdb_get_reg8(mem_buf, env->cf[n - 32]); - } else if (n =3D=3D 40) { + } else if (n =3D=3D 32) { + uint64_t val =3D read_fcc(env); + return gdb_get_reg64(mem_buf, val); + } else if (n =3D=3D 33) { return gdb_get_reg32(mem_buf, env->fcsr0); } return 0; @@ -67,10 +86,11 @@ static int loongarch_gdb_set_fpu(CPULoongArchState *env, if (0 <=3D n && n < 32) { env->fpr[n] =3D ldq_p(mem_buf); length =3D 8; - } else if (32 <=3D n && n < 40) { - env->cf[n - 32] =3D ldub_p(mem_buf); - length =3D 1; - } else if (n =3D=3D 40) { + } else if (n =3D=3D 32) { + uint64_t val =3D ldq_p(mem_buf); + write_fcc(env, val); + length =3D 8; + } else if (n =3D=3D 33) { env->fcsr0 =3D ldl_p(mem_buf); length =3D 4; } --=20 2.34.1