From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:6d5:0:0:0:0:0 with SMTP id 204csp660716lfg; Fri, 5 Mar 2021 12:19:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJytilZpatuqklbXnbmfBF6YLTFXQOjf6PjHA+UKNZNH9FwThNfzreiC9u5/q7P7//6TTrvT X-Received: by 2002:a17:90a:5d87:: with SMTP id t7mr12145706pji.175.1614975558743; Fri, 05 Mar 2021 12:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614975558; cv=none; d=google.com; s=arc-20160816; b=W5VSu50eS/oh2J4fsyEzV6pfrUhenTKwpocpCYC7SNvNZ4oKkkYkuJQiFb0J5Tnvj7 z8BfjVQXftXm0fg3bV3tjJ4CuHk/H4oEWCyztx24P8rCBOu0fqHKGVox8yAqfeK1KqWl gAx5x2JstK/l8A66HlGD7bZAeLHrpp74jbKx9m1UkxloLM9FyyV1dLTJUFhqBHTMuH5f d5xdlN/Sged1Q+OJ04SEcjJxwO9YaBcA8B0W9DTohc+JhlwWvPQjAr1HRScEbVGcYwUB YdP5P/GN4gWU1IkD/VfIQrUjN2+Xvds2KNsnhybHuEtisXBTuFR6J1fm28g4v+KBKr1D 9awg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature:dkim-signature; bh=Ane6Z/iOYdLzQEYJ1l+yME575dvok5HTBcejFsm2kdE=; b=E6XE0cy3LOXFgMJbxfAfLQkq+zRXGagKgzndsw8itqObpCVxtYH4mzAj3iDREp9xe2 rsReXNPyjAoQHeiCShaAZDk5lNVN8le5RNZDbQQtWMuGc9G3DVmXjcdQvhW5GY/IqtzM 4JgdVgzUuiJuOIIWgNGy3kDLzkEzKm2pSozRXQifeZ1AQ5fR7IY5bVxl8G0erBRGD22r h+yhr1Vx9edwOpoSpqgc9WAARND/yWAtz2tXrAn+1ZIKOdqEcGC8ISvB60B+YmHi6MEw ngw+WBU6l9FHxNl6bSrLN4adjpGDzeM3h7gb5N4JbmW1vWK9KK7JlVxMGuFoEvyCpMpy A4VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@keithp.com header.s=mail header.b=F35daGPr; dkim=pass header.i=@keithp.com header.s=mail header.b=RmS6hyxk; spf=pass (google.com: domain of keithp@keithp.com designates 63.227.221.253 as permitted sender) smtp.mailfrom=keithp@keithp.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=keithp.com Return-Path: Received: from elaine.keithp.com (home.keithp.com. [63.227.221.253]) by mx.google.com with ESMTPS id bh4si2060271plb.435.2021.03.05.12.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:19:18 -0800 (PST) Received-SPF: pass (google.com: domain of keithp@keithp.com designates 63.227.221.253 as permitted sender) client-ip=63.227.221.253; Authentication-Results: mx.google.com; dkim=pass header.i=@keithp.com header.s=mail header.b=F35daGPr; dkim=pass header.i=@keithp.com header.s=mail header.b=RmS6hyxk; spf=pass (google.com: domain of keithp@keithp.com designates 63.227.221.253 as permitted sender) smtp.mailfrom=keithp@keithp.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=keithp.com Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 2DCC73F2EE3F; Fri, 5 Mar 2021 12:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1614975557; bh=Ane6Z/iOYdLzQEYJ1l+yME575dvok5HTBcejFsm2kdE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=F35daGPrBakhHFqXEvzw8ZwZXl7iauUYj8OKDHRL/hxd0vOtHVC9sShTeA7Octcw4 MfR3s1gw+BD9rg5RX8dr1EGlnJRCdiMl6Lse8TEztBPvQ4hbZVlJu6k4xzJQsYcRTg qMu8jC8xRSkKH/aWuYHsycPonIBbnCsQRkT8SN6qoxP+7ww8TIN/mb8UugTBO7JZ0t 3cJzxXZWkttA9EswpIYmEYWPMFKltilJugU+kFWw8/LFgEZ4DKsiKv1H7LF2qsagrr tkkS9DaCf0HhyJ639TZ4+9GvJ/dprkem+gduX9x7c1FnBkRqJ7u7xf9CO1IZYZyCyB ERgJHjKYgZSfA== X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lCDKVBfi5HNK; Fri, 5 Mar 2021 12:19:16 -0800 (PST) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id C0DBB3F2EE21; Fri, 5 Mar 2021 12:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1614975556; bh=Ane6Z/iOYdLzQEYJ1l+yME575dvok5HTBcejFsm2kdE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RmS6hyxkYPgcAcR7ivjPlg8uV9hrFA2irCbdaxdTJwGKSY9emvROt4BILfZZ7qrOh CFcOrGd2qbGqwTa0HBJjiX3T9nKRuG+jxGSwu11mxFG+foM9mB0BXJNplOrf58Ntut Aig5p8B/oUC9xGPfxiqYprzg/mIHL7kZgR5u2tnMRe0n1EDnzQe3dg8619CRvCpjOU buHqviXiGGTOnNE2p0xvo5MDdjIExr2SDbP+i47whFnMGSHiHr4YKa5SVmr7x0LsvE N3wj0tU1FQ54/uXjWTHeZCh8rEbmtUwX+X+dJLK7Cgxq0ugqQx1/ZSVECav2wDLkty DbS7TwVF/y5bw== Received: by keithp.com (Postfix, from userid 1000) id 98A9D15821A3; Fri, 5 Mar 2021 12:19:16 -0800 (PST) From: Keith Packard To: Alex =?utf-8?Q?Benn=C3=A9e?= , qemu-devel@nongnu.org Cc: Alex =?utf-8?Q?Benn=C3=A9e?= , Bug 1915925 <1915925@bugs.launchpad.net>, Peter Maydell , "open list:ARM TCG CPUs" Subject: Re: [PATCH v1 3/3] semihosting/arg-compat: fix up handling of SYS_HEAPINFO In-Reply-To: <20210305135451.15427-4-alex.bennee@linaro.org> References: <20210305135451.15427-1-alex.bennee@linaro.org> <20210305135451.15427-4-alex.bennee@linaro.org> Date: Fri, 05 Mar 2021 12:19:16 -0800 Message-ID: <87lfb1gxq3.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-TUID: mPZQ8YMRK+HC --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alex Benn=C3=A9e writes: > I'm not sure this every worked properly and it's certainly not > exercised by check-tcg or Peter's semihosting tests. Hoist it into > it's own helper function and attempt to validate the results in the > linux-user semihosting test at the least. The patch is mostly code motion, moving the existing heapinfo stuff into a separate function. That makes it really hard to see how you've changed the values being returned. I'd love to see a two patch series, one of which moves the code as-is and a second patch which fixes whatever bugs you've found. =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAmBCkkQACgkQ2yIaaQAA ABH2vQ/9Hns9A12xQi4WE/5uRF4/KHbPczlCwwrrmCIYkllMzNQ9AtlXLSZZIDgD dBro2yHjBzYWY0WkmgQS5qrsPSAfseWdRTmKukSHJWhxK5sSN8TMe/NvnQ2nN86Y cCm9QHam716TF+b5mZgQjqTm4RdwHo6RWFhnlxj7M+FfUAKsLo5o9rD0+CL+WHW6 rJycd0X45M7FXVUQqfpZnbmKVzW7wFUeE4PEpIDZvtwU2KOLurYKyIXb+T6xVMdh qgG9kaEJbYRrrKJXom62yaX+lD+/zwpuU9GUiQ73zrs2oYk+wo0XLXefW7wSDLgy 8HlIHmhplruKQJu3ly0vbqzO7o5QSGvRjsjfvKFe2DrOR5KXBH5bcGRjQ/6Xv7M2 BFh5fjkSs1fcN/LVlxZfug8xP7rsEjsjBfH8FV4j9gOp/qmMdVcWWAl/znuAJUoH pNnVSsFQ5wVlpTRiYPplDQuzveiUBSXFfcLVnB+SgIIX4COmsI07bj+Z0exRQOqR UUnVkgG8OUu4u877DOPWJf9v/ly9kkmwJMaJ9VPnvcioJQcxsosHCQgFN3KwI+wb QUgUrQ0ZrR/stzzqlWjHdBPJNFYt/m0JXguKkHvzSMXYzfaf4LR3h1o6uk+q1xA6 vhYNON0fZ5QJPWGVBk0U+d9LLJxCNsUBOWX+L3ZpGL9yglVvdO4= =GQC+ -----END PGP SIGNATURE----- --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6431EC433E0 for ; Fri, 5 Mar 2021 20:21:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DA75600EF for ; Fri, 5 Mar 2021 20:21:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DA75600EF Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:35838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIGwg-0007WI-Bp for qemu-devel@archiver.kernel.org; Fri, 05 Mar 2021 15:21:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIGv1-0006d1-IT; Fri, 05 Mar 2021 15:19:27 -0500 Received: from home.keithp.com ([63.227.221.253]:33058 helo=elaine.keithp.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIGux-0001fq-Is; Fri, 05 Mar 2021 15:19:27 -0500 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 2DCC73F2EE3F; Fri, 5 Mar 2021 12:19:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1614975557; bh=Ane6Z/iOYdLzQEYJ1l+yME575dvok5HTBcejFsm2kdE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=F35daGPrBakhHFqXEvzw8ZwZXl7iauUYj8OKDHRL/hxd0vOtHVC9sShTeA7Octcw4 MfR3s1gw+BD9rg5RX8dr1EGlnJRCdiMl6Lse8TEztBPvQ4hbZVlJu6k4xzJQsYcRTg qMu8jC8xRSkKH/aWuYHsycPonIBbnCsQRkT8SN6qoxP+7ww8TIN/mb8UugTBO7JZ0t 3cJzxXZWkttA9EswpIYmEYWPMFKltilJugU+kFWw8/LFgEZ4DKsiKv1H7LF2qsagrr tkkS9DaCf0HhyJ639TZ4+9GvJ/dprkem+gduX9x7c1FnBkRqJ7u7xf9CO1IZYZyCyB ERgJHjKYgZSfA== X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lCDKVBfi5HNK; Fri, 5 Mar 2021 12:19:16 -0800 (PST) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id C0DBB3F2EE21; Fri, 5 Mar 2021 12:19:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1614975556; bh=Ane6Z/iOYdLzQEYJ1l+yME575dvok5HTBcejFsm2kdE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=RmS6hyxkYPgcAcR7ivjPlg8uV9hrFA2irCbdaxdTJwGKSY9emvROt4BILfZZ7qrOh CFcOrGd2qbGqwTa0HBJjiX3T9nKRuG+jxGSwu11mxFG+foM9mB0BXJNplOrf58Ntut Aig5p8B/oUC9xGPfxiqYprzg/mIHL7kZgR5u2tnMRe0n1EDnzQe3dg8619CRvCpjOU buHqviXiGGTOnNE2p0xvo5MDdjIExr2SDbP+i47whFnMGSHiHr4YKa5SVmr7x0LsvE N3wj0tU1FQ54/uXjWTHeZCh8rEbmtUwX+X+dJLK7Cgxq0ugqQx1/ZSVECav2wDLkty DbS7TwVF/y5bw== Received: by keithp.com (Postfix, from userid 1000) id 98A9D15821A3; Fri, 5 Mar 2021 12:19:16 -0800 (PST) To: Alex =?utf-8?Q?Benn=C3=A9e?= , qemu-devel@nongnu.org Cc: Alex =?utf-8?Q?Benn=C3=A9e?= , Bug 1915925 <1915925@bugs.launchpad.net>, Peter Maydell , "open list:ARM TCG CPUs" Subject: Re: [PATCH v1 3/3] semihosting/arg-compat: fix up handling of SYS_HEAPINFO In-Reply-To: <20210305135451.15427-4-alex.bennee@linaro.org> References: <20210305135451.15427-1-alex.bennee@linaro.org> <20210305135451.15427-4-alex.bennee@linaro.org> Date: Fri, 05 Mar 2021 12:19:16 -0800 Message-ID: <87lfb1gxq3.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Received-SPF: pass client-ip=63.227.221.253; envelope-from=keithp@keithp.com; helo=elaine.keithp.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, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Keith Packard From: Keith Packard via --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alex Benn=C3=A9e writes: > I'm not sure this every worked properly and it's certainly not > exercised by check-tcg or Peter's semihosting tests. Hoist it into > it's own helper function and attempt to validate the results in the > linux-user semihosting test at the least. The patch is mostly code motion, moving the existing heapinfo stuff into a separate function. That makes it really hard to see how you've changed the values being returned. I'd love to see a two patch series, one of which moves the code as-is and a second patch which fixes whatever bugs you've found. =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAmBCkkQACgkQ2yIaaQAA ABH2vQ/9Hns9A12xQi4WE/5uRF4/KHbPczlCwwrrmCIYkllMzNQ9AtlXLSZZIDgD dBro2yHjBzYWY0WkmgQS5qrsPSAfseWdRTmKukSHJWhxK5sSN8TMe/NvnQ2nN86Y cCm9QHam716TF+b5mZgQjqTm4RdwHo6RWFhnlxj7M+FfUAKsLo5o9rD0+CL+WHW6 rJycd0X45M7FXVUQqfpZnbmKVzW7wFUeE4PEpIDZvtwU2KOLurYKyIXb+T6xVMdh qgG9kaEJbYRrrKJXom62yaX+lD+/zwpuU9GUiQ73zrs2oYk+wo0XLXefW7wSDLgy 8HlIHmhplruKQJu3ly0vbqzO7o5QSGvRjsjfvKFe2DrOR5KXBH5bcGRjQ/6Xv7M2 BFh5fjkSs1fcN/LVlxZfug8xP7rsEjsjBfH8FV4j9gOp/qmMdVcWWAl/znuAJUoH pNnVSsFQ5wVlpTRiYPplDQuzveiUBSXFfcLVnB+SgIIX4COmsI07bj+Z0exRQOqR UUnVkgG8OUu4u877DOPWJf9v/ly9kkmwJMaJ9VPnvcioJQcxsosHCQgFN3KwI+wb QUgUrQ0ZrR/stzzqlWjHdBPJNFYt/m0JXguKkHvzSMXYzfaf4LR3h1o6uk+q1xA6 vhYNON0fZ5QJPWGVBk0U+d9LLJxCNsUBOWX+L3ZpGL9yglVvdO4= =GQC+ -----END PGP SIGNATURE----- --=-=-=-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E91D4C433E6 for ; Fri, 5 Mar 2021 20:32:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F030B64F42 for ; Fri, 5 Mar 2021 20:32:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F030B64F42 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bugs.launchpad.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIH7I-00040u-Pk for qemu-devel@archiver.kernel.org; Fri, 05 Mar 2021 15:32:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIH62-00037b-PA for qemu-devel@nongnu.org; Fri, 05 Mar 2021 15:30:50 -0500 Received: from indium.canonical.com ([91.189.90.7]:38404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lIH5v-0006fd-0z for qemu-devel@nongnu.org; Fri, 05 Mar 2021 15:30:50 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1lIH5t-0008T5-6x for ; Fri, 05 Mar 2021 20:30:41 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 301FA2E8041 for ; Fri, 5 Mar 2021 20:30:41 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 05 Mar 2021 20:19:16 -0000 From: Keith Packard <1915925@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=Confirmed; importance=Undecided; assignee=alex.bennee@linaro.org; X-Launchpad-Bug-Tags: semihosting testcase X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: ajbennee inver7 keithp pmaydell X-Launchpad-Bug-Reporter: iNvEr7 (inver7) X-Launchpad-Bug-Modifier: Keith Packard (keithp) References: <161356438332.24036.4652954745285513495.malonedeb@chaenomeles.canonical.com> <20210305135451.15427-4-alex.bennee@linaro.org> Message-ID: <87lfb1gxq3.fsf@keithp.com> Subject: [Bug 1915925] Re: [PATCH v1 3/3] semihosting/arg-compat: fix up handling of SYS_HEAPINFO X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="fc09074b06b3b9178bd28175bdab646b3b5abfce"; Instance="production" X-Launchpad-Hash: 1f92a15f0b8ba76a4d0b198f149de4e1377c18ab Received-SPF: none client-ip=91.189.90.7; envelope-from=bounces@canonical.com; helo=indium.canonical.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1915925 <1915925@bugs.launchpad.net> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Message-ID: <20210305201916.VqDqB6HqQ91wSuqhRjOxLzZR3teyRWs4mGr2yik9-h4@z> Alex Benn=C3=A9e writes: > I'm not sure this every worked properly and it's certainly not > exercised by check-tcg or Peter's semihosting tests. Hoist it into > it's own helper function and attempt to validate the results in the > linux-user semihosting test at the least. The patch is mostly code motion, moving the existing heapinfo stuff into a separate function. That makes it really hard to see how you've changed the values being returned. I'd love to see a two patch series, one of which moves the code as-is and a second patch which fixes whatever bugs you've found. -- = -keith -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1915925 Title: ARM semihosting HEAPINFO results wrote to wrong address Status in QEMU: Confirmed Bug description: This affects latest development branch of QEMU. According to the ARM spec of the HEAPINFO semihosting call: https://developer.arm.com/documentation/100863/0300/Semihosting- operations/SYS-HEAPINFO--0x16-?lang=3Den > the PARAMETER REGISTER contains the address of a pointer to a four- field data block. However, QEMU treated the PARAMETER REGISTER as pointing to a four- field data block directly. Here is a simple program that can demonstrate this problem: https://github.com/iNvEr7/qemu-learn/tree/newlib-bug/semihosting- newlib This code links with newlib with semihosting mode, which will call the HEAPINFO SVC during crt0 routine. When running in QEMU (make run), it may crash the program either because of invalid write or memory curruption, depending on the compiled program structure. Also refer to my discussion with newlib folks: https://sourceware.org/pipermail/newlib/2021/018260.html To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1915925/+subscriptions