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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 A8F9FC433DB for ; Fri, 12 Mar 2021 10:29:28 +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 291DD64FC0 for ; Fri, 12 Mar 2021 10:29:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 291DD64FC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKf2r-0005Jr-HF for qemu-devel@archiver.kernel.org; Fri, 12 Mar 2021 05:29:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKeuV-00009G-Gx for qemu-devel@nongnu.org; Fri, 12 Mar 2021 05:20:47 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:45622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKeuN-0005GB-NI for qemu-devel@nongnu.org; Fri, 12 Mar 2021 05:20:47 -0500 Received: by mail-ej1-x62b.google.com with SMTP id mm21so52252278ejb.12 for ; Fri, 12 Mar 2021 02:20:36 -0800 (PST) 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=7aRz5A1gJNP7JkbnM/fhJCTS7Za0DL/dufGag57ukuY=; b=fDqhjR2Hd6JmMUDPMnxLDANWYCDs8QACyL9YXtgW0ADkKSLqP/MMhdBgOhQxRPUIO/ A3NmXNh4DIQd93aokAJ/sRMRhc6nZlTCBhSBYjd+xHpVvhclIUpnWZzkB4bGMOjzfNlL uamfDu9OHs0PbqN2eyPMpeE7vm92QpB9cJQVFAX5UitLfRfFj/A8cjGQikkeVAt+ILOw 1whUE0/dEgnRRw88QRX5G/WRfQtrWGNeE50hN6XW4O9kyIg/o+FIKIHQBWjpNS25d17M DPO9ttfHPst2u4vCtw4lVgTpl/JKBr/M5jtU/J5lqi+SyT3wpDDPW4n43jjbSq1tMz1T /2ng== 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=7aRz5A1gJNP7JkbnM/fhJCTS7Za0DL/dufGag57ukuY=; b=piFUXIGpfM4BJh8qxfi3WzskJtQXhPndpHQ3d4+zZG7Y8QcVHbgkNhCp4OA5dzTjF+ CrG3yBe6cbNvwYZJxzaQSPr+84db8IQYjlvtALeGyW2SFF/1UNCc+hnDynRYhTuIH/GN xt6jr6WZWCTCIy0NG8TDssmeu7lRjXrW71iRvNv9shUPRhPf4epxi8BYwIXqV49A3Qlf Fs9xrUSNmO9cmgcsMMRsRDV5HAwcKvv1Xkfhu7unOlExScXfl4YQWjY6YW/7sCrLZuJp SW1Wd/7pk9YesWd6+fzQ9YzfslBf9yVMjNWYbfleEQJp4Ny0tPron/YGOp6bZMrvnX/G COMA== X-Gm-Message-State: AOAM5330uUg8goUccbk+N9R+PJ5miSMxPEVmhBJlZz7nRZNGgJO/XnB8 y2VoJXblI177+xHGYaRZ8N+NDw== X-Google-Smtp-Source: ABdhPJw179z+XcBzrDvsd5yGmEHu2EkbnWOBkRDSXGFQq76TnSj3OhtlxzMiVdHvPxvVC/XyhG08wA== X-Received: by 2002:a17:906:4747:: with SMTP id j7mr7601778ejs.221.1615544435208; Fri, 12 Mar 2021 02:20:35 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v12sm2515090ejh.94.2021.03.12.02.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 02:20:30 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EDAAA1FF8F; Fri, 12 Mar 2021 10:20:29 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v5 3/5] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Date: Fri, 12 Mar 2021 10:20:27 +0000 Message-Id: <20210312102029.17017-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312102029.17017-1-alex.bennee@linaro.org> References: <20210312102029.17017-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-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 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: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , keithp@keithp.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Bug 1915925 <1915925@bugs.launchpad.net> Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As per the spec: the PARAMETER REGISTER contains the address of a pointer to a four-field data block. So we need to follow arg0 and place the results of SYS_HEAPINFO there. Fixes: 3c37cfe0b1 ("semihosting: Change internal common-semi interfaces to use CPUState *") Bug: https://bugs.launchpad.net/bugs/1915925 Cc: Bug 1915925 <1915925@bugs.launchpad.net> Cc: Keith Packard Signed-off-by: Alex Bennée --- v3 - just revert the old behaviour --- semihosting/arm-compat-semi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 0f0e129a7c..fe079ca93a 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1214,7 +1214,11 @@ target_ulong do_common_semihosting(CPUState *cs) for (i = 0; i < ARRAY_SIZE(retvals); i++) { bool fail; - fail = SET_ARG(i, retvals[i]); + if (is_64bit_semihosting(env)) { + fail = put_user_u64(retvals[i], arg0 + i * 8); + } else { + fail = put_user_u32(retvals[i], arg0 + i * 4); + } if (fail) { /* Couldn't write back to argument block */ -- 2.20.1 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=-18.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, 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 D0F39C433DB for ; Fri, 12 Mar 2021 10:40:30 +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 EEB5B64FEA for ; Fri, 12 Mar 2021 10:40:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEB5B64FEA 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]:37820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKfDZ-0006Oj-1D for qemu-devel@archiver.kernel.org; Fri, 12 Mar 2021 05:40:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKezQ-0000Tl-Dc for qemu-devel@nongnu.org; Fri, 12 Mar 2021 05:25:53 -0500 Received: from indium.canonical.com ([91.189.90.7]:40788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKezE-0008NP-J1 for qemu-devel@nongnu.org; Fri, 12 Mar 2021 05:25:52 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1lKezC-0002fT-1v for ; Fri, 12 Mar 2021 10:25:38 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 0D7872E815D for ; Fri, 12 Mar 2021 10:25:38 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 12 Mar 2021 10:20:27 -0000 From: =?utf-8?q?Alex_Benn=C3=A9e?= <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: =?utf-8?q?Alex_Benn=C3=A9e_=28ajbennee=29?= References: <161356438332.24036.4652954745285513495.malonedeb@chaenomeles.canonical.com> Message-ID: <20210312102029.17017-4-alex.bennee@linaro.org> Subject: [Bug 1915925] [PATCH v5 3/5] semihosting/arm-compat-semi: don't use SET_ARG to report 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="d4fcb062545ed29d3cd7773e52e43615e042623f"; Instance="production" X-Launchpad-Hash: e7453fe183adb8c91dcbf762f21144b1070ca5cf 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.25, 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: <20210312102027.glRGB1kZvaQki0M-W35n8fJDZapt7IW0mVInEkU2QjE@z> As per the spec: the PARAMETER REGISTER contains the address of a pointer to a four-field data block. So we need to follow arg0 and place the results of SYS_HEAPINFO there. Fixes: 3c37cfe0b1 ("semihosting: Change internal common-semi interfaces to = use CPUState *") Bug: https://bugs.launchpad.net/bugs/1915925 Cc: Bug 1915925 <1915925@bugs.launchpad.net> Cc: Keith Packard Signed-off-by: Alex Benn=C3=A9e --- v3 - just revert the old behaviour --- semihosting/arm-compat-semi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 0f0e129a7c..fe079ca93a 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1214,7 +1214,11 @@ target_ulong do_common_semihosting(CPUState *cs) for (i =3D 0; i < ARRAY_SIZE(retvals); i++) { bool fail; = - fail =3D SET_ARG(i, retvals[i]); + if (is_64bit_semihosting(env)) { + fail =3D put_user_u64(retvals[i], arg0 + i * 8); + } else { + fail =3D put_user_u32(retvals[i], arg0 + i * 4); + } = if (fail) { /* Couldn't write back to argument block */ -- = 2.20.1 -- = 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lKeub-0000ST-Qi for mharc-qemu-riscv@gnu.org; Fri, 12 Mar 2021 05:20:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKeuV-00009Q-Jp for qemu-riscv@nongnu.org; Fri, 12 Mar 2021 05:20:47 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:39431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKeuM-0005GA-U4 for qemu-riscv@nongnu.org; Fri, 12 Mar 2021 05:20:47 -0500 Received: by mail-ej1-x630.google.com with SMTP id p7so40986623eju.6 for ; Fri, 12 Mar 2021 02:20:36 -0800 (PST) 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=7aRz5A1gJNP7JkbnM/fhJCTS7Za0DL/dufGag57ukuY=; b=fDqhjR2Hd6JmMUDPMnxLDANWYCDs8QACyL9YXtgW0ADkKSLqP/MMhdBgOhQxRPUIO/ A3NmXNh4DIQd93aokAJ/sRMRhc6nZlTCBhSBYjd+xHpVvhclIUpnWZzkB4bGMOjzfNlL uamfDu9OHs0PbqN2eyPMpeE7vm92QpB9cJQVFAX5UitLfRfFj/A8cjGQikkeVAt+ILOw 1whUE0/dEgnRRw88QRX5G/WRfQtrWGNeE50hN6XW4O9kyIg/o+FIKIHQBWjpNS25d17M DPO9ttfHPst2u4vCtw4lVgTpl/JKBr/M5jtU/J5lqi+SyT3wpDDPW4n43jjbSq1tMz1T /2ng== 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=7aRz5A1gJNP7JkbnM/fhJCTS7Za0DL/dufGag57ukuY=; b=mJMwACPFZA+F10woJA3NfsHJ/c+Hy/3ag3KuEpbPfhVReHLoKdZSUgF97ECxNr8+QL myx2s3N7uvf1XhalmhgP1DabSzZBKE+Rz1LNHrx1MSV1PGBtG9E/QFjwCWg9gYAabFdW n8SyTjBQi81B3m/ZrwwdUIK5RbzXLiodm2kWxrbF0w+bor+dUyY1BJkEXHwNaKO8PF6g 6mpxJO0/xRWJ3E6m8ewltaIzM1BULTa9FeDR+okal3eTMYRqkqY3uXSKADzX234faGhS Fbl24kHltf2n642JENj0p1vEAfapwJsOSpd71OG4AZWs1p8CzZXx0/2dqC2QObJdMSNa EQ5g== X-Gm-Message-State: AOAM531GoTsu4U8v5+TzSoE5PuvZzRL9nrQlfD9Opa845V4wqWEut8bJ +x449TLgvRK83tQJyg2EZhsblBTc+wFYUg== X-Google-Smtp-Source: ABdhPJw179z+XcBzrDvsd5yGmEHu2EkbnWOBkRDSXGFQq76TnSj3OhtlxzMiVdHvPxvVC/XyhG08wA== X-Received: by 2002:a17:906:4747:: with SMTP id j7mr7601778ejs.221.1615544435208; Fri, 12 Mar 2021 02:20:35 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v12sm2515090ejh.94.2021.03.12.02.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 02:20:30 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EDAAA1FF8F; Fri, 12 Mar 2021 10:20:29 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: keithp@keithp.com, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Bug 1915925 <1915925@bugs.launchpad.net> Subject: [PATCH v5 3/5] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO Date: Fri, 12 Mar 2021 10:20:27 +0000 Message-Id: <20210312102029.17017-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312102029.17017-1-alex.bennee@linaro.org> References: <20210312102029.17017-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Mar 2021 10:20:48 -0000 As per the spec: the PARAMETER REGISTER contains the address of a pointer to a four-field data block. So we need to follow arg0 and place the results of SYS_HEAPINFO there. Fixes: 3c37cfe0b1 ("semihosting: Change internal common-semi interfaces to use CPUState *") Bug: https://bugs.launchpad.net/bugs/1915925 Cc: Bug 1915925 <1915925@bugs.launchpad.net> Cc: Keith Packard Signed-off-by: Alex Bennée --- v3 - just revert the old behaviour --- semihosting/arm-compat-semi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 0f0e129a7c..fe079ca93a 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1214,7 +1214,11 @@ target_ulong do_common_semihosting(CPUState *cs) for (i = 0; i < ARRAY_SIZE(retvals); i++) { bool fail; - fail = SET_ARG(i, retvals[i]); + if (is_64bit_semihosting(env)) { + fail = put_user_u64(retvals[i], arg0 + i * 8); + } else { + fail = put_user_u32(retvals[i], arg0 + i * 4); + } if (fail) { /* Couldn't write back to argument block */ -- 2.20.1