From nobody Tue Feb 10 03:38:57 2026 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1586895477; cv=none; d=zohomail.com; s=zohoarc; b=np2NyctXx719fV5fHM3sjVT0xeficDx+ZT7hRyta+65T8O9bmvGx6m0xcptLoYDh1CdnfLv0A2DSQVRCmOG9/xwY0Xyma5TWueENx8sP8N+hgJ54KhYeDadOPz/Ymb+S1bjRh7ZQKrN2VqsSLWI994Ivxd92CWN6fkFgwheKpuU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586895477; 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=U0GHkMxjV1uSRYh2+mG4n9m1cHTJmvyky0OeonmCsaU=; b=dss4PQk9Eteokozlt2nnNxK0ng0otLS+cgJ3R5GFjmST3ABROhJ5PntMJTH0aNplJ4o9tVEbyygEdb0W3W4fGfDfA4I2VbhX0WkMSFQp4vckELROh+PY8vdOJCF+p8gbnAkD2LFnrY9SB+qoO28A8iNPkJ1aPFWQ5InZ2h1DQ6k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1586895477094590.3381254243171; Tue, 14 Apr 2020 13:17:57 -0700 (PDT) Received: from localhost ([::1]:38618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOS0J-0005ta-Rg for importer@patchew.org; Tue, 14 Apr 2020 16:17:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jORyi-00040S-Lm for qemu-devel@nongnu.org; Tue, 14 Apr 2020 16:16:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jORyh-0001iV-BM for qemu-devel@nongnu.org; Tue, 14 Apr 2020 16:16:16 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:40511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jORyh-0001hw-4e for qemu-devel@nongnu.org; Tue, 14 Apr 2020 16:16:15 -0400 Received: by mail-wm1-x342.google.com with SMTP id a81so15773847wmf.5 for ; Tue, 14 Apr 2020 13:16:15 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w12sm5778068wrk.56.2020.04.14.13.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 13:16:11 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 09FA11FF9D; Tue, 14 Apr 2020 21:06:34 +0100 (BST) 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=U0GHkMxjV1uSRYh2+mG4n9m1cHTJmvyky0OeonmCsaU=; b=zDyVX+eGLidywceNh4TJT/ZYZU5Sl8GDbcntFEUGG5+KT3G5Rp02Ky9cQbxUpfbefN MQq8fa1MP/TzuzOq3BesyNCGzQIhS1w01JPNnmjJZ/gaYLiYfTrDiDdrK0zEwNjNzbKb UWLiqqrX9WVcYop2mp08FcL3LqKt04r69IWfcx+5UyhTWHbU1PSdLKNBg5cV58rW5N6B lZiInQtKv7errpITUoT5XmBZwzKMx+hVVn1pQMCzYjD4ephmZUvxx6tTy6ZBbWWA/d+b GyB3HSD+M4CHp9CyN9p5hIUpNRTjp1d5mBC63geazmVR/BvS0Vb+v3pJh4yHWRKz4Air nnmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U0GHkMxjV1uSRYh2+mG4n9m1cHTJmvyky0OeonmCsaU=; b=UYOR36MEIJvFMh20UINTjdzggLfCzNc2Z+7P7gpyrfkB03o7TevlTjbID1KSEgkzjE IVbN+7bGd4OadXLRmshO4IT5YS464YwoG5FiMQdWzVxYulI6sNJBP3psOg8YWQ4H/HhW JPIykLsLoAssmttOwsYMAFipNRdn5twRct2nq24wlhBlOgzVxM+998PQraQshT5Pi0gw QCNnVd4rCqoTQLnIYzhX2PXhuAVU88nv1N2kDif+SVZFQSd0Q7P3MJtg00gcytR0jsKI prxI6NmbyK9ZkvFMym07DPlFdPxwA6Q5RYIwm7XbSUxp3lc369NLq4WNGYR64hREL5Wk 88Pg== X-Gm-Message-State: AGi0PubOnOG75oH9iKQRsIGqzOTCZabA10n2/VgFgC9EdhllundIqlkI +fVcvg21OK3SQ4FrBEBmnhdoYs64EUA= X-Google-Smtp-Source: APiQypKU7B+SAR0tD9up2nLR7I6A6sBWx864DeYzBvGVPvRy0iyNS2uU9KguBdQT8LI6gu1pgz73JQ== X-Received: by 2002:a1c:808c:: with SMTP id b134mr1587510wmd.131.1586895374113; Tue, 14 Apr 2020 13:16:14 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 15/17] target/m68k: hack around the FPU register support (HACK!) Date: Tue, 14 Apr 2020 21:06:29 +0100 Message-Id: <20200414200631.12799-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200414200631.12799-1-alex.bennee@linaro.org> References: <20200414200631.12799-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::342 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Attempting to attach to the gdbstub causes GDB to complain: warning: Register "fp0" has an unsupported size (80 bits) warning: Register "fp1" has an unsupported size (80 bits) warning: Register "fp2" has an unsupported size (80 bits) warning: Register "fp3" has an unsupported size (80 bits) warning: Register "fp4" has an unsupported size (80 bits) warning: Register "fp5" has an unsupported size (80 bits) warning: Register "fp6" has an unsupported size (80 bits) warning: Register "fp7" has an unsupported size (80 bits) Remote 'g' packet reply is too long (expected 148 bytes, got 164 bytes): = 000000000000000000000000000000000000000000000000000000000000000000000000000= 000000000000000000000000$ 00000000000000000000408009f000000000800003407fffffffffffffffffff7ffffffff= fffffffffff7fffffffffffffffffff7fffffffffffffffffff7fffffffffffffffffff7fff= ffffffffffffffff7fffffff$ fffffffffff7fffffffffffffffffff000000000000000000000000 and then subsequently fail. The root problem seems to be this is an undefined size register for the target description. There does exist a floatformats_m68881_ext in GDB but setting "m68881_ext" also fails as the only "weird" tdesc types gdb seems to understand are: { "arm_fpa_ext", TDESC_TYPE_ARM_FPA_EXT }, { "i387_ext", TDESC_TYPE_I387_EXT } So present the register as a i386_ext as some sort of hack. The values are garbage but at least we can continue to connect. Perhaps we should just delete the code because I don't think this ever worked with upstream tools. Signed-off-by: Alex Benn=C3=A9e Cc: Laurent Vivier --- target/m68k/helper.c | 11 +++++------ gdb-xml/m68k-fp.xml | 16 ++++++++-------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 79b0b10ea9b..80069adb8cc 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -109,9 +109,8 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_= t *mem_buf, int n) static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByteArray *mem_buf, in= t n) { if (n < 8) { - int len =3D gdb_get_reg16(mem_buf, env->fregs[n].l.upper); - len +=3D gdb_get_reg16(mem_buf, 0); - len +=3D gdb_get_reg64(mem_buf, env->fregs[n].l.lower); + int len =3D gdb_get_reg64(mem_buf, cpu_to_le64(env->fregs[n].l.low= er)); + len +=3D gdb_get_reg16(mem_buf, cpu_to_le16(env->fregs[n].l.upper)= ); return len; } switch (n) { @@ -128,9 +127,9 @@ static int m68k_fpu_gdb_get_reg(CPUM68KState *env, GByt= eArray *mem_buf, int n) static int m68k_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n) { if (n < 8) { - env->fregs[n].l.upper =3D lduw_be_p(mem_buf); - env->fregs[n].l.lower =3D ldq_be_p(mem_buf + 4); - return 12; + env->fregs[n].l.lower =3D le64_to_cpu(* (uint64_t *) mem_buf); + env->fregs[n].l.upper =3D le16_to_cpu(* (uint16_t *) (mem_buf + 8)= ); + return 10; } switch (n) { case 8: /* fpcontrol */ diff --git a/gdb-xml/m68k-fp.xml b/gdb-xml/m68k-fp.xml index 64290d16306..8eb55af2860 100644 --- a/gdb-xml/m68k-fp.xml +++ b/gdb-xml/m68k-fp.xml @@ -6,14 +6,14 @@ notice and this notice are preserved. --> - - - - - - - - + + + + + + + + =20 , --=20 2.20.1